:root {
    --banner-overlay-start: 0.66;
    --banner-overlay-end: 0.74;
    --primary: #171717;
    --accent: #f59e0b;
    --success: #16a34a;
    --danger: #dc2626;
    --bg: #f4f7fb;
    --surface: #ffffff;
    --surface-strong: #f8fafc;
    --text: #111827;
    --muted: #667085;
    --line: #e4e7ec;
    --shadow-soft: 0 18px 40px rgba(17, 24, 39, 0.14);
    --shadow-tight: 0 10px 24px rgba(17, 24, 39, 0.12);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: Arial, Helvetica, sans-serif;
    padding-bottom: 96px;
}

button,
input,
textarea,
select {
    font: inherit;
}

button {
    -webkit-tap-highlight-color: transparent;
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.65;
}

.hero {
    min-height: 248px;
    background: #171717;
    background-size: cover;
    background-position: center;
    color: #fff;
    position: relative;
}

.hero-overlay {
    min-height: 248px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 16px 16px 22px;
    background:
        linear-gradient(180deg, rgba(0, 0, 0, var(--banner-overlay-start)), rgba(0, 0, 0, var(--banner-overlay-end))),
        radial-gradient(circle at 18% 22%, rgba(0, 0, 0, calc(var(--banner-overlay-start) - 0.24)), rgba(0, 0, 0, calc(var(--banner-overlay-end) + 0.02)));
}

.hero-topbar,
.hero-content,
.app-shell,
.cart-dock button,
.cart-sheet {
    width: min(100%, 540px);
    margin-inline: auto;
}

.hero-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.brand-chip,
.status-pill,
.hero-meta span {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 0 11px;
    border-radius: 999px;
    border: 1px solid rgba(228, 231, 236, 0.9);
    background: rgba(255, 255, 255, 0.94);
    color: #344054;
    font-size: 12px;
    font-weight: 900;
    backdrop-filter: blur(12px);
}

.status-pill {
    border-color: rgba(22, 163, 74, 0.35);
    background: rgba(22, 163, 74, 0.92);
    color: #fff;
}

.status-pill.closed {
    border-color: rgba(220, 38, 38, 0.4);
    background: rgba(220, 38, 38, 0.88);
    color: #fff;
}

.hero-content {
    display: grid;
    grid-template-columns: 76px 1fr;
    align-items: end;
    gap: 13px;
    transform: translateY(18px);
}

.logo {
    width: 76px;
    height: 76px;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
    border: 2px solid rgba(255, 255, 255, 0.92);
    box-shadow: 0 12px 24px rgba(17, 24, 39, 0.18);
}

.logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-copy h1 {
    font-size: 27px;
    line-height: 1.04;
    letter-spacing: 0;
    font-weight: 900;
    text-wrap: balance;
    text-shadow: 0 4px 18px rgba(0, 0, 0, 0.72);
}

.hero-copy p {
    margin-top: 7px;
    color: rgba(255, 255, 255, 0.92);
    font-size: 14px;
    line-height: 1.4;
    text-shadow: 0 3px 14px rgba(0, 0, 0, 0.55);
}

.hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 11px;
}

.app-shell {
    padding: 18px 14px 24px;
}

.search-wrap {
    position: sticky;
    top: 0;
    z-index: 20;
    padding: 12px 0 10px;
    margin-top: -10px;
    background: linear-gradient(180deg, rgba(244, 247, 251, 0.98), rgba(244, 247, 251, 0.9));
    backdrop-filter: blur(12px);
}

.search-box {
    height: 58px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 16px;
    border-radius: 8px;
    background: var(--surface);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-tight);
}

.search-icon {
    color: var(--accent);
    font-size: 22px;
    line-height: 1;
}

.search-box input {
    width: 100%;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text);
    font-size: 16px;
    font-weight: 700;
}

.search-box input::placeholder {
    color: #98a2b3;
    font-weight: 600;
}

.categorias {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 10px 0 16px;
    scrollbar-width: none;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: 14px;
}

.categorias::-webkit-scrollbar {
    display: none;
}

.categorias button {
    min-height: 40px;
    flex: 0 0 auto;
    scroll-snap-align: start;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--text);
    border-radius: 999px;
    padding: 0 17px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 8px 18px rgba(17, 24, 39, 0.06);
}

.categorias button.active {
    border-color: var(--primary);
    background: var(--primary);
    color: #fff;
}

.lista-produtos {
    display: grid;
    gap: 16px;
}

.estado-vazio {
    padding: 28px 18px;
    border-radius: 8px;
    background: var(--surface);
    border: 1px solid var(--line);
    color: var(--muted);
    text-align: center;
    font-weight: 700;
}

.product-card {
    display: grid;
    grid-template-columns: 128px 1fr;
    gap: 14px;
    min-height: 158px;
    padding: 12px;
    border-radius: 14px;
    background: var(--surface);
    border: 0;
    box-shadow: 0 16px 34px rgba(17, 24, 39, 0.1);
    animation: cardIn 0.18s ease both;
}

@keyframes cardIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.product-photo {
    position: relative;
    height: 134px;
    min-height: 0;
    border-radius: 12px;
    overflow: hidden;
    background: linear-gradient(135deg, #111827, #374151);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 34px;
    font-weight: 900;
}

.product-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    max-width: calc(100% - 16px);
    padding: 5px 8px;
    border-radius: 999px;
    background: var(--accent);
    color: #111827;
    font-size: 11px;
    font-weight: 900;
}

.product-info {
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 10px;
}

.product-info h3 {
    color: var(--text);
    font-size: 18px;
    line-height: 1.15;
    font-weight: 900;
}

.product-info p {
    margin-top: 6px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.product-price {
    color: var(--primary);
    font-size: 20px;
    font-weight: 900;
    white-space: nowrap;
}

.btn-add {
    min-width: 98px;
    height: 42px;
    border: 0;
    border-radius: 10px;
    background: var(--primary);
    color: #fff;
    font-size: 14px;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(17, 24, 39, 0.18);
}

.btn-add.added {
    background: var(--success);
}

.btn-add:disabled {
    background: #98a2b3;
    color: #fff;
    box-shadow: none;
}

.product-card.closed-store .product-photo,
.product-card.closed-store .product-info {
    opacity: 0.72;
}

.product-card.closed-store .product-badge {
    display: none;
}

.cart-dock {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    padding: 12px 14px 16px;
    background: linear-gradient(180deg, rgba(244, 247, 251, 0), rgba(244, 247, 251, 0.96) 34%);
}

.cart-dock button,
.btn-primary {
    height: 58px;
    border: 0;
    border-radius: 8px;
    background: var(--primary);
    color: #fff;
    font-weight: 900;
    cursor: pointer;
    box-shadow: var(--shadow-soft);
}

.cart-dock button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0 18px;
    font-size: 16px;
}

.cart-dock strong {
    font-size: 14px;
    white-space: nowrap;
}

.cart-modal {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    background: rgba(15, 23, 42, 0.58);
    backdrop-filter: blur(8px);
}

.cart-sheet {
    max-height: 90vh;
    overflow-y: auto;
    padding: 10px 16px 18px;
    border-radius: 18px 18px 0 0;
    background: var(--surface);
    box-shadow: 0 -22px 48px rgba(17, 24, 39, 0.26);
}

.sheet-handle {
    width: 42px;
    height: 4px;
    border-radius: 999px;
    background: #d0d5dd;
    margin: 0 auto 12px;
}

.modal-topo {
    position: relative;
    min-height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 54px;
}

.modal-topo h2 {
    max-width: 100%;
    text-align: center;
    font-size: 20px;
    font-weight: 900;
    line-height: 1.15;
}

.modal-topo .icon-button {
    position: absolute;
    top: 2px;
}

#voltar-carrinho {
    left: 0;
}

#fechar-carrinho {
    right: 0;
}

.icon-button {
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 999px;
    background: var(--surface-strong);
    color: var(--text);
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
}

.checkout-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 16px 0;
}

.step {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #edf2f7;
    color: var(--muted);
    font-size: 13px;
    font-weight: 900;
}

.step.active,
.step.done {
    background: var(--primary);
    color: #fff;
}

.step-line {
    width: 74px;
    height: 3px;
    border-radius: 999px;
    background: var(--accent);
}

.cart-message {
    margin-bottom: 12px;
    padding: 12px;
    border-radius: 8px;
    background: #ecfdf3;
    color: #027a48;
    font-weight: 800;
    line-height: 1.35;
}

.cart-message.error {
    background: #fef3f2;
    color: #b42318;
}

.cart-item {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
}

.cart-item h3 {
    font-size: 15px;
    font-weight: 900;
}

.cart-item p {
    margin-top: 4px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.qty-control {
    display: grid;
    grid-template-columns: 34px 30px 34px;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface-strong);
    overflow: hidden;
}

.qty-control button {
    width: 34px;
    height: 34px;
    border: 0;
    background: transparent;
    color: var(--text);
    font-size: 20px;
    font-weight: 900;
    cursor: pointer;
}

.qty-control span {
    text-align: center;
    font-weight: 900;
}

.change-box {
    padding: 14px;
    border: 1px solid rgba(245, 158, 11, 0.22);
    border-radius: 18px;
    background: #fff8ed;
}

.change-box label {
    margin-bottom: 8px;
}

.change-box small {
    display: block;
    color: var(--text-muted);
    font-size: 12px;
}

.pix-box {
    display: grid;
    gap: 12px;
    padding: 14px;
    border-radius: 8px;
    border: 1px solid #bbf7d0;
    background: #f0fdf4;
}

.pix-box.error {
    border-color: #fecaca;
    background: #fef2f2;
}

.pix-box-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.pix-box-head strong {
    color: var(--text);
    font-size: 16px;
    font-weight: 900;
}

.pix-box-head span,
.pix-box small {
    color: #047857;
    font-size: 12px;
    font-weight: 800;
}

.pix-box.error .pix-box-head span,
.pix-box.error small {
    color: #b42318;
}

.pix-instructions {
    display: grid;
    gap: 4px;
    padding: 10px 12px;
    border-radius: 8px;
    background: #ffffff;
    border: 1px solid var(--line);
}

.pix-instructions strong {
    color: var(--text);
    font-size: 13px;
    font-weight: 900;
}

.pix-instructions span {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.35;
    font-weight: 700;
}

.pix-box img {
    width: min(100%, 220px);
    aspect-ratio: 1;
    justify-self: center;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: #fff;
    padding: 10px;
}

.pix-proof-note {
    display: grid;
    gap: 4px;
    padding: 11px;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.78);
    color: var(--text);
}

.pix-proof-note strong {
    font-size: 13px;
    font-weight: 900;
}

.pix-proof-note span {
    color: #047857;
    font-size: 12px;
    line-height: 1.35;
    font-weight: 800;
}

.pix-code {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    align-items: center;
}

.pix-code span {
    min-width: 0;
    min-height: 42px;
    display: flex;
    align-items: center;
    padding: 9px 10px;
    border-radius: 8px;
    background: #fff;
    border: 1px solid var(--line);
    color: var(--text);
    font-size: 12px;
    font-weight: 800;
    overflow-wrap: anywhere;
}

.pix-code button {
    height: 42px;
    border: 0;
    border-radius: 8px;
    padding: 0 13px;
    background: var(--success);
    color: #fff;
    font-size: 13px;
    font-weight: 900;
    cursor: pointer;
}

.modal-total {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 16px 0;
    padding: 14px;
    border-radius: 8px;
    background: var(--surface-strong);
    border: 1px solid var(--line);
}

.modal-total span {
    color: var(--muted);
    font-weight: 800;
}

.modal-total strong {
    color: var(--text);
    font-size: 22px;
    font-weight: 900;
}

.btn-primary {
    width: 100%;
    font-size: 16px;
}

.checkout {
    display: grid;
    gap: 12px;
}

.checkout label {
    display: grid;
    gap: 7px;
    color: var(--text);
    font-size: 13px;
    font-weight: 900;
}

.checkout input,
.checkout textarea,
.checkout select {
    width: 100%;
    min-height: 50px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-strong);
    color: var(--text);
    padding: 12px;
    outline: 0;
    font-size: 15px;
}

.checkout textarea {
    min-height: 78px;
    resize: vertical;
}

.checkout input:focus,
.checkout textarea:focus,
.checkout select:focus {
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(17, 24, 39, 0.08);
}

.toast-cart {
    position: fixed;
    left: 50%;
    bottom: 92px;
    z-index: 100;
    transform: translate(-50%, 14px);
    opacity: 0;
    pointer-events: none;
    padding: 11px 14px;
    border-radius: 999px;
    background: rgba(17, 24, 39, 0.94);
    color: #fff;
    font-size: 14px;
    font-weight: 900;
    transition: 0.18s ease;
    white-space: nowrap;
}

.toast-cart.visible {
    opacity: 1;
    transform: translate(-50%, 0);
}

[hidden] {
    display: none !important;
}

@media (min-width: 720px) {
    body {
        padding-bottom: 110px;
    }

    .hero,
    .hero-overlay {
        min-height: 330px;
    }

    .hero-copy h1 {
        font-size: 38px;
    }

    .lista-produtos {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .product-card {
        grid-template-columns: 1fr;
    }

    .product-photo {
        height: 190px;
        min-height: 0;
    }

    .cart-modal {
        justify-content: flex-end;
        align-items: stretch;
    }

    .cart-sheet {
        max-width: 430px;
        height: 100vh;
        max-height: 100vh;
        border-radius: 18px 0 0 18px;
    }
}

@media (max-width: 390px) {
    .hero-content {
        grid-template-columns: 70px 1fr;
    }

    .logo {
        width: 70px;
        height: 70px;
    }

    .product-card {
        grid-template-columns: 112px 1fr;
    }

    .product-photo {
        height: 126px;
        min-height: 0;
    }

    .btn-add {
        min-width: 86px;
        font-size: 13px;
    }
}
