/* ============================================================
   Barra Beach — Digital Menu Styles
   Beach-resort feel: warm neutrals, sand/ocean accent, generous
   spacing, soft rounded cards.
   ============================================================ */

:root {
    --barra-sand: #f1f1f1;
    --barra-sand-dark: #ece3d3;
    --barra-ink: #1f2a24;
    --barra-ocean: #0f6e6a;
    --barra-ocean-dark: #0b5451;
    --barra-gold: #c9973f;
    --barra-radius: 14px;
    --barra-max-width: 760px;
}

.barra-menu-page {
    margin: 0;
    background: var(--barra-sand);
    color: var(--barra-ink);
    /*font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;*/
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.barra-menu-page * {
    box-sizing: border-box;
}

/* Header */
.barra-header {
    background: var(--barra-ocean-dark);
    color: #fff;
}
.barra-header-inner {
    max-width: var(--barra-max-width);
    margin: 0 auto;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.barra-logo {
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    letter-spacing: 0.08em;
    font-size: 1.1rem;
}
.barra-nav a {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    margin-left: 18px;
    font-size: 0.95rem;
}
.barra-nav a.active,
.barra-nav a:hover {
    color: var(--barra-gold);
}

/* Hero */
.menu-hero {
    max-width: var(--barra-max-width);
    margin: 0 auto;
    padding: 40px 20px 24px;
    text-align: center;
}
.menu-hero h1 {
    font-size: clamp(1.8rem, 5vw, 2.4rem);
    margin: 0 0 10px;
    letter-spacing: 0.02em;
}
.menu-hero p {
    color: #555;
    max-width: 480px;
    margin: 0 auto 20px;
}
.btn-pdf {
    display: inline-block;
    background: var(--barra-ocean);
    color: #fff;
    text-decoration: none;
    padding: 12px 22px;
    border-radius: 999px;
    font-size: 0.95rem;
    font-weight: 600;
    transition: background 0.15s ease;
}
.btn-pdf:hover {
    background: var(--barra-ocean-dark);
}

/* Search */
.menu-search-wrap {
    max-width: var(--barra-max-width);
    margin: 0 auto;
    padding: 0 20px 16px;
}
.menu-search {
    width: 100%;
    padding: 14px 16px;
    font-size: 1rem;
    border: 1px solid var(--barra-sand-dark);
    border-radius: var(--barra-radius);
    background: #fff;
}
.menu-search:focus {
    outline: 2px solid var(--barra-ocean);
    outline-offset: 1px;
}

/* Category filter bar — horizontally scrollable on mobile */
.menu-categories {
    max-width: var(--barra-max-width);
    margin: 0 auto;
    padding: 0 20px 20px;
    display: flex;
    gap: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.menu-categories::-webkit-scrollbar {
    display: none;
}
.cat-btn {
    flex: 0 0 auto;
    background: #fff;
    border: 1px solid var(--barra-sand-dark);
    color: var(--barra-ink);
    padding: 9px 16px;
    border-radius: 999px;
    font-size: 0.9rem;
    cursor: pointer;
    white-space: nowrap;
}
.cat-btn.active {
    background: var(--barra-ocean);
    border-color: var(--barra-ocean);
    color: #fff;
}

/* Menu list */
.menu-list {
    max-width: var(--barra-max-width);
    margin: 0 auto;
    padding: 0 20px 10px;
}
.menu-category-heading {
    font-size: 1.15rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--barra-ocean-dark);
    margin: 30px 0 12px;
}
.menu-category-heading:first-of-type {
    margin-top: 0;
}
.menu-category-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.menu-item {
    position: relative;
    background: #fff;
    border: 1px solid var(--barra-sand-dark);
    border-radius: var(--barra-radius);
    overflow: hidden;
    transition: border-color 0.2s ease;
}
.menu-item-heading {
    margin: 0;
}

/* Thumbnail button (dish photo), sits before the dish name */
.menu-item-thumb {
    position: absolute;
    top: 10px;
    left: 12px;
    width: 48px;
    height: 48px;
    border-radius: 10px;
    border: none;
    padding: 0;
    background-size: cover;
    background-position: center;
    cursor: pointer;
    z-index: 2;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}
.menu-item-thumb-icon {
    display: none; /* only shown as fallback if background image fails; kept for a11y via aria-label */
}
.menu-item-toggle.has-thumb {
    padding-left: 72px; /* room for the 48px thumb + spacing */
    min-height: 68px;
}

.menu-item-toggle {
    width: 100%;
    background: none;
    border: none;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    text-align: left;
    cursor: pointer;
    font-size: 1rem;
    color: inherit;
    font-family: inherit;
    min-height: 48px; /* comfortable tap target */
}
.menu-item-name {
    flex: 1;
    /*font-weight: 600;*/
}
.menu-item-price {
    color: var(--barra-gold);
    font-weight: 600;
    white-space: nowrap;
}
.menu-item-icon {
    width: 22px;
    height: 22px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: var(--barra-sand);
    display: flex;
    
    justify-content: center;
    font-size: 1.1rem;
    line-height: 1;
    transition: transform 0.2s ease;
}
.menu-item-toggle[aria-expanded="true"] .menu-item-icon {
    transform: rotate(45deg);
    background: var(--barra-ocean);
    color: #fff;
}

.menu-item-panel {
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.25s ease;
}
.menu-item-panel.is-open {
    max-height: 400px; /* generous cap; content is short */
}
.menu-item-panel-inner {
    padding: 0 16px 16px;
    border-top: 1px solid var(--barra-sand-dark);
    padding-top: 12px;
    margin-top: -4px;
}
.menu-item-serving {
    margin: 0 0 6px;
    font-size: 0.9rem;
    color: #666;
}
.menu-item-description {
    margin: 0;
    font-size: 0.9rem;
    color: #333;
}
.menu-item-description-empty {
    color: #888;
    font-size: 0.9rem;
    font-style: italic;
}

.menu-empty,
.menu-noresults {
    text-align: center;
    color: #777;
    padding: 30px 20px;
    max-width: var(--barra-max-width);
    margin: 0 auto;
}

.menu-pdf-footer {
    text-align: center;
    padding: 30px 20px 50px;
}

/* Footer */
.barra-footer {
    background: var(--barra-ink);
    color: rgba(255, 255, 255, 0.75);
    text-align: center;
    padding: 26px 20px;
    font-size: 0.9rem;
}
.barra-footer p {
    margin: 4px 0;
}

.dish-lightbox {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}
.dish-lightbox[hidden] {
    display: none;
}
.dish-lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 20, 18, 0.88);
}
.dish-lightbox-dialog {
    position: relative;
    z-index: 1;
    width: min(92vw, 640px);
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.dish-lightbox-image {
    width: 100%;
    max-height: 64vh;
    object-fit: contain;
    border-radius: 10px;
    background: #111;
}
.dish-lightbox-close {
    position: absolute;
    top: -44px;
    right: 0;
    background: none;
    border: none;
    color: #fff;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    padding: 8px;
}
.dish-lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: #fff;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.dish-lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.3);
}
.dish-lightbox-prev { left: -8px; }
.dish-lightbox-next { right: -8px; }
.dish-lightbox-nav[hidden] { display: none; }

.dish-lightbox-caption {
    margin-top: 12px;
    color: #fff;
    text-align: center;
    font-size: 0.95rem;
}
.dish-lightbox-caption #dish-lightbox-name {
    font-weight: 600;
    margin-right: 8px;
}
.dish-lightbox-counter {
    color: rgba(255, 255, 255, 0.65);
    font-size: 0.85rem;
}
.dish-lightbox-dots {
    margin-top: 10px;
    display: flex;
    gap: 6px;
}
.dish-lightbox-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.35);
    border: none;
    padding: 0;
    cursor: pointer;
}
.dish-lightbox-dot.active {
    background: var(--barra-gold);
}

@media (min-width: 640px) {
    :root {
        --barra-max-width: 820px;
    }
    .menu-item-toggle {
        padding: 18px 20px;
    }
    .menu-item-toggle.has-thumb {
        padding-left: 78px;
    }
    .menu-item-thumb {
        top: 14px;
        left: 16px;
        width: 52px;
        height: 52px;
    }
    .dish-lightbox-prev { left: 8px; }
    .dish-lightbox-next { right: 8px; }
}

/* ============================================================
   Featured strip — dynamic, time-of-day dish picks
   ============================================================ */
.featured-strip {
    max-width: var(--barra-max-width);
    margin: 0 auto;
    padding: 4px 0 24px;
}
.featured-strip-header {
    padding: 0 20px 10px;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
}
.featured-strip-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--barra-ocean-dark);
    margin: 0;
}
.featured-strip-sub {
    font-size: 0.8rem;
    color: #888;
    margin: 2px 0 0;
}
.featured-strip-track {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 2px 20px 6px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.featured-strip-track::-webkit-scrollbar {
    display: none;
}
.featured-card {
    flex: 0 0 auto;
    scroll-snap-align: start;
    width: 148px;
    background: #fff;
    border: 1px solid var(--barra-sand-dark);
    border-radius: var(--barra-radius);
    overflow: hidden;
    cursor: pointer;
    text-align: left;
    padding: 0;
    font-family: inherit;
    color: inherit;
    
    /* ADD THESE TO LOCK THE INTERNAL LAYOUT: */
    display: flex;
    flex-direction: column;
}

.featured-card-image {
    width: 100%;
    height: 100px;
    background-size: cover;
    background-position: center;
    background-color: var(--barra-sand-dark);
    
    /* ADD THESE TO PREVENT FLEX DISTORTION: */
    flex-shrink: 0;
    display: block;
}

/* Ensure the body container inside the card has no top margin pushing the image */
.featured-card-content,
.featured-card-info,
.featured-card > *:not(.featured-card-image) {
    margin-top: 0;
}
.featured-card-body {
    padding: 10px 12px 12px;
}
.featured-card-name {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1.25;
    margin-bottom: 4px;
    /* clamp to 2 lines so cards stay a uniform height */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.featured-card-price {
    display: block;
    font-size: 0.8rem;
    color: var(--barra-gold);
    font-weight: 600;
}

/* "Signature" badge shown inline next to a dish name in the main list */
.menu-item-badge {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--barra-ocean-dark);
    background: #eaf3f1;
    border-radius: 999px;
    padding: 2px 7px;
    vertical-align: middle;
    margin-left: 6px;
}

/* Brief highlight pulse when a featured card jumps the user to a dish below */
@keyframes barra-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(15, 110, 106, 0.45); }
    100% { box-shadow: 0 0 0 10px rgba(15, 110, 106, 0); }
}
.menu-item.is-highlighted {
    animation: barra-pulse 1s ease-out 1;
    border-color: var(--barra-ocean);
}

@media (min-width: 640px) {
    .featured-card { width: 168px; }
    .featured-card-image { height: 112px; }
}

.scroll-top-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--barra-ocean, #0f6e6a);
    color: #ffffff;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    
    /* Ensure it sits on top of all other elements and accepts clicks */
    z-index: 99999;
    pointer-events: auto;
}

.scroll-top-btn[hidden] {
    display: none !important;
}

.barra-logo img {
    height: 40px; /* Adjust height to match header design */
    width: auto;
    display: block;
}

.barra-footer-modern {
    background: #28282B;
    color: rgba(255, 255, 255, 0.75);
    padding: 40px 20px 28px;
}
.barra-footer-inner {
    max-width: var(--barra-max-width);
    margin: 0 auto;
    text-align: center;
}
.barra-footer-brand {
    margin: 0 0 8px;
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: #fff;
}
.barra-footer-line {
    margin: 0;
    font-size: 0.9rem;
}
.barra-footer-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.15);
    margin: 24px auto;
    max-width: 200px;
}
.barra-footer-bottom {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
}
.barra-footer-copyright {
    margin: 0;
    color: rgba(255, 255, 255, 0.55);
}
.barra-footer-link {
    color: #fff;
    text-decoration: none;
}
.barra-footer-link:hover {
    color: #409197;
}

@media (min-width: 640px) {
    .barra-footer-bottom {
        flex-direction: row;
        justify-content: space-between;
        max-width: var(--barra-max-width);
        margin: 0 auto;
    }
}

/* ============================================================
   WhatsApp CTA (hero button + floating button)
   ============================================================ */
.menu-hero-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
}
.btn-whatsapp {
    display: inline-block;
    background: #25D366;
    color: #0b3d19;
    text-decoration: none;
    padding: 12px 22px;
    border-radius: 999px;
    font-size: 0.95rem;
    font-weight: 700;
    transition: background 0.15s ease;
}
.btn-whatsapp:hover {
    background: #1fb859;
}
.btn-whatsapp-block {
    display: block;
    text-align: center;
    width: 100%;
}

.whatsapp-fab {
    position: fixed;
    bottom: 24px;
    left: 20px;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: #25D366;
    color: #0b3d19;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    text-decoration: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    z-index: 500;
}

@media (min-width: 480px) {
    .menu-hero-actions {
        flex-direction: row;
        justify-content: center;
    }
}

#favorites-fab {
    position: fixed;
    bottom: 80px;
    right: 20px;
    z-index: 1000;
    transition: bottom 0.2s ease;
}

/* When scroll-top button is hidden, drop the fav button down to the corner */
.scroll-top-btn[hidden] ~ #favorites-fab,
.scroll-top-btn[style*="display: none"] ~ #favorites-fab {
    bottom: 20px;
}

/* ============================================================
   Favourites — heart button, floating button, modal
   ============================================================ */
.menu-item-favorite {
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: #b9b4a6;
    font-size: 1.3rem;
    cursor: pointer;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
}
.menu-item-favorite.is-favorited {
    color: #d84c6a;
}
.menu-item-toggle {
    padding-right: 48px;
}

.menu-item-share {
    margin-top: 10px;
    background: none;
    border: 1px solid var(--barra-sand-dark);
    color: var(--barra-ocean-dark);
    font-size: 0.85rem;
    font-weight: 600;
    padding: 8px 14px;
    border-radius: 999px;
    cursor: pointer;
}
.menu-item-share:hover {
    background: var(--barra-sand);
}

.favorites-fab {
    position: fixed;
    bottom: 24px;
    right: 20px;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: #fff;
    border: 1px solid var(--barra-sand-dark);
    color: #d84c6a;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
}
.favorites-fab-count {
    position: absolute;
    top: -2px;
    right: -2px;
    background: var(--barra-ocean);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

.favorites-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}
.favorites-modal[hidden] {
    display: none;
}
.favorites-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 20, 18, 0.6);
}
.favorites-modal-dialog {
    position: relative;
    z-index: 1;
    width: min(92vw, 420px);
    max-height: 85vh;
    overflow-y: auto;
    background: #fff;
    border-radius: var(--barra-radius);
    padding: 24px 20px;
    box-sizing: border-box; /* Added to ensure padding doesn't widen dialog beyond 92vw */
}
.favorites-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: none;
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
    color: #888;
}
.favorites-modal-title {
    margin: 0 0 16px;
    font-size: 1.2rem;
    color: var(--barra-ocean-dark);
}
.favorites-list {
    list-style: none;
    margin: 0 0 16px;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.favorites-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    background: var(--barra-sand);
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 0.9rem;
}
.favorites-list-item-remove {
    background: none;
    border: none;
    color: #999;
    font-size: 1.2rem;
    cursor: pointer;
    line-height: 1;
}
.favorites-empty {
    color: #888;
    font-size: 0.9rem;
    text-align: center;
    padding: 10px 0 20px;
}
.favorites-actions {
    margin-bottom: 20px;
}
.favorites-optin {
    border-top: 1px solid var(--barra-sand-dark);
    padding-top: 16px;
}
.favorites-optin-label {
    font-size: 0.9rem;
    color: #555;
    margin: 0 0 10px;
}
.favorites-optin-form {
    display: flex;
    gap: 8px;
    width: 100%;
    box-sizing: border-box; /* Ensures form respects dialog padding */
}
.favorites-optin-input {
    flex: 1 1 auto;
    min-width: 0; /* Critical: allows text input to shrink below default width */
    padding: 10px 12px;
    border: 1px solid var(--barra-sand-dark);
    border-radius: var(--barra-radius);
    font-size: 0.9rem;
    box-sizing: border-box;
}
.favorites-optin-submit {
    flex: 0 0 auto;
    background: var(--barra-ocean);
    color: #fff;
    border: none;
    border-radius: var(--barra-radius);
    padding: 10px 12px; /* Slightly reduced horizontal padding for tight screens */
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    box-sizing: border-box;
}
.favorites-optin-status {
    margin: 10px 0 0;
    font-size: 0.85rem;
    color: var(--barra-ocean-dark);
}
.favorites-optin-status.is-error {
    color: #a33;
}

/* Align items inside header toggle container */
.menu-item-toggle {
    display: flex;
    align-items: center;
    width: 100%;
    gap: 10px;
}

/* Ensure price stays aligned and doesn't wrap unnecessarily */
.menu-item-price {
    margin-left: auto;
    white-space: nowrap;
}

/* Ensure heart icon button is aligned at the end */
.menu-item-favorite {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 6px;
    cursor: pointer;
    z-index: 2;
    font-size: 1.2rem;
}


