/* ==========================================================================
   Açaí do Sandrinho — estilos do cardápio e do acompanhamento de pedidos
   Paleta tirada do cardápio impresso: roxo açaí, rosa e verde-limão.
   ========================================================================== */

:root {
    --purple-900: #2a0c40;
    --purple-800: #3b1556;
    --purple-700: #521f74;
    --purple-100: #f1e8f8;
    --purple-50: #faf6fd;
    --pink: #e3137f;
    --pink-dark: #b80d66;
    --lime: #b6e22e;
    --lime-dark: #4f6b00;
    --ink: #24132f;
    --muted: #6d5c78;
    --line: #e6dcee;
    --white: #ffffff;
    --danger: #c62828;
    --success: #2e7d32;

    --radius-sm: 8px;
    --radius: 14px;
    --radius-lg: 20px;
    --shadow: 0 6px 20px rgba(42, 12, 64, 0.12);

    --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-display: ui-rounded, "SF Pro Rounded", "Arial Rounded MT Bold", "Nunito", var(--font);

    --bottom-bar-height: 72px;
}

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

html {
    -webkit-text-size-adjust: 100%;
    scroll-padding-top: 120px;
}

body {
    margin: 0;
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.45;
    color: var(--ink);
    background: var(--purple-50);
    padding-bottom: calc(var(--bottom-bar-height) + env(safe-area-inset-bottom));
}

img {
    max-width: 100%;
    display: block;
}

a {
    color: var(--purple-700);
}

button,
input,
select,
textarea {
    font: inherit;
    color: inherit;
}

:focus-visible {
    outline: 3px solid var(--pink);
    outline-offset: 2px;
}

[hidden] {
    display: none !important;
}

.visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.skip-link {
    position: absolute;
    left: 12px;
    top: -60px;
    z-index: 100;
    padding: 10px 14px;
    background: var(--white);
    border-radius: var(--radius-sm);
}

.skip-link:focus {
    top: 12px;
}

/* --------------------------------------------------------------------------
   Cabeçalho da loja
   -------------------------------------------------------------------------- */

.store-header {
    color: var(--white);
    background:
        radial-gradient(circle at 85% 10%, rgba(227, 19, 127, 0.35), transparent 45%),
        radial-gradient(circle at 10% 90%, rgba(182, 226, 46, 0.18), transparent 40%),
        var(--purple-800);
}

.store-header__inner {
    max-width: 960px;
    margin: 0 auto;
    padding: 28px 20px 24px;
}

.brand {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0 8px;
    font-family: var(--font-display);
    font-weight: 900;
    line-height: 0.95;
    transform: rotate(-3deg);
    transform-origin: left center;
}

.brand__acai {
    font-size: 3rem;
    color: var(--white);
    text-shadow: 3px 3px 0 var(--lime);
}

.brand__do {
    font-size: 1.6rem;
    color: var(--pink);
}

.brand__name {
    font-size: 1.9rem;
    color: var(--lime);
}

.store-header__slogan {
    margin: 14px 0 16px;
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 700;
    color: #f3e6ff;
}

.store-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.status-pill,
.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 32px;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 0.875rem;
    font-weight: 700;
}

.chip {
    background: rgba(255, 255, 255, 0.12);
    color: var(--white);
}

.status-pill {
    background: rgba(255, 255, 255, 0.12);
}

.status-pill::before {
    content: "";
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #bbb;
}

.status-pill[data-open="true"] {
    background: var(--lime);
    color: var(--purple-900);
}

.status-pill[data-open="true"]::before {
    background: var(--lime-dark);
}

.status-pill[data-open="false"] {
    background: #ffd5d5;
    color: #7a0d0d;
}

.status-pill[data-open="false"]::before {
    background: var(--danger);
}

.store-header__address {
    margin: 14px 0 0;
    font-size: 0.875rem;
    color: #e2d2ee;
}

.closed-banner {
    padding: 12px 20px;
    text-align: center;
    font-weight: 600;
    background: #fff1f1;
    color: #7a0d0d;
    border-bottom: 1px solid #f3caca;
}

/* --------------------------------------------------------------------------
   Navegação por categorias (fixa no topo ao rolar)
   -------------------------------------------------------------------------- */

.category-nav {
    position: sticky;
    top: 0;
    z-index: 20;
    background: var(--white);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 2px 10px rgba(42, 12, 64, 0.06);
}

.category-nav__search {
    max-width: 960px;
    margin: 0 auto;
    padding: 10px 16px 4px;
}

.category-nav__search input {
    width: 100%;
    min-height: 42px;
    padding: 8px 14px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--purple-50);
}

.category-nav__tabs {
    display: flex;
    gap: 4px;
    max-width: 960px;
    margin: 0 auto;
    padding: 4px 12px 0;
    overflow-x: auto;
    scrollbar-width: none;
}

.category-nav__tabs::-webkit-scrollbar {
    display: none;
}

.category-tab {
    flex: none;
    padding: 10px 12px 12px;
    border: 0;
    border-bottom: 3px solid transparent;
    background: none;
    font-weight: 600;
    color: var(--muted);
    white-space: nowrap;
    cursor: pointer;
}

.category-tab[aria-current="true"] {
    color: var(--purple-800);
    border-bottom-color: var(--pink);
}

/* --------------------------------------------------------------------------
   Lista de produtos
   -------------------------------------------------------------------------- */

.menu {
    max-width: 960px;
    margin: 0 auto;
    padding: 8px 16px 24px;
}

.menu:focus {
    outline: none;
}

.menu__state {
    padding: 48px 16px;
    text-align: center;
    color: var(--muted);
}

.menu-section {
    padding-top: 20px;
}

.menu-section__title {
    margin: 0 0 12px;
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--purple-800);
}

.product-grid {
    display: grid;
    gap: 12px;
}

@media (min-width: 720px) {
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.product-card {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
    align-items: center;
    width: 100%;
    padding: 14px;
    text-align: left;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--white);
    cursor: pointer;
    transition: box-shadow 0.15s, transform 0.15s;
}

.product-card--photo {
    grid-template-columns: 1fr 104px;
}

.product-card:hover {
    box-shadow: var(--shadow);
}

.product-card:active {
    transform: scale(0.99);
}

.product-card__name {
    margin: 0;
    font-weight: 700;
    font-size: 1rem;
}

.product-card__description {
    display: -webkit-box;
    margin: 4px 0 8px;
    overflow: hidden;
    font-size: 0.875rem;
    color: var(--muted);
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.product-card__price {
    font-weight: 800;
    color: var(--purple-700);
}

.product-card__price small {
    font-weight: 600;
    color: var(--muted);
}

.product-thumb {
    width: 104px;
    height: 104px;
    border-radius: var(--radius-sm);
    object-fit: cover;
}

.empty-search {
    padding: 32px 0;
    text-align: center;
    color: var(--muted);
}

/* --------------------------------------------------------------------------
   Rodapé e barra inferior
   -------------------------------------------------------------------------- */

.site-footer {
    max-width: 960px;
    margin: 0 auto;
    padding: 24px 16px 32px;
    font-size: 0.875rem;
    color: var(--muted);
    text-align: center;
}

.site-footer p {
    margin: 4px 0;
}

.bottom-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 30;
    display: flex;
    gap: 10px;
    align-items: center;
    max-width: 960px;
    margin: 0 auto;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
    background: var(--white);
    border-top: 1px solid var(--line);
}

.bottom-bar__orders {
    display: inline-flex;
    align-items: center;
    min-height: 48px;
    padding: 0 14px;
    border-radius: var(--radius);
    font-weight: 700;
    text-decoration: none;
    color: var(--purple-800);
    background: var(--purple-100);
}

.bottom-bar__cart {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 48px;
    padding: 0 16px;
    border: 0;
    border-radius: var(--radius);
    font-weight: 800;
    color: var(--white);
    background: var(--pink);
    white-space: nowrap;
    cursor: pointer;
}

.bottom-bar__count {
    display: inline-grid;
    place-items: center;
    min-width: 26px;
    height: 26px;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--white);
    color: var(--pink-dark);
    font-size: 0.875rem;
}

/* --------------------------------------------------------------------------
   Folhas (dialog) de produto e carrinho
   -------------------------------------------------------------------------- */

.sheet {
    width: 100%;
    max-width: 560px;
    height: 100%;
    max-height: 100%;
    margin: 0 auto;
    padding: 0;
    border: 0;
    background: var(--white);
    color: var(--ink);
}

.sheet::backdrop {
    background: rgba(30, 8, 46, 0.55);
}

@media (min-width: 640px) {
    .sheet {
        height: auto;
        max-height: 92vh;
        margin: 4vh auto;
        border-radius: var(--radius-lg);
        box-shadow: var(--shadow);
    }
}

.sheet__layout {
    display: flex;
    flex-direction: column;
    height: 100%;
    max-height: inherit;
}

.sheet__body {
    flex: 1;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.sheet__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--line);
}

.sheet__header h2 {
    margin: 0;
    font-size: 1.15rem;
}

.sheet__close {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 50%;
    background: var(--purple-100);
    font-size: 1.4rem;
    line-height: 1;
    color: var(--purple-800);
    cursor: pointer;
}

.sheet__image-wrap {
    position: relative;
}

.sheet__image {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
}

.sheet__image-wrap .sheet__close {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(255, 255, 255, 0.92);
}

.sheet__intro {
    padding: 16px;
}

.sheet__intro h2 {
    margin: 0 0 6px;
    font-family: var(--font-display);
    font-size: 1.45rem;
    color: var(--purple-800);
}

.sheet__intro p {
    margin: 0;
    color: var(--muted);
}

.sheet__footer {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    background: var(--white);
}

/* Grupo de opções */

.option-group {
    margin: 0;
    padding: 0;
    border: 0;
}

.option-group__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    padding: 12px 16px;
    background: var(--purple-100);
}

.option-group__head legend,
.option-group__title {
    padding: 0;
    font-weight: 800;
}

.option-group__hint {
    display: block;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--muted);
}

.badge {
    flex: none;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 800;
    background: var(--purple-800);
    color: var(--white);
}

.badge--ok {
    background: var(--lime);
    color: var(--purple-900);
}

.option-row {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 52px;
    padding: 8px 16px;
    border-bottom: 1px solid var(--line);
    cursor: pointer;
}

.option-row input {
    width: 22px;
    height: 22px;
    flex: none;
    accent-color: var(--pink);
}

.option-row__name {
    flex: 1;
}

.option-row__price {
    font-weight: 700;
    color: var(--purple-700);
    white-space: nowrap;
}

.option-row:has(input:disabled:not(:checked)) {
    opacity: 0.45;
    cursor: not-allowed;
}

.field {
    display: block;
    padding: 12px 16px;
}

.field__label {
    display: block;
    margin-bottom: 6px;
    font-weight: 700;
}

.field__input {
    width: 100%;
    min-height: 46px;
    padding: 10px 12px;
    border: 1px solid #cdbfd8;
    border-radius: var(--radius-sm);
    background: var(--white);
}

textarea.field__input {
    min-height: 76px;
    resize: vertical;
}

.field__input[aria-invalid="true"] {
    border-color: var(--danger);
    box-shadow: 0 0 0 1px var(--danger);
}

.field__error {
    display: block;
    margin-top: 4px;
    font-size: 0.875rem;
    color: var(--danger);
}

/* Contador de quantidade */

.stepper {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--purple-50);
}

.stepper button {
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 50%;
    background: none;
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--purple-800);
    cursor: pointer;
}

.stepper button:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.stepper output {
    min-width: 28px;
    text-align: center;
    font-weight: 800;
}

.stepper--small button {
    width: 34px;
    height: 34px;
    font-size: 1.1rem;
}

/* Botões */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
    padding: 10px 18px;
    border: 0;
    border-radius: var(--radius);
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
}

.btn--primary {
    flex: 1;
    justify-content: space-between;
    background: var(--pink);
    color: var(--white);
}

.btn--primary:hover {
    background: var(--pink-dark);
}

.btn--primary:disabled {
    background: #c9b7d4;
    cursor: not-allowed;
}

.btn--ghost {
    background: var(--purple-100);
    color: var(--purple-800);
}

.btn--whatsapp {
    background: #1f9d55;
    color: var(--white);
}

.btn--block {
    width: 100%;
    justify-content: center;
}

/* --------------------------------------------------------------------------
   Carrinho
   -------------------------------------------------------------------------- */

.cart-item {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 6px 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--line);
}

.cart-item__name {
    margin: 0;
    font-weight: 700;
}

.cart-item__details {
    margin: 2px 0 0;
    font-size: 0.875rem;
    color: var(--muted);
}

.cart-item__price {
    font-weight: 800;
    text-align: right;
}

.cart-item__actions {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.link-button {
    padding: 6px 0;
    border: 0;
    background: none;
    font-weight: 700;
    color: var(--danger);
    cursor: pointer;
}

.section-title {
    margin: 0;
    padding: 16px 16px 4px;
    font-size: 1rem;
    font-weight: 800;
    color: var(--purple-800);
}

.segmented {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
    gap: 8px;
    padding: 8px 16px;
}

.segmented label {
    position: relative;
}

.segmented input {
    position: absolute;
    opacity: 0;
}

.segmented span {
    display: grid;
    place-items: center;
    min-height: 48px;
    padding: 6px 8px;
    border: 2px solid var(--line);
    border-radius: var(--radius-sm);
    font-weight: 700;
    text-align: center;
    cursor: pointer;
}

.segmented input:checked + span {
    border-color: var(--pink);
    background: #fdeaf4;
    color: var(--pink-dark);
}

.segmented input:focus-visible + span {
    outline: 3px solid var(--pink);
    outline-offset: 2px;
}

.totals {
    margin: 8px 16px 16px;
    padding: 14px;
    border-radius: var(--radius);
    background: var(--purple-50);
}

.totals__row {
    display: flex;
    justify-content: space-between;
    padding: 3px 0;
}

.totals__row--total {
    margin-top: 6px;
    padding-top: 8px;
    border-top: 1px solid var(--line);
    font-size: 1.15rem;
    font-weight: 800;
}

.form-alert {
    margin: 12px 16px 0;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    background: #fff1f1;
    color: #7a0d0d;
    font-weight: 600;
}

.notice {
    margin: 0 16px 12px;
    font-size: 0.875rem;
    color: var(--muted);
}

/* --------------------------------------------------------------------------
   Acompanhamento do pedido
   -------------------------------------------------------------------------- */

.page {
    max-width: 640px;
    margin: 0 auto;
    padding: 20px 16px 40px;
}

.page-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    color: var(--white);
    background: var(--purple-800);
}

.page-top a {
    color: var(--white);
    font-weight: 700;
    text-decoration: none;
}

.page-top .brand__acai {
    font-size: 1.6rem;
    text-shadow: 2px 2px 0 var(--lime);
}

.page-top .brand__do {
    font-size: 1rem;
}

.page-top .brand__name {
    font-size: 1.15rem;
}

.card {
    margin-bottom: 14px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--white);
}

.order-hero {
    text-align: center;
}

.order-hero__number {
    margin: 0;
    font-family: var(--font-display);
    font-size: 2.6rem;
    font-weight: 900;
    color: var(--purple-800);
}

.order-hero__status {
    display: inline-block;
    margin-top: 6px;
    padding: 6px 14px;
    border-radius: 999px;
    font-weight: 800;
    background: var(--purple-100);
    color: var(--purple-800);
}

.order-hero__status[data-status="confirmado"],
.order-hero__status[data-status="saiu_entrega"],
.order-hero__status[data-status="pronto_retirada"] {
    background: var(--lime);
    color: var(--purple-900);
}

.order-hero__status[data-status="entregue"] {
    background: #dff3e1;
    color: var(--success);
}

.order-hero__status[data-status="cancelado"] {
    background: #ffe0e0;
    color: var(--danger);
}

.countdown {
    margin: 16px 0 0;
}

.countdown__value {
    display: block;
    font-family: var(--font-display);
    font-size: 3rem;
    font-weight: 900;
    font-variant-numeric: tabular-nums;
    color: var(--pink);
}

.countdown__label {
    color: var(--muted);
}

.steps {
    display: grid;
    gap: 0;
    margin: 0;
    padding: 0;
    list-style: none;
}

.steps li {
    position: relative;
    padding: 0 0 18px 34px;
    color: var(--muted);
}

.steps li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 2px;
    width: 20px;
    height: 20px;
    border: 3px solid var(--line);
    border-radius: 50%;
    background: var(--white);
}

.steps li::after {
    content: "";
    position: absolute;
    left: 9px;
    top: 24px;
    bottom: 0;
    width: 2px;
    background: var(--line);
}

.steps li:last-child::after {
    display: none;
}

.steps li[data-state="done"],
.steps li[data-state="current"] {
    color: var(--ink);
    font-weight: 700;
}

.steps li[data-state="done"]::before {
    border-color: var(--lime-dark);
    background: var(--lime);
}

.steps li[data-state="current"]::before {
    border-color: var(--pink);
    background: #fdeaf4;
}

.steps small {
    display: block;
    font-weight: 500;
    color: var(--muted);
}

.order-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.order-list li {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
}

.order-list a {
    font-weight: 700;
}

/* --------------------------------------------------------------------------
   Avisos flutuantes
   -------------------------------------------------------------------------- */

.toast-region {
    position: fixed;
    left: 50%;
    bottom: calc(var(--bottom-bar-height) + 16px);
    z-index: 200;
    display: grid;
    gap: 8px;
    width: min(92vw, 420px);
    transform: translateX(-50%);
}

.toast {
    padding: 12px 16px;
    border-radius: var(--radius);
    font-weight: 600;
    color: var(--white);
    background: var(--purple-900);
    box-shadow: var(--shadow);
}

.toast--error {
    background: var(--danger);
}

.toast--success {
    background: var(--success);
}

@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
        scroll-behavior: auto !important;
    }
}
