/* ===== Herdade do Serra — Design System ===== */
/* v20260604-2015 */
html, body {
    height: 100%;
    margin: 0;
}
html {
    transition: background-color 0.4s ease, color 0.4s ease;
}
body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: background-color 0.4s ease, color 0.4s ease;
}
:root {
    --color-gold: #C5A367;
    --color-gold-dark: #A8894D;
    --color-gold-light: #E8D5B0;
    /* Pale gold for text placed over dark strips — deliberately not overridden in dark mode */
    --color-gold-light-on-dark: #E8D5B0;
    /* Near-white for text laid over photographs and dark bands. Also deliberately not overridden
       in dark mode: the surface behind it is dark in both themes, so tying it to --color-cream
       would turn the text near-black in dark mode and hide it against the photo. */
    --color-text-on-dark: #FAF8F5;
    --color-brown: #8B7355;
    --color-olive: #6B8E5A;
    --color-olive-dark: #557045;
    --color-cream: #FAF8F5;
    --color-cream-dark: #F0EDE8;
    --color-earth: #3D3226;
    --color-earth-light: #6B5E52;
    --color-footer-bg: #2C2416;
    --color-footer-text: #A89880;
    --color-footer-divider: #4A3F33;
    --color-gold-pale: #FDF7ED;
    --color-available-bg: #EDF4E8;
    --color-available-text: #3D5A2E;
    --color-unavailable-bg: #FEF9F0;
    --color-unavailable-text: #8B6914;
    --color-border-light: #E0DDD8;
    --color-muted-text: #A09890;
    --color-disabled-bg: #F5F3F0;
    --color-progress-bg: #E2E8F0;
    --color-success-icon: #48BB78;
    --color-error-icon: #E53E3E;
    --font-serif: 'Playfair Display', Georgia, serif;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --shadow-sm: 0 2px 8px rgba(61, 50, 38, 0.06);
    --shadow-md: 0 4px 20px rgba(61, 50, 38, 0.10);
    --shadow-lg: 0 8px 40px rgba(61, 50, 38, 0.12);
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== Dark Mode ===== */
html.dark {
    --color-gold: #C5A367;
    --color-gold-dark: #D4B87A;
    --color-gold-light: #8B7355;
    --color-brown: #A0896E;
    --color-olive: #8BA87A;
    --color-olive-dark: #7A9A6A;
    --color-cream: #1A1815;
    --color-cream-dark: #252220;
    --color-earth: #E8E4DF;
    --color-earth-light: #B0A89E;
    --color-gold-pale: #2A2218;
    --color-available-bg: #2A3A20;
    --color-available-text: #B5D99C;
    --color-unavailable-bg: #3D3020;
    --color-unavailable-text: #D4B87A;
    --color-border-light: #3A3530;
    --color-muted-text: #8A8278;
    --color-disabled-bg: #2A2724;
    --color-progress-bg: #3A3530;
    --color-success-icon: #68D391;
    --color-error-icon: #FC8181;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.25);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.40);
}
html.dark body {
    color: var(--color-earth);
    background: var(--color-cream);
}
/* Dark mode overrides for specific components */
html.dark .bg-white,
html.dark .bg-light,
html.dark .bg-cream { background: var(--color-cream-dark) !important; }
html.dark .text-earth { color: var(--color-earth) !important; }
html.dark .text-dark { color: var(--color-earth) !important; }
html.dark .badge.bg-warning.text-dark { color: #212529 !important; background-color: #ffc107 !important; font-size: 0.8rem !important; line-height: 1.3 !important; vertical-align: middle !important; }
.badge.bg-warning.text-dark { font-size: 0.8rem !important; line-height: 1.3 !important; vertical-align: middle !important; }
html.dark .border { border-color: rgba(255,255,255,0.08) !important; }
html.dark .card { background: var(--color-cream-dark); border-color: rgba(255,255,255,0.06); }
html.dark .modal-content { background: var(--color-cream-dark); }
html.dark .dropdown-menu,
html.dark .animated-dropdown,
html.dark .user-dropdown { background: #2A2724 !important; border-color: rgba(255,255,255,0.06) !important; }
html.dark .user-dropdown .dropdown-item:hover { background: rgba(255,255,255,0.06) !important; color: var(--color-gold) !important; }
html.dark .dropdown-divider { border-color: rgba(255,255,255,0.06) !important; }
html.dark .dropdown-item { color: var(--color-earth); }
html.dark .dropdown-item:hover,
html.dark .dropdown-item.active { background: rgba(255,255,255,0.06) !important; color: var(--color-gold) !important; }
html.dark .dropdown-item:focus,
html.dark .dropdown-item:active { background: transparent !important; color: var(--color-earth) !important; }
html.dark .form-control,
html.dark .form-select { background: #2A2724; border-color: rgba(255,255,255,0.10); color: var(--color-earth); }
html.dark .input-group-text { background: #2A2724; border-color: rgba(255,255,255,0.10); color: var(--color-earth); }
html.dark .form-control:focus,
html.dark .form-select:focus { border-color: var(--color-gold); }
html.dark .table { color: var(--color-earth); }
html.dark .table-hover tbody tr:hover { background-color: rgba(255,255,255,0.04) !important; color: var(--color-earth) !important; }
html.dark .table-striped > tbody > tr:nth-of-type(odd) > * {
    --bs-table-accent-bg: rgba(255, 255, 255, 0.03);
    color: var(--color-earth);
}
html.dark .table-dark {
    --bs-table-bg: #2A2724;
    --bs-table-color: var(--color-earth);
    --bs-table-border-color: rgba(255, 255, 255, 0.06);
    --bs-table-hover-bg: rgba(255, 255, 255, 0.04);
}
html.dark .text-muted { color: #9A948C !important; }
html.dark hr { border-color: rgba(255,255,255,0.06); }
html.dark .alert-danger { background: #3D1F1F; color: #F5C6C6; border-color: rgba(255,100,100,0.2); }
html.dark .alert-success { background: #1F3D1F; color: #C6F5C6; border-color: rgba(100,255,100,0.2); }
html.dark .alert-warning { background: #3D351F; color: #F5E6C6; border-color: rgba(255,200,100,0.2); }
html.dark .alert-info { background: #1F2F3D; color: #C6E0F5; border-color: rgba(100,180,255,0.2); }
html.dark .btn-outline-secondary { color: var(--color-earth); border-color: rgba(255,255,255,0.15); }
html.dark .btn-outline-secondary:hover { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.25); color: var(--color-earth); }
html.dark header { background: var(--color-cream) !important; border-bottom-color: rgba(255,255,255,0.06) !important; }
html.dark .navbar { background: var(--color-cream) !important; }
html.dark .nav-link { color: var(--color-earth) !important; }
html.dark .dark-toggle-btn { border-color: rgba(255,255,255,0.15); }
/* Shared header icon button (dark toggle + language switcher) */
.header-icon-btn {
    background: transparent;
    border: 1.5px solid #D0CCC4;
    color: var(--color-earth);
    cursor: pointer;
    padding: 0.35rem 0.6rem;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    line-height: 1;
    transition: all var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    white-space: nowrap;
}
.header-icon-btn:hover {
    border-color: var(--color-gold);
    color: var(--color-gold);
}
.header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: nowrap;
    flex-shrink: 0;
}
html.dark .user-btn:hover { background: #2A2724 !important; }
html.dark .dropdown-toggle:hover { background: #2A2724 !important; }
html.dark .cookie-card { background: var(--color-cream-dark); }
html.dark .booking-card { background: var(--color-cream-dark); border-color: rgba(255,255,255,0.06); }
html.dark .site-footer { background: var(--color-cream); border-top-color: rgba(255,255,255,0.06); }
html.dark .modal-header,
html.dark .modal-footer { border-color: rgba(255,255,255,0.06); }
html.dark .availability-result { background: var(--color-cream-dark); }
html.dark .payment-option { border-color: rgba(255,255,255,0.10); }
html.dark .payment-option.selected { border-color: var(--color-gold); background: rgba(197,163,103,0.08); }
html.dark .service-card { background: var(--color-cream-dark); }
html.dark .spinner-border { color: var(--color-gold); }
/* Messages / UnconfirmedBooking cards */
html.dark .message-card,
html.dark .booking-card { background: var(--color-cream-dark) !important; border-color: rgba(255,255,255,0.06) !important; }
html.dark .message-card .text-muted { color: #9A948C !important; }
/* Client management table headers */
html.dark .table-light { background: #2A2724 !important; color: var(--color-earth) !important; }
html.dark .table-light th { background: #2A2724 !important; color: var(--color-earth) !important; border-color: rgba(255,255,255,0.06) !important; }
html.dark .table-secondary { background: #252220 !important; color: #9A948C !important; }
html.dark .table-secondary td { background: #252220 !important; }
/* Home about section */
html.dark section[style*="background: #fff"],
html.dark section[style*="background:#fff"] { background: var(--color-cream) !important; }
/* Home rooms + gallery sections — slightly lighter than about */
html.dark section#quartos,
html.dark section#galeria { background: #1E1C19 !important; }
/* Promo preview iframe — transparent to show dark background */
html.dark iframe[srcdoc] { background: var(--color-cream-dark); }
html.dark .card-header { background: var(--color-cream-dark) !important; border-bottom-color: rgba(255,255,255,0.06) !important; }
/* Calendar zeros — bright in dark mode */
html.dark .totals-cell span { color: #B0A89E !important; }
/* Calendar table borders */
html.dark .calendar-table { border-color: rgba(255,255,255,0.06) !important; }
html.dark .table-bordered,
html.dark .table-bordered th,
html.dark .table-bordered td { border-color: rgba(255,255,255,0.06) !important; }
/* Messages page — active tab, unread rows, detail panel */
html.dark .nav-tabs .nav-link.active { background: #2A2724 !important; color: var(--color-gold) !important; border-color: rgba(255,255,255,0.06) !important; border-bottom-color: #2A2724 !important; }
html.dark .nav-tabs { border-bottom-color: rgba(255,255,255,0.06) !important; }
html.dark .table-warning { --bs-table-bg: #3D351F; --bs-table-color: #F5E6C6; --bs-table-hover-bg: #4A3F28; --bs-table-hover-color: #F5E6C6; }
html.dark .table-warning td,
html.dark .table-warning th { background: #3D351F !important; color: #F5E6C6 !important; }
html.dark .message-detail-content { background: #2A2724 !important; }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: hidden; width: 100%; }
body {
    font-family: var(--font-sans);
    color: var(--color-earth);
    background: var(--color-cream);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
}

/* Sticky header — stays on top inside flex scroll container */
header[style*="position: sticky"] {
    position: -webkit-sticky !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 1030 !important;
}
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-serif);
    font-weight: 600;
    color: var(--color-earth);
    letter-spacing: -0.02em;
}
a { color: var(--color-gold-dark); transition: color var(--transition); }
a:hover { color: var(--color-brown); }

/* ===== Buttons ===== */
.btn-success {
    background: var(--color-gold) !important;
    border-color: var(--color-gold) !important;
    color: #fff !important;
    font-weight: 500;
    border-radius: var(--radius-sm);
    padding: 0.6rem 1.5rem;
    transition: all var(--transition);
}
.btn-success:hover {
    background: var(--color-gold-dark) !important;
    border-color: var(--color-gold-dark) !important;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}
.btn-success:disabled { opacity: 0.5; transform: none; box-shadow: none; }
.btn-outline-success { border-color: var(--color-gold) !important; color: var(--color-gold) !important; border-radius: var(--radius-sm); }
.btn-outline-success:hover { background: var(--color-gold) !important; color: #fff !important; }
.btn-outline-primary { border-color: var(--color-olive) !important; color: var(--color-olive) !important; border-radius: var(--radius-sm); }
.btn-outline-primary:hover { background: var(--color-olive) !important; color: #fff !important; }

/* ===== Cards ===== */
.card { border: none; border-radius: var(--radius-md); box-shadow: var(--shadow-sm); transition: transform var(--transition), box-shadow var(--transition); background: #fff; }
.card:hover { box-shadow: var(--shadow-md); }

/* ===== Forms ===== */
.form-control, .form-select {
    border-radius: var(--radius-sm);
    border: 1.5px solid #E0DDD8;
    padding: 0.65rem 0.9rem;
    font-family: var(--font-sans);
    transition: border-color var(--transition), box-shadow var(--transition);
}
.form-control:focus, .form-select:focus { border-color: var(--color-gold); box-shadow: 0 0 0 3px rgba(197, 163, 103, 0.15); outline: none; }
.form-label { font-weight: 500; font-size: 0.9rem; color: var(--color-earth-light); margin-bottom: 0.35rem; }

/* ===== Alerts ===== */
.alert { border: none; border-radius: var(--radius-sm); font-size: 0.9rem; }

/* ===== Animations ===== */
@keyframes fadeInUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }
.animate-fade-in { opacity: 0; animation: fadeInUp 0.6s ease both; will-change: transform, opacity; }
.animate-fade-in-fast { animation: fadeInUp 0.35s ease both; }
.animate-delay-1 { animation-delay: 0.1s; opacity: 0; will-change: transform, opacity; }
.animate-delay-2 { animation-delay: 0.2s; opacity: 0; will-change: transform, opacity; }
.animate-delay-3 { animation-delay: 0.3s; opacity: 0; will-change: transform, opacity; }

.badge-success { background: var(--color-olive) !important; font-weight: 500; font-size: 0.75rem; padding: 0.35em 0.7em; border-radius: 50px; }
hr { border-color: #E0DDD8; opacity: 0.6; }
.text-gold { color: var(--color-gold) !important; }
.text-earth { color: var(--color-earth-light) !important; }

#blazor-error-ui {
    background: #FFF3CD; bottom: 0; box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    display: none; left: 0; padding: 0.8rem; position: fixed; width: 100%; z-index: 1000;
    border-top: 3px solid var(--color-gold);
}
#blazor-error-ui .dismiss { cursor: pointer; }
.valid.modified:not([type=checkbox]) { outline: 1.5px solid var(--color-olive); }
.invalid { outline: 1.5px solid #dc3545; }
.validation-message { color: #dc3545; }
.content { padding-top: 1.1rem; }
h1:focus { outline: none; }
.darker-border-checkbox.form-check-input { border-color: #929292; }


/* ===== Language Button ===== */
.language-btn {
    background: var(--color-cream-dark);
    border: 1.5px solid var(--color-cream-dark);
    cursor: default;
    flex-shrink: 0;
    white-space: nowrap;
    margin: 0;
}

.language-btn:hover {
    border-color: var(--color-gold);
    color: var(--color-earth);
    box-shadow: var(--shadow-sm);
}

/* ===== Dark Mode Button ===== */
.dark-btn {
    background: var(--color-cream-dark);
    border: 1.5px solid var(--color-cream-dark);
    flex-shrink: 0;
    white-space: nowrap;
    margin: 0;
}

.dark-btn:hover {
    border-color: var(--color-gold);
    color: var(--color-earth);
    box-shadow: var(--shadow-sm);
}
@media (max-width: 991px) {
    .dark-btn:hover {
        border-color: var(--color-cream-dark);
    }
}
/* ===== Register Button ===== */
.register-btn {
    background: var(--color-cream-dark);
    color: var(--color-earth);
    border: 1.5px solid var(--color-cream-dark);
    padding: 0.5rem 1.3rem;
    border-radius: var(--radius-sm);
}
.register-btn:hover {
    border-color: var(--color-gold);
    color: var(--color-earth);
    box-shadow: var(--shadow-sm);
}

/* ===== User Menu ===== */
.user-btn {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: var(--color-cream-dark);
    border: 1.5px solid;
    border-color: var(--color-cream-dark);
    border-radius: 50px;
    padding: 0.35rem 1rem 0.35rem 0.35rem;
    cursor: pointer;
    transition: all var(--transition);
    font-family: var(--font-sans);
    font-size: 0.9rem;
    color: var(--color-earth);
}
.user-btn:hover { border-color: var(--color-gold); background: #fff; box-shadow: var(--shadow-sm); }
.user-btn::after { display: none !important; }

.user-avatar {
    width: 34px; height: 34px;
    border-radius: 50%;
    background: var(--color-gold);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 600; font-size: 0.8rem;
    letter-spacing: 0.05em;
    flex-shrink: 0;
}

.gestao { font-weight: 500; }

.user-name { font-weight: 500; }

.user-dropdown {
    border: none;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    padding: 0.5rem 0;
    margin-top: 0.5rem;
    min-width: 200px;
}
.user-dropdown .dropdown-item {
    padding: 0.6rem 1.2rem; font-size: 0.9rem;
    transition: background var(--transition);
}
.user-dropdown .dropdown-item:hover { background: var(--color-cream-dark); }
.user-dropdown .dropdown-divider { margin: 0.3rem 0; }

/* ===== Hover Dropdowns (desktop only) ===== */
@media (min-width: 992px) {
.hover-dropdown .animated-dropdown {
    margin-top: 0;
}
.hover-dropdown:hover > .animated-dropdown {
    display: block;
    animation: dropdownFadeIn 0.2s ease-out;
}
.hover-dropdown .dropdown-toggle::after {
    transition: transform 0.2s ease;
}
.hover-dropdown:hover .dropdown-toggle::after {
    transform: rotate(180deg);
}
.hover-dropdown > .dropdown-toggle:focus {
    outline: none;
    box-shadow: none;
}
}

@keyframes dropdownFadeIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Fade-in for mobile click (Bootstrap .show) */
.dropdown-menu.show {
    animation: dropdownFadeIn 0.2s ease-out;
}

.navbar-nav .nav-link.no-underline::after {
    display: none;
}

/* Admin nav link — stands out from regular items */
.navbar-nav .nav-link.admin-nav-link {
    display: flex;
    align-items: center;
    text-align: center;
    background: var(--color-cream-dark);
    border: 1.5px solid;
    border-color: var(--color-cream-dark);
    border-radius: 50px;
    padding: 0.35rem 1rem;
    cursor: pointer;
    transition: all var(--transition);
    font-family: var(--font-sans);
    font-size: 0.9rem;
    color: var(--color-earth);
}
.navbar-nav .nav-link.admin-nav-link:hover {
    color: var(--color-earth);
    border-color: var(--color-gold);
    background: #fff;
}
.navbar-nav .nav-link.admin-nav-link.active {
    background: var(--color-gold);
    color: #fff !important;
}

/* Header nav link bottom bar - animated from center on hover/active */
.navbar-nav .nav-link {
    position: relative;
    padding-bottom: 0.6rem; /* space for the bottom bar */
}

    .navbar-nav .nav-link::after {
        content: "";
        position: absolute;
        left: 50%;
        bottom: 0; /* align to the bottom of the link area */
        transform: translateX(-50%) scaleX(0);
        transform-origin: center;
        height: 4px; /* thickness of the bar */
        width: 60%; /* default width when fully expanded */
        background-color: rgb(205, 166, 99); /* primary color */
        transition: transform 220ms cubic-bezier(0.4, 0, 0.2, 1);
        border-radius: 2px;
    }

    .navbar-nav .nav-link.active::after {
        transform: translateX(-50%) scaleX(1);
    }

/* Optional: make the bar span more for larger screens */
@media (min-width: 768px) {
    .navbar-nav .nav-link::after {
        width: 70%;
    }
}

/* Make nav items equal width and adjust colors */
.navbar-nav {
    display: flex;
    align-items: center;
}

    .navbar-nav .nav-item {
        flex: 1 1 auto;
        text-align: center;
    }

/* Mobile: nav items stack naturally */
@media (max-width: 991px) {
    .navbar-nav .nav-item { flex: none; text-align: left; }
    .navbar-nav .nav-link::after { display: none; }
    .navbar-nav { padding: 0.5rem 0; flex-direction: row; flex-wrap: wrap; justify-content: center; gap: 0.25rem; }
    .navbar-nav .nav-link { font-size: 0.85rem; padding: 0.25rem 0.5rem !important; }
    .admin-nav-link { font-size: 0.8rem !important; padding: 0.2rem 0.6rem !important; }
}

    .navbar-nav .nav-link {
        display: block;
        color: rgba(0,0,0,0.65); /* lighter by default */
        padding-top: .5rem;
        padding-bottom: .5rem;
        border-radius: 5px;
    }

.navbar-nav .nav-link:hover {
    color: black;
    text-shadow: 0 0 1px rgba(61, 50, 38, 0.25);
}

.navbar-nav .nav-link.active,
.navbar-nav .nav-link:focus{
    color: rgba(0,0,0,0.92);
}

/* ============================================= */
/* ===== MOBILE RESPONSIVE STYLES ===== */
/* ============================================= */
@media (max-width: 991px) {
    .navbar { flex-wrap: nowrap !important; }
    h1 { font-size: 1.8rem !important; }
    h2 { font-size: 1.5rem !important; }
    h3 { font-size: 1.25rem !important; }
    .hero-title { font-size: 2.2rem !important; }
    .hero-tagline { font-size: 1rem !important; }
    .hero-subtitle { font-size: 0.85rem !important; }
    section.py-5 { padding-top: 2.5rem !important; padding-bottom: 2.5rem !important; }
    .container.py-5 { padding-top: 2rem !important; padding-bottom: 2rem !important; }
    .container.py-4 { padding-top: 1.5rem !important; padding-bottom: 1.5rem !important; }
    .card-body { padding: 1.25rem !important; }
    .navbar-brand { font-size: 1.1rem !important; }
    .navbar-brand img { height: 30px !important; }
    .user-btn .user-name { display: none; }
    .user-btn { padding: 0.35rem !important; }
    footer .row > div { margin-bottom: 1.5rem; }
    footer .row > div:last-child { margin-bottom: 0; }
    footer h5 { font-size: 1rem !important; }
    footer { text-align: center; }
    footer .d-flex.gap-3 { justify-content: center; }
    .btn-lg { padding: 0.5rem 1.25rem !important; font-size: 0.95rem !important; }
    .header-actions {
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        right: 1rem;
        z-index: 10;
    }
}
@media (max-width: 575px) {
    .hero-title { font-size: 1.8rem !important; }
    .hero-section { min-height: 70vh !important; }
    h2 { font-size: 1.35rem !important; }
    .btn { font-size: 0.85rem; }
    .btn-lg { font-size: 0.9rem !important; }
    .day-cell { min-width: 36px; font-size: 0.7rem; }
}

/* Hero background — light/dark toggle with cross-fade */
.hero-bg {
    position: absolute;
    inset: 0;
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
    z-index: 0;
    transition: opacity 0.4s ease;
}
.hero-bg-light { opacity: 1; }
.hero-bg-dark  { opacity: 0; }
html.dark .hero-bg-light { opacity: 0; }
html.dark .hero-bg-dark  { opacity: 1; }

/* ===== Star Rating ===== */
.star-rating {
    display: inline-flex;
    gap: 4px;
    align-items: center;
}
.star-rating .star {
    cursor: pointer;
    font-size: 1.5rem;
    color: #D4C4A8;
    transition: color 0.15s ease, transform 0.15s ease;
    outline: none;
}
.star-rating .star:hover,
.star-rating .star:focus-visible {
    transform: scale(1.15);
}
.star-rating .star.active,
.star-rating .star:hover,
.star-rating .star:hover ~ .star {
    color: var(--color-gold);
}
/* Invert the hover so stars to the left of hovered star also light up */
.star-rating:hover .star {
    color: var(--color-gold);
}
.star-rating .star:hover ~ .star {
    color: #D4C4A8;
}
html.dark .star-rating .star {
    color: #6B5E52;
}
html.dark .star-rating .star.active,
html.dark .star-rating:hover .star {
    color: var(--color-gold);
}
html.dark .star-rating .star:hover ~ .star {
    color: #6B5E52;
}

.star-rating-display {
    display: inline-flex;
    gap: 1px;
    font-size: 0.85rem;
}

/* ===== Restaurant detail page ===== */
/* Banner at the top, the name laid over the main picture. */
.restaurant-hero {
    position: relative;
    height: 380px;
    overflow: hidden;
    background-color: var(--color-footer-bg);
}
.restaurant-hero-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.restaurant-hero-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: 4rem;
    color: var(--color-gold);
    background: linear-gradient(135deg, var(--color-gold-pale), var(--color-cream-dark));
}
/* Keeps the white title readable over a bright photo. */
.restaurant-hero-shade {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.05));
}
.restaurant-hero-content {
    position: absolute;
    inset: auto 0 0 0;
    padding-bottom: 1.75rem;
    color: var(--color-text-on-dark);
}
.restaurant-back {
    display: inline-block;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
    color: var(--color-text-on-dark);
    opacity: 0.85;
    text-decoration: none;
}
.restaurant-back:hover {
    opacity: 1;
    color: var(--color-gold-light-on-dark);
}
.restaurant-hero-title {
    margin: 0 0 0.4rem;
    color: var(--color-text-on-dark) !important;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.45);
}
.restaurant-hero-rating {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
}

.restaurant-block {
    margin-bottom: 2.5rem;
}
.restaurant-block-title {
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--color-gold-pale);
}
.restaurant-description {
    color: var(--color-earth-light);
    line-height: 1.75;
    white-space: pre-line;
}

.restaurant-gallery {
    overflow: hidden;
    border-radius: var(--radius-md);
    background-color: var(--color-cream-dark);
}
.restaurant-gallery .carousel-item img {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

.restaurant-sidebar {
    position: sticky;
    top: 6rem;
    padding: 1.5rem;
    border-radius: var(--radius-md);
    background-color: var(--color-cream-dark);
    box-shadow: var(--shadow-sm);
    text-align: center;
}
.sidebar-rating {
    margin-bottom: 1.25rem;
}
.sidebar-score {
    font-family: var(--font-serif);
    font-size: 2.5rem;
    line-height: 1;
    color: var(--color-earth);
}
.sidebar-count,
.sidebar-norating {
    margin-top: 0.35rem;
    margin-bottom: 1.25rem;
    font-size: 0.85rem;
    color: var(--color-muted-text);
}

/* Reviews */
.review {
    padding: 1rem 0;
    border-bottom: 1px solid var(--color-border-light);
}
.review:last-child {
    border-bottom: none;
}
.review-head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.4rem;
}
.review-name {
    font-weight: 600;
    color: var(--color-earth);
}
.review-date {
    margin-left: auto;
    font-size: 0.8rem;
    color: var(--color-muted-text);
}
.review-feedback {
    margin-bottom: 0.5rem;
    color: var(--color-earth-light);
    line-height: 1.6;
}
.review-dimensions {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.8rem;
    color: var(--color-muted-text);
}
.review-dimension strong {
    color: var(--color-earth);
}

.restaurant-missing-icon {
    font-size: 3rem;
    color: var(--color-muted-text);
}

/* Cookie consent banner — bottom-right card, slides up */
.cookie-banner {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1040;
    max-width: 420px;
    transform: translateY(120%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.cookie-banner.cookie-visible {
    transform: translateY(0);
}
.cookie-card {
    background: #3D3226;
    color: #fff;
    border-radius: 12px;
    padding: 1.25rem;
    box-shadow: 0 8px 32px rgba(0,0,0,0.25);
}
.cookie-card .btn-outline-secondary {
    color: #fff;
    border-color: rgba(255,255,255,0.4);
}
.cookie-card .btn-outline-secondary:hover {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.6);
    color: #fff;
}
.cookie-card .form-check-input:checked {
    background-color: rgb(205, 166, 99);
    border-color: rgb(205, 166, 99);
}
.cookie-card small {
    color: rgba(255,255,255,0.55);
    font-size: 0.8rem;
}
@media (max-width: 480px) {
    .cookie-banner {
        left: 50%;
        right: auto;
        bottom: 12px;
        max-width: 420px;
        width: calc(100% - 24px);
        transform: translateX(-50%) translateY(120%);
    }
    .cookie-banner.cookie-visible {
        transform: translateX(-50%) translateY(0);
    }
}

/* Badge centering */
.badge { line-height: 1.2; vertical-align: middle; }

/* ===== Legal Popups (Terms / Privacy) ===== */
.legal-popup-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: legalFadeIn 0.25s ease;
}
@keyframes legalFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
.legal-popup-card {
    position: relative;
    background: #fff;
    border-radius: var(--radius-md);
    max-width: 720px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    padding: 2rem 2rem 1.5rem;
    box-shadow: var(--shadow-lg);
    animation: legalSlideUp 0.3s ease;
}
@keyframes legalSlideUp {
    from { opacity: 0; transform: translateY(30px); }
    to   { opacity: 1; transform: translateY(0); }
}
.legal-popup-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    font-size: 1.3rem;
    color: var(--color-gold);
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
    transition: var(--transition);
}
.legal-popup-close:hover { color: var(--color-gold-dark); }
.legal-popup-title {
    font-family: var(--font-serif);
    color: var(--color-earth);
    font-size: 1.6rem;
    margin-bottom: 1.2rem;
    padding-right: 30px;
}
.legal-popup-body {
    line-height: 1.8;
    color: #4a5568;
}
.legal-popup-body h6 {
    color: var(--color-earth);
    font-weight: 600;
    margin-top: 1.2rem;
    margin-bottom: 0.3rem;
}
.legal-popup-body p {
    margin-bottom: 0.5rem;
}
.legal-popup-btn {
    border: 1.5px solid var(--color-gold);
    color: var(--color-gold);
    background: transparent;
    transition: var(--transition);
}
.legal-popup-btn:hover {
    background: var(--color-gold);
    color: #fff;
}

/* Dark mode — legal popups */
html.dark .legal-popup-card { background: #2A2724; }
html.dark .legal-popup-title { color: var(--color-earth) !important; }
html.dark .legal-popup-body { color: #B8B0A8; }
html.dark .legal-popup-body h6 { color: var(--color-earth) !important; }
html.dark .legal-popup-body p { color: #B8B0A8; }
html.dark .legal-popup-backdrop { background: rgba(0,0,0,0.75); }

/* Terms modal (Register page) */
.terms-modal-content { background: #fff; }
html.dark .terms-modal-content { background: #2A2724; color: #B8B0A8; }

/* ===== Photo sets (folder-driven photos and carousels) ===== */
/* Each usage sizes its own photos with --photo-aspect / --photo-max-height. */
.photo-single,
.photo-carousel .carousel-item img {
    display: block;
    width: 100%;
    object-fit: cover;
    aspect-ratio: var(--photo-aspect, auto);
    max-height: var(--photo-max-height, none);
    border-radius: var(--radius-md);
}

/* Optional thumbnail strip under a photo carousel (PhotoSet ShowThumbnails="true"):
   every photo is visible at once and any of them can be picked directly. */
.photo-thumbs {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
    padding-bottom: 0.25rem;
    overflow-x: auto;
    scrollbar-width: thin;
}
.photo-thumb {
    flex: 0 0 auto;
    width: 104px;
    height: 72px;
    padding: 0;
    border: 2px solid transparent;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: none;
    opacity: 0.5;
    transition: all var(--transition);
    cursor: pointer;
}
.photo-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.photo-thumb:hover {
    opacity: 0.85;
}
.photo-thumb.active {
    opacity: 1;
    border-color: var(--color-gold);
}

/* ===== Utility Classes ===== */
.flex-1 { flex: 1; }
.page-section-center { display: flex; align-items: center; flex: 1; }
.page-column { background: var(--color-cream); display: flex; flex-direction: column; flex: 1; }
.font-serif-heading { font-family: var(--font-serif); color: var(--color-earth); }
.text-gold-dark { color: var(--color-gold-dark) !important; }
.text-gold { color: var(--color-gold) !important; }
.hero-eyebrow { color: var(--color-gold-light-on-dark); letter-spacing: 0.1em; }
/* Title of a page's dark hero band (pairs with .hero-eyebrow). Gold keeps the heading
   readable on the dark strip in both themes; the global heading colour flips with the
   theme and turns almost invisible there in classic mode. */
.page-hero-title { font-size: clamp(1.8rem, 5vw, 2.4rem); color: var(--color-gold); }
.cursor-pointer { cursor: pointer; }
.spinner-gold { color: var(--color-gold); }
.modal-backdrop-custom { background: rgba(0,0,0,0.5); }
.password-strength-bg { height: 4px; border-radius: 2px; background: var(--color-progress-bg); }
.password-strength-bar { height: 4px; border-radius: 2px; transition: width 0.3s; }
.password-strength-label { font-size: 0.75rem; white-space: nowrap; }
.promo-check-label { font-size: 0.9rem; color: var(--color-muted-text); }
.gold-badge { background: var(--color-gold); color: #fff; }
.preview-thumb { position: relative; display: inline-block; }
.preview-thumb-img { height: 80px; border-radius: 6px; border: 2px solid var(--color-gold); object-fit: cover; }
.preview-thumb-remove { position: absolute; top: -8px; right: -8px; width: 22px; height: 22px; padding: 0; line-height: 1; border-radius: 50%; font-size: 11px; }
.preview-thumb-label { font-size: 10px; color: var(--color-gold); text-align: center; margin-top: 2px; }
.promo-preview-card { top: 80px; }
.promo-preview-header { background: var(--color-cream); }
.promo-preview-iframe { width: 100%; height: 500px; border: none; }
.not-found-container { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 80vh; text-align: center; padding: 2rem; }
.not-found-code { font-family: var(--font-serif); font-size: 6rem; color: var(--color-gold-light); line-height: 1; margin-bottom: 2rem; }
.not-found-title { font-family: var(--font-serif); color: var(--color-earth); margin-bottom: 0.5rem; }
.not-found-message { color: var(--color-earth-light); max-width: 400px; margin-bottom: 2rem; }
.not-found-divider { width: 200px; border-color: var(--color-cream-dark); margin: 1rem 0; }
.not-found-contact { color: var(--color-earth-light); font-size: 0.9rem; margin-bottom: 0.5rem; }
.not-found-contact:last-of-type { margin-bottom: 1.5rem; }
.not-found-social-label { color: var(--color-earth-light); font-size: 0.85rem; margin-bottom: 1.5rem; }
.not-found-social-link { color: var(--color-earth); font-size: 1.5rem; }
.not-found-booking-link { display: flex; align-items: center; }
.not-found-booking-icon { width: 24px; height: 24px; }
.main-scroll-container { display: flex; flex-direction: column; height: 100vh; overflow-y: auto; overflow-x: hidden; width: 100%; max-width: 100vw; scroll-behavior: smooth; }

/* Anchor sections land just below the sticky header */
section[id] {
    scroll-margin-top: 20vh;
}
.site-header { position: sticky; top: 0; z-index: 1030; background: #fff; border-bottom: 1px solid rgba(0,0,0,0.08); will-change: transform; }
.site-header-nav { display: flex !important; align-items: center !important; flex-wrap: nowrap !important; justify-content: space-between !important; }
.site-brand { font-family: var(--font-serif); font-size: 1.3rem; color: var(--color-earth); flex-shrink: 0; }
.admin-nav-dropdown { cursor: default; height: 3rem; }
.mobile-header-actions { display: flex !important; align-items: center !important; gap: 0.5rem; flex-wrap: nowrap !important; flex-shrink: 0; margin-left: 0.5rem !important; }
.mobile-header-icons { display: flex !important; gap: 0.5rem; flex-wrap: nowrap !important; align-items: center !important; }
.calendar-container { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.calendar-title { font-size: 2rem; }
.price-input { width: 5.5rem; }
.text-success-icon { color: var(--color-success-icon); }
.detail-content { white-space: pre-wrap; }
html.dark .terms-modal-content .modal-title { color: var(--color-earth) !important; }
html.dark .terms-modal-content .modal-header { border-bottom-color: #3D3834; }
html.dark .terms-modal-content .modal-footer { border-top-color: #3D3834; }
html.dark .terms-modal-content .btn-close { filter: invert(1) grayscale(100%) brightness(200%); }

/* ===== Backend Health Check Loading Overlay ===== */
.backend-loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: var(--color-cream);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.4s ease;
    opacity: 1;
}
.backend-loading-fadeout {
    opacity: 0;
    pointer-events: none;
}
.backend-loading-card {
    text-align: center;
    padding: 2rem;
}

/* Animated dots */
.loading-dots { display: flex; gap: 8px; justify-content: center; }
.loading-dots span {
    width: 12px; height: 12px;
    border-radius: 50%;
    background: var(--color-gold);
    animation: dotBounce 1.2s infinite ease-in-out both;
}
.loading-dots span:nth-child(1) { animation-delay: -0.32s; }
.loading-dots span:nth-child(2) { animation-delay: -0.16s; }
.loading-dots span:nth-child(3) { animation-delay: 0s; }
@keyframes dotBounce {
    0%, 80%, 100% { transform: scale(0.4); opacity: 0.3; }
    40% { transform: scale(1); opacity: 1; }
}
