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

:root {
  --red: #E31E24;
  --black: #1A1A1A;
  --white: #FFFFFF;
  --gray-mid: #888;
  --gray-line: #ececea;
  --transition: 0.35s ease;
}

html { scroll-behavior: smooth; }
body {
  font-family: Helvetica, Arial, sans-serif;
  color: var(--black);
  background: var(--white);
  padding-top: 70px; /* header height */
  padding-bottom: 60px; /* fixed footer height */
}

a { color: inherit; }

/* ─── HEADER ─────────────────────────────────────────────── */
header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: var(--white);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 40px;
  height: 70px;
  border-bottom: 2px solid var(--red);
  box-shadow: 0 2px 12px rgba(0,0,0,.08);
}

.logo {
  position: absolute; left: 50%; transform: translateX(-50%);
  font-family: 'Montserrat', sans-serif;
  font-size: 2.4rem; font-weight: 900;
  color: var(--red); letter-spacing: -1px;
  text-decoration: none; user-select: none;
}

.main-nav {
  display: flex; align-items: center; gap: 28px;
  font-family: 'Montserrat', sans-serif;
}
.main-nav a {
  font-size: 13px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .5px; text-decoration: none; color: var(--black);
  padding: 6px 0; position: relative; white-space: nowrap;
}
.main-nav a::after {
  content: ""; position: absolute; left: 0; right: 100%; bottom: -2px; height: 2px;
  background: var(--red); transition: right var(--transition);
}
.main-nav a:hover::after { right: 0; }
.main-nav a.active { color: var(--red); }
.main-nav a.active::after { right: 0; }

.header-right {
  display: flex; align-items: center; gap: 20px;
  z-index: 2;
}
.hotline {
  font-size: 13px; font-weight: 600;
  color: var(--black); font-family: 'Montserrat', sans-serif;
  white-space: nowrap;
}
.hotline span { color: var(--red); }

/* ─── FOOTER ─────────────────────────────────────────────── */
footer {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 90;
  background: var(--black);
}
.footer-bottom {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 24px;
  justify-content: space-between;
  align-items: center;
  padding: 14px 40px;
  font-size: 0.78rem;
  color: #bdbdbd;
}
.footer-bottom a:hover { color: var(--red); }
.footer-note {
  text-align: center;
  font-size: 13px;
  color: var(--gray-mid);
  padding: 18px 20px 0;
}
.footer-note b { color: var(--black); }

/* ─── FLAG STRIPE ─────────────────────────────────────────────── */
.flag-stripe { display: flex; height: 6px; width: 100%; }
.flag-stripe span { flex: 1; }
.flag-stripe .g { background: #2E7D32; }
.flag-stripe .y { background: yellow; }
.flag-stripe .r { background: #C62828; }

/* ─── HOME HERO ──────────────────────────────────────────── */
.home-hero {
  max-width: 1200px; margin: 0 auto;
  padding: 60px 40px 20px;
  text-align: center;
}
.home-hero h1 {
  font-family: 'Montserrat', sans-serif;
  font-size: 2.2rem; font-weight: 900;
  color: var(--black);
  letter-spacing: -0.5px;
}
.home-hero p {
  margin-top: 10px;
  font-size: 15px; color: var(--gray-mid);
  max-width: 560px; margin-left: auto; margin-right: auto;
}

.brand-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  max-width: 1200px; margin: 40px auto 80px;
  padding: 0 40px; gap: 28px;
}
.brand-card {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 20px;
  border: 1px solid var(--gray-line);
  border-radius: 4px;
  padding: 50px 24px;
  text-decoration: none;
  background: var(--white);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.brand-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 34px rgba(0,0,0,.10);
  border-color: transparent;
}
.brand-card img { max-width: 200px; max-height: 90px; object-fit: contain; }
.brand-card span {
  font-family: 'Montserrat', sans-serif;
  font-size: 12px; font-weight: 700; letter-spacing: 1.5px;
  text-transform: uppercase; color: var(--gray-mid);
}

/* ─── BRAND PAGE HERO ────────────────────────────────────── */
.brand-hero { position: relative; width: 100%; overflow: hidden; }
.brand-hero img.hero-banner {
  width: 100%; display: block; aspect-ratio: 16 / 9; object-fit: cover;
}

.brand-intro {
  max-width: 1200px; margin: 0 auto; padding: 60px 40px 10px;
}
.brand-intro h1 {
  font-family: 'Montserrat', sans-serif; font-weight: 900; font-size: 1.9rem;
  letter-spacing: -0.5px;
}
.brand-intro p {
  margin-top: 10px; color: var(--gray-mid); font-size: 14px; max-width: 640px; line-height: 1.6;
}

/* ─── CATEGORY NAV (quick jump) ──────────────────────────── */
.cat-nav {
  max-width: 1200px; margin: 24px auto 0; padding: 0 40px;
  display: flex; flex-wrap: wrap; gap: 10px;
}
.cat-nav a {
  font-family: 'Montserrat', sans-serif;
  font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px;
  text-decoration: none; padding: 8px 16px; border-radius: 20px;
  border: 1px solid var(--gray-line); color: var(--black);
  transition: all var(--transition);
}
.cat-nav a:hover { border-color: var(--accent, var(--red)); color: var(--accent, var(--red)); }

/* ─── PRODUCT GRID / CARDS ───────────────────────────────── */
.catalog { max-width: 1200px; margin: 0 auto; padding: 20px 40px 80px; }

.cat-block { margin-top: 36px; scroll-margin-top: 90px; }
.cat-block h2 {
  font-family: 'Montserrat', sans-serif; font-size: 1.1rem; font-weight: 700;
  color: var(--accent, var(--black));
  border-left: 4px solid var(--accent, var(--red));
  padding-left: 12px; margin-bottom: 4px;
}
.cat-count { font-size: 12px; color: var(--gray-mid); margin-left: 16px; font-weight: 400; }

.category-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 18px; margin-top: 18px;
}

.product-card {
  border: 1px solid var(--gray-line); border-radius: 6px; overflow: hidden;
  background: var(--white); transition: box-shadow var(--transition), transform var(--transition);
}
.product-card:hover { box-shadow: 0 10px 24px rgba(0,0,0,.08); transform: translateY(-3px); }

.product-thumb {
  aspect-ratio: 1 / 1;
  background: linear-gradient(135deg, #f7f7f5, #ececea);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.product-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

.product-info { padding: 12px 14px 14px; }
.product-name {
  font-family: 'Montserrat', sans-serif; font-weight: 700; font-size: 13.5px;
  color: var(--black); line-height: 1.3; margin-bottom: 8px; min-height: 34px;
}
.size-chip {
  display: inline-block; font-size: 11px; font-weight: 600;
  padding: 3px 9px; margin: 0 4px 4px 0; border-radius: 20px;
  background: var(--accent-soft, #f3f3f2); color: var(--accent, var(--gray-mid));
}

/* ─── FLAVOR SELECTOR (image left / chip list right) ────── */
.flavor-selector { display: flex; gap: 30px; align-items: flex-start; margin-top: 14px; }
.flavor-image { flex: 0 0 240px; }
.flavor-image-frame {
  width: 240px; height: 240px; border-radius: 20px; overflow: hidden;
  background: none;
  position: relative;
}
.flavor-image-frame img {
  width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0;
}
.flavor-image-frame .selected-img { display: none; }
.flavor-image.has-selection .default-img { display: none; }
.flavor-image.has-selection .selected-img { display: block; }
.flavor-image-caption { margin-top: 12px; text-align: center; }
.flavor-image-name { display: block; font-weight: 700; font-size: 14px; }
.flavor-image-size { display: block; font-size: 12px; color: var(--gray-mid); margin-top: 2px; }
.flavor-image-caption .product-sizes { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; }

/* compact chip-list variant (Mứt / Mứt Filling / Xốt Topping / Nước Cốt) */
.flavor-chip-grid { flex: 1; display: flex; flex-wrap: wrap; gap: 6px; align-content: flex-start; }
.flavor-chip {
  border: 1px solid var(--gray-line); background: var(--white); border-radius: 20px;
  padding: 6px 14px; font-size: 12px; font-weight: 600; cursor: pointer;
  line-height: 1.3; transition: all var(--transition); color: var(--black);
  font-family: 'Quicksand', sans-serif;
}
.flavor-chip:hover, .flavor-chip.is-active {
  border-color: var(--accent); color: var(--accent); background: var(--accent-soft);
}

.flavor-picker { flex: 1; width: 100%; max-width: 320px; position: relative; }
.flavor-dropdown-toggle {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 11px 14px; border: 1px solid var(--gray-line); border-radius: 8px;
  background: var(--white); cursor: pointer; font-size: 13px; font-weight: 600;
  color: var(--black); text-align: left; font-family: inherit;
}
.flavor-dropdown-toggle:hover { border-color: var(--accent); }
.flavor-dropdown-toggle .arrow { flex-shrink: 0; transition: transform var(--transition); color: var(--accent); }
.flavor-picker.is-open .flavor-dropdown-toggle .arrow { transform: rotate(180deg); }
.flavor-picker.is-open .flavor-dropdown-toggle { border-color: var(--accent); }

.flavor-dropdown-list {
  position: absolute; left: 0; right: 0; top: calc(100% + 8px);
  max-height: 280px; overflow-y: auto;
  background: var(--white); border: 1px solid var(--gray-line); border-radius: 10px;
  box-shadow: 0 16px 34px rgba(0,0,0,.14);
  list-style: none; padding: 6px; margin: 0;
  z-index: 30; display: none;
}
.flavor-picker.is-open .flavor-dropdown-list { display: block; }
.flavor-option {
  width: 100%; text-align: left; padding: 9px 12px; border: none; background: none;
  cursor: pointer; font-size: 13px; border-radius: 6px; color: var(--black); font-family: inherit;
}
.flavor-option:hover, .flavor-option.is-active { background: var(--accent-soft); color: var(--accent); }

/* ─── 3-CATEGORY ROW LAYOUT ──────────────────────────────── */
.catalog-row {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px;
  align-items: start; margin-top: 10px;
}
.catalog-row .cat-block h2 { font-size: 1rem; }
.catalog-row .flavor-selector { flex-direction: column; align-items: center; text-align: center; }
.catalog-row .flavor-image { flex: none; }
.catalog-row .flavor-image-frame { width: 130px; height: 130px; margin: 0 auto; }
.catalog-row .flavor-picker { margin-top: 14px; max-width: 100%; }
.catalog-row .category-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 14px; }
.catalog-row .category-grid.single { grid-template-columns: 1fr; max-width: 190px; margin: 14px auto 0; }
.catalog-row .flavor-chip-grid { justify-content: center; margin-top: 14px; }

.catalog-row-2 { grid-template-columns: repeat(2, 1fr); max-width: 760px; margin-left: auto; margin-right: auto; }

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

/* ─── FLAVOR CAROUSEL + CHIP (for categories with many flavors) ── */
.flavor-carousel {
  display: flex; gap: 16px; overflow-x: auto; padding: 10px 4px 18px;
  scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch;
}
.flavor-carousel::-webkit-scrollbar { height: 6px; }
.flavor-carousel::-webkit-scrollbar-thumb { background: var(--gray-line); border-radius: 10px; }
/* ─── ACCORDION (Golden Farm) ────────────────────────────── */
details.cat-accordion {
  border: 1px solid var(--gray-line);
  border-radius: 16px;
  padding: 16px 20px;
}
details.cat-accordion + details.cat-accordion { margin-top: 14px; }
details.cat-accordion summary {
  cursor: pointer; list-style: none;
  display: flex; align-items: center; justify-content: space-between;
  font-family: 'Quicksand', sans-serif; font-weight: 600; font-size: 1.05rem;
  color: var(--black);
}
details.cat-accordion summary::-webkit-details-marker { display: none; }
details.cat-accordion summary .cat-title { display: flex; align-items: baseline; gap: 12px; }
details.cat-accordion summary .cat-title .dot {
  width: 10px; height: 10px; border-radius: 50%; background: var(--accent, var(--red));
  display: inline-block;
}
details.cat-accordion summary .cat-count { font-family: Helvetica, sans-serif; }
details.cat-accordion summary .chevron {
  width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--gray-line);
  display: flex; align-items: center; justify-content: center; font-size: 14px;
  color: var(--accent, var(--red)); transition: transform var(--transition);
  flex-shrink: 0;
}
details.cat-accordion[open] summary .chevron { transform: rotate(45deg); }
details.cat-accordion[open] summary { margin-bottom: 6px; }

/* compact variant when embedded inside a 3-column row */
.catalog-row details.cat-accordion { margin-top: 0; padding: 14px 16px; }
.catalog-row details.cat-accordion summary { font-size: 0.95rem; }

/* ─── VI A THEME (dark) ──────────────────────────────────── */
.theme-va { background: #0d0d0d; color: #f2f2f2; }
.theme-va .brand-intro p { color: #b8b8b8; }
.theme-va .cat-nav a { border-color: #333; color: #f2f2f2; }
.theme-va .cat-nav a:hover { border-color: var(--accent); color: var(--accent); }
.theme-va .cat-block h2 { color: var(--accent); }
.theme-va .catalog-row .cat-block {
  margin-top: 0; border-radius: 14px; padding: 20px;
}
.theme-va .cat-count { color: #999; }
.theme-va .catalog {padding:0;}
.theme-va .flavor-image-frame {
  width: 360px; height: 360px;}
.theme-va  .flavor-image-frame img {
  height: 100%; object-fit: cover;
}
.theme-va .product-card { background: #161616; border-color: #2a2a2a; }
.theme-va .product-thumb { background: linear-gradient(135deg,#1c1c1c,#0d0d0d); }
.theme-va .product-name { color: #f2f2f2; }
/* ─── THEME ACCENTS ───────────────────────────────────────── */
.theme-gf { --accent: #1B6B3A; --accent-soft: #E7F2EA; }
.theme-mr { --accent: #C62828; --accent-soft: #FBEAEA; }
.theme-va { --accent: #E31E24; --accent-soft: #2a1414; }

/* ─── MAMA ROSA THEME (Italian trattoria) ───────────────────── */
.theme-mr { background: #FFFBF3; }

.theme-mr .brand-intro h1 {
  font-family: 'Playfair Display', serif; font-style: italic; font-weight: 700;
  color: #7a1414;
}
.theme-mr .brand-intro p { font-family: Georgia, serif; }

.theme-mr .cat-nav a { font-family: 'Playfair Display', serif; font-style: italic; font-weight: 700; text-transform: none; letter-spacing: 0; border-radius: 30px; }

.theme-mr .cat-block h2 {
  font-family: 'Playfair Display', serif; font-style: italic; font-size: 1.4rem;
  border-left: none; padding-left: 20px; position: relative;
}
.theme-mr .cat-block h2::before {
  content: ""; position: absolute; left: 0; top: 3px; bottom: 3px; width: 5px;
  background: linear-gradient(180deg, #2E7D32, #C62828); border-radius: 3px;
}
.theme-mr .cat-count { font-family: Helvetica, sans-serif; font-style: normal; }

.theme-mr .product-card {
  border-radius: 18px; border-color: #eee0c8;
  box-shadow: 0 2px 8px rgba(122,20,20,.05);
}
.theme-mr .product-card:hover { box-shadow: 0 14px 28px rgba(122,20,20,.14); }
.theme-mr .product-thumb { border-radius: 18px 18px 0 0; }
.theme-mr .product-name { font-family: 'Playfair Display', serif; font-style: italic; font-size: 14.5px; }

.theme-mr .flavor-thumb { border: 3px solid #f0e4c8; }
.theme-mr .flavor-item:hover .flavor-thumb,
.theme-mr .flavor-item.is-active .flavor-thumb { border-color: var(--accent); }
.theme-mr .flavor-name { font-family: 'Playfair Display', serif; font-style: italic; }
.theme-mr .flavor-dropdown-toggle, .theme-mr .flavor-option { font-family: 'Playfair Display', serif; font-style: italic; }

/* ─── RESPONSIVE ─────────────────────────────────────────── */
@media (max-width: 1024px) {
  .brand-grid { grid-template-columns: 1fr; max-width: 480px; }
  .category-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
}
@media (max-width: 768px) {
  header { padding: 0 16px; height: auto; flex-wrap: wrap; padding-top: 10px; padding-bottom: 8px; }
  body { padding-top: 96px; padding-bottom: 92px; }
  .hotline { display: none; }
  .logo { position: static; transform: none; font-size: 1.5rem; order: 1; }
  .header-right { order: 2; margin-left: auto; }
  .main-nav { order: 3; width: 100%; justify-content: center; gap: 14px; flex-wrap: wrap; margin-top: 4px; }
  .main-nav a { font-size: 11px; }
  .brand-intro, .cat-nav, .catalog, .footer-bottom { padding-left: 20px; padding-right: 20px; }
  .footer-bottom { flex-direction: column; gap: 4px; padding: 10px 20px; text-align: center; font-size: 0.72rem; }
}
@media (max-width: 480px) {
  .category-grid { grid-template-columns: repeat(2, 1fr); }
}
