/*
 * Aparência do cardápio React — curvas suaves e superfícies leves.
 * O escopo .food-store evita qualquer alteração no painel administrativo.
 * As classes antigas são intencionais: mantêm a integração PHP/Bootstrap.
 */
body.food-store {
    --menu-radius-xs: 10px;
    --menu-radius-sm: 14px;
    --menu-radius-md: 19px;
    --menu-radius-lg: 25px;
    --menu-radius-xl: 30px;
    --menu-shadow-card: 0 6px 22px rgba(28, 35, 48, .055);
    --menu-shadow-float: 0 14px 34px rgba(28, 35, 48, .105);
    --menu-border-soft: rgba(100, 116, 139, .15);
    --menu-focus-ring: 0 0 0 3px color-mix(in srgb, var(--primary, #e63946) 18%, transparent);
    -webkit-font-smoothing: antialiased;
}

/* O cabeçalho desktop recupera as medidas e curvas originais de food-store.css.
   Somente a capa no mobile recebe o layout especial da versão anterior. */
body.food-store .topbar-icon,
body.food-store .topbar-customer-avatar,
body.food-store .food-cart { border-radius: var(--menu-radius-md) !important; }
body.food-store .topbar-search-shell {
    border-radius: var(--menu-radius-md) !important;
    border-color: var(--menu-border-soft) !important;
    box-shadow: 0 4px 18px rgba(25, 35, 48, .045) !important;
    transition: border-color .2s ease, box-shadow .2s ease;
}
body.food-store .topbar-search-shell:focus-within { box-shadow: var(--menu-focus-ring) !important; }

/* Vitrine estática: sem salto ao passar o mouse, zoom ou sombra. */
body.food-store .product-card,
body.food-store .product-card:hover,
body.food-store .product-card:focus-within,
body.food-store #topOrderedSection .product-card,
body.food-store #topOrderedSection .product-card:hover {
    border-radius: var(--menu-radius-lg) !important;
    border: 1px solid var(--menu-border-soft) !important;
    background: var(--food-paper, #fff) !important;
    box-shadow: none !important;
    transform: none !important;
    translate: none !important;
    rotate: none !important;
    animation: none !important;
    transition: none !important;
    overflow: hidden;
}
body.food-store .product-thumb-wrap { overflow: hidden; }
body.food-store .product-thumb,
body.food-store .product-card:hover .product-thumb,
body.food-store .product-card:focus-within .product-thumb {
    transform: none !important;
    animation: none !important;
    transition: none !important;
    box-shadow: none !important;
}
body.food-store .product-tag,
body.food-store .product-discount-percent,
body.food-store .product-coupon-timer { border-radius: 999px !important; }
body.food-store .product-body { min-width: 0; }
body.food-store .btn-add-product {
    border-radius: var(--menu-radius-sm) !important;
    min-height: 39px;
    transition: none !important;
}
body.food-store .btn-add-product:not(:disabled):hover { filter: none !important; transform: none !important; }
body.food-store .btn-add-product:disabled { cursor: not-allowed; opacity: .55; }
body.food-store .product-card:focus-within { outline: 2px solid color-mix(in srgb, var(--primary, #e63946) 35%, transparent); outline-offset: 2px; }
body.food-store .category-section-banner,
body.food-store .category-section-banner img { border-radius: var(--menu-radius-lg) !important; }
body.food-store .food-promo { border-radius: var(--menu-radius-lg) !important; }
body.food-store .menu-section-head { border-radius: var(--menu-radius-sm); }
body.food-store .food-cta,
body.food-store .cart-fab { border-radius: var(--menu-radius-md) !important; }

/* Barra horizontal de categorias: pílulas arredondadas sem perder o toque acessível. */
@media (min-width: 992px) {
    body.food-store .category-scroll .chip,
    body.food-store .category-scroll .chip.has-media {
        border: 1px solid var(--menu-border-soft) !important;
        background: var(--food-paper, #fff) !important;
        border-radius: 999px !important;
        padding: 11px 17px 13px !important;
        transition: color .16s ease, background .16s ease, border-color .16s ease;
    }
    body.food-store .category-scroll .chip:hover,
    body.food-store .category-scroll .chip.active {
        background: color-mix(in srgb, var(--primary, #e63946) 7%, #fff) !important;
        border-color: color-mix(in srgb, var(--primary, #e63946) 29%, #fff) !important;
    }
    body.food-store .category-scroll .chip.active::after { display:none !important; }
}
body.food-store .category-scroll .chip:focus-visible,
body.food-store .food-bottom-nav :is(button, a):focus-visible,
body.food-store button:focus-visible,
body.food-store a:focus-visible { outline: 2px solid var(--primary, #e63946); outline-offset: 3px; }
body.food-store .chip-media,
body.food-store .food-category-icon { box-shadow: 0 4px 16px rgba(25, 35, 48, .07) !important; }

/* Carrinho, modal do produto e checkout existentes preservados e suavizados. */
body.food-store .offcanvas,
body.food-store .modal-content,
body.food-store .checkout-card,
body.food-store .checkout-selected-payment-card,
body.food-store .product-modal-content,
body.food-store .front-system-dialog,
body.food-store .store-menu-canvas {
    border-radius: var(--menu-radius-lg) !important;
}
body.food-store :is(.offcanvas-header, .offcanvas-body, .modal-header, .modal-body) {
    scrollbar-color: rgba(148, 163, 184, .35) transparent;
}
body.food-store :is(.cart-item, .cart-upsell__item, .checkout-field,
    .checkout-payment-card, .checkout-delivery-type-card, .checkout-address-selected,
    .coupon-entry, .store-info-section, .store-menu-item, .product-complement-group,
    .product-complement-item, .checkout-summary-card, .cashback-option) {
    border-radius: var(--menu-radius-sm) !important;
}
body.food-store .store-menu-item { margin: 2px 10px; }
body.food-store :is(input.form-control, select.form-select, textarea.form-control,
    .checkout-field input, .checkout-field select, .checkout-field textarea) {
    border-radius: var(--menu-radius-sm) !important;
}
body.food-store :is(.modal-content, .offcanvas) { box-shadow: var(--menu-shadow-float); }
body.food-store :is(.btn.btn-primary, .btn.btn-outline-primary, .btn.btn-secondary,
    .checkout-next-btn, .checkout-prev-btn, .cart-upsell__add) {
    border-radius: var(--menu-radius-sm) !important;
}
body.food-store .food-bottom-nav { border-radius: var(--menu-radius-lg) !important; }

@media (max-width: 991.98px) {
    body.food-store .menu-hero { border-radius: var(--menu-radius-lg) !important; }
    body.food-store .product-card,
    body.food-store .product-card:hover,
    body.food-store .product-card:focus-within { border-radius: 19px !important; }
    body.food-store .category-scroll .chip-media,
    body.food-store .category-scroll .food-category-icon { border-radius: 17px !important; }
    body.food-store .category-scroll .chip.active::after { border-radius: 999px !important; }
    body.food-store .food-bottom-nav { border-radius: 20px !important; }
}
@media (max-width: 600px) {
    body.food-store .product-card,
    body.food-store .product-card:hover,
    body.food-store .product-card:focus-within { border-radius: 17px !important; }
    body.food-store .category-section-banner,
    body.food-store .category-section-banner img { border-radius: 18px !important; }
    body.food-store .product-body { padding: 10px !important; }
    body.food-store .btn-add-product { border-radius: 12px !important; min-width: 36px !important; }
    body.food-store .menu-hero { border-radius: 21px !important; }
}
@media (prefers-reduced-motion: reduce) {
    body.food-store .product-card,
    body.food-store .product-thumb,
    body.food-store .btn-add-product { transition: none !important; }
}

/* V163 - Cabeçalho responsivo com capa fotográfica e cartão de loja suspenso.
   A renderização React continua usando os dados reais e os eventos PHP/Bootstrap. */
body.food-store .mobile-hero-actions { display: none; }
body.food-store .store-location { display: none; }
@media (max-width: 991.98px) {
    body.food-store[data-page-type="catalog"] .front-topbar {
        position: sticky;
        top: 0;
        height: 64px;
        padding: 10px 14px !important;
        background: transparent !important;
        border: 0 !important;
        box-shadow: none !important;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        transition: background-color .2s ease, box-shadow .2s ease;
    }
    body.food-store[data-page-type="catalog"] .front-topbar .front-topbar-inner {
        max-width: 780px;
        grid-template-columns: 44px minmax(0, 1fr) auto;
        grid-template-rows: 44px;
        gap: 7px;
    }
    /* A capa começa atrás da barra, como no app de referência. */
    body.food-store[data-page-type="catalog"] .menu-hero {
        width: 100%;
        max-width: none;
        margin: -64px 0 0 !important;
        display: block;
        overflow: visible !important;
        isolation: auto;
        background: transparent !important;
        border: 0 !important;
        border-radius: 0 !important;
        box-shadow: none !important;
    }
    body.food-store[data-page-type="catalog"] .hero-banner {
        position: relative;
        height: clamp(260px, 71vw, 345px) !important;
        min-height: 260px;
        width: 100%;
        overflow: hidden;
        border-radius: 0 !important;
        background: #302720;
        box-shadow: none !important;
    }
    body.food-store[data-page-type="catalog"] .hero-banner picture,
    body.food-store[data-page-type="catalog"] .hero-banner-img { display: block; width: 100%; height: 100%; }
    body.food-store[data-page-type="catalog"] .hero-banner-img {
        object-fit: cover;
        object-position: center center;
    }
    body.food-store[data-page-type="catalog"] .hero-banner::after {
        content: '';
        display: block;
        position: absolute;
        inset: 0;
        pointer-events: none;
        background: linear-gradient(180deg, rgba(0, 0, 0, .40) 0%, rgba(0, 0, 0, .05) 38%, rgba(0, 0, 0, .33) 100%);
    }
    /* Substitui o bloco promocional do banner pela foto da loja. */
    body.food-store[data-page-type="catalog"] .food-hero-copy { display: none !important; }
    /* Menu continua funcional e fica sobre a fotografia; outras ações voltam ao rolar. */
    body.food-store[data-page-type="catalog"] .front-topbar:not(.mobile-hero-scrolled) .menu-bars-btn {
        background: rgba(0, 0, 0, .24) !important;
        color: #fff !important;
        border: 1px solid rgba(255,255,255,.26) !important;
        box-shadow: none !important;
        backdrop-filter: blur(6px);
        -webkit-backdrop-filter: blur(6px);
    }
    body.food-store[data-page-type="catalog"] .front-topbar:not(.mobile-hero-scrolled) .topbar-delivery,
    body.food-store[data-page-type="catalog"] .front-topbar:not(.mobile-hero-scrolled) .topbar-account-actions {
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
    }
    body.food-store[data-page-type="catalog"] .front-topbar.mobile-hero-scrolled {
        background: rgba(255,255,255,.97) !important;
        border-bottom: 1px solid #edf0f3 !important;
        box-shadow: 0 4px 16px rgba(15,23,42,.07) !important;
        backdrop-filter: blur(14px);
        -webkit-backdrop-filter: blur(14px);
    }
    body.food-store[data-page-type="catalog"] .front-topbar.mobile-hero-scrolled .topbar-delivery,
    body.food-store[data-page-type="catalog"] .front-topbar.mobile-hero-scrolled .topbar-account-actions {
        visibility: visible;
        opacity: 1;
        pointer-events: auto;
    }
    body.food-store[data-page-type="catalog"] .front-topbar .topbar-icon.menu-bars-btn {
        width: 44px;
        height: 44px;
        border-radius: 50% !important;
    }
    body.food-store[data-page-type="catalog"] .front-topbar .topbar-icon.menu-bars-btn i { font-size: 22px; }
    /* Botões na própria imagem, alinhados à direita e com área de toque confortável. */
    body.food-store[data-page-type="catalog"] .mobile-hero-actions {
        position: absolute;
        z-index: 4;
        display: flex;
        align-items: center;
        gap: 9px;
        top: 12px;
        right: max(12px, env(safe-area-inset-right, 0px));
    }
    body.food-store[data-page-type="catalog"] .mobile-hero-action {
        position: relative;
        display: inline-grid;
        place-items: center;
        flex: 0 0 44px;
        width: 44px;
        height: 44px;
        padding: 0;
        color: #fff !important;
        border: 1px solid rgba(255,255,255,.32) !important;
        border-radius: 50% !important;
        background: rgba(0,0,0,.33) !important;
        box-shadow: none !important;
        text-decoration: none !important;
        backdrop-filter: blur(6px);
        -webkit-backdrop-filter: blur(6px);
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }
    body.food-store[data-page-type="catalog"] .mobile-hero-action i {
        font-size: 21px;
        line-height: 1;
    }
    body.food-store[data-page-type="catalog"] .mobile-hero-cart-count {
        position: absolute;
        top: -5px;
        right: -5px;
        min-width: 19px;
        height: 19px;
        padding: 1px 4px;
        display: grid;
        place-items: center;
        border: 2px solid white;
        border-radius: 999px;
        background: var(--primary, #e63946);
        color: white;
        font-size: 10px;
        font-weight: 800;
        line-height: 1;
        font-variant-numeric: tabular-nums;
    }
    body.food-store[data-page-type="catalog"] .mobile-hero-action:focus-visible {
        outline: 3px solid #fff;
        outline-offset: 3px;
    }
    /* Um cartão branco único, flutuando sobre a borda inferior da foto. */
    body.food-store[data-page-type="catalog"] .store-panel {
        box-sizing: border-box;
        position: relative;
        z-index: 3;
        display: grid;
        grid-template-columns: 70px minmax(0, 1fr);
        grid-template-rows: repeat(4, auto);
        align-items: start;
        column-gap: 12px;
        row-gap: 4px;
        width: calc(100% - 24px);
        min-height: 136px;
        padding: 15px;
        margin: -80px auto 0 !important;
        background: #fff !important;
        color: #1f2229;
        border: 1px solid rgba(231,234,239,.8) !important;
        border-radius: 22px !important;
        box-shadow: 0 12px 32px rgba(18,26,38,.15) !important;
        text-align: left;
    }
    body.food-store[data-page-type="catalog"] .store-logo-wrap {
        grid-column: 1;
        grid-row: 1 / 5;
        align-self: start;
        width: 70px;
        height: 70px;
        padding: 0;
        border: 0;
        border-radius: 16px;
        background: #f6f7fa;
        overflow: hidden;
        box-shadow: none;
    }
    body.food-store[data-page-type="catalog"] .store-logo,
    body.food-store[data-page-type="catalog"] .store-logo-fallback {
        width: 100%;
        height: 100%;
        object-fit: cover;
        border-radius: 16px;
        box-shadow: none;
        font-size: 27px;
    }
    body.food-store[data-page-type="catalog"] .store-title {
        grid-column: 2;
        grid-row: 1;
        margin: 0;
        font-size: clamp(16px, 4.2vw, 20px) !important;
        line-height: 1.22 !important;
        font-weight: 800;
        letter-spacing: -.35px;
        overflow-wrap: break-word;
    }
    body.food-store[data-page-type="catalog"] .store-location {
        display: block;
        grid-column: 2;
        grid-row: 2;
        width: 100%;
        margin: 0;
        color: #858891;
        font-size: 11px;
        line-height: 1.35;
        text-overflow: ellipsis;
        overflow: hidden;
        white-space: nowrap;
    }
    body.food-store[data-page-type="catalog"] .store-location i { font-size: 11px; color: #a2a4aa; }
    body.food-store[data-page-type="catalog"] .store-panel > .status-badge {
        grid-column: 2;
        grid-row: 3;
        margin: 0;
        padding: 0;
        background: transparent;
        border-radius: 0;
        font-size: 11px;
        line-height: 1.4;
        font-weight: 650;
    }
    body.food-store[data-page-type="catalog"] .store-panel > .status-badge::before {
        content: '';
        display: inline-block;
        width: 6px;
        height: 6px;
        margin-right: 5px;
        border-radius: 50%;
        background: currentColor;
        vertical-align: middle;
    }
    body.food-store[data-page-type="catalog"] .store-meta-line {
        grid-column: 2;
        grid-row: 4;
        align-items: center;
        display: flex;
        flex-wrap: wrap;
        gap: 4px 9px;
        margin: 2px 0 0;
        min-width: 0;
        font-size: 10px;
        font-weight: 500;
        line-height: 1.4;
        color: #6c727d;
    }
    body.food-store[data-page-type="catalog"] .store-meta-line > span {
        padding: 0 !important;
        margin: 0;
        background: transparent !important;
        box-shadow: none !important;
        border: 0 !important;
        display: inline-flex;
        align-items: center;
        gap: 3px;
        min-width: 0;
    }
    body.food-store[data-page-type="catalog"] .store-meta-line > span:first-child { color: #32935c; font-weight: 650; }
    body.food-store[data-page-type="catalog"] .store-meta-line .store-review-btn,
    body.food-store[data-page-type="catalog"] .store-meta-line .store-more-btn {
        padding: 0 2px !important;
        font-size: 10px !important;
        color: #6c727d;
        border-radius: 4px !important;
        background: transparent !important;
        box-shadow: none !important;
        min-height: 22px;
        border: 0;
        max-width: 100%;
    }
    body.food-store[data-page-type="catalog"] .store-meta-line .bi-star-fill { color: #ffa21c; }
    body.food-store[data-page-type="catalog"] .mobile-search-host {
        width: min(780px, 100%);
        margin: 7px auto 0;
        padding-top: 10px;
    }
    body.food-store[data-page-type="catalog"] .category-strip-wrap { margin-top: 4px; }
}
@media (max-width: 380px) {
    body.food-store[data-page-type="catalog"] .menu-hero { width: 100%; }
    body.food-store[data-page-type="catalog"] .store-panel {
        grid-template-columns: 62px minmax(0, 1fr);
        gap: 3px 10px;
        padding: 12px;
        margin-top: -74px !important;
        width: calc(100% - 20px);
    }
    body.food-store[data-page-type="catalog"] .store-logo-wrap { width: 62px; height: 62px; }
    body.food-store[data-page-type="catalog"] .store-title { font-size: 15px !important; }
    body.food-store[data-page-type="catalog"] .store-meta-line { font-size: 9px; gap: 3px 6px; }
}
@media (max-width: 991.98px) {
    /* A barra transparente não pode bloquear os atalhos da capa. */
    body.food-store[data-page-type="catalog"] .front-topbar:not(.mobile-hero-scrolled) { pointer-events: none; }
    body.food-store[data-page-type="catalog"] .front-topbar:not(.mobile-hero-scrolled) .menu-bars-btn { pointer-events: auto; }
}

/* V164 — checkout lateral com topo reto, sem a curva superior da versão React. */
body.food-store #cartCanvas.offcanvas {
    border-radius: 0 !important;
    box-shadow: none !important;
}
body.food-store #cartCanvas .checkout-main-header {
    border-radius: 0 !important;
}
body.food-store #checkoutOverviewBlock[hidden],
body.food-store #checkoutOverviewDivider[hidden] {
    display: none !important;
}
body.food-store #checkoutStepper .checkout-step-btn__label {
    white-space: normal;
    overflow-wrap: anywhere;
}
