/* ============================================================
   public.css — Cardápio Digital Public
   Design Premium & Responsivo
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=Playfair+Display:wght@700;800&display=swap');

/* ============================================================
   CSS Custom Properties (injetadas dinamicamente via JS)
   ============================================================ */
:root {
    --primary: #e63946;
    --primary-dark: #c1121f;
    --primary-light: #ff6b7a;
    --secondary: #1d3557;
    --secondary-dark: #0a1929;
    --accent: #f4a261;
    --bg: #f8f9fa;
    --bg-card: #ffffff;
    --text: #212529;
    --text-muted: #6c757d;
    --text-light: #adb5bd;
    --border: #e9ecef;
    --success: #2d6a4f;
    --success-bg: #d8f3dc;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, .08);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, .10);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, .15);
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-xl: 32px;
    --transition: all .25s cubic-bezier(.4, 0, .2, 1);
    --font-main: 'Inter', system-ui, sans-serif;
    --font-display: 'Playfair Display', Georgia, serif;
}

/* ============================================================
   Reset & Base
   ============================================================ */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.6;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
}

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

a {
    text-decoration: none;
    color: inherit;
}

button {
    cursor: pointer;
    border: none;
    background: none;
    font-family: inherit;
}

ul {
    list-style: none;
}

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
    background: var(--primary);
    color: #fff;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 20px rgba(0, 0, 0, .2);
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
    gap: 16px;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-logo {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, .3);
}

.header-logo-placeholder {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}

.header-title {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: -.5px;
    line-height: 1.2;
}

.header-subtitle {
    font-size: .75rem;
    opacity: .8;
    font-weight: 400;
}

/* Status da loja */
.store-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: .8rem;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 20px;
    background: rgba(255, 255, 255, .15);
}

.store-status .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #4ade80;
    animation: pulse-green 2s infinite;
}

.store-status.closed .dot {
    background: #f87171;
    animation: none;
}

@keyframes pulse-green {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: .6;
        transform: scale(1.3);
    }
}

/* Botão carrinho mobile */
.cart-toggle-btn {
    position: relative;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .2);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    transition: var(--transition);
}

.cart-toggle-btn:hover {
    background: rgba(255, 255, 255, .3);
}

.cart-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent);
    color: var(--secondary-dark);
    font-size: .7rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pop .2s ease;
}

@keyframes pop {
    from {
        transform: scale(0);
    }

    to {
        transform: scale(1);
    }
}

/* ============================================================
   BANNER
   ============================================================ */
.store-banner {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

.welcome-bar {
    background: linear-gradient(135deg, var(--secondary) 0%, var(--secondary-dark) 100%);
    color: #fff;
    text-align: center;
    padding: 14px 20px;
    font-size: .95rem;
}

/* ============================================================
   LAYOUT PRINCIPAL
   ============================================================ */
.main-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 28px 20px;
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 28px;
    align-items: start;
}

@media (max-width: 900px) {
    .main-container {
        grid-template-columns: 1fr;
    }
}

/* ============================================================
   FILTRO DE CATEGORIAS
   ============================================================ */
.categories-nav {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 28px;
}

.cat-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 20px;
    background: var(--bg-card);
    border: 2px solid var(--border);
    color: var(--text-muted);
    font-size: .85rem;
    font-weight: 600;
    transition: var(--transition);
    cursor: pointer;
}

.cat-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.cat-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

/* ============================================================
   SEÇÃO DE CATEGORIA
   ============================================================ */
.category-section {
    margin-bottom: 40px;
}

.category-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.category-icon {
    font-size: 1.5rem;
}

.category-name {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--text);
}

.category-divider {
    flex: 1;
    height: 2px;
    background: linear-gradient(to right, var(--border), transparent);
    border-radius: 1px;
}

/* ============================================================
   CARDS DE PRODUTO
   ============================================================ */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}

.product-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    cursor: pointer;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
}

.product-card.featured {
    border-color: var(--accent);
    position: relative;
}

.featured-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--accent);
    color: var(--secondary-dark);
    font-size: .7rem;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 10px;
    z-index: 1;
    text-transform: uppercase;
    letter-spacing: .5px;
}

.product-image-wrap {
    width: 100%;
    height: 175px;
    overflow: hidden;
    background: linear-gradient(135deg, var(--border) 0%, #e0e0e0 100%);
    position: relative;
}

.product-image-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .4s ease;
}

.product-card:hover .product-image-wrap img {
    transform: scale(1.06);
}

.product-emoji-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    background: linear-gradient(135deg, #f0f0f0, #e0e0e0);
}

.product-body {
    padding: 14px 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-name {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 6px;
    line-height: 1.3;
}

.product-desc {
    font-size: .82rem;
    color: var(--text-muted);
    line-height: 1.5;
    flex: 1;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-serves {
    font-size: .75rem;
    color: var(--text-light);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.product-tags {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.tag {
    font-size: .68rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    background: var(--border);
    color: var(--text-muted);
}

.tag.vegano {
    background: #d8f3dc;
    color: #2d6a4f;
}

.tag.destaque {
    background: #fff3cd;
    color: #856404;
}

.tag.novo {
    background: #cfe2ff;
    color: #084298;
}

.product-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.price-wrap {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.price-original {
    font-size: .75rem;
    text-decoration: line-through;
    color: var(--text-light);
}

.price-current {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--primary);
}

.price-promo {
    color: #e63946;
}

.add-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 9px 16px;
    background: var(--primary);
    color: #fff;
    border-radius: var(--radius-sm);
    font-size: .85rem;
    font-weight: 700;
    transition: var(--transition);
    white-space: nowrap;
}

.add-btn:hover {
    background: var(--primary-dark);
    transform: scale(1.04);
}

.add-btn:active {
    transform: scale(.97);
}

/* ============================================================
   CARRINHO / CHECKOUT
   ============================================================ */
.cart-aside {
    position: sticky;
    top: 86px;
}

.cart-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
    overflow: hidden;
}

.cart-header {
    padding: 18px 20px;
    background: linear-gradient(135deg, var(--secondary) 0%, var(--secondary-dark) 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.cart-header h2 {
    font-size: 1.05rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.cart-count-badge {
    background: var(--accent);
    color: var(--secondary-dark);
    font-size: .75rem;
    font-weight: 800;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-body {
    padding: 16px 20px;
}

.cart-items-list {
    max-height: 280px;
    overflow-y: auto;
    margin-bottom: 12px;
}

.cart-items-list::-webkit-scrollbar {
    width: 4px;
}

.cart-items-list::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 2px;
}

.cart-empty {
    text-align: center;
    padding: 28px 16px;
    color: var(--text-muted);
}

.cart-empty .empty-icon {
    font-size: 3rem;
    margin-bottom: 8px;
}

.cart-empty p {
    font-size: .9rem;
}

.cart-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    animation: slide-in .2s ease;
}

@keyframes slide-in {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

.cart-item:last-child {
    border-bottom: none;
}

.cart-item-info {
    flex: 1;
    min-width: 0;
}

.cart-item-name {
    font-size: .88rem;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cart-item-price {
    font-size: .78rem;
    color: var(--text-muted);
}

.cart-item-qty {
    display: flex;
    align-items: center;
    gap: 6px;
}

.qty-btn {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .9rem;
    font-weight: 700;
    color: var(--text-muted);
    transition: var(--transition);
    background: var(--bg-card);
    cursor: pointer;
}

.qty-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.qty-minus:hover {
    border-color: #dc3545;
    color: #dc3545;
}

.qty-value {
    font-weight: 700;
    font-size: .9rem;
    min-width: 20px;
    text-align: center;
}

/* Totais */
.cart-totals {
    margin-top: 12px;
}

.cart-totals-row {
    display: flex;
    justify-content: space-between;
    font-size: .88rem;
    padding: 4px 0;
    color: var(--text-muted);
}

.cart-totals-row.total {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text);
    border-top: 2px solid var(--border);
    padding-top: 10px;
    margin-top: 6px;
}

.cart-totals-row.total .price {
    color: var(--primary);
}

/* Formulário de checkout */
.checkout-form {
    margin-top: 16px;
    border-top: 1px solid var(--border);
    padding-top: 16px;
}

.checkout-title {
    font-size: .8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .8px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.form-group {
    margin-bottom: 12px;
}

.form-label {
    display: block;
    font-size: .82rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 5px;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 9px 12px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: .88rem;
    font-family: var(--font-main);
    color: var(--text);
    background: var(--bg-card);
    transition: var(--transition);
    outline: none;
    appearance: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(230, 57, 70, .12);
}

.form-textarea {
    resize: vertical;
    min-height: 70px;
}

.form-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236c757d'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 16px;
    padding-right: 32px;
}

/* Botão WhatsApp */
.whatsapp-btn {
    width: 100%;
    padding: 14px;
    background: #25D366;
    color: #fff;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 14px;
    transition: var(--transition);
    box-shadow: 0 4px 14px rgba(37, 211, 102, .35);
    cursor: pointer;
}

.whatsapp-btn:hover {
    background: #128C7E;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 211, 102, .45);
}

.whatsapp-btn:active {
    transform: translateY(0);
}

.whatsapp-btn svg {
    width: 22px;
    height: 22px;
    fill: #fff;
}

.form-error {
    background: #fff5f5;
    border: 1px solid #feb2b2;
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font-size: .83rem;
    color: #c53030;
    margin-top: 10px;
    display: none;
}

.form-error.show {
    display: block;
}

/* ============================================================
   LOJA FECHADA — OVERLAY
   ============================================================ */
.closed-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .7);
    z-index: 200;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.closed-overlay.show {
    display: flex;
}

.closed-box {
    background: #fff;
    border-radius: var(--radius-lg);
    padding: 40px;
    text-align: center;
    max-width: 380px;
    margin: 20px;
    box-shadow: var(--shadow-lg);
}

.closed-icon {
    font-size: 4rem;
    margin-bottom: 12px;
}

.closed-title {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 8px;
}

.closed-msg {
    color: var(--text-muted);
    font-size: .95rem;
}

/* ============================================================
   LOADING
   ============================================================ */
.loading-state {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    flex-direction: column;
    gap: 16px;
    color: var(--text-muted);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin .7s linear infinite;
}

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

/* ============================================================
   TOAST NOTIFICATIONS
   ============================================================ */
.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 999;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    background: var(--secondary-dark);
    color: #fff;
    padding: 12px 18px;
    border-radius: var(--radius-sm);
    font-size: .88rem;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 8px;
    animation: toast-in .3s ease;
    max-width: 300px;
}

.toast.success {
    background: #2d6a4f;
}

.toast.error {
    background: #c53030;
}

@keyframes toast-in {
    from {
        opacity: 0;
        transform: translateX(20px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
    background: var(--secondary-dark);
    color: rgba(255, 255, 255, .6);
    text-align: center;
    padding: 20px;
    font-size: .82rem;
    margin-top: 40px;
}

.site-footer a {
    color: var(--accent);
}

/* ============================================================
   RESPONSIVO
   ============================================================ */
@media (max-width: 900px) {
    .cart-aside {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        top: auto;
        z-index: 150;
        transform: translateY(100%);
        transition: transform .35s cubic-bezier(.4, 0, .2, 1);
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
        max-height: 88vh;
        overflow-y: auto;
    }

    .cart-aside.open {
        transform: translateY(0);
    }

    .cart-aside-backdrop {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, .5);
        z-index: 140;
        backdrop-filter: blur(2px);
    }

    .cart-aside-backdrop.show {
        display: block;
    }

    .main-container {
        padding-bottom: 80px;
    }
}

@media (max-width: 480px) {
    .products-grid {
        grid-template-columns: 1fr;
    }

    .header-title {
        font-size: 1.15rem;
    }
}

/* ============================================================
   BARRA DE BUSCA RÁPIDA
   ============================================================ */
.search-wrap {
    position: relative;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 14px;
    font-size: 1rem;
    color: var(--text-muted);
    pointer-events: none;
}

.search-input {
    width: 100%;
    padding: 12px 38px 12px 42px;
    border-radius: 24px;
    background: var(--bg-card);
    border: 2px solid var(--border);
    color: var(--text);
    font-size: .92rem;
    outline: none;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.search-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(230, 57, 70, .15);
}

.search-clear {
    position: absolute;
    right: 14px;
    background: var(--border);
    color: var(--text-muted);
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .7rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
}

.search-clear:hover {
    background: var(--primary);
    color: #fff;
}

/* ============================================================
   BARRA FLUTUANTE DE CARRINHO MOBILE
   ============================================================ */
.mobile-cart-bar {
    position: fixed;
    bottom: 16px;
    left: 16px;
    right: 16px;
    background: var(--primary);
    color: #fff;
    border-radius: 30px;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 130;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
    cursor: pointer;
    transition: transform .2s ease, background .2s ease;
    animation: slide-up .3s cubic-bezier(.175, .885, .32, 1.275);
}

.mobile-cart-bar:active {
    transform: scale(.97);
}

@keyframes slide-up {
    from {
        transform: translateY(100px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.mobile-cart-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.mobile-cart-badge {
    background: var(--accent);
    color: var(--secondary-dark);
    font-weight: 800;
    font-size: .8rem;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-cart-total {
    font-weight: 700;
    font-size: 1.05rem;
}

.mobile-cart-cta {
    font-weight: 700;
    font-size: .9rem;
    display: flex;
    align-items: center;
    gap: 4px;
}

@media (min-width: 901px) {
    .mobile-cart-bar {
        display: none !important;
    }
}

/* ============================================================
   MICRO-ANIMATIONS & SENIOR FRONTEND ACCESSIBILITY (Senior Architect)
   ============================================================ */

/* Entrance animation for product cards */
.product-card {
    will-change: transform, opacity, box-shadow;
    animation: fadeInCard 0.35s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.cat-btn, .btn, button {
    will-change: transform;
}

.cat-btn:active, .btn:active, button:active {
    transform: scale(0.96);
}

@keyframes fadeInCard {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Stagger animation delay on product list */
.products-grid > .product-card:nth-child(1) { animation-delay: 0.04s; }
.products-grid > .product-card:nth-child(2) { animation-delay: 0.08s; }
.products-grid > .product-card:nth-child(3) { animation-delay: 0.12s; }
.products-grid > .product-card:nth-child(4) { animation-delay: 0.16s; }
.products-grid > .product-card:nth-child(5) { animation-delay: 0.20s; }
.products-grid > .product-card:nth-child(6) { animation-delay: 0.24s; }

/* Accessibility: Honor user reduced motion settings */
@media (prefers-reduced-motion: reduce) {
    *,
    ::before,
    ::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}