/* Camada visual do cardápio público, carregada após os estilos legados. */

.categories { padding: 24px 0 10px; }
.categories-list { gap: 12px; padding: 5px 4px 14px; }
.category-item {
    width: auto;
    min-height: 54px;
    flex-direction: row;
    gap: 10px;
    padding: 7px 17px 7px 8px;
    border: 1px solid color-mix(in srgb, var(--border) 82%, transparent);
    border-radius: 999px;
    background: var(--surface);
    box-shadow: 0 5px 16px rgba(15,23,42,.07);
}
.category-icon {
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 50%;
    background: color-mix(in srgb, var(--primary) 9%, var(--surface));
    color: var(--primary);
    box-shadow: none;
}
.category-icon svg { width: 19px; height: 19px; stroke-width: 2; }
.category-name { color: var(--text); text-align: left; white-space: nowrap; font-size: .9rem; font-weight: 700; }
.category-item:hover { border-color: color-mix(in srgb, var(--primary) 32%, var(--border)); box-shadow: 0 9px 22px rgba(15,23,42,.1); }
.category-item.active {
    border-color: var(--primary);
    background: var(--primary);
    box-shadow: 0 8px 20px color-mix(in srgb, var(--primary) 22%, transparent);
}
.category-item.active .category-icon {
    border-color: transparent;
    background: rgba(255,255,255,.18);
    color: #fff;
    box-shadow: none;
}
.category-item.active .category-icon svg { stroke-width: 2.2; }
.category-item.active .category-name { color: #fff; }
.category-item:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--primary) 28%, transparent);
    outline-offset: 2px;
}

.products { display: block; padding: 24px 0 48px; }
.menu-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 20px;
}
.menu-heading span {
    display: block;
    margin-bottom: 4px;
    color: var(--primary);
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
}
.menu-heading h2 {
    margin: 0;
    color: var(--text);
    font-size: clamp(1.35rem, 2.5vw, 1.8rem);
    line-height: 1.2;
}
.menu-heading small {
    flex-shrink: 0;
    padding: 7px 11px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    color: var(--text-light);
    font-size: .76rem;
    font-weight: 700;
}
.menu-empty {
    min-height: 300px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    max-width: 620px;
    margin: 0 auto;
    padding: 44px 24px;
    border: 1px dashed color-mix(in srgb, var(--primary) 28%, var(--border));
    border-radius: 24px;
    background: color-mix(in srgb, var(--primary) 3%, var(--surface));
    text-align: center;
}
.menu-empty-icon {
    width: 64px;
    height: 64px;
    display: grid;
    place-items: center;
    margin-bottom: 18px;
    border-radius: 20px;
    background: color-mix(in srgb, var(--primary) 13%, var(--surface));
    color: var(--primary);
}
.menu-empty-icon svg { width: 30px; height: 30px; }
.menu-empty h2 { margin: 0; color: var(--text); font-size: 1.3rem; }
.menu-empty p { max-width: 470px; margin: 10px 0 0; color: var(--text-light); font-size: .9rem; line-height: 1.55; }
.menu-empty-action {
    min-height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 22px;
    padding: 0 20px;
    border-radius: 999px;
    background: var(--primary);
    color: #fff;
    font-size: .88rem;
    font-weight: 750;
    text-decoration: none;
    box-shadow: var(--shadow-sm);
}
.menu-empty-action:hover { background: var(--primary-hover); box-shadow: var(--shadow-md); }
.menu-empty-action svg { width: 18px; height: 18px; }

@media (max-width: 768px) {
    .categories { padding: 16px 0 6px; }
    .categories-list { gap: 8px; }
    .category-item { width: auto; min-height: 46px; padding: 5px 13px 5px 6px; }
    .category-icon { width: 34px; height: 34px; }
    .category-icon svg { width: 17px; height: 17px; }
    .products { padding: 18px 0 32px; }
    .products-grid { grid-template-columns: 1fr; gap: 12px; }
    .product-card { min-height: 136px; flex-direction: row; border-radius: 18px; }
    .product-image { width: 132px; height: auto; min-height: 136px; flex: 0 0 132px; }
    .product-content { min-width: 0; padding: 15px; }
    .product-title { margin-bottom: 6px; font-size: 1rem; -webkit-line-clamp: 2; }
    .product-description { font-size: .82rem; line-height: 1.4; -webkit-line-clamp: 2; }
    .product-footer { gap: 10px; margin-top: 12px; }
    .product-price { font-size: 20px; }
    .product-button { width: 44px; height: 44px; }
    .menu-heading { align-items: center; margin-bottom: 16px; }
    .menu-heading h2 { font-size: 1.3rem; }
    .menu-heading small { padding: 6px 9px; }
    .menu-empty { min-height: 250px; padding: 34px 22px; border-radius: 20px; }
}

@media (max-width: 420px) {
    .product-image { width: 118px; flex-basis: 118px; }
    .menu-heading span { font-size: .66rem; }
}

/* Preços usam uma cor estável de confiança, sem competir com a identidade da loja. */
.products .product-price{color:#087a59!important}

/* O conteúdo do produto rola entre a foto e as ações, dentro da janela. */
#productModal .modal-box:has(.modal-image) {
    height: auto;
    max-height: calc(100dvh - 32px);
}
#modalContent:has(.modal-image) {
    display: flex;
    flex-direction: column;
    min-height: 0;
    max-height: inherit;
}
#modalContent:has(.modal-image) .modal-footer { flex-shrink: 0; }
#modalContent .qty-btn,
#modalContent .modal-close { width: 44px; height: 44px; }

@media (max-width: 640px) {
    .header .container { gap: 8px; flex-wrap: wrap; }
    .header .restaurant { flex: 1 1 110px; }
    .header .header-actions { flex: 0 0 auto; gap: 6px; margin-left: auto; }
    .header-actions .icon-btn { width: 44px; height: 44px; flex-shrink: 0; }
    .header-actions .icon-btn svg { width: 22px; height: 22px; }
    .product-footer { flex-wrap: wrap; }
    #productModal .modal-box:has(.modal-image) {
        height: auto;
        max-height: calc(100dvh - max(8px, env(safe-area-inset-top)) - max(8px, env(safe-area-inset-bottom)));
        border-radius: 20px;
    }
    #modalContent:has(.modal-image) .modal-footer {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
        gap: 12px;
        padding: 12px 16px max(12px, env(safe-area-inset-bottom));
    }
    #modalContent .product-quantity {
        display: grid;
        grid-template-columns: 44px 24px 44px;
        gap: 4px 6px;
    }
    #modalContent .product-quantity-label { grid-column: 1 / -1; text-align: center; }
    #modalContent .modal-add-btn { min-width: 0; min-height: 52px; align-self: end; }
}

[data-theme="dark"] .search { background: var(--surface); }
[data-theme="dark"] .products .product-price { color: #6ee7b7 !important; }
[data-theme="dark"] .restaurant-status.open { color: #86efac; }
[data-theme="dark"] .restaurant-status.closed { color: #fca5a5; }
[data-theme="dark"] .cart-total, [data-theme="dark"] .cart-line-total { background: #16382f; color: #a7f3d0; border-color: #326451; }
@media(max-width:768px) {
 .hero-content { padding: 12px 16px; }
 #heroTitle { display: none; }
 #heroDescription:empty { display: none; }
 .hero-info { margin-top: 8px; gap: 8px; }
 .hero-chip { min-height: 36px; padding: 8px 12px; font-size: .8rem; }
 .hero-banner { max-height: 160px; }
 .restaurant-meta { gap: 4px 8px; }
 .restaurant-meta button[data-restaurant-details] { min-height: 36px; font-size: .75rem; padding: 2px 0; }
 .header .restaurant { gap: 8px; }
 .header .restaurant-logo { width: 40px; height: 40px; }
 .header-actions .icon-btn { width: 36px; height: 40px; }
}

body { background: var(--background); color: var(--text); }
[data-theme="dark"] .hero .hero-chip { background: var(--surface-hover) !important; color: var(--text) !important; border-color: var(--border) !important; }
[data-theme="dark"] .additional-option:has(input:checked) { background: #16382f; }
[data-theme="dark"] #productModal .modal-close { background: var(--surface); color: var(--text); }

/* Acabamento visual do cardápio, compartilhado pelos temas. */
.header { border-bottom: 1px solid var(--border); box-shadow: none; }
.header .icon-btn { box-shadow: none; border-color: var(--border); }
.restaurant-name, .product-title { letter-spacing: -.025em; }
.restaurant-meta button[data-restaurant-details] { min-height: 44px; padding: 4px 8px; border-radius: 10px; color: var(--text-light); }
.restaurant-meta button[data-restaurant-details]:hover { background: var(--surface-hover); color: var(--text); text-decoration: none; }
#heroInfo[hidden] { display: none; }
#heroDescription:empty { display: none; }
.products-grid { gap: 20px; }
.products .product-card { border-color: var(--border); box-shadow: 0 3px 14px rgba(15,23,42,.035); }
.products .product-card:hover { transform: none; border-color: color-mix(in srgb, var(--primary) 28%, var(--border)); box-shadow: var(--shadow-sm); }
.product-price { font-variant-numeric: tabular-nums; letter-spacing: -.025em; }
.product-button { border-radius: 14px; box-shadow: none; }
.product-button:hover { transform: none; }
.category-item { box-shadow: none; }
.category-item.active { box-shadow: 0 4px 12px color-mix(in srgb, var(--primary) 15%, transparent); }
#restaurant-details h2 { letter-spacing: -.025em; line-height: 1.25; }
#restaurant-details a { text-underline-offset: 4px; }
[data-theme="dark"] .products .product-card { box-shadow: none; }
[data-theme="dark"] #heroInfo .hero-chip { background: var(--surface-hover) !important; color: var(--text) !important; border-color: var(--border) !important; }
[data-theme="dark"] #heroInfo .hero-chip svg { color: var(--text-light) !important; }
@media(max-width:768px) {
    .hero-content { padding: 12px 0; gap: 10px; }
    .hero-content > .container { width: 100%; }
    .hero-content:has(#heroDescription:empty):has(#heroInfo[hidden]) { display: none; }
    .hero-banner { box-shadow: none; }
    .search { padding: 12px 0; }
    .products-grid { gap: 12px; }
    .products .product-content { padding: 14px; }
    .products .product-title { font-size: .98rem; line-height: 1.35; }
    .products .product-description { font-size: .875rem; line-height: 1.5; }
    .products .product-footer { margin-top: 10px; }
    .products .product-price { font-size: 1.15rem; }
    .header .header-actions { gap: 2px; }
    .header .header-actions .icon-btn { width: 44px; height: 44px; border-color: transparent; background: transparent; }
}
@media(prefers-reduced-motion:reduce) {
    .product-card, .product-button, .category-item { transition: none; }
}


/* Compra guiada: ações explícitas e feedback sem interromper a navegação. */
.products .product-description { color: #4b5563; }
[data-theme="dark"] .products .product-description { color: #cbd5e1; }
.products .product-labels { display: flex; flex-wrap: wrap; margin-bottom: 6px; }
.products .product-labels .badge-day {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 7px;
    font-size: .68rem;
    line-height: 1.4;
    white-space: nowrap;
    background: #dcfce7;
    color: #166534;
    box-shadow: none;
    backdrop-filter: none;
}
[data-theme="dark"] .products .product-labels .badge-day { background: #16382f; color: #a7f3d0; }
.products .product-button { width: auto; min-width: 94px; min-height: 44px; height: auto; padding: 10px 12px; font-size: .8rem; font-weight: 700; }
.product-footer { flex-wrap: wrap; }
.product-observation summary { cursor: pointer; min-height: 44px; padding: 12px 0; font-weight: 650; }
.product-observation summary small { color: var(--text-light); font-weight: 400; margin-left: 6px; }
.additional-option--included { border-left: 3px solid var(--success); }
.additional-option--extra { border-left: 3px solid var(--border); }
.additional-option small { display: block; color: var(--text-light); font-size: .75rem; }
.cart-feedback { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(100px + env(safe-area-inset-bottom)); z-index: 9100; width: max-content; max-width: calc(100% - 32px); padding: 12px 18px; border-radius: 14px; background: var(--text); color: var(--surface); box-shadow: var(--shadow-md); pointer-events: none; font-size: .88rem; }
.cart-feedback[hidden] { display: none; }
.menu-suggestions { padding: 0 0 24px; }
.menu-suggestions h2 { font-size: 1.15rem; margin: 0 0 5px; }
.menu-suggestions > p { color: var(--text-light); font-size: .82rem; margin: 0 0 12px; }
.suggestions-list { display: flex; gap: 12px; overflow-x: auto; padding: 3px 3px 12px; scroll-snap-type: x proximity; }
.suggestion-product { flex: 0 0 240px; display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); color: var(--text); text-align: left; cursor: pointer; scroll-snap-align: start; }
.suggestion-product img { width: 64px; height: 64px; object-fit: contain; border-radius: 10px; background: var(--surface-hover); }
.suggestion-product strong, .suggestion-product small { display: block; }
.suggestion-product small { margin-top: 6px; color: var(--text-light); }
.store-services { display: flex; flex-wrap: wrap; gap: 8px; width: 100%; }
.service-pill { display: inline-flex; align-items: center; min-height: 44px; padding: 8px 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-hover); color: var(--text); font: inherit; font-size: .8rem; }
button.service-pill { cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.store-order-status { display: block; width: 100%; color: var(--text-light); font-size: .78rem; line-height: 1.5; }
#deliveryPreview { position: fixed; inset: 0; margin: auto; width: min(500px, calc(100% - 24px)); max-height: calc(100dvh - 24px); overflow: auto; padding: 24px; border: 1px solid var(--border); border-radius: 22px; background: var(--surface); color: var(--text); }
#deliveryPreview::backdrop { background: rgba(10,18,30,.6); }
#deliveryPreview header { display: flex; align-items: start; justify-content: space-between; gap: 12px; }
#deliveryPreview h2 { font-size: 1.25rem; margin: 0; }
#deliveryPreview [data-close] { width: 44px; height: 44px; flex-shrink: 0; background: var(--surface-hover); color: var(--text); border: 1px solid var(--border); border-radius: 12px; font-size: 24px; cursor: pointer; }
#deliveryPreview p { margin: 14px 0; line-height: 1.5; }
#deliveryPreview small { display: block; color: var(--text-light); line-height: 1.5; margin: 10px 0; }
#deliveryPreview label { display: block; margin: 16px 0 8px; }
#deliveryPreview input { width: 100%; min-height: 48px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-hover); color: var(--text); padding: 12px; font: inherit; }
.delivery-preview-submit { width: 100%; min-height: 48px; border: 1px solid var(--border); border-radius: 12px; background: var(--text); color: var(--surface); font: inherit; padding: 12px; cursor: pointer; }
.delivery-preview-submit:disabled { opacity: .6; cursor: wait; }
.suggestion-product:focus-visible, .service-pill:focus-visible, #deliveryPreview :focus-visible { outline: 3px solid var(--primary); outline-offset: 3px; }
