/* Coupon Empire Design System v1.0 */

/* ============================================
   1. CSS CUSTOM PROPERTIES (Design Tokens)
   ============================================ */

:root {
  /* Typography */
  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Instrument Sans', system-ui, sans-serif;
  
  /* Core Palette */
  --midnight: #0D1117;
  --ink: #1B2332;
  --slate: #3A4558;
  --storm: #6B7A8D;
  --silver: #B4BEC9;
  --mist: #E8ECF0;
  --cloud: #F4F6F8;
  --snow: #FFFFFF;
  
  /* Accent & Semantic */
  --coral: #FF5A5F;
  --coral-hover: #E8484D;
  --coral-light: #FFF0F0;
  --amber: #FFB020;
  --amber-light: #FFF8E6;
  --emerald: #10B981;
  --emerald-light: #ECFDF5;
  --sky: #3B82F6;
  --sky-light: #EFF6FF;
  
  /* Code type colors */
  --purple: #7C3AED;
  --purple-light: #EDE9FE;
  
  /* Radii */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  
  /* Shadows */
  --shadow-card: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-elevated: 0 10px 25px rgba(0,0,0,0.08), 0 4px 10px rgba(0,0,0,0.04);
  --shadow-hover: 0 14px 30px rgba(0,0,0,0.12), 0 6px 14px rgba(0,0,0,0.06);
  
  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 64px;
}

/* ============================================
   2. BASE STYLES
   ============================================ */

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.7;
  color: var(--slate);
  background-color: var(--cloud);
}

a {
  color: var(--sky);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

img {
  max-width: 100%;
  height: auto;
}

/* ============================================
   3. TYPOGRAPHY
   ============================================ */

.hero-headline {
  font-family: var(--font-display);
  font-size: 40px;
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--snow);
}

.hero-headline em {
  font-style: italic;
}

.section-head {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--ink);
  margin: 0 0 var(--space-lg);
}

.card-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--midnight);
  margin: 0;
}

.deal-amount {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.0;
  color: var(--coral);
}

.ui-label {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  line-height: 1.4;
  text-transform: uppercase;
  color: var(--storm);
}

.ui-small {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  line-height: 1.3;
  color: var(--storm);
}

/* ============================================
   4. LAYOUT
   ============================================ */

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-lg);
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-lg);
}

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

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

/* ============================================
   5. HEADER
   ============================================ */

.header {
  background: var(--midnight);
  padding: var(--space-md) 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  color: var(--snow);
  text-decoration: none;
}

.logo:hover {
  text-decoration: none;
  color: var(--coral);
}

.nav {
  display: flex;
  gap: var(--space-lg);
}

.nav a {
  color: var(--silver);
  font-size: 14px;
  font-weight: 500;
}

.nav a:hover {
  color: var(--snow);
  text-decoration: none;
}

.search-box {
  display: flex;
  align-items: center;
  background: var(--ink);
  border-radius: var(--radius-md);
  padding: var(--space-sm) var(--space-md);
}

.search-box input {
  background: none;
  border: none;
  color: var(--snow);
  font-size: 14px;
  outline: none;
  width: 200px;
}

.search-box input::placeholder {
  color: var(--storm);
}

/* ============================================
   6. HERO BANNER
   ============================================ */

.hero {
  position: relative;
  height: 400px;
  background: linear-gradient(135deg, var(--midnight) 0%, var(--ink) 100%);
  overflow: hidden;
  display: flex;
  align-items: center;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0.3;
}

.hero-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(13,17,23,0.85) 0%, rgba(13,17,23,0.4) 60%, transparent 100%);
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 600px;
}

.hero-subhead {
  font-size: 16px;
  color: rgba(255,255,255,0.85);
  margin: var(--space-md) 0 var(--space-lg);
}

@media (max-width: 768px) {
  .hero {
    height: 280px;
  }
  .hero-headline {
    font-size: 28px;
  }
}

/* ============================================
   7. TRUST BAR
   ============================================ */

.trust-bar {
  background: var(--snow);
  border-bottom: 1px solid var(--mist);
  padding: var(--space-lg) 0;
}

.trust-bar-inner {
  display: flex;
  justify-content: center;
  gap: var(--space-3xl);
}

.trust-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.trust-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--coral-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.trust-text h4 {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  margin: 0;
}

.trust-text p {
  font-size: 12px;
  color: var(--storm);
  margin: 2px 0 0;
}

@media (max-width: 768px) {
  .trust-bar-inner {
    flex-direction: column;
    gap: var(--space-md);
    align-items: center;
  }
}

/* ============================================
   8. OFFER CARD (Homepage Grid)
   ============================================ */

.offer-card {
  background: var(--snow);
  border: 1px solid var(--mist);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  text-decoration: none;
  display: block;
}

.offer-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
  text-decoration: none;
}

.offer-card-hero {
  position: relative;
  height: 160px;
  background: linear-gradient(135deg, var(--cloud) 0%, var(--mist) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.offer-card-hero img {
  max-height: 80px;
  max-width: 80%;
  object-fit: contain;
}

.offer-card-logo {
  position: absolute;
  bottom: -24px;
  left: var(--space-md);
  width: 48px;
  height: 48px;
  background: var(--snow);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-card);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.offer-card-logo img {
  max-width: 36px;
  max-height: 36px;
}

.offer-card-badge {
  position: absolute;
  top: var(--space-sm);
  right: var(--space-sm);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.badge-exclusive {
  background: var(--coral);
  color: var(--snow);
}

.badge-verified {
  background: var(--emerald);
  color: var(--snow);
}

.offer-card-body {
  padding: var(--space-lg);
  padding-top: calc(var(--space-lg) + 12px);
}

.offer-card-brand {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--storm);
  margin-bottom: var(--space-xs);
}

.offer-card-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--midnight);
  line-height: 1.3;
  margin: 0 0 var(--space-md);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.offer-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.offer-card-cta {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  background: var(--coral);
  color: var(--snow);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  transition: background 0.2s ease;
}

.offer-card:hover .offer-card-cta {
  background: var(--coral-hover);
}

.offer-card-meta {
  font-size: 12px;
  color: var(--storm);
}

/* ============================================
   9. CODE ROW (Category/Store Page)
   ============================================ */

.code-row {
  background: var(--snow);
  border: 1px solid var(--mist);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  box-shadow: var(--shadow-card);
  transition: box-shadow 0.2s ease;
  margin-bottom: var(--space-md);
}

.code-row:hover {
  box-shadow: var(--shadow-elevated);
}

.code-row-logo {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--mist);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--snow);
  overflow: hidden;
}

.code-row-logo img {
  max-width: 44px;
  max-height: 44px;
}

.code-row-content {
  flex: 1;
  min-width: 0;
}

.code-row-brand {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--storm);
  margin-bottom: 2px;
}

.code-row-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  color: var(--midnight);
  margin: 0 0 var(--space-xs);
}

.code-row-details {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  flex-wrap: wrap;
}

.code-row-meta {
  font-size: 13px;
  color: var(--storm);
}

.code-row-type {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.type-code {
  background: var(--purple-light);
  color: var(--purple);
}

.type-deal {
  background: var(--emerald-light);
  color: #059669;
}

.code-row-cta {
  flex-shrink: 0;
}

/* ============================================
   10. BUTTONS
   ============================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
}

.btn-primary {
  background: var(--coral);
  color: var(--snow);
  box-shadow: 0 2px 8px rgba(255,90,95,0.25);
}

.btn-primary:hover {
  background: var(--coral-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(255,90,95,0.35);
  text-decoration: none;
  color: var(--snow);
}

.btn-reveal {
  background: var(--midnight);
  color: var(--snow);
  border: 2px dashed rgba(255,255,255,0.2);
}

.btn-reveal:hover {
  background: var(--ink);
  border-color: rgba(255,255,255,0.3);
  text-decoration: none;
  color: var(--snow);
}

.btn-secondary {
  background: var(--snow);
  color: var(--ink);
  border: 2px solid var(--mist);
}

.btn-secondary:hover {
  border-color: var(--silver);
  background: var(--cloud);
  text-decoration: none;
}

/* ============================================
   11. SECTIONS
   ============================================ */

.section {
  padding: var(--space-2xl) 0;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-lg);
}

.section-link {
  font-size: 14px;
  font-weight: 500;
  color: var(--sky);
}

/* ============================================
   12. CATEGORY PILLS
   ============================================ */

.category-nav {
  background: var(--snow);
  border-bottom: 1px solid var(--mist);
  padding: var(--space-md) 0;
  position: sticky;
  top: 60px;
  z-index: 90;
}

.category-pills {
  display: flex;
  gap: var(--space-sm);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.category-pills::-webkit-scrollbar {
  display: none;
}

.category-pill {
  padding: var(--space-sm) var(--space-md);
  border-radius: 20px;
  font-size: 14px;
  font-weight: 500;
  color: var(--slate);
  background: var(--cloud);
  white-space: nowrap;
  text-decoration: none;
  transition: all 0.2s ease;
}

.category-pill:hover {
  background: var(--mist);
  text-decoration: none;
}

.category-pill.active {
  background: var(--midnight);
  color: var(--snow);
}

/* ============================================
   13. FOOTER
   ============================================ */

.footer {
  background: var(--midnight);
  color: var(--silver);
  padding: var(--space-2xl) 0;
  margin-top: var(--space-3xl);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--space-xl);
}

.footer-brand {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  color: var(--snow);
  margin-bottom: var(--space-md);
}

.footer-desc {
  font-size: 14px;
  line-height: 1.6;
  color: var(--storm);
}

.footer h4 {
  color: var(--snow);
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 var(--space-md);
}

.footer ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer li {
  margin-bottom: var(--space-sm);
}

.footer a {
  color: var(--storm);
  font-size: 14px;
}

.footer a:hover {
  color: var(--snow);
}

.footer-bottom {
  border-top: 1px solid var(--ink);
  margin-top: var(--space-xl);
  padding-top: var(--space-lg);
  font-size: 13px;
  color: var(--storm);
}

@media (max-width: 768px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 480px) {
  .footer-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================
   14. SEASONAL OVERRIDES
   ============================================ */

/* Mother's Day */
.season-mothers-day .hero {
  background: linear-gradient(135deg, #FFF5F8 0%, #FFE4ED 100%);
}

.season-mothers-day .hero-headline {
  color: var(--ink);
}

.season-mothers-day .hero-subhead {
  color: var(--slate);
}

.badge-seasonal-mothers-day {
  background: #FFE4ED;
  color: #E8487C;
}

/* Easter */
.season-easter .hero {
  background: linear-gradient(135deg, #F5FFF0 0%, #E8FFD6 100%);
}

.season-easter .hero-headline {
  color: var(--ink);
}

.badge-seasonal-easter {
  background: #E8FFD6;
  color: #4A8C20;
}

/* ============================================
   15. UTILITIES
   ============================================ */

.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.hidden { display: none; }

@media (max-width: 768px) {
  .hide-mobile { display: none; }
}

@media (min-width: 769px) {
  .hide-desktop { display: none; }
}
