/* ═══ Munchie Cookies Catalog — Styles ═══ */

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

:root {
  --blue: #1a4fa0;
  --blue-dark: #143d7a;
  --blue-light: #2e6ed8;
  --cream: #FFF8E7;
  --cream-dark: #F5EDD8;
  --gold: #D4A017;
  --gold-light: #F0C040;
  --brown: #5C3D2E;
  --brown-light: #8B6F47;
  --coral: #E85D4A;
  --mint: #2ECC71;
  --text: #2D2A26;
  --text-muted: #8B8680;
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 20px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.12);
  --radius: 16px;
  --radius-sm: 10px;
  --radius-xs: 6px;
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

@font-face {
  font-family: 'Milkyway';
  src: url('../MilkywayDEMO.ttf') format('truetype');
  font-display: swap;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--cream);
  background-image: url('../hand_tapestry_tile.svg');
  background-repeat: repeat;
  background-size: 800px 600px;
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ── Navbar ── */
.catalog-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: rgba(255,248,231,0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(0,0,0,0.05);
}

.nav-brand { display: flex; align-items: center; text-decoration: none; }
.nav-logo { height: 36px; width: auto; }
.nav-title {
  font-family: 'Milkyway', cursive;
  font-size: 18px;
  color: var(--blue);
  letter-spacing: -0.3px;
}
.nav-back {
  font-size: 13px;
  color: var(--blue);
  text-decoration: none;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: var(--radius-xs);
  transition: var(--transition);
}
.nav-back:hover { background: rgba(26,79,160,0.08); }

/* ── Hero ── */
.catalog-hero {
  position: relative;
  padding: 60px 20px 50px;
  text-align: center;
  overflow: hidden;
}

.hero-bg-pattern {
  position: absolute;
  inset: 0;
  background-image: url('../hand_tapestry_tile.svg');
  background-size: 180px;
  opacity: 0.04;
  pointer-events: none;
}

.hero-content { position: relative; z-index: 1; }

.hero-title {
  font-family: 'Milkyway', cursive;
  font-size: clamp(36px, 8vw, 56px);
  color: var(--blue);
  margin-bottom: 8px;
  line-height: 1.1;
}

.hero-sub {
  font-size: 16px;
  color: var(--text-muted);
  font-weight: 400;
  margin-bottom: 30px;
}

.hero-stats {
  display: inline-flex;
  align-items: center;
  gap: 20px;
  background: white;
  padding: 16px 28px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
}

.stat { text-align: center; }
.stat-num {
  display: block;
  font-size: 22px;
  font-weight: 800;
  color: var(--blue);
  line-height: 1.2;
}
.stat-label { font-size: 11px; color: var(--text-muted); font-weight: 500; text-transform: uppercase; letter-spacing: 0.5px; }
.stat-divider { width: 1px; height: 32px; background: rgba(0,0,0,0.08); }

/* ── Quiz CTA ── */
.quiz-cta {
  max-width: 640px;
  margin: 0 auto 24px;
  padding: 0 20px;
  cursor: pointer;
}

.quiz-cta-inner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue-light) 100%);
  border-radius: var(--radius);
  color: white;
  transition: var(--transition);
  box-shadow: var(--shadow-md);
}
.quiz-cta-inner:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.quiz-icon { font-size: 28px; }
.quiz-title { font-weight: 700; font-size: 14px; }
.quiz-sub { font-size: 12px; opacity: 0.8; margin-top: 2px; }
.quiz-arrow { font-size: 20px; margin-left: auto; opacity: 0.7; }

/* ── Quiz Modal ── */
.quiz-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}

.quiz-box {
  background: white;
  border-radius: var(--radius);
  padding: 32px 28px;
  max-width: 440px;
  width: 100%;
  position: relative;
  box-shadow: var(--shadow-lg);
}

.quiz-close {
  position: absolute;
  top: 12px;
  right: 14px;
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: var(--text-muted);
  padding: 4px;
  line-height: 1;
}

.quiz-steps {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 24px;
}
.quiz-step-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--cream-dark);
  transition: var(--transition);
}
.quiz-step-dot.active { background: var(--blue); }
.quiz-step-dot.current { transform: scale(1.3); }

.quiz-question h3 {
  font-size: 18px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 20px;
  color: var(--text);
}

.quiz-options { display: flex; flex-direction: column; gap: 10px; }

.quiz-opt {
  display: block;
  width: 100%;
  padding: 14px 18px;
  border: 2px solid var(--cream-dark);
  border-radius: var(--radius-sm);
  background: white;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition: var(--transition);
  font-family: inherit;
}
.quiz-opt:hover { border-color: var(--blue); background: rgba(26,79,160,0.04); transform: translateX(4px); }

.quiz-result-icon { font-size: 48px; text-align: center; margin-bottom: 12px; }

.quiz-result-card {
  background: var(--cream);
  border-radius: var(--radius-sm);
  padding: 20px;
  text-align: center;
  margin: 16px 0;
}
.qr-name { font-size: 20px; font-weight: 800; color: var(--blue); margin-bottom: 8px; }
.qr-desc { font-size: 13px; color: var(--text-muted); line-height: 1.5; margin-bottom: 12px; }
.qr-tags { display: flex; gap: 6px; justify-content: center; margin-bottom: 16px; flex-wrap: wrap; }
.qr-order {
  display: inline-block;
  padding: 12px 28px;
  background: var(--blue);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
  text-decoration: none;
}
.qr-order:hover { transform: scale(1.03); box-shadow: 0 4px 16px rgba(26,79,160,0.3); }

.quiz-retry {
  display: block;
  margin: 12px auto 0;
  background: none;
  border: none;
  color: var(--blue);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

/* ── Filters Section ── */
.filters-section {
  position: sticky;
  top: 60px;
  z-index: 50;
  background: rgba(255,248,231,0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(0,0,0,0.05);
  padding: 12px 0;
}

.filters-container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }

.search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: white;
  border: 2px solid var(--cream-dark);
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  margin-bottom: 10px;
  transition: var(--transition);
}
.search-bar:focus-within { border-color: var(--blue); }
.search-bar svg { color: var(--text-muted); flex-shrink: 0; }
.search-bar input {
  border: none;
  outline: none;
  font-size: 14px;
  width: 100%;
  background: transparent;
  font-family: inherit;
  color: var(--text);
}

.active-filters-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background: rgba(26,79,160,0.06);
  border-radius: var(--radius-xs);
  margin-bottom: 10px;
}
.af-label { font-size: 12px; font-weight: 600; color: var(--blue); }
.af-clear {
  font-size: 11px;
  font-weight: 600;
  color: var(--coral);
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
}

.toggle-filters-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 14px;
  background: white;
  border: 2px solid var(--cream-dark);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
  transition: var(--transition);
}
.toggle-filters-btn:hover { border-color: var(--blue-light); }
.filter-count-badge {
  background: var(--blue);
  color: white;
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 99px;
  font-weight: 800;
}
.toggle-arrow { margin-left: auto; transition: var(--transition); font-size: 12px; }
.toggle-arrow.open { transform: rotate(180deg); }

.filter-panels {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  animation: slideDown 0.25s ease;
}

@keyframes slideDown { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }

.filter-group { }
.filter-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.filter-pills { display: flex; flex-wrap: wrap; gap: 6px; }

.fpill {
  padding: 7px 14px;
  border: 2px solid var(--cream-dark);
  border-radius: 99px;
  background: white;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
  white-space: nowrap;
}
.fpill:hover { border-color: var(--blue-light); background: rgba(26,79,160,0.03); }
.fpill.active {
  background: var(--blue);
  color: white;
  border-color: var(--blue);
}

/* ── Results Info ── */
.results-info {
  max-width: 1100px;
  margin: 16px auto 0;
  padding: 0 20px;
  font-size: 13px;
  color: var(--text-muted);
}

/* ── Product Grid ── */
.products-section {
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.product-card {
  background: white;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: var(--transition);
  border: 2px solid transparent;
  animation: fadeInUp 0.35s ease both;
}
.product-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(26,79,160,0.12);
}

@keyframes fadeInUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.card-image {
  position: relative;
  height: 180px;
  background: linear-gradient(135deg, var(--cream) 0%, var(--cream-dark) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.card-img-placeholder { font-size: 64px; opacity: 0.6; }

.card-featured {
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--gold);
  color: white;
  font-size: 10px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 99px;
  letter-spacing: 0.3px;
}

.card-stock-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 10px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 99px;
}
.card-stock-badge.in-stock { background: rgba(46,204,113,0.15); color: var(--mint); }
.card-stock-badge.no-stock { background: rgba(232,93,74,0.15); color: var(--coral); }

.card-body { padding: 16px 18px 18px; }

.card-name {
  font-size: 17px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 6px;
}

.card-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 12px;
  min-height: 40px;
}

.card-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 14px; }

.card-tag {
  font-size: 10px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 99px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.card-tag.base { background: rgba(26,79,160,0.08); color: var(--blue); }
.card-tag.intensity { background: rgba(232,93,74,0.08); color: var(--coral); }
.card-tag.sweetness { background: rgba(212,160,23,0.08); color: var(--gold); }

.card-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}


.card-order-btn {
  padding: 8px 16px;
  background: var(--blue);
  color: white;
  border: none;
  border-radius: var(--radius-xs);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
  text-decoration: none;
  display: inline-block;
}
.card-order-btn:hover { background: var(--blue-dark); transform: scale(1.04); }

/* ── Detail Modal ── */
.detail-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}

@media (min-width: 640px) {
  .detail-overlay { align-items: center; }
}

.detail-modal {
  background: white;
  border-radius: var(--radius) var(--radius) 0 0;
  max-width: 520px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  animation: slideUp 0.3s ease;
}

@media (min-width: 640px) {
  .detail-modal { border-radius: var(--radius); }
}

@keyframes slideUp { from { transform: translateY(40px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.detail-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 10;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255,255,255,0.9);
  border: none;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
}

.detail-header {
  position: relative;
  height: 200px;
  background: linear-gradient(135deg, var(--cream) 0%, var(--cream-dark) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.detail-img-placeholder { font-size: 80px; opacity: 0.5; }

.detail-featured-tag {
  position: absolute;
  bottom: 12px;
  left: 16px;
  background: var(--gold);
  color: white;
  font-size: 11px;
  font-weight: 800;
  padding: 5px 12px;
  border-radius: 99px;
}

.detail-body { padding: 24px; }

.detail-name {
  font-size: 24px;
  font-weight: 900;
  color: var(--text);
  margin-bottom: 4px;
}

.detail-price {
  font-size: 22px;
  font-weight: 900;
  color: var(--blue);
  margin-bottom: 16px;
}

.detail-desc {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.65;
  margin-bottom: 24px;
}

.detail-attrs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 24px;
}

.attr {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 14px 10px;
  background: var(--cream);
  border-radius: var(--radius-sm);
}
.attr-icon { font-size: 20px; margin-bottom: 4px; }
.attr-label { font-size: 10px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.attr-val { font-size: 13px; font-weight: 700; color: var(--text); margin-top: 2px; }

.detail-section {
  margin-bottom: 18px;
}
.detail-section h4 {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}
.detail-section p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}

.topping-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.topping-tag {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 99px;
  background: rgba(26,79,160,0.06);
  color: var(--blue);
}

.detail-actions { margin-top: 24px; }

.btn-menu-link {
  display: block;
  width: 100%;
  padding: 16px;
  background: var(--blue);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
  text-decoration: none;
  text-align: center;
}
.btn-menu-link:hover { background: var(--blue-dark); transform: scale(1.02); }

/* ── Loading & Empty ── */
.loading-state {
  text-align: center;
  padding: 80px 20px;
}
.loader {
  width: 40px;
  height: 40px;
  border: 3px solid var(--cream-dark);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  margin: 0 auto 16px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-state p { font-size: 13px; color: var(--text-muted); }

.empty-state {
  text-align: center;
  padding: 80px 20px;
}
.empty-icon { font-size: 56px; margin-bottom: 12px; opacity: 0.5; }
.empty-state h3 { font-size: 18px; font-weight: 700; color: var(--text); margin-bottom: 8px; }
.empty-state p { font-size: 13px; color: var(--text-muted); }
.link-btn {
  background: none;
  border: none;
  color: var(--blue);
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
  font-size: inherit;
  font-family: inherit;
}

/* ── Footer (matches landing) ── */
.footer {
  position: relative; z-index: 1;
  text-align: center; padding: 3rem 2rem;
  background: var(--blue);
  color: rgba(255,255,255,0.9); font-size: 0.85rem;
  overflow: hidden;
}
.footer::before {
  content: ''; position: absolute; inset: -40px;
  background-image: url('../hand_tapestry_tile.svg');
  background-repeat: repeat;
  background-size: 600px 450px;
  opacity: 0.35;
  filter: brightness(0) invert(1);
  animation: footer-wobble 8s ease-in-out infinite;
  pointer-events: none; z-index: 0;
}
@keyframes footer-wobble {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  25% { transform: translate(8px, -5px) rotate(0.5deg); }
  50% { transform: translate(-5px, 8px) rotate(-0.5deg); }
  75% { transform: translate(6px, 5px) rotate(0.3deg); }
}
.footer > * { position: relative; z-index: 1; }
.footer-brand {
  font-family: 'Milkyway', cursive; font-size: 1.1rem;
  color: white; margin-bottom: 0.5rem; font-weight: 400;
}
.footer-logo-white {
  filter: brightness(0) invert(1) drop-shadow(0 0 1px rgba(255,255,255,0.6));
  height: 55px; width: auto;
  margin-bottom: 0.5rem;
}

/* ── Product Images ── */
.card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.product-card:hover .card-img { transform: scale(1.06); }

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

.qr-img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
}

/* ── Intensity/Sweetness Meters ── */
.detail-meters {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}
.meter { display: flex; align-items: center; gap: 10px; }
.meter-label { font-size: 12px; font-weight: 600; color: var(--text-muted); min-width: 90px; }
.meter-bar {
  flex: 1;
  height: 8px;
  background: var(--cream-dark);
  border-radius: 99px;
  overflow: hidden;
}
.meter-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--coral) 0%, #FF6B45 100%);
  border-radius: 99px;
  transition: width 0.6s ease;
}
.meter-fill.sweet {
  background: linear-gradient(90deg, var(--gold) 0%, var(--gold-light) 100%);
}
.meter-val { font-size: 11px; font-weight: 700; color: var(--text); min-width: 60px; }

/* ── Tags common ── */
.tag {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 99px;
  background: rgba(26,79,160,0.08);
  color: var(--blue);
}

/* ── Animations ── */
.anim-fade { animation: fadeIn 0.3s ease; }

/* ── Responsive ── */
@media (max-width: 480px) {
  .product-grid { grid-template-columns: 1fr; }
  .hero-stats { flex-direction: row; gap: 14px; padding: 12px 20px; }
  .detail-modal { max-height: 85vh; }
  .nav-center { display: none; }
}

@media (min-width: 768px) {
  .product-grid { grid-template-columns: repeat(2, 1fr); }
  .filters-section { top: 60px; }
}

@media (min-width: 1024px) {
  .product-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--cream); }
::-webkit-scrollbar-thumb { background: var(--cream-dark); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }
