/* =========================================
   DOM ZEFERINO — TABLET MENU
   Optimized for tablet display (menu.domzeferino.pt)
   ========================================= */

:root {
    --olive: #4a5240;
    --olive-dark: #2e3328;
    --ivory: #f5f0e8;
    --ivory-dark: #ede5d4;
    --gold: #c9a84c;
    --gold-light: #d4b96a;
    --gold-dark: #a8871f;
    --cream: #faf7f2;
    --text-dark: #1a1a14;
    --text-medium: #3d3d30;
    --white: #ffffff;
    --font-serif: 'Cormorant Garamond', Georgia, serif;
    --font-sans: 'Montserrat', sans-serif;
}

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

html, body {
    height: 100%;
    -webkit-tap-highlight-color: transparent;
    -webkit-text-size-adjust: 100%;
}

/* Legal footer (sticky) */
.tablet-legal-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 50;
    background: var(--olive);
    border-top: 1px solid rgba(201, 168, 76, 0.1);
    padding: 0.4rem 1.5rem 0.5rem;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
}

.tablet-legal-footer .iva-notice,
.tablet-legal-footer .allergen-notice {
    position: static;
    font-family: var(--font-sans);
    font-size: 0.6rem;
    color: rgba(245, 240, 232, 0.45);
    letter-spacing: 0.03em;
    margin: 0;
    line-height: 1.4;
    pointer-events: auto;
}

/* IVA notice (standalone on non-menu pages) */
.iva-notice {
    position: fixed;
    bottom: 0.5rem;
    left: 0;
    right: 0;
    text-align: center;
    font-family: var(--font-sans);
    font-size: 0.6rem;
    color: rgba(245, 240, 232, 0.45);
    letter-spacing: 0.04em;
    margin: 0;
    pointer-events: none;
    z-index: 10;
}

/* Lock scroll on intro & lang pages, allow on menu */
body:has(.intro-page), body:has(.lang-page), body:has(.table-page) {
    overflow: hidden;
}

body:has(.tablet-menu) {
    overflow-y: auto;
    overflow-x: hidden;
}

body {
    font-family: var(--font-sans);
    background:
        linear-gradient(160deg, rgba(30, 34, 24, 0.94) 0%, rgba(46, 51, 40, 0.90) 100%),
        var(--olive-dark);
    background-color: var(--olive-dark);
    color: var(--ivory);
}

/* =========================================
   PAGE 1: INTRO
   ========================================= */

.intro-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100%;
    padding: 2rem;
    overflow-x: hidden;
    overflow-y: auto;
    overflow-y: auto;
}

.intro-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 800px;
    width: 100%;
}

.intro-logo {
    width: 200px;
    height: auto;
    margin-bottom: 2rem;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.3));
}

.intro-line-deco {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    width: 100%;
    max-width: 500px;
    margin-bottom: 2rem;
}

.deco-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(201, 168, 76, 0.4));
}

.deco-line:last-child {
    background: linear-gradient(90deg, rgba(201, 168, 76, 0.4), transparent);
}

.deco-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--gold);
    flex-shrink: 0;
    margin: 0 0.5rem;
}

.intro-heading {
    font-family: var(--font-serif);
    font-size: 3.2rem;
    font-weight: 600;
    text-align: center;
    color: var(--ivory);
    line-height: 1.2;
    margin-bottom: 1.8rem;
}

.intro-gold {
    color: var(--gold);
}

.intro-subtitle-caps {
    font-family: var(--font-sans);
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: rgba(245, 240, 232, 0.4);
    text-align: center;
    margin-bottom: 1.8rem;
}

.intro-divider {
    width: 80px;
    height: 1px;
    background: var(--gold);
    opacity: 0.5;
    margin: 0 auto 1.8rem;
}

/* Slide one-by-one */
.intro-slide {
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: transform 0.8s ease, opacity 0.8s ease;
}

.intro-quote {
    font-family: var(--font-serif);
    font-size: 1.2rem;
    font-weight: 400;
    color: rgba(245, 240, 232, 0.55);
    text-align: center;
    line-height: 1.6;
    max-width: 800px;
    min-height: 5.8em;
}

.intro-quote em {
    font-style: normal;
}

.quote-last {
    display: block;
    margin-top: 0.3rem;
    font-style: normal;
}

/* Start button */
.start-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 2rem;
    width: 80px;
    height: 80px;
    border: 1px solid rgba(201, 168, 76, 0.4);
    border-radius: 50%;
    background: transparent;
    text-decoration: none;
    color: var(--gold);
    transition: all 0.3s ease;
}

.start-btn:hover, .start-btn:active {
    background: rgba(201, 168, 76, 0.1);
    border-color: var(--gold);
    transform: scale(1.05);
}

.start-icon {
    width: 36px;
    height: 36px;
}

/* ---- LANGUAGE SELECTION PAGE ---- */

.lang-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 2rem;
    gap: 2.5rem;
}

.lang-header {
    text-align: center;
}

.lang-logo {
    width: 150px;
    height: auto;
    margin-bottom: 1.2rem;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.3));
}

.lang-subtitle {
    font-family: var(--font-serif);
    font-size: 1.4rem;
    font-weight: 400;
    font-style: italic;
    color: var(--gold-light);
    letter-spacing: 0.02em;
}

/* ---- FLAG GRID ---- */

.lang-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1.5rem;
    max-width: 720px;
    width: 100%;
}

.lang-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    padding: 1.5rem 1rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(201, 168, 76, 0.15);
    text-decoration: none;
    color: var(--ivory);
    transition: all 0.3s ease;
    cursor: pointer;
}

.lang-card:hover,
.lang-card:active {
    background: rgba(201, 168, 76, 0.12);
    border-color: var(--gold);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.lang-card:active {
    transform: translateY(0);
}

.lang-flag {
    width: 72px;
    height: 54px;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.lang-label {
    font-family: var(--font-sans);
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--ivory-dark);
}

/* =========================================
   MENU VIEW (when language is selected)
   ========================================= */

/* Header bar */
.tablet-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    padding: 0.6rem 1.2rem;
    background: rgba(30, 34, 24, 0.97);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(201, 168, 76, 0.15);
}

.tablet-header .header-icon-btn {
    position: absolute;
    left: 1.2rem;
}

.header-icon-btn {
    background: none;
    border: none;
    color: var(--gold);
    padding: 0.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
}

.header-logo-link {
    line-height: 0;
}

.header-logo {
    height: 36px;
    width: auto;
}

.header-tab {
    font-family: var(--font-sans);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    text-decoration: none;
    color: rgba(245, 240, 232, 0.45);
    padding: 0.5rem 1.2rem;
    border-bottom: 2px solid transparent;
    transition: all 0.25s;
}

.header-tab.active {
    color: var(--gold);
    border-bottom-color: var(--gold);
}

.header-tab:hover {
    color: var(--ivory);
}


/* Sidebar */
.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 300;
}

.sidebar-backdrop.open { display: block; }

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    max-width: 80vw;
    height: 100%;
    background: rgba(30, 34, 24, 0.98);
    backdrop-filter: blur(16px);
    border-right: 1px solid rgba(201, 168, 76, 0.15);
    z-index: 301;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}

.sidebar.open { transform: translateX(0); }

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 1rem 1.2rem;
    border-bottom: 1px solid rgba(201, 168, 76, 0.12);
}

.sidebar-logo {
    height: 35px;
    width: auto;
}

.sidebar-close {
    position: absolute;
    right: 1.2rem;
    background: none;
    border: none;
    color: var(--ivory);
    font-size: 1.8rem;
    cursor: pointer;
    padding: 0 0.3rem;
    opacity: 0.6;
}

.sidebar-sections {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem 0;
}

.sidebar-group-title {
    padding: 0.9rem 1.5rem 0.5rem;
    font-family: var(--font-sans);
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--gold);
}

.sidebar-group-title a {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s;
}

.sidebar-group-title a:hover {
    color: var(--ivory);
}

.sidebar-group-title.active {
    color: var(--gold);
}

.sidebar-group-title.active a {
    color: var(--gold);
}

.sidebar-link {
    display: block;
    padding: 0.4rem 1.5rem 0.4rem 2.5rem;
    font-family: var(--font-serif);
    font-size: 1.05rem;
    font-weight: 500;
    color: rgba(245, 240, 232, 0.7);
    text-decoration: none;
    border-left: 3px solid transparent;
    transition: all 0.2s;
}

.sidebar-link:hover, .sidebar-link:active {
    color: var(--ivory);
    background: rgba(201, 168, 76, 0.06);
    border-left-color: var(--gold);
}


.sidebar-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(201, 168, 76, 0.12);
}

.sidebar-home {
    font-family: var(--font-sans);
    font-size: 0.8rem;
    color: var(--gold-light);
    text-decoration: none;
    opacity: 0.7;
}

.sidebar-home:hover { opacity: 1; }


/* Menu content */
.tablet-menu {
    padding: 70px 1.5rem 2rem;
    max-width: 900px;
    margin: 0 auto;
}

/* Main group (e.g. Sobremesas, Bebidas) */
.tablet-group {
    margin-bottom: 2.5rem;
}

.group-header {
    margin-bottom: 1rem;
}

.group-title {
    font-family: var(--font-serif);
    font-size: 2rem;
    font-weight: 600;
    color: var(--ivory);
    margin-bottom: 0.5rem;
}

.group-subtitle {
    font-family: var(--font-sans);
    font-size: 0.65rem;
    font-weight: 500;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--gold);
    opacity: 0.6;
    margin-bottom: 0.4rem;
}

.section-divider {
    width: 100%;
    height: 2px;
    background: var(--gold);
    margin-bottom: 0.5rem;
    opacity: 0.5;
}

/* Subsection (e.g. Doces, Fruta under Sobremesas) */
.tablet-subsection {
    margin-bottom: 1.5rem;
}

.subsection-title {
    font-family: var(--font-serif);
    font-size: 1.3rem;
    font-weight: 500;
    color: var(--gold-light);
    margin-bottom: 0.8rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid rgba(201, 168, 76, 0.15);
}

/* Menu item */
.menu-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.8rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

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

.item-image {
    flex-shrink: 0;
    width: 70px;
    height: 70px;
    border-radius: 8px;
    overflow: hidden;
}

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

.item-info {
    flex: 1;
    min-width: 0;
}

.item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.item-text {
    flex: 1;
    min-width: 0;
}

.item-name {
    font-family: var(--font-serif);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--ivory);
    line-height: 1.3;
}

.item-tag {
    display: inline-block;
    font-family: var(--font-sans);
    font-size: 0.55rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--gold);
    background: rgba(201, 168, 76, 0.12);
    border: 1px solid rgba(201, 168, 76, 0.25);
    padding: 0.15rem 0.5rem;
    border-radius: 3px;
    margin-left: 0.5rem;
    vertical-align: middle;
}

.item-price {
    flex-shrink: 0;
    display: flex;
    gap: 0.8rem;
    font-family: var(--font-sans);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--gold-light);
    white-space: nowrap;
}

.item-price small {
    font-size: 0.7em;
    opacity: 0.7;
}

.price-2pax {
    opacity: 0.6;
    font-size: 0.85rem;
}

.item-desc {
    font-family: var(--font-sans);
    font-size: 0.8rem;
    font-weight: 300;
    color: rgba(245, 240, 232, 0.55);
    line-height: 1.5;
    margin-top: 0.3rem;
}

/* Welcome modal */
.welcome-overlay {
    position: fixed;
    inset: 0;
    z-index: 500;
    background: rgba(0, 0, 0, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.4s ease;
}

.welcome-overlay.hide {
    opacity: 0;
    pointer-events: none;
}

.welcome-modal {
    background: var(--olive);
    border: 1px solid rgba(201, 168, 76, 0.2);
    border-radius: 16px;
    padding: 2.5rem 2rem;
    max-width: 520px;
    width: 90%;
    text-align: center;
}

.welcome-logo {
    width: 120px;
    height: auto;
    margin-bottom: 1.5rem;
    filter: drop-shadow(0 2px 8px rgba(0,0,0,0.3));
}

.welcome-title {
    font-family: var(--font-serif);
    font-size: 1.6rem;
    font-weight: 600;
    color: var(--gold);
    margin-bottom: 1rem;
}

.welcome-text {
    font-family: var(--font-sans);
    font-size: 0.85rem;
    font-weight: 300;
    color: rgba(245, 240, 232, 0.7);
    line-height: 1.7;
    margin-bottom: 1.5rem;
}

.welcome-btn {
    display: inline-block;
    padding: 0.7rem 2.5rem;
    border: 1px solid var(--gold);
    border-radius: 4px;
    background: transparent;
    color: var(--gold);
    font-family: var(--font-sans);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.25s;
}

.welcome-btn:hover, .welcome-btn:active {
    background: var(--gold);
    color: var(--olive-dark);
}

/* Price rows with add buttons */
.item-prices {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.3rem;
    flex-shrink: 0;
    align-self: center;
}

.price-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.price-label {
    width: 18px;
    text-align: center;
    color: rgba(245, 240, 232, 0.35);
    font-size: 0.7rem;
}

.price-val {
    font-family: var(--font-sans);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--gold-light);
    white-space: nowrap;
    min-width: 55px;
}

.price-val small {
    font-size: 0.7em;
    opacity: 0.7;
}

.add-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid rgba(201, 168, 76, 0.3);
    background: transparent;
    color: var(--gold);
    font-size: 1.1rem;
    font-weight: 300;
    line-height: 1;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.add-btn:active, .add-btn.added {
    background: var(--gold);
    color: var(--olive-dark);
    transform: scale(1.15);
}

/* Floating cart button */
.cart-fab {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 150;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    border: none;
    background: var(--gold);
    color: var(--olive-dark);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s;
}

.cart-fab:active {
    transform: scale(0.95);
}

.cart-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #c0623a;
    color: #fff;
    font-family: var(--font-sans);
    font-size: 0.65rem;
    font-weight: 700;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Cart panel (slide from right) */
.cart-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 300;
}

.cart-backdrop.open { display: block; }

.cart-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 420px;
    max-width: 90vw;
    height: 100%;
    display: flex;
    flex-direction: column;
    background: rgba(30, 34, 24, 0.98);
    backdrop-filter: blur(16px);
    border-left: 1px solid rgba(201, 168, 76, 0.15);
    z-index: 301;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}

.cart-panel.open { transform: translateX(0); }

.cart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.2rem 1.5rem;
    border-bottom: 1px solid rgba(201, 168, 76, 0.12);
}

.cart-title {
    font-family: var(--font-serif);
    font-size: 1.2rem;
    color: var(--gold);
}

.cart-close {
    background: none;
    border: none;
    color: var(--ivory);
    font-size: 1.8rem;
    cursor: pointer;
    opacity: 0.6;
}

.cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem 0;
}

.cart-empty {
    text-align: center;
    color: rgba(245, 240, 232, 0.35);
    font-family: var(--font-sans);
    font-size: 0.85rem;
    padding: 2rem;
}

.cart-item {
    display: flex;
    align-items: center;
    padding: 0.7rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.cart-item-img {
    width: 36px;
    height: 36px;
    border-radius: 4px;
    object-fit: cover;
    flex-shrink: 0;
    margin-right: 0.6rem;
}

.cart-item-name {
    flex: 1;
    font-family: var(--font-serif);
    font-size: 0.95rem;
    color: var(--ivory);
}

.cart-item-price {
    font-family: var(--font-sans);
    font-size: 0.8rem;
    color: var(--gold-light);
    margin: 0 0.8rem;
}

.cart-item-remove {
    background: none;
    border: none;
    color: rgba(245, 240, 232, 0.3);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0 0.3rem;
}

.cart-item-remove:hover { color: #c0623a; }

.cart-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(201, 168, 76, 0.12);
}

.cart-panel-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(201, 168, 76, 0.12);
}

.cart-panel-table {
    font-family: var(--font-sans);
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--gold);
    opacity: 0.7;
}

.cart-lang-toggle {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background: none;
    border: 1px solid rgba(201, 168, 76, 0.3);
    border-radius: 6px;
    padding: 0.4rem 0.7rem;
    color: var(--gold);
    font-family: var(--font-sans);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s ease, border-color 0.2s ease;
}

.cart-lang-toggle:hover {
    opacity: 1;
}

.cart-lang-icon {
    width: 18px;
    height: 18px;
}

.cart-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.8rem;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid rgba(201, 168, 76, 0.12);
}

.cart-total-label {
    font-family: var(--font-sans);
    font-size: 0.8rem;
    font-weight: 500;
    color: rgba(245, 240, 232, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.cart-total-value {
    font-family: var(--font-serif);
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--gold);
}

.cart-clear {
    width: 100%;
    padding: 0.6rem;
    background: transparent;
    border: 1px solid rgba(201, 168, 76, 0.3);
    border-radius: 6px;
    color: var(--gold-light);
    font-family: var(--font-sans);
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s;
}

.cart-clear:hover {
    background: rgba(201, 168, 76, 0.1);
}

/* Wine-specific */
.region-heading {
    font-family: var(--font-sans);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--gold);
    opacity: 0.7;
    margin: 1rem 0 0.5rem;
    padding-bottom: 0.3rem;
    border-bottom: 1px solid rgba(201, 168, 76, 0.15);
}

.wine-grape {
    font-family: var(--font-sans);
    font-size: 0.72rem;
    font-weight: 400;
    color: rgba(245, 240, 232, 0.4);
    font-style: italic;
    margin-top: 0.15rem;
}

.price-glass {
    opacity: 0.6;
    font-size: 0.85rem;
}

.price-glass::after {
    content: ' /';
    opacity: 0.4;
    margin-right: 0.3rem;
}

/* ---- RESPONSIVE ---- */

/* Portrait tablet */
@media (max-width: 768px) and (orientation: portrait) {
    .lang-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 0.8rem;
        max-width: 95vw;
    }

    .lang-card {
        padding: 0.8rem 0.4rem;
    }

    .lang-flag {
        width: 52px;
        height: 39px;
    }

    .lang-label {
        font-size: 0.65rem;
    }
}

/* Landscape tablet */
@media (min-width: 769px) and (max-width: 1280px) and (orientation: landscape) {
    .lang-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 1.2rem;
        max-width: 800px;
    }
}

/* Large screens */
@media (min-width: 1281px) {
    .lang-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 1.8rem;
        max-width: 900px;
    }

    .lang-flag {
        width: 88px;
        height: 66px;
    }

    .lang-label {
        font-size: 0.95rem;
    }
}

/* ==================== TABLE SELECTION PAGE ==================== */

.table-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 2rem;
    gap: 2.5rem;
}

.table-header {
    text-align: center;
}

.table-logo {
    width: 150px;
    height: auto;
    margin-bottom: 1.2rem;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.3));
}

.table-title {
    font-family: var(--font-serif);
    font-size: 1.4rem;
    font-weight: 400;
    font-style: italic;
    color: var(--gold-light);
    letter-spacing: 0.02em;
    margin: 0;
}

.table-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.2rem;
    max-width: 600px;
    width: 100%;
}

.table-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
    padding: 1.2rem 0.8rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(201, 168, 76, 0.15);
    text-decoration: none;
    color: var(--ivory);
    transition: all 0.3s ease;
    cursor: pointer;
}

.table-card:hover,
.table-card:active {
    background: rgba(201, 168, 76, 0.12);
    border-color: var(--gold);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.table-card:active {
    transform: translateY(0);
}

.table-icon {
    width: 36px;
    height: 36px;
    color: var(--gold);
}

.table-label {
    font-family: var(--font-sans);
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    color: var(--ivory);
}

/* Header language toggle */
.header-lang-toggle {
    position: absolute;
    right: 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background: none;
    border: 1px solid rgba(201, 168, 76, 0.3);
    border-radius: 6px;
    padding: 0.3rem 0.6rem;
    color: var(--gold);
    font-family: var(--font-sans);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    cursor: pointer;
    transition: opacity 0.2s ease, border-color 0.2s ease;
}

.header-lang-toggle:hover {
    border-color: var(--gold);
    opacity: 1;
}

.header-lang-icon {
    width: 16px;
    height: 16px;
}

/* Allergen icons */
.item-allergens {
    display: flex;
    gap: 0.25rem;
    margin-top: 0.3rem;
}

.allergen-dot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 1px solid var(--gold);
}

/* Allergen legend */
.allergen-legend {
    margin-top: 3rem;
    padding: 1.5rem;
    border-top: 1px solid rgba(201, 168, 76, 0.15);
}

.allergen-legend-title {
    font-family: var(--font-sans);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--gold);
    opacity: 0.6;
    margin-bottom: 1rem;
}

.allergen-legend-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.5rem;
}

.allergen-legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-sans);
    font-size: 0.75rem;
    color: rgba(245, 240, 232, 0.5);
}

/* Custom tooltips */
[data-tooltip] {
    position: relative;
}

[data-tooltip]::before,
[data-tooltip]::after {
    position: absolute;
    z-index: 9000;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

[data-tooltip]::after {
    content: attr(data-tooltip);
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    background: var(--olive-dark, #2e3328);
    color: var(--ivory, #f5f0e8);
    font-family: var(--font-sans, 'Montserrat', sans-serif);
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.03em;
    padding: 0.35rem 0.7rem;
    border-radius: 6px;
    border: 1px solid rgba(201, 168, 76, 0.25);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    white-space: nowrap;
    max-width: 220px;
    text-align: center;
}

[data-tooltip]::before {
    content: '';
    bottom: calc(100% + 2px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    border: 5px solid transparent;
    border-top-color: var(--olive-dark, #2e3328);
}

[data-tooltip]:hover::before,
[data-tooltip]:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Allergen SVG sprite badges */
.allergen-badge-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 1px solid var(--gold);
    margin-left: 2px;
    vertical-align: middle;
    flex-shrink: 0;
    position: relative;
    z-index: 2;
    cursor: pointer;
}

.allergen-badge-icon:first-child {
    margin-left: 10px;
}

/* Allergen individual icon */
.allergen-icon-img {
    width: 16px;
    height: 16px;
    display: block;
    filter: brightness(0) saturate(100%) invert(73%) sepia(30%) saturate(700%) hue-rotate(10deg) brightness(90%);
}

/* Allergen info modal — uses shared buildAllergenModal (inline styles) */
