/* V4 — mobile-first, inspirado no iFood */

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

:root {
    --v4-primary:    #e8212a;
    --v4-primary-dk: #b71c1c;
    --v4-bg:         #f5f5f5;
    --v4-card:       #ffffff;
    --v4-text:       #3d3d3d;
    --v4-text-light: #717171;
    --v4-radius:     12px;
    --v4-shadow:     0 2px 8px rgba(0,0,0,.12);
    --v4-tab-h:      48px;
    --v4-sacola-h:   64px;
    --v4-header-h:   220px;
}

html { scroll-behavior: smooth; }

body.v4-body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--v4-bg);
    color: var(--v4-text);
    min-height: 100vh;
    padding-bottom: calc(var(--v4-sacola-h) + env(safe-area-inset-bottom));
}

/* ── HEADER / CAPA ───────────────────────────────────────────────────────── */
.v4-header {
    position: relative;
    height: var(--v4-header-h);
    background: var(--v4-primary) center/cover no-repeat;
    overflow: visible;
}

.v4-header-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,.25), rgba(0,0,0,.5));
    display: flex;
    align-items: flex-end;
    justify-content: flex-start;
    padding: 0 16px 0;
}

.v4-logo-wrap {
    position: absolute;
    bottom: -36px;
    left: 16px;
    z-index: 10;
}

.v4-logo {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid #fff;
    object-fit: cover;
    background: #fff;
    box-shadow: var(--v4-shadow);
}

/* ── PAINEL DA LOJA ─────────────────────────────────────────────────────── */
.v4-painel {
    background: var(--v4-card);
    padding: 48px 16px 16px 16px;
    border-bottom: 1px solid #ebebeb;
}

.v4-loja-nome {
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 4px;
}

.v4-fechada-badge {
    display: inline-block;
    background: #e53935;
    color: #fff;
    font-size: .72rem;
    font-weight: 700;
    padding: 2px 10px;
    border-radius: 20px;
    margin-bottom: 8px;
    letter-spacing: .04em;
}

.v4-loja-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 6px;
}

.v4-info-item {
    font-size: .85rem;
    color: var(--v4-text-light);
}

.v4-info-tel { color: var(--v4-primary); text-decoration: none; }
.v4-info-tel:hover { text-decoration: underline; }

.v4-horarios {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

.v4-horario {
    font-size: .78rem;
    background: #f5f5f5;
    padding: 3px 10px;
    border-radius: 20px;
    color: var(--v4-text-light);
}

/* ── TABS DE CATEGORIA ──────────────────────────────────────────────────── */
.v4-tabs-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--v4-card);
    border-bottom: 1px solid #ebebeb;
    box-shadow: 0 2px 4px rgba(0,0,0,.06);
}

.v4-tabs-list {
    display: flex;
    overflow-x: auto;
    list-style: none;
    padding: 0 8px;
    height: var(--v4-tab-h);
    align-items: center;
    gap: 4px;
    scrollbar-width: none;
}

.v4-tabs-list::-webkit-scrollbar { display: none; }

.v4-tab-btn {
    white-space: nowrap;
    border: none;
    background: transparent;
    font-size: .85rem;
    font-weight: 600;
    color: var(--v4-text-light);
    padding: 6px 14px;
    border-radius: 20px;
    cursor: pointer;
    transition: color .15s, background .15s;
}

.v4-tab-item.v4-tab-active .v4-tab-btn,
.v4-tab-btn:hover {
    color: var(--v4-primary);
    background: #fdecea;
}

/* ── DESTAQUES ──────────────────────────────────────────────────────────── */
.v4-destaques {
    padding: 16px 0 8px 16px;
    background: var(--v4-card);
    border-bottom: 6px solid var(--v4-bg);
}

.v4-destaques-scroll {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-right: 16px;
    scrollbar-width: none;
}

.v4-destaques-scroll::-webkit-scrollbar { display: none; }

.v4-destaque-card {
    flex: 0 0 140px;
    background: var(--v4-card);
    border-radius: var(--v4-radius);
    box-shadow: var(--v4-shadow);
    overflow: hidden;
    cursor: pointer;
    transition: transform .15s;
}

.v4-destaque-card:hover { transform: translateY(-2px); }

.v4-destaque-img {
    width: 100%;
    height: 100px;
    object-fit: cover;
    object-position: center center;
    display: block;
    background: #f0f0f0;
}

.v4-destaque-body {
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.v4-destaque-nome {
    font-size: .78rem;
    font-weight: 600;
    line-height: 1.2;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.v4-destaque-preco {
    font-size: .78rem;
    font-weight: 700;
    color: var(--v4-primary);
}

/* ── CATÁLOGO ───────────────────────────────────────────────────────────── */
.v4-catalogo {
    padding-top: 8px;
}

.v4-categoria-section {
    background: var(--v4-card);
    margin-bottom: 8px;
    padding-bottom: 8px;
    scroll-margin-top: calc(var(--v4-tab-h) + 2px);
}

.v4-categoria-titulo {
    font-size: 1rem;
    font-weight: 700;
    padding: 16px 16px 8px;
    color: var(--v4-text);
}

.v4-produtos-grid {
    display: flex;
    flex-direction: column;
}

.v4-produto-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
    border-top: 1px solid #f2f2f2;
    transition: background .12s;
}

.v4-produto-card:hover,
.v4-produto-card:focus-visible { background: #fafafa; }

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

.v4-produto-nome {
    font-size: .95rem;
    font-weight: 600;
    margin-bottom: 4px;
    line-height: 1.2;
}

.v4-produto-desc {
    font-size: .8rem;
    color: var(--v4-text-light);
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
}

.v4-produto-preco {
    font-size: .88rem;
    color: var(--v4-primary);
    font-weight: 700;
}

.v4-apartirde {
    font-weight: 400;
    font-size: .78rem;
    color: var(--v4-text-light);
    margin-right: 2px;
}

.v4-cashback-badge {
    display: inline-block;
    margin-top: 4px;
    padding: 2px 8px;
    border-radius: 20px;
    background: #fff8e1;
    border: 1px solid #f9a825;
    color: #e65100;
    font-size: .72rem;
    font-weight: 600;
    line-height: 1.4;
}

.v4-cashback-modal {
    margin-top: 8px;
    font-size: .82rem;
    padding: 4px 12px;
}

.v4-produto-img-wrap {
    flex: 0 0 90px;
    width: 90px;
    height: 90px;
    overflow: hidden;
    border-radius: 8px;
    background: #f0f0f0;
}

.v4-produto-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    display: block;
}

/* ── SACOLA BAR ─────────────────────────────────────────────────────────── */
.v4-sacola-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 200;
    padding: 8px 16px calc(8px + env(safe-area-inset-bottom));
    background: transparent;
}

.v4-sacola-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 14px 20px;
    background: var(--v4-primary);
    color: #fff;
    border: none;
    border-radius: var(--v4-radius);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(232,33,42,.4);
    transition: background .15s;
}

.v4-sacola-btn:hover { background: var(--v4-primary-dk); }

.v4-sacola-icon { font-size: 1.2rem; }

.v4-sacola-qtd {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    background: rgba(255,255,255,.25);
    border-radius: 50%;
    font-size: .8rem;
    font-weight: 700;
    padding: 0 4px;
}

.v4-sacola-label { flex: 1; text-align: left; }
.v4-sacola-total { margin-left: auto; }

/* ── MODAIS ─────────────────────────────────────────────────────────────── */
@keyframes v4-slide-up {
    from { transform: translateY(100%); }
    to   { transform: translateY(0); }
}

@keyframes v4-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.v4-modal {
    position: fixed;
    inset: 0;
    z-index: 500;
    background: rgba(0,0,0,.5);
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

/* Fundo escuro anima junto */
.v4-modal:not(.v4-hidden) {
    animation: v4-fade-in .2s ease;
}

/* Inner sobe de baixo — usa max-height relativo ao pai (evita bug 100vh iOS) */
.v4-modal:not(.v4-hidden) .v4-modal-inner {
    animation: v4-slide-up .32s cubic-bezier(.32,.72,0,1);
}

@media (min-width: 600px) {
    .v4-modal {
        align-items: center;
        justify-content: center;
        padding: 20px;
    }
    .v4-modal-inner {
        max-width: 520px;
        max-height: calc(100% - 40px);
        border-radius: var(--v4-radius) !important;
    }
    /* Slide-up vira fade+scale no desktop */
    .v4-modal:not(.v4-hidden) .v4-modal-inner {
        animation: v4-modal-pop .25s cubic-bezier(.34,1.56,.64,1);
    }
}

.v4-modal-inner {
    position: relative;
    background: var(--v4-card);
    width: 100%;
    /* max-height relativo ao pai (position:fixed inset:0) evita o bug 100vh do iOS
       onde 100vh usa a large viewport (barra de URL recolhida) e corta o topo */
    max-height: calc(100% - 40px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--v4-radius) var(--v4-radius) 0 0;
    display: flex;
    flex-direction: column;
    /* Espaço extra para notch/home indicator no iPhone */
    padding-bottom: env(safe-area-inset-bottom);
}

.v4-modal-fechar {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 10;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: rgba(0,0,0,.12);
    color: var(--v4-text);
    font-size: 1.3rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ── UTILITÁRIOS ────────────────────────────────────────────────────────── */
.v4-hidden { display: none !important; }

/* CTA Adicionar — bloqueado até extras válidos */
.v4-cta-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 16px;
    background: var(--v4-primary);
    color: #fff;
    border: none;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    border-radius: 8px;
    transition: background .15s, opacity .15s;
}

.v4-cta-btn:disabled,
.v4-cta-btn[disabled] {
    background: #ccc;
    opacity: .7;
    cursor: not-allowed;
}

.v4-cta-btn:not(:disabled):hover { background: var(--v4-primary-dk); }

/* Grupos de extras */
.v4-extra-grupo { margin-bottom: 16px; }
.v4-extra-titulo {
    font-size: .9rem;
    font-weight: 700;
    padding: 12px 16px 8px;
    border-bottom: 1px solid #f2f2f2;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.v4-extra-badge {
    font-size: .72rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 20px;
}
.v4-extra-badge.obrigatorio { background: #e53935; color: #fff; }
.v4-extra-badge.opcional    { background: #ebebeb; color: var(--v4-text-light); }

.v4-extra-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    border-bottom: 1px solid #f9f9f9;
    cursor: pointer;
}

.v4-extra-item:hover { background: #fafafa; }

.v4-extra-desc { flex: 1; font-size: .88rem; }
.v4-extra-preco { font-size: .85rem; color: var(--v4-text-light); }

/* Stepper (modoqtdw) */
.v4-stepper {
    display: flex;
    align-items: center;
    gap: 8px;
}
.v4-stepper-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid var(--v4-primary);
    background: #fff;
    color: var(--v4-primary);
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .12s, color .12s;
}
.v4-stepper-btn:hover { background: var(--v4-primary); color: #fff; }
.v4-stepper-val { font-size: .9rem; font-weight: 700; min-width: 20px; text-align: center; }

/* Quantidade do produto */
.v4-qty-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 16px;
}
.v4-qty-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid var(--v4-primary);
    background: #fff;
    color: var(--v4-primary);
    font-size: 1.3rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.v4-qty-num { font-size: 1.1rem; font-weight: 700; min-width: 32px; text-align: center; }

/* Itens da sacola */
.v4-sacola-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid #f2f2f2;
}
.v4-sacola-item-info { flex: 1; }
.v4-sacola-item-nome { font-size: .9rem; font-weight: 600; }
.v4-sacola-item-obs  { font-size: .78rem; color: var(--v4-text-light); margin-top: 4px; }
.v4-sacola-item-preco { font-size: .9rem; font-weight: 700; color: var(--v4-primary); white-space: nowrap; }
.v4-sacola-remover {
    background: none;
    border: none;
    color: #ccc;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0 4px;
}
.v4-sacola-remover:hover { color: #e53935; }

/* Rodapé da sacola */
.v4-sacola-footer {
    padding: 16px;
    border-top: 1px solid #ebebeb;
    background: #fff;
    position: sticky;
    bottom: 0;
}
.v4-sacola-subtotal {
    display: flex;
    justify-content: space-between;
    font-weight: 700;
    margin-bottom: 12px;
    font-size: .95rem;
}
.v4-sacola-continuar {
    composes: v4-cta-btn;
    width: 100%;
    padding: 16px;
    background: var(--v4-primary);
    color: #fff;
    border: none;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    border-radius: 8px;
}

/* Container de imagem do modal — altura fixa independente da resolução original */
.v4-modal-img-container {
    width: 100%;
    height: 260px;          /* altura fixa para qualquer resolução */
    overflow: hidden;
    background: #f0f0f0;    /* placeholder enquanto carrega */
    flex-shrink: 0;
}

@media (min-height: 700px) {
    .v4-modal-img-container { height: 300px; }
}

/* Imagem fill no container — recorta e centraliza */
.v4-modal-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    display: block;
    /* Suaviza o carregamento */
    transition: opacity .2s;
}

.v4-modal-img[data-loading] { opacity: 0; }
.v4-modal-img.loaded         { opacity: 1; }
.v4-modal-produto-info {
    padding: 16px 16px 0;
}
.v4-modal-produto-nome {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 6px;
}
.v4-modal-produto-desc {
    font-size: .88rem;
    color: var(--v4-text-light);
    line-height: 1.5;
    margin-bottom: 12px;
}
.v4-modal-produto-preco {
    font-size: 1rem;
    font-weight: 700;
    color: var(--v4-primary);
    margin-bottom: 8px;
}

/* Conteúdo scrollável dentro do modal (cresce para preencher) */
.v4-modal-scroll {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    /* Espaço para o botão fechar absoluto */
    padding-top: 8px;
}

/* Sticky CTA ao fundo do modal */
.v4-modal-cta-wrap {
    position: sticky;
    bottom: 0;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    background: #fff;
    border-top: 1px solid #f2f2f2;
    margin-top: auto;
}

/* Campo de observação do produto */
.v4-obs-wrap {
    padding: 16px 16px 8px;
    border-top: 6px solid var(--v4-bg);
}

.v4-obs-label {
    display: block;
    font-size: .9rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--v4-text);
}

.v4-obs-sublabel {
    font-size: .78rem;
    font-weight: 400;
    color: var(--v4-text-light);
    margin-left: 4px;
}

.v4-obs-textarea {
    width: 100%;
    min-height: 72px;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: .88rem;
    font-family: inherit;
    color: var(--v4-text);
    resize: none;
    background: #fafafa;
    transition: border-color .15s;
    box-sizing: border-box;
}

.v4-obs-textarea:focus {
    outline: none;
    border-color: var(--v4-primary);
    background: #fff;
}

.v4-obs-textarea::placeholder { color: #bbb; }

/* ── STATUS BADGE (aberta/fechada) ──────────────────────────────────────── */

.v4-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .02em;
    white-space: nowrap;
}
.v4-status-badge.aberta  { background: #e6f4ea; color: #1a7a1a; }
.v4-status-badge.aberta::before  { content: '●'; font-size: .55rem; }
.v4-status-badge.fechada { background: #fce8e8; color: #c0392b; }
.v4-status-badge.fechada::before { content: '●'; font-size: .55rem; }

/* ── PAINEL DA LOJA (refatorado) ─────────────────────────────────────────── */

.v4-painel-clicavel {
    cursor: pointer;
    transition: background .15s;
}
.v4-painel-clicavel:hover  { background: #f0f0f0; }
.v4-painel-clicavel:active { background: #e8e8e8; }

.v4-painel-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
}

.v4-painel-endereco {
    font-size: .82rem;
    color: var(--v4-text-light);
    margin-top: 2px;
}

.v4-painel-horarios-fechada {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-top: 6px;
}

.v4-horario-linha {
    font-size: .8rem;
    color: var(--v4-text-light);
}

.v4-painel-ver-mais {
    font-size: .78rem;
    color: var(--v4-primary);
    margin-top: 6px;
    font-weight: 600;
}

/* ── MODAL INFO DA LOJA ──────────────────────────────────────────────────── */

.v4-loja-modal-wrap {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.v4-loja-modal-logo-wrap {
    display: flex;
    justify-content: center;
}

.v4-loja-modal-logo {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #f0f0f0;
}

.v4-loja-modal-nome {
    font-size: 1.15rem;
    font-weight: 700;
    text-align: center;
    color: var(--v4-text);
}

.v4-loja-modal-status {
    display: flex;
    justify-content: center;
}

.v4-loja-modal-secao {
    border-top: 1px solid #f2f2f2;
    padding-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.v4-loja-modal-secao-titulo {
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--v4-text-light);
}

.v4-loja-modal-secao-corpo {
    font-size: .92rem;
    color: var(--v4-text);
    line-height: 1.4;
}

.v4-loja-modal-tel {
    color: var(--v4-primary);
    text-decoration: none;
    font-weight: 600;
}

.v4-loja-modal-horario-linha {
    display: flex;
    justify-content: space-between;
    font-size: .88rem;
    padding: 3px 0;
    border-bottom: 1px solid #fafafa;
}

.v4-loja-modal-horario-dia {
    color: var(--v4-text-light);
    font-weight: 600;
    min-width: 80px;
}

.v4-loja-modal-mapa-wrap {
    width: 100%;
    height: 200px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e0e0e0;
}

.v4-loja-modal-mapa {
    width: 100%;
    height: 100%;
    border: none;
}

.v4-loja-modal-gmaps-btn {
    display: block;
    text-align: center;
    font-size: .85rem;
    color: var(--v4-primary);
    font-weight: 600;
    text-decoration: none;
    padding: 6px 0;
}

/* ── CHECKOUT (Sprint 4.5 / 5) ──────────────────────────────────────────── */

.v4-checkout-wrap {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.v4-checkout-titulo {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--v4-text);
}

.v4-checkout-voltar {
    background: none;
    border: none;
    color: var(--v4-primary);
    font-size: .9rem;
    cursor: pointer;
    padding: 0;
    align-self: flex-start;
}

.v4-checkout-opcoes {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.v4-checkout-opcao-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border: 1.5px solid #e0e0e0;
    border-radius: var(--v4-radius);
    background: #fff;
    cursor: pointer;
    font-size: .95rem;
    font-weight: 600;
    color: var(--v4-text);
    text-align: left;
    transition: border-color .15s, box-shadow .15s;
}

.v4-checkout-opcao-btn:hover {
    border-color: var(--v4-primary);
    box-shadow: 0 0 0 2px rgba(232,33,42,.12);
}

.v4-checkout-opcao-icon {
    font-size: 1.3rem;
    width: 28px;
    text-align: center;
    flex-shrink: 0;
}

.v4-checkout-pagamentos {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.v4-form-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.v4-form-label {
    font-size: .8rem;
    font-weight: 600;
    color: var(--v4-text-light);
    text-transform: uppercase;
    letter-spacing: .02em;
}

.v4-form-input {
    padding: 10px 12px;
    border: 1.5px solid #e0e0e0;
    border-radius: 8px;
    font-size: .92rem;
    font-family: inherit;
    color: var(--v4-text);
    background: #fafafa;
    transition: border-color .15s;
    width: 100%;
}

.v4-form-input:focus {
    outline: none;
    border-color: var(--v4-primary);
    background: #fff;
}

.v4-checkout-resumo {
    display: flex;
    justify-content: space-between;
    font-size: .9rem;
    color: var(--v4-text-light);
    padding: 4px 0;
    border-bottom: 1px solid #f2f2f2;
}

.v4-checkout-total {
    font-weight: 700;
    font-size: 1rem;
    color: var(--v4-text);
    border-bottom: none;
    padding-top: 8px;
}

.v4-checkout-frete-info {
    font-size: .85rem;
    min-height: 16px;
}

/* ── PIX ─────────────────────────────────────────────────────────────────── */
.v4-pix-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 40px 16px;
    color: var(--v4-text-light);
}

.v4-spinner {
    width: 36px;
    height: 36px;
    border: 4px solid #e0e0e0;
    border-top-color: var(--v4-primary);
    border-radius: 50%;
    animation: v4-spin .8s linear infinite;
}

@keyframes v4-spin { to { transform: rotate(360deg); } }

.v4-pix-instrucao {
    font-size: .9rem;
    color: var(--v4-text-light);
    margin-bottom: 8px;
    line-height: 1.5;
}

.v4-pix-qrcode-wrap {
    display: flex;
    justify-content: center;
    margin: 16px 0;
    padding: 14px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.v4-pix-qrcode-wrap canvas,
.v4-pix-qrcode-wrap img {
    display: block;
    max-width: 240px;
    max-height: 240px;
}

.v4-pix-copy-btn {
    width: 100%;
    padding: 12px;
    background: #00897b;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: .95rem;
    font-weight: 600;
    cursor: pointer;
}

.v4-pix-copy-btn:active { background: #00695c; }

.v4-pix-aviso {
    font-size: .82rem;
    color: var(--v4-text-light);
    text-align: center;
    margin: 4px 0;
}

.v4-pix-status-aguard {
    text-align: center;
    padding: 10px;
    font-size: .88rem;
    color: #666;
    background: #f5f5f5;
    border-radius: 8px;
    margin-top: 12px;
}


.v4-pix-status-pago {
    text-align: center;
    padding: 12px;
    font-size: .95rem;
    font-weight: 600;
    color: #1a7a1a;
    background: #e6f4ea;
    border-radius: 8px;
    margin-top: 12px;
}

.v4-pix-fechar-btn {
    width: 100%;
    padding: 14px;
    background: #fff;
    border: 1.5px solid #ddd;
    border-radius: 8px;
    font-size: .95rem;
    color: #555;
    cursor: pointer;
}

.v4-pix-fechar-btn:active { background: #f5f5f5; }

.v4-erro-msg {
    color: #c0392b;
    font-size: .9rem;
    padding: 12px;
    background: #fce8e8;
    border-radius: 8px;
    text-align: center;
}

.v4-form-erros {
    background: #fce8e8;
    border-left: 3px solid #c0392b;
    border-radius: 6px;
    padding: 10px 12px;
    margin-bottom: 8px;
}

.v4-form-erros p {
    margin: 0 0 4px;
    font-size: .85rem;
    color: #c0392b;
}

.v4-form-erros p:last-child { margin-bottom: 0; }

/* ── Cartão de crédito ───────────────────────────────────────────────────── */
.v4-card-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   DESKTOP / TABLET  —  não altera nenhum estilo mobile (< 768px)
   ═══════════════════════════════════════════════════════════════════════════ */

@keyframes v4-modal-pop {
    from { opacity: 0; transform: scale(.94); }
    to   { opacity: 1; transform: scale(1); }
}

/* ── Tablet (768px+): layout centralizado, grid 2 colunas ─────────────── */
@media (min-width: 768px) {
    html { background: #d9d9d9; }

    body.v4-body {
        max-width: 900px;
        margin: 0 auto;
        box-shadow: 0 0 40px rgba(0,0,0,.18);
        background: var(--v4-bg);
        /* remove padding-bottom extra; sacola fica dentro do container */
        padding-bottom: 80px;
    }

    :root { --v4-header-h: 280px; }

    .v4-logo { width: 96px; height: 96px; }
    .v4-logo-wrap { bottom: -44px; left: 24px; }
    .v4-painel { padding: 56px 24px 16px; }

    /* Grid de 2 colunas nos produtos */
    .v4-produtos-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }
    .v4-produto-card {
        border-top: 1px solid #f2f2f2;
        border-left: 1px solid #f2f2f2;
    }

    /* Sacola bar: contida no container centralizado */
    .v4-sacola-bar {
        max-width: 900px;
        left: 50%;
        right: auto;
        transform: translateX(-50%);
        width: 100%;
        border-radius: var(--v4-radius) var(--v4-radius) 0 0;
        overflow: hidden;
    }
    .v4-sacola-btn { border-radius: 0; }
}

/* ── Desktop (1024px+): sidebar esquerda + conteúdo direita ───────────── */
@media (min-width: 1024px) {
    body.v4-body {
        max-width: 1100px;
        display: grid;
        /* col 1 = sidebar 268px | col 2 = conteúdo */
        grid-template-columns: 268px 1fr;
        align-items: start;
        padding-bottom: 0;
    }

    /* Header ocupa as duas colunas */
    #v4-header { grid-column: 1 / -1; }

    /* Painel da loja: sidebar, linha 2 */
    #v4-painel {
        grid-column: 1;
        border-bottom: none;
        border-right: 1px solid #ebebeb;
        padding-top: 52px;
    }

    /* Tabs: sidebar, linha 3 — sticky para toda a extensão do catálogo */
    #v4-tabs-nav {
        grid-column: 1;
        position: sticky;
        top: 0;
        align-self: start;
        border-bottom: none;
        border-right: 1px solid #ebebeb;
        box-shadow: none;
    }
    #v4-tabs-nav .v4-tabs-list {
        flex-direction: column;
        overflow-x: visible;
        overflow-y: auto;
        height: auto;
        max-height: 100vh;
        padding: 8px 0;
        gap: 2px;
        align-items: stretch;
    }
    #v4-tabs-nav .v4-tab-item { width: 100%; }
    #v4-tabs-nav .v4-tab-btn {
        width: 100%;
        text-align: left;
        border-radius: 0;
        padding: 11px 20px;
        font-size: .88rem;
        white-space: normal;
        border-left: 3px solid transparent;
        background: transparent;
    }
    #v4-tabs-nav .v4-tab-item.v4-tab-active .v4-tab-btn,
    #v4-tabs-nav .v4-tab-btn:hover {
        background: #fdecea;
        color: var(--v4-primary);
        border-left-color: var(--v4-primary);
    }

    /* Destaques e catálogo: coluna direita (auto-placement) */
    .v4-destaques { grid-column: 2; }
    #v4-catalogo  { grid-column: 2; }

    /* Sacola bar: centrada no container */
    .v4-sacola-bar { max-width: 1100px; }

    /* Ajustes visuais no conteúdo direito */
    .v4-categoria-titulo {
        font-size: 1.05rem;
        padding: 18px 20px 10px;
        border-bottom: 1px solid #f0f0f0;
    }
    .v4-produto-card { padding: 14px 20px; }
    .v4-produto-img-wrap { flex: 0 0 100px; width: 100px; height: 100px; }
    .v4-produto-nome { font-size: 1rem; }
    .v4-produto-desc { -webkit-line-clamp: 3; }
    .v4-logo { width: 104px; height: 104px; }
    .v4-logo-wrap { bottom: -48px; }
    /* Sem tab sticky no topo da coluna direita */
    .v4-categoria-section { scroll-margin-top: 8px; }
}

