:root {
    --sf-nav-h: 56px;
    --sf-max-w: 100%;
    --sf-pad-x: 16px;
}

body { background-color: #fff; padding-bottom: 30px; color: #1a1a1a; overflow-x: clip; }
    
    /* Header Estilo App Nativo */
    .app-header-sticky {
        position: sticky; 
        top: var(--sf-nav-h, 56px); 
        z-index: 1020; 
        background: rgba(255, 255, 255, 0.96); 
        backdrop-filter: blur(10px);
        padding: 12px 0; 
        border-bottom: 1px solid #f0f0f0;
        box-shadow: none;
        width: 100%;
        box-sizing: border-box;
    }

    /* Ícones de Ação Rápidos */
    .action-icon-btn {
        width: 44px; 
        height: 44px; 
        border-radius: 50%;
        background-color: #ffffff;
        color: #333;
        border: 1px solid #e2e8f0;
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: 0 4px 10px rgba(0,0,0,0.05);
        transition: all 0.2s ease-in-out;
        cursor: pointer;
    }
    .action-icon-btn:hover, .action-icon-btn:focus {
        background-color: var(--cor-loja);
        color: #fff;
        border-color: var(--cor-loja);
        transform: translateY(-2px);
        box-shadow: 0 6px 14px rgba(0,0,0,0.1);
    }
    
    .status-badge { font-size: 0.65rem; padding: 4px 12px; border-radius: 50px; font-weight: 800; text-transform: uppercase; white-space: nowrap; display: flex; align-items: center; }
    .status-aberto { background-color: #d1e7dd; color: #0f5132; }
    .status-fechado { background-color: #f8d7da; color: #842029; }

    /* Layout da Galeria */
    .product-gallery-main {
        position: relative; background: #f5f5f5; border-radius: 16px; overflow: hidden;
        aspect-ratio: 1/1; border: none; display: flex;
        align-items: center; justify-content: center; margin-bottom: 15px;
        box-shadow: none;
    }
    .product-gallery-main img { width: 100%; height: 100%; object-fit: contain; transition: transform 0.3s ease; }
    .product-gallery-main:hover img { transform: scale(1.05); }

    .thumb-grid { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 10px; scrollbar-width: none; -ms-overflow-style: none; }
    .thumb-grid::-webkit-scrollbar { display: none; }
    .thumb-item {
        width: 75px; height: 75px; flex-shrink: 0; border: 2px solid transparent; border-radius: 12px;
        cursor: pointer; opacity: 0.6; transition: 0.2s; background: #fff; padding: 2px;
    }
    .thumb-item:hover { opacity: 0.9; }
    .thumb-item.active { border-color: var(--cor-loja); opacity: 1; box-shadow: 0 4px 10px rgba(0,0,0,0.1); }
    .thumb-item img { width: 100%; height: 100%; object-fit: cover; border-radius: 8px; }

    /* Detalhes */
    .product-title { font-size: 1.5rem; font-weight: 800; color: #1a1a1a; line-height: 1.25; margin-bottom: 0; letter-spacing: -0.02em; }
    .product-price { font-size: 1.5rem; font-weight: 800; color: #1a1a1a; }
    .price-old { text-decoration: line-through; color: #a1a1aa; font-size: 1rem; font-weight: 600; }
    .cat-badge { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 1px; color: #64748b; font-weight: 800; background: #f1f5f9; padding: 4px 10px; border-radius: 6px; }

    /* Variações Modernas */
    .variation-group { margin-bottom: 25px; transition: 0.3s ease; }
    .variation-title { font-weight: 800; margin-bottom: 12px; display: block; font-size: 1rem; color: #1e293b; }
    
    .option-card-label {
        display: flex; align-items: center; justify-content: space-between;
        padding: 14px 15px 14px 45px;
        border: 2px solid #f1f5f9; border-radius: 12px;
        cursor: pointer; transition: all 0.2s ease; background: #fff; user-select: none; width: 100%; margin: 0;
    }
    
    .option-card-input { width: 1.3rem; height: 1.3rem; margin-top: 0.1rem; }
    .option-card-input:checked + .option-card-label {
        border-color: var(--cor-loja);
        background-color: color-mix(in srgb, var(--cor-loja) 5%, white);
        box-shadow: 0 4px 10px color-mix(in srgb, var(--cor-loja) 15%, transparent);
    }
    .option-card-input:checked + .option-card-label .nome-opcao { font-weight: 700; color: var(--cor-loja-hover); }
    .option-card-input:disabled + .option-card-label { opacity: 0.5; cursor: not-allowed; background: #f8f9fa; border-color: #eee; }

    /* Estilos do Badge de Estoque no Card de Relacionados */
    .overlay-esgotado {
        position: absolute; top: 0; left: 0; width: 100%; height: 100%;
        background: rgba(255,255,255,0.7); z-index: 2;
        display: flex; align-items: center; justify-content: center;
        backdrop-filter: blur(2px);
    }
    .badge-estoque-baixo {
        position: absolute; top: 10px; left: 10px; z-index: 3;
        font-size: 0.7rem; font-weight: 800; box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    }

    /* Cards Relacionados */
    .product-related-card.card-food,
    .card-food.product-related-card {
        background: #fff;
        border-radius: 16px;
        border: 1px solid #f1f1f1;
        overflow: hidden;
        height: 100%;
        transition: transform 0.1s;
        display: flex;
        flex-direction: column;
        cursor: pointer;
        box-shadow: 0 4px 15px rgba(0,0,0,0.04);
        position: relative;
        padding: 0;
        gap: 0;
        align-items: stretch;
    }
    .product-related-card:hover {
        transform: translateY(-3px);
        box-shadow: 0 8px 25px rgba(0,0,0,0.08);
        background: #fff;
    }
    .product-related-card:active { transform: scale(0.98); }
    .product-related-card .img-food-box {
        width: 100%;
        height: auto;
        aspect-ratio: 1;
        background: #f5f5f5;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0;
        border-bottom: 1px solid #f8f9fa;
        position: relative;
        border-radius: 0;
        flex-shrink: 0;
        overflow: hidden;
    }
    .product-related-card .img-food-box img {
        width: 100%;
        height: 100%;
        max-width: none;
        max-height: none;
        object-fit: cover;
        object-position: center;
    }
    .product-related-name {
        font-size: 0.9rem;
        line-height: 1.3;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        min-height: 2.4em;
    }
    .price-tag-rel { color: var(--cor-loja); font-weight: 800; font-size: 1.05rem; }

    .btn-add-primary {
        background-color: var(--cor-loja) !important;
        border: none !important;
        color: #ffffff !important;
    }
    .btn-add-primary span, .btn-add-primary i {
        color: #ffffff !important;
    }

    /* Barra Fixa Mobile Add Cart */
    .sticky-footer-product {
        position: fixed; bottom: 0; left: 0; width: 100%;
        background: #fff; padding: 15px; box-shadow: 0 -5px 20px rgba(0,0,0,0.1); z-index: 1040; display: none; 
    }

    /* CARRINHO FLUTUANTE GLOBAL */
    .fab-cart-right {
        position: fixed; bottom: 30px; right: 20px; z-index: 1050;
        display: none; flex-direction: column; align-items: flex-end;
        animation: popIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    }
    @keyframes popIn { 0% { transform: scale(0.5); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }

    .btn-smart-cart {
        background-color: var(--cor-loja); color: #fff; border-radius: 50px; padding: 12px 20px;
        display: flex; align-items: center; gap: 12px; box-shadow: 0 10px 30px rgba(0,0,0,0.25);
        text-decoration: none; transition: 0.3s; border: 2px solid rgba(255,255,255,0.2);
    }
    .btn-smart-cart:hover { color: #fff; transform: translateY(-3px) scale(1.05); box-shadow: 0 15px 35px rgba(0,0,0,0.3); }
    .cart-icon-wrapper { font-size: 1.3rem; position: relative; }
    .cart-badge-count {
        position: absolute; top: -8px; right: -12px; background: #fff; color: var(--cor-loja);
        font-size: 0.7rem; font-weight: 900; min-width: 20px; height: 20px; border-radius: 50%;
        display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    }
    .cart-total-text { font-weight: 800; font-size: 1.1rem; }

    /* Novo Toast de Feedback */
    .toast-feedback {
        position: fixed; bottom: -100px; left: 50%; transform: translateX(-50%);
        background: #212529 !important; color: #ffffff !important; padding: 12px 24px; border-radius: 50px;
        box-shadow: 0 5px 20px rgba(0,0,0,0.3); z-index: 9999; font-weight: 600;
        display: flex; align-items: center; gap: 10px; transition: bottom 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); white-space: nowrap;
    }
    .toast-feedback.show { bottom: 40px; }

    /* Mesma coluna central da home (header + conteúdo) */
    @media (min-width: 992px) {
        /* Mesmo valor de storefront.css: a home usa 1100px nos dois layouts. */
        :root {
            --sf-max-w: 1100px;
            --sf-pad-x: 20px;
        }
        body.sf-layout-grid,
        body.sf-layout-list {
            --sf-max-w: 1100px;
        }
        body.store-body .sv-navbar > .container.sv-navbar-inner,
        body.store-body .sv-navbar-inner {
            max-width: var(--sf-max-w) !important;
            width: 100%;
            margin-left: auto;
            margin-right: auto;
            padding-left: var(--sf-pad-x);
            padding-right: var(--sf-pad-x);
            box-sizing: border-box;
        }
        .app-header-sticky .container,
        .container.product-page {
            max-width: var(--sf-max-w) !important;
            width: 100%;
            margin-left: auto;
            margin-right: auto;
            padding-left: var(--sf-pad-x);
            padding-right: var(--sf-pad-x);
            box-sizing: border-box;
        }
    }

    @media (max-width: 991.98px) {
        :root {
            --sf-pad-x: 12px;
        }
        body.store-body .sv-navbar > .container.sv-navbar-inner,
        body.store-body .sv-navbar-inner {
            padding-left: var(--sf-pad-x);
            padding-right: var(--sf-pad-x);
            box-sizing: border-box;
        }
        .app-header-sticky .container {
            padding-left: var(--sf-pad-x);
            padding-right: var(--sf-pad-x);
            max-width: 100%;
            box-sizing: border-box;
        }
    }

    @media(max-width: 768px) {
        .sticky-footer-product { display: block; }
        .desktop-add-btn { display: none; }
        body { padding-bottom: 100px; }
        .fab-cart-right { bottom: 100px; }
        .toast-feedback.show { bottom: 100px; }

        .app-header-sticky .container {
            padding-left: 12px;
            padding-right: 12px;
            max-width: 100%;
        }
        .status-badge { font-size: 0.65rem; }

        .container.product-page {
            padding-top: 0.5rem !important;
            padding-left: 0 !important;
            padding-right: 0 !important;
            max-width: 100%;
            overflow-x: clip;
        }
        .product-page > .row {
            --bs-gutter-x: 0;
            --bs-gutter-y: 0;
            margin-left: 0;
            margin-right: 0;
        }
        .product-page > .row > [class*="col-"] {
            padding-left: 0;
            padding-right: 0;
            width: 100%;
            max-width: 100%;
        }
        .product-gallery-wrap {
            width: 100%;
        }
        .product-gallery-main {
            width: 100%;
            max-width: 100%;
            margin: 0 auto 0;
            border-radius: 0;
            aspect-ratio: 1 / 1;
            max-height: none;
            background: #f5f5f5;
        }
        .product-gallery-main img {
            width: 100%;
            height: 100%;
            object-fit: contain;
            object-position: center center;
            margin: 0 auto;
            display: block;
        }
        .thumb-grid {
            padding: 10px 16px 0;
            justify-content: center;
        }
        .product-details-panel {
            border-radius: 0 !important;
            border: none !important;
            box-shadow: none !important;
            padding: 1rem 16px 1.5rem !important;
        }
        .product-related {
            padding: 1.25rem 16px 2rem;
            margin-top: 0.5rem !important;
            border-top: 1px solid #f0f0f0 !important;
        }
        .product-related-grid {
            --bs-gutter-x: 0.75rem;
            --bs-gutter-y: 0.75rem;
            margin-left: 0;
            margin-right: 0;
        }
        .product-related-grid > [class*="col-"] {
            padding-left: calc(var(--bs-gutter-x) * 0.5);
            padding-right: calc(var(--bs-gutter-x) * 0.5);
        }
        .product-related-card .img-food-box {
            aspect-ratio: 1;
            min-height: 0;
        }
        /* WA sobe / some pra não cobrir título e sugestões */
        body.store-body .store-wa-fab {
            display: none;
        }
    }

    @media (min-width: 769px) {
        .product-gallery-main {
            margin-left: auto;
            margin-right: auto;
        }
    }