/* ==========================================================================
   Promise | Coffee with Promise — Curated Affiliate Deal Hub
   Mobile-First Responsive Stylesheet (Zero External Framework Bloat)
   ========================================================================== */

:root {
  /* Color System (Brief Section 3) */
  --bg-primary: #FAF7F2;
  --bg-card: #FFFFFF;
  --bg-accent-soft: #F1EBE1;
  --text-primary: #1E1B18;
  --text-secondary: #5C554E;
  --accent-cta: #B86B43;
  --accent-cta-hover: #9E5632;
  --badge-deal: #2D4A3E;
  --badge-reel: #1E1B18;
  --border-subtle: #E6DFD5;

  /* Outer Desktop Frame Background */
  --bg-desktop-outer: #EFECE6;

  /* Typography */
  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  /* Shadows & Transitions */
  --shadow-card: 0 2px 10px rgba(30, 27, 24, 0.04);
  --shadow-card-hover: 0 6px 18px rgba(30, 27, 24, 0.08);
  --shadow-avatar: 0 4px 14px rgba(184, 107, 67, 0.18);
  --transition-fast: 160ms cubic-bezier(0.22, 1, 0.36, 1);
}

/* Reset & Box Sizing */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg-desktop-outer);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-weight: 400;
  line-height: 1.45;
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img,
svg {
  display: block;
  max-width: 100%;
}

button,
input {
  font: inherit;
  color: inherit;
}

/* ==========================================================================
   Main App Container (Constrained to 540px on Desktop)
   ========================================================================== */
.app-shell {
  width: 100%;
  max-width: 540px;
  min-height: 100dvh;
  margin: 0 auto;
  background-color: var(--bg-primary);
  display: flex;
  flex-direction: column;
  box-shadow: 0 0 40px rgba(30, 27, 24, 0.06);
}

main {
  flex: 1 0 auto;
}

/* ==========================================================================
   Section A: Compact Sunlit Influencer Header
   ========================================================================== */
.influencer-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 22px 16px 14px;
  background: radial-gradient(circle at 50% 0%, #FFFDF9 0%, #FAF7F2 78%);
}

.avatar-ring {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 2.5px solid var(--accent-cta);
  box-shadow: 0 6px 18px rgba(184, 107, 67, 0.22);
  overflow: hidden;
  background-color: #FFFDF9;
  margin-bottom: 10px;
  flex-shrink: 0;
}

.avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.persona-name {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
  line-height: 1.22;
  letter-spacing: -0.015em;
  color: var(--text-primary);
  margin-bottom: 5px;
}

.persona-bio {
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--text-secondary);
  max-width: 380px;
  margin-bottom: 10px;
}

.compliance-micro-banner {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 500;
  line-height: 1.35;
  color: var(--text-secondary);
  background-color: var(--bg-accent-soft);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  padding: 5px 12px;
}

/* ==========================================================================
   Section B: Black Friday Deal Alert Strip
   ========================================================================== */
.deal-alert-wrapper {
  padding: 0 16px 8px;
}

.deal-alert-strip {
  width: 100%;
  border-radius: 12px;
  background-color: var(--bg-accent-soft);
  border: 1px solid var(--border-subtle);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.pulse-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background-color: var(--badge-deal);
  flex-shrink: 0;
  position: relative;
  box-shadow: 0 0 0 0 rgba(45, 74, 62, 0.55);
  animation: sagePulse 2s infinite;
}

@keyframes sagePulse {
  0% {
    box-shadow: 0 0 0 0 rgba(45, 74, 62, 0.55);
  }
  70% {
    box-shadow: 0 0 0 7px rgba(45, 74, 62, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(45, 74, 62, 0);
  }
}

.deal-alert-text {
  font-size: 0.76rem;
  line-height: 1.35;
  color: var(--text-primary);
}

.deal-alert-text strong {
  font-weight: 700;
}

/* ==========================================================================
   Section C: Sticky Filter & Search Bar
   ========================================================================== */
.sticky-filter-bar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(250, 247, 242, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 10px 16px 10px;
  border-bottom: 1px solid rgba(230, 223, 213, 0.75);
}

.search-box-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  margin-bottom: 10px;
}

.search-icon {
  position: absolute;
  left: 14px;
  width: 17px;
  height: 17px;
  color: var(--text-secondary);
  pointer-events: none;
}

.search-input {
  width: 100%;
  min-height: 44px;
  padding: 10px 42px 10px 40px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background-color: var(--bg-card);
  font-size: 0.875rem;
  color: var(--text-primary);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  appearance: none;
  -webkit-appearance: none;
}

.search-input::placeholder {
  color: var(--text-secondary);
  opacity: 0.85;
}

.search-input:focus {
  outline: none;
  border-color: var(--accent-cta);
  box-shadow: 0 0 0 3px rgba(184, 107, 67, 0.14);
}

/* Hide native webkit search cancel button in favor of custom accessible button */
.search-input::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
}

.search-clear-btn {
  position: absolute;
  right: 6px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--bg-accent-soft);
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color var(--transition-fast), color var(--transition-fast);
}

.search-clear-btn[hidden] {
  display: none;
}

.search-clear-btn:hover,
.search-clear-btn:focus-visible {
  background-color: var(--border-subtle);
  color: var(--text-primary);
}

/* Horizontal Scrollable Category Pills */
.category-pills {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding-bottom: 2px;
}

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

.category-pill {
  flex: 0 0 auto;
  min-height: 44px;
  padding: 8px 13px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background-color: var(--bg-accent-soft);
  color: var(--text-primary);
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast), transform var(--transition-fast);
}

.category-pill:hover {
  border-color: #CFC5B7;
}

.category-pill:active {
  transform: scale(0.98);
}

.category-pill.is-active {
  background-color: var(--text-primary);
  color: #FFFFFF;
  border-color: var(--text-primary);
}

/* ==========================================================================
   Section D: "Featured in Latest Reel" Spotlight Card
   ========================================================================== */
.spotlight-section {
  padding: 12px 16px 4px;
}

.spotlight-section[hidden] {
  display: none;
}

.spotlight-card {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 12px;
  align-items: center;
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 10px;
  box-shadow: var(--shadow-card);
}

.spotlight-media {
  width: 110px;
  aspect-ratio: 1 / 1;
  border-radius: 8px;
  overflow: hidden;
  background-color: #F7F4EF;
  position: relative;
}

.spotlight-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.spotlight-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
}

.spotlight-eyebrow {
  display: inline-flex;
  align-items: center;
  background-color: var(--badge-reel);
  color: #FFFFFF;
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 3px 7px;
  border-radius: 5px;
  margin-bottom: 5px;
}

.spotlight-title {
  font-family: var(--font-sans);
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--text-primary);
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.spotlight-tip {
  font-size: 0.75rem;
  line-height: 1.35;
  color: var(--text-secondary);
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.spotlight-cta {
  width: 100%;
}

/* ==========================================================================
   Section E: 2-Column Mobile Product Grid (Core Conversion Engine)
   ========================================================================== */
.product-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  padding: 12px 16px;
}

@media (min-width: 480px) {
  .product-grid {
    gap: 16px;
  }
}

.product-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  box-shadow: var(--shadow-card);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
  min-width: 0;
}

.product-card:hover {
  box-shadow: var(--shadow-card-hover);
}

.card-image-container {
  aspect-ratio: 1 / 1;
  width: 100%;
  border-radius: 10px 10px 0 0;
  overflow: hidden;
  position: relative;
  background: #F7F4EF;
}

.card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 280ms ease;
}

.product-card:hover .card-image {
  transform: scale(1.02);
}

.card-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 2;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1.1;
  padding: 4px 8px;
  border-radius: 6px;
  color: #FFFFFF;
  background-color: var(--badge-deal);
  letter-spacing: 0.01em;
  box-shadow: 0 2px 6px rgba(30, 27, 24, 0.14);
}

.card-badge.badge-reel {
  background-color: var(--badge-reel);
}

.card-body {
  padding: 10px 12px 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex: 1 1 auto;
  gap: 10px;
}

.card-text-group {
  display: flex;
  flex-direction: column;
}

.card-brand-tag {
  text-transform: uppercase;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-title {
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-primary);
  margin-bottom: 5px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: calc(0.88rem * 1.3 * 2);
}

.card-note {
  font-size: 0.75rem;
  font-weight: 400;
  line-height: 1.38;
  color: var(--text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: calc(0.75rem * 1.38 * 2);
}

/* Primary CTA Button */
.cta-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 100%;
  min-height: 42px;
  padding: 8px 6px;
  border-radius: 8px;
  background-color: var(--accent-cta);
  color: #FFFFFF;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  text-decoration: none;
  text-align: center;
  line-height: 1.15;
  cursor: pointer;
  transition: background-color var(--transition-fast), transform var(--transition-fast);
  user-select: none;
}

.cta-button:hover,
.cta-button:focus-visible {
  background-color: var(--accent-cta-hover);
}

.cta-button:active {
  background-color: var(--accent-cta-hover);
  transform: translateY(1px);
}

.cta-arrow {
  font-size: 0.85em;
  line-height: 1;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 36px 20px;
  margin: 8px 16px 20px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
}

.empty-state[hidden] {
  display: none;
}

.empty-state-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.empty-state-sub {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-bottom: 14px;
}

.reset-filters-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 20px;
  border-radius: 999px;
  border: 1px solid var(--text-primary);
  background-color: var(--text-primary);
  color: #FFFFFF;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity var(--transition-fast);
}

.reset-filters-btn:hover {
  opacity: 0.9;
}

/* ==========================================================================
   Editorial Section: Promise's 3 Golden Rules
   ========================================================================== */
.golden-rules-section {
  padding: 6px 16px 12px;
}

.golden-rules-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 18px 16px;
  box-shadow: var(--shadow-card);
}

.golden-rules-eyebrow {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-cta);
  margin-bottom: 4px;
}

.golden-rules-title {
  font-family: var(--font-display);
  font-size: 1.12rem;
  font-weight: 600;
  line-height: 1.28;
  color: var(--text-primary);
  margin-bottom: 14px;
}

.golden-rules-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.golden-rule-item {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 10px 12px;
  border-radius: 10px;
  background-color: var(--bg-primary);
  border: 1px solid var(--border-subtle);
}

.rule-number {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background-color: var(--accent-cta);
  color: #FFFFFF;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin-top: 1px;
}

.rule-copy {
  min-width: 0;
}

.rule-heading {
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text-primary);
  margin-bottom: 3px;
}

.rule-text {
  font-size: 0.77rem;
  line-height: 1.45;
  color: var(--text-secondary);
}

/* ==========================================================================
   Section F: Footer & Mandatory Legal Disclosures
   ========================================================================== */
.site-footer {
  text-align: center;
  padding: 28px 20px 48px;
  border-top: 1px solid var(--border-subtle);
  background-color: var(--bg-primary);
  margin-top: 12px;
}

.footer-disclosures {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 460px;
  margin: 0 auto 20px;
}

.disclosure-primary {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary);
}

.disclosure-secondary,
.disclosure-routing {
  font-size: 0.73rem;
  line-height: 1.48;
  color: var(--text-secondary);
}

.social-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 16px;
}

.social-icon-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 44px;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background-color: var(--bg-accent-soft);
  color: var(--text-primary);
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none;
  transition: background-color var(--transition-fast), border-color var(--transition-fast);
}

.social-icon-link:hover,
.social-icon-link:focus-visible {
  background-color: #E6DFD5;
  border-color: #D2C7B8;
}

.footer-legal-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.73rem;
  color: var(--text-secondary);
}

.privacy-trigger-btn {
  background: none;
  border: none;
  padding: 10px 6px;
  min-height: 44px;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--accent-cta);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  transition: color var(--transition-fast);
}

.privacy-trigger-btn:hover,
.privacy-trigger-btn:focus-visible {
  color: var(--accent-cta-hover);
}

.footer-divider {
  opacity: 0.55;
}

/* ==========================================================================
   Privacy Policy Modal
   ========================================================================== */
body.modal-open {
  overflow: hidden;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background-color: rgba(30, 27, 24, 0.56);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-backdrop[hidden] {
  display: none;
}

.modal-card {
  width: 100%;
  max-width: 480px;
  max-height: 85dvh;
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  box-shadow: 0 18px 48px rgba(30, 27, 24, 0.22);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-subtle);
  background-color: var(--bg-primary);
}

.modal-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-primary);
}

.modal-close-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border-subtle);
  background-color: var(--bg-card);
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color var(--transition-fast);
}

.modal-close-btn:hover,
.modal-close-btn:focus-visible {
  background-color: var(--bg-accent-soft);
}

.modal-body {
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 0.81rem;
  line-height: 1.5;
  color: var(--text-secondary);
}

.modal-body h3 {
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-top: 4px;
}

.modal-body strong {
  color: var(--text-primary);
}

.modal-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border-subtle);
  background-color: var(--bg-primary);
  display: flex;
  justify-content: flex-end;
}

.modal-done-btn {
  min-height: 44px;
  padding: 10px 22px;
  border-radius: 8px;
  border: none;
  background-color: var(--accent-cta);
  color: #FFFFFF;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  transition: background-color var(--transition-fast);
}

.modal-done-btn:hover,
.modal-done-btn:focus-visible {
  background-color: var(--accent-cta-hover);
}
