﻿:root {
  --bg: #fbf7f1;
  --card: #ffffff;
  --text: #1f140f;
  --muted: #74675d;
  --line: #eadfd3;
  --primary: #6d1f1f;
  --primary-dark: #4f1414;
  --gold: #c9a24a;
  --gold-soft: #fff6df;
  --soft: #fffaf2;
  --disabled: #eee7df;
  --shadow: 0 16px 38px rgba(31, 20, 15, 0.10);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Tahoma, Arial, sans-serif;
  background:
    radial-gradient(circle at top right, rgba(201, 162, 74, 0.20), transparent 30rem),
    linear-gradient(180deg, #fffaf3 0%, var(--bg) 45%, #ffffff 100%);
  color: var(--text);
}

.container {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

/* Hero */

.hero {
  padding: 46px 0 24px;
  text-align: center;
}

.brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 18px;
  border: 1px solid rgba(201, 162, 74, 0.65);
  border-radius: 999px;
  color: var(--primary);
  background: rgba(255, 248, 236, 0.9);
  font-weight: 800;
  margin-bottom: 18px;
  box-shadow: 0 8px 22px rgba(201, 162, 74, 0.12);
}

h1 {
  margin: 0;
  font-size: clamp(30px, 5vw, 54px);
  line-height: 1.18;
  letter-spacing: -1px;
}

.subtitle {
  color: var(--muted);
  font-size: 18px;
  line-height: 1.9;
  max-width: 820px;
  margin: 18px auto;
}

.affiliate-disclosure {
  background: rgba(255, 248, 236, 0.86);
  border: 1px solid rgba(201, 162, 74, 0.42);
  border-radius: 18px;
  padding: 14px 18px;
  color: #604b2b;
  line-height: 1.8;
  max-width: 900px;
  margin: 0 auto;
}

/* Tabs */

.tabs-section {
  margin: 24px 0 24px;
}

.tabs {
  display: flex;
  justify-content: center;
  gap: 10px;
  overflow-x: auto;
  padding: 4px 0 10px;
}

.tab-btn {
  appearance: none;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.85);
  color: var(--text);
  padding: 11px 18px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  font-weight: 800;
  font-size: 14px;
  transition: 0.2s ease;
}

.tab-btn:hover,
.tab-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 10px 24px rgba(109, 31, 31, 0.18);
}

/* Cards */

.deals-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  padding-bottom: 52px;
}

.deal-card {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  border-radius: 26px;
  padding: 20px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  min-height: 330px;
  position: relative;
  overflow: hidden;
}

.deal-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 5px;
  background: linear-gradient(90deg, var(--primary), var(--gold));
}

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.store-badge {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  font-weight: 900;
  font-size: 21px;
  box-shadow: 0 12px 24px rgba(109, 31, 31, 0.22);
}

.category-pill {
  font-size: 12px;
  color: var(--primary);
  background: var(--gold-soft);
  border: 1px solid rgba(201, 162, 74, 0.42);
  padding: 7px 11px;
  border-radius: 999px;
  white-space: nowrap;
  font-weight: 800;
}

.deal-card h2 {
  font-size: 22px;
  line-height: 1.45;
  margin: 0 0 4px;
}

.store-name {
  color: var(--primary);
  margin: 0 0 14px;
  font-weight: 900;
  direction: ltr;
  text-align: right;
}

.note {
  color: var(--muted);
  line-height: 1.9;
  margin: 0 0 18px;
  flex: 1;
}

/* Code box */

.code-box {
  border: 1px dashed rgba(109, 31, 31, 0.36);
  background: #fffaf5;
  border-radius: 18px;
  padding: 13px 14px;
  margin-bottom: 14px;
}

.code-label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 7px;
}

.code-value {
  font-size: 24px;
  font-weight: 900;
  letter-spacing: 1px;
  color: var(--primary);
  direction: ltr;
  text-align: right;
}

.code-value.small {
  font-size: 18px;
}

/* Buttons */

.actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: auto;
}

.actions:has(.btn:only-child) {
  grid-template-columns: 1fr;
}

.btn,
button.btn,
a.btn {
  appearance: none;
  border: 0;
  outline: 0;
  border-radius: 16px;
  padding: 13px 14px;
  min-height: 48px;
  cursor: pointer;
  font-weight: 900;
  text-decoration: none;
  text-align: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  font-size: 14px;
  transition: 0.2s ease;
  font-family: inherit;
}

.btn-copy,
button.btn-copy {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  box-shadow: 0 12px 24px rgba(109, 31, 31, 0.20);
}

.btn-copy:hover,
button.btn-copy:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 28px rgba(109, 31, 31, 0.26);
}

.btn-link,
a.btn-link {
  background: #24170f;
  color: #fff;
  box-shadow: 0 12px 24px rgba(36, 23, 15, 0.16);
}

.btn-link:hover,
a.btn-link:hover {
  transform: translateY(-1px);
}

.btn-disabled,
button.btn-disabled {
  background: var(--disabled);
  color: #9b8d82;
  cursor: not-allowed;
  box-shadow: none;
}

.status {
  margin-top: 13px;
  font-size: 12px;
  color: var(--muted);
  font-weight: 700;
}

.status.active_limited {
  color: #9a6a00;
}

/* Empty / Footer / Toast */

.empty-state {
  text-align: center;
  padding: 46px 0;
  color: var(--muted);
}

.hidden {
  display: none;
}

.footer {
  border-top: 1px solid var(--line);
  padding: 22px 0;
  color: var(--muted);
  text-align: center;
}

.toast {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%) translateY(30px);
  background: #24170f;
  color: #fff;
  padding: 12px 20px;
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  transition: 0.25s ease;
  z-index: 20;
  font-weight: 800;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.18);
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Responsive */

@media (max-width: 940px) {
  .deals-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .hero {
    text-align: right;
  }

  .tabs {
    justify-content: flex-start;
  }

  .affiliate-disclosure,
  .subtitle {
    margin-right: 0;
    margin-left: 0;
  }
}

@media (max-width: 640px) {
  .container {
    width: min(100% - 24px, 1120px);
  }

  .hero {
    padding-top: 32px;
  }

  .deals-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .deal-card {
    min-height: auto;
    padding: 18px;
  }

  .actions {
    grid-template-columns: 1fr;
  }

  .btn,
  button.btn,
  a.btn {
    width: 100%;
  }
}
