/* ══════════════════════════════════════════════════════════════
   Rooftop 612 — Design System
   Colors derived from logo #7fb3b1 (muted teal/sage)
   ══════════════════════════════════════════════════════════════ */

/* ── Tokens ───────────────────────────────────────────────── */
:root {
  /* Brand */
  --brand: #7fb3b1;
  --brand-dark: #5a8f8d;
  --brand-light: #a8d0ce;
  --brand-subtle: #e8f4f3;

  /* Warm accent (amber/gold) */
  --warm: #c8a97a;
  --warm-dark: #a8845a;
  --overlay-dark: rgba(0, 0, 0, 0.52);
  --overlay-gradient: linear-gradient(to top, rgba(0,0,0,0.72) 0%, rgba(0,0,0,0.1) 60%, transparent 100%);

  /* Typography */
  --font-display: 'Playfair Display', Georgia, serif;

  /* Light theme */
  --bg: #fafaf8;
  --surface: #ffffff;
  --surface-raised: #f5f5f2;
  --text: #1c1c1a;
  --text-secondary: #6b6b66;
  --text-muted: #9b9b95;
  --border: #e5e5e0;
  --border-light: #f0f0ec;
  --price: #2d2d2a;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 2px 8px rgba(0,0,0,0.08);
  --nav-bg: rgba(250,250,248,0.92);
  --header-bg: rgba(250,250,248,0.95);

  /* Expand animation */
  --expand-duration: 250ms;

  /* Layout */
  --header-h: 56px;
  --nav-h: 92px;
  --radius-sm: 6px;
  --radius-pill: 100px;
  --card-radius: 14px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg: #0a0a0a;
    --surface: #161616;
    --surface-raised: #1e1e1e;
    --text: #ededeb;
    --text-secondary: #a0a09a;
    --text-muted: #6b6b66;
    --border: #2e2e2e;
    --border-light: #222222;
    --price: #e8e8e5;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.2);
    --shadow-md: 0 2px 8px rgba(0,0,0,0.3);
    --nav-bg: rgba(10,10,10,0.92);
    --header-bg: rgba(10,10,10,0.95);
    --brand-subtle: #1a2e2d;
    --overlay-gradient: linear-gradient(to top, rgba(0,0,0,0.58) 0%, rgba(0,0,0,0.08) 60%, transparent 100%);
    --warm: #d4b882;
  }
}

:root[data-theme="dark"] {
  --bg: #0a0a0a;
  --surface: #161616;
  --surface-raised: #1e1e1e;
  --text: #ededeb;
  --text-secondary: #a0a09a;
  --text-muted: #6b6b66;
  --border: #2e2e2e;
  --border-light: #222222;
  --price: #e8e8e5;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.2);
  --shadow-md: 0 2px 8px rgba(0,0,0,0.3);
  --nav-bg: rgba(10,10,10,0.92);
  --header-bg: rgba(10,10,10,0.95);
  --brand-subtle: #1a2e2d;
  --overlay-gradient: linear-gradient(to top, rgba(0,0,0,0.58) 0%, rgba(0,0,0,0.08) 60%, transparent 100%);
  --warm: #d4b882;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + var(--nav-h) + 8px);
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, sans-serif;
  font-size: 18px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  padding-bottom: 3rem;
  overflow-x: hidden;
}

button {
  font-family: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

/* ── Header ───────────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
  padding: 0 1rem;
  background: var(--header-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

/* Fully transparent when hero is in view — logo + button float over the image */
body.hero-visible .site-header {
  background: transparent;
  border-bottom-color: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

body.hero-visible .lang-toggle,
body.hero-visible .theme-toggle,
body.hero-visible .pdf-link {
  background: rgba(0,0,0,0.35);
  border-color: rgba(255,255,255,0.18);
  color: rgba(255,255,255,0.92);
}

.logo {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
}

.pdf-link {
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.15rem 0.55rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  text-decoration: none;
  transition: background 0.15s;
}

.pdf-link:active {
  background: var(--brand-subtle);
  color: var(--brand);
}

.lang-toggle {
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.15rem 0.55rem;
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--text-secondary);
  transition: background 0.15s;
}

.lang-toggle:active {
  background: var(--brand-subtle);
  color: var(--brand);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.theme-toggle {
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.15rem 0.45rem;
  font-size: 1rem;
  color: var(--text-secondary);
  line-height: 1;
  transition: background 0.15s;
}

.theme-toggle:active {
  background: var(--brand-subtle);
  color: var(--brand);
}

/* ── Navigation ───────────────────────────────────────────── */
.menu-nav {
  position: sticky;
  top: var(--header-h);
  z-index: 15;
  background: var(--nav-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

/* Level 1: Comidas | Bebidas */
.nav-level1 {
  display: flex;
}

.nav-level1 .nav-tab {
  flex: 1;
  padding: 0.7rem 0.5rem;
  border: none;
  background: none;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 2.5px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}

.nav-level1 .nav-tab.active {
  color: var(--text);
  border-bottom: 3px solid var(--brand);
}

/* Level 2: Subcategory pills */
.nav-level2 {
  display: flex;
  gap: 0.4rem;
  padding: 0.5rem 0.75rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none; /* Firefox */
}

.nav-level2::-webkit-scrollbar {
  display: none;
}

.nav-tab--sub {
  flex-shrink: 0;
  white-space: nowrap;
  padding: 0.4rem 0.85rem;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius-pill);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all 0.2s;
}

.nav-tab--sub.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.nav-tab--sub:active {
  transform: scale(0.96);
}

/* ── Hero image ──────────────────────────────────────────── */
.menu-hero {
  position: relative;
  overflow: hidden;
  height: clamp(160px, 35vh, 280px);
}

.menu-hero::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 40%;
  background: linear-gradient(to top, rgba(0,0,0,0.45), transparent);
  pointer-events: none;
}

.hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.nav--search-active .menu-hero {
  display: none;
}

/* ── DOTW hero slot ──────────────────────────────────────── */
.dotw-hero,
.fotw-hero {
  position: relative;
  overflow: hidden;
  height: clamp(260px, 52vh, 440px);
  background: var(--card-bg, #1a1205) center / cover no-repeat;
  margin-top: calc(-1 * var(--header-h)); /* slide up behind the sticky header */
}

/* Top gradient — fades hero into the sticky header above it */
.dotw-hero::before,
.fotw-hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 45%;
  background: linear-gradient(to bottom, rgba(0,0,0,0.48), transparent);
  pointer-events: none;
  z-index: 1;
}

/* Bottom gradient — keeps text readable */
.dotw-hero::after,
.fotw-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--overlay-gradient);
  pointer-events: none;
  z-index: 1;
}

.dotw-hero__body,
.fotw-hero__body {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1.75rem 1.5rem 1.5rem;
  z-index: 2;
}

/* Scale up text for the larger hero canvas */
.dotw-hero .dotw-label,
.fotw-hero .dotw-label {
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  margin-bottom: 0.5rem;
}

.dotw-hero .dotw-name,
.fotw-hero .dotw-name {
  font-size: clamp(1.9rem, 6.5vw, 3rem);
  line-height: 1.08;
  margin-bottom: 0.5rem;
}

.dotw-hero .dotw-desc,
.fotw-hero .dotw-desc {
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
}

.dotw-hero__footer,
.fotw-hero__footer {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 0.25rem;
}

.dotw-hero .dotw-price,
.fotw-hero .dotw-price {
  font-size: 1.15rem;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  padding: 0.42rem 0.9rem;
  border: 1px solid rgba(255,255,255,0.55);
  border-radius: var(--radius-pill);
  background: rgba(255,255,255,0.14);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: background 150ms ease;
}

.hero-cta:hover,
.hero-cta:active {
  background: rgba(255,255,255,0.26);
}

.fotw-hero {
  display: none;
}

.category--comidas .dotw-hero,
.nav--search-active .dotw-hero,
.nav--search-active .fotw-hero {
  display: none;
}

.category--comidas .fotw-hero {
  display: block;
}

/* ── Search ──────────────────────────────────────────────── */
.search-bar {
  display: none;                    /* unhidden by search.js on init */
  padding: 0.5rem 1rem 0.4rem;
  max-width: 600px;
  margin: 0 auto;
  position: sticky;
  top: var(--header-h);
  z-index: 14;
  background: var(--bg);
}

.search-bar.active {
  display: block;
}

.search-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.search-input-wrap input[type="search"] {
  width: 100%;
  padding: 0.6rem 2.2rem 0.6rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--text);
  font-size: 0.9rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  -webkit-appearance: none;
}

.search-input-wrap input[type="search"]:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(127, 179, 177, 0.15);
}

.search-input-wrap input[type="search"]::-webkit-search-cancel-button,
.search-input-wrap input[type="search"]::-webkit-search-decoration {
  -webkit-appearance: none;
}

.search-clear {
  position: absolute;
  right: 0.5rem;
  background: none;
  border: none;
  font-size: 1.2rem;
  color: var(--text-muted);
  padding: 0.3rem;
  cursor: pointer;
  line-height: 1;
  transition: color 0.15s;
}

.search-clear:active {
  color: var(--text);
}

.search-tags {
  display: flex;
  gap: 0.35rem;
  padding-top: 0.5rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.search-tags::-webkit-scrollbar {
  display: none;
}

.search-tag {
  flex-shrink: 0;
  white-space: nowrap;
  padding: 0.3rem 0.7rem;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius-pill);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
}

.search-tag.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.search-tag:active {
  transform: scale(0.96);
}

.search-hidden {
  display: none !important;
}

.nav--search-active {
  display: none;
}

.search-no-results {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* ── Highlights carousel ─────────────────────────────────── */
.highlights-carousel {
  padding: 1rem 0 0.5rem;
}

.carousel-track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding: 0 0 0 1rem;
  scroll-behavior: smooth;
  scrollbar-width: none;
  gap: 0.75rem;
  padding: 0 1rem;
  -webkit-overflow-scrolling: touch;
}

.carousel-track::-webkit-scrollbar {
  display: none;
}

.highlight-card {
  flex-shrink: 0;
  width: 78vw;
  max-width: 340px;
  height: 220px;
  border-radius: var(--card-radius);
  background: var(--card-bg, #1a1a1a) center / cover no-repeat;
  position: relative;
  scroll-snap-align: start;
  overflow: hidden;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.highlight-card:last-child {
  scroll-snap-align: end;
}

.highlight-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--overlay-gradient);
  z-index: 0;
}

.highlight-card__body {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1rem;
  z-index: 1;
}

.highlight-card__name {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
  margin-bottom: 0.25rem;
}

.highlight-card__desc {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.82);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 0.4rem;
  line-height: 1.4;
}

.highlight-card__pair {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.65);
  font-style: italic;
  margin-bottom: 0.35rem;
  line-height: 1.3;
}

.highlight-card__price {
  font-size: 1rem;
  font-weight: 600;
  color: var(--warm);
}

.highlight-badge {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 2;
  background: var(--warm);
  color: #1a1208;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  padding: 0.25rem 0.55rem;
  border-radius: var(--radius-pill);
}

.highlight-badge--pairing {
  background: var(--brand);
  color: #fff;
}

.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.6rem 0 0.25rem;
}

.carousel-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-muted);
  opacity: 0.5;
  transition: background 0.2s, transform 0.2s, opacity 0.2s;
}

.carousel-dot.active {
  background: var(--warm);
  opacity: 1;
  transform: scale(1.35);
}

.highlight-badge--inline {
  color: var(--warm);
  font-size: 0.8rem;
  margin-left: 0.3em;
  vertical-align: middle;
  line-height: 1;
}

.nav--search-active .highlights-carousel {
  display: none;
}

/* Flash animation for navigating to an item via carousel */
.menu-item.flash {
  background: rgba(200, 169, 122, 0.18);
  transition: background 0.6s ease-out;
}

/* ── Menu content ─────────────────────────────────────────── */
.menu-content {
  padding: 0 1rem;
  max-width: 600px;
  margin: 0 auto;
}

.menu-section {
  padding-top: 1.25rem;
  padding-bottom: 0.5rem;
}

.section-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  padding-bottom: 0.6rem;
  margin-bottom: 0.25rem;
  border-bottom: 1px solid var(--border);
  letter-spacing: -0.01em;
}

/* ── Section banner strip ─────────────────────────────────── */
.section-banner {
  height: clamp(100px, 28vw, 140px);
  background: var(--brand-dark) bottom / cover no-repeat;
  border-radius: var(--card-radius);
  margin-bottom: 0.75rem;
  overflow: hidden;
  position: relative;
}

.section-banner::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 50%, rgba(0,0,0,0.25) 100%);
  pointer-events: none;
}

/* Gradient fallbacks — shown when no banner_image is wired yet */
#section-entradas    .section-banner { background: linear-gradient(135deg, #2d3a1a, #80a050); }
#section-platos-fuertes .section-banner { background: linear-gradient(135deg, #3a2a1a, #c09060); background-position: left 55%; }
#section-pizzas      .section-banner { background: linear-gradient(135deg, #3a1a1a, #c07050); background-position: center; }
#section-pastas      .section-banner { background: linear-gradient(135deg, #3a2a1a, #c0a060); background-position: left 70%; background-position-x: left 20%; }
#section-cocteles    .section-banner { background: linear-gradient(135deg, #2d4a49, #7fb3b1); background-position: center 25%; }
#section-mixologia   .section-banner { background: linear-gradient(135deg, #2d4a49, #7fb3b1); background-position: left 40%; }
#section-shots       .section-banner { background: linear-gradient(135deg, #4a2d2d, #b17f7f); }
#section-vinos       .section-banner { background: linear-gradient(135deg, #4a1a2d, #b07090); background-position: center 60%; }
#section-digestivos  .section-banner { background: linear-gradient(135deg, #2a2a1a, #a09060); }
#section-cervezas    .section-banner { background: linear-gradient(135deg, #3a3a1a, #c8b560); background-position: center 90%; }
#section-tarros    .section-banner { background: linear-gradient(135deg, #3a3a1a, #c8b560); background-position: top; }
#section-rooftop     .section-banner { background: linear-gradient(135deg, #1a2d4a, #6080b0); background-position: center 65%; }
#section-destilados  .section-banner { background: linear-gradient(135deg, #2a1a3a, #8060a0); background-position: left 65%; }

.group-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--brand-dark);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 1.25rem;
  margin-bottom: 0.4rem;
  padding-left: 0.15rem;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .group-title {
    color: var(--brand-light);
  }
}

[data-theme="dark"] .group-title {
  color: var(--brand-light);
}

/* ── Serving column headers (wines & spirits) ─────────────── */
.serving-labels {
  display: flex;
  justify-content: flex-end;
  gap: 0.25rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 0;
}

.serving-labels span {
  width: 4.5rem;
  text-align: right;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.item-list--servings .item-header {
  display: flex;
  align-items: baseline;
  gap: 0.25rem;
}

.item-list--servings .item-name {
  flex: 1;
  min-width: 0;
}

.item-prices {
  display: flex;
  gap: 0.25rem;
  flex-shrink: 0;
}

.item-prices .item-price {
  width: 4.5rem;
  text-align: right;
}

/* ── Drink of the Week ───────────────────────────────────── */
.dotw-card {
  position: relative;
  overflow: hidden;
  height: 180px;
  border-radius: var(--card-radius);
  background: var(--card-bg, #1a1205) center / cover no-repeat;
  border: 2px solid var(--warm);
  margin: 1rem 1rem 0;
}

.dotw-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--overlay-gradient);
}

.dotw-card__body {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1rem;
  z-index: 1;
}

.dotw-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand-light);
  margin-bottom: 0.2rem;
}

.dotw-name {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.15;
  margin-bottom: 0.2rem;
}

.dotw-desc {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.8);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
  margin-bottom: 0.35rem;
}

.dotw-price {
  font-size: 1rem;
  font-weight: 600;
  color: var(--warm);
}

/* ── Item list ────────────────────────────────────────────── */
.item-list {
  list-style: none;
}

.menu-item {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border-light);
}

.menu-item:last-child {
  border-bottom: none;
}

/* Item header */
.item-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
}

.expandable {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
}

.expandable .item-header,
.expandable .item-desc,
.expandable .item-details-wrap {
  pointer-events: none;
}

.item-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.35;
}

/* Photo indicator — small image icon after the name */
.has-photo .item-name::after {
  content: '';
  display: inline-block;
  width: 11px;
  height: 11px;
  margin-left: 5px;
  vertical-align: middle;
  opacity: 0.45;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none' stroke='%237fb3b1' stroke-width='1.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='0.8' y='0.8' width='10.4' height='10.4' rx='1.5'/%3E%3Ccircle cx='4' cy='4' r='1' fill='%237fb3b1' stroke='none'/%3E%3Cpolyline points='0.8,9 3.5,6 5.5,8 7.5,5.5 11.2,9'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* Chevron indicator for expandable items */
.expandable .item-name::before {
  content: "";
  display: inline-block;
  width: 0.45em;
  height: 0.45em;
  border-right: 2px solid var(--text-muted);
  border-bottom: 2px solid var(--text-muted);
  transform: rotate(-45deg);
  margin-right: 0.5em;
  transition: transform var(--expand-duration) ease;
  vertical-align: 0.1em;
}

.expandable.expanded .item-name::before {
  transform: rotate(45deg);
  vertical-align: 0.15em;
}

.item-price {
  flex-shrink: 0;
  white-space: nowrap;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--price);
}

.item-unit {
  font-weight: 400;
  color: var(--text-muted);
  font-size: 0.82rem;
}

/* Description */
.item-desc {
  font-size: 0.85rem;
  line-height: 1.45;
  color: var(--text-secondary);
  margin-top: 0.2rem;
}

/* ── Expand/Collapse animation (CSS grid trick) ───────────── */
.item-details-wrap {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows var(--expand-duration) ease;
}

.expanded .item-details-wrap {
  grid-template-rows: 1fr;
}

.item-details {
  overflow: hidden;
}

.item-details-inner {
  padding-top: 0.5rem;
  padding-left: 0.6rem;
  border-left: 2px solid var(--brand);
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ── Item expand image ────────────────────────────────────── */
.item-expand-image {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  background: var(--brand-subtle); /* placeholder color while loading */
}

/* Remove the text-style chrome (border + padding) when showing a photo */
.item-details-inner:has(.item-expand-image) {
  padding: 0;
  border-left: none;
}

.details-label {
  font-weight: 600;
  color: var(--text-secondary);
}

/* ── Featured item image ──────────────────────────────────── */
.item-image {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: var(--radius-sm);
  margin-bottom: 0.5rem;
}

/* ── Error state ──────────────────────────────────────────── */
.error {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* ── Utility ──────────────────────────────────────────────── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}
