:root {
    /* Cores Premium Dark Mode */
    --bg-color: #0d0f12;
    --surface-color: #1a1e24;
    --surface-hover: #232830;
    --primary-color: #ff6b35;
    /* Laranja vibrante para apetite */
    --primary-hover: #ff8457;
    --text-color: #e2e8f0;
    --text-muted: #94a3b8;
    --border-color: #2d3748;
    --success-color: #10b981;
    --danger-color: #ef4444;

    /* Efeitos */
    --shadow-sm: 0 4px 6px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
    --glass-bg: rgba(26, 30, 36, 0.7);
    --glass-border: rgba(255, 255, 255, 0.05);

    /* Transições */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
    -webkit-tap-highlight-color: transparent; /* Remove tap highlight on mobile */
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    padding-bottom: calc(80px + env(safe-area-inset-bottom));
    /* Espaço para botão fixo + safe area (iPhone X+) */
    overscroll-behavior-y: contain; /* Evita bounce excessivo no iOS */
    min-height: 100dvh; /* Dynamic viewport = app real */
}

/* Safe area para o header em devices com notch */
.main-header {
    padding-top: calc(1rem + env(safe-area-inset-top));
    padding-left: max(1.5rem, env(safe-area-inset-left));
    padding-right: max(1.5rem, env(safe-area-inset-right));
    padding-bottom: 1rem;
}

/* ==================================
   HEADER E NAVEGAÇÃO
   ================================== */
.main-header {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--glass-border);
    padding: 1rem 1.5rem;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo-icon {
    font-size: 2.5rem;
    color: var(--primary-color);
}

.logo-text h1 {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.logo-text p {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.cart-btn {
    background: var(--surface-hover);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    transition: var(--transition-normal);
}

.cart-btn:hover {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.cart-btn i {
    font-size: 1.5rem;
}

.cart-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--danger-color);
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Categorias */
.category-nav {
    max-width: 1200px;
    margin: 1.5rem auto;
    overflow-x: auto;
    padding: 0 1.5rem;
    scrollbar-width: none;
    /* Firefox */
}

.category-nav::-webkit-scrollbar {
    display: none;
}

/* Chrome */

.category-list {
    display: flex;
    gap: 1rem;
    list-style: none;
    padding-bottom: 0.5rem;
}

.category-item {
    padding: 0.6rem 1.25rem;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-weight: 500;
    font-size: 0.9rem;
    white-space: nowrap;
    cursor: pointer;
    transition: var(--transition-fast);
}

.category-item.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.category-item:hover:not(.active) {
    background: var(--surface-hover);
}

/* ==================================
   PRODUTOS (GRID E CARDS)
   ================================== */
.menu-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.product-card {
    background: var(--surface-color);
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: var(--transition-normal);
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.product-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: var(--transition-normal);
}

.product-card:hover .product-image {
    transform: scale(1.05);
}

.product-content {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.product-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.product-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}

.product-price {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
}

.add-btn {
    background: var(--surface-hover);
    color: var(--text-color);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-fast);
}

.add-btn i {
    font-size: 1.2rem;
}

.add-btn:hover {
    background: var(--primary-color);
    color: white;
}

/* ==================================
   MODAL DO PRODUTO
   ================================== */
.product-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    z-index: 2100;
    /* Acima do carrinho que é 2000 */
    display: flex;
    align-items: flex-end;
    /* Mobile bottom sheet */
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition-normal);
}

.product-modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.product-modal-content {
    background: var(--surface-color);
    width: 100%;
    max-width: 600px;
    border-radius: 24px 24px 0 0;
    position: relative;
    transform: translateY(100%);
    transition: var(--transition-normal);
    max-height: 90vh;
    overflow-y: auto;
}

/* Modal no Desktop */
@media (min-width: 768px) {
    .product-modal-overlay {
        align-items: center;
    }

    .product-modal-content {
        border-radius: 20px;
        transform: scale(0.9);
        opacity: 0;
    }

    .product-modal-overlay.active .product-modal-content {
        transform: scale(1);
        opacity: 1;
    }
}

.product-modal-overlay.active .product-modal-content {
    transform: translateY(0);
}

.close-modal-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
}

.modal-image-container {
    width: 100%;
    height: 250px;
}

.modal-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.modal-info {
    padding: 1.5rem;
}

.modal-info h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.modal-desc {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
}

.modal-price-area {
    margin-bottom: 1.5rem;
}

.modal-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.modal-actions {
    display: flex;
    gap: 1rem;
    align-items: stretch;
}

.quantity-control {
    display: flex;
    align-items: center;
    background: var(--bg-color);
    border-radius: 12px;
    padding: 0.25rem;
    border: 1px solid var(--border-color);
}

.qty-btn {
    background: transparent;
    color: var(--text-color);
    border: none;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.2rem;
}

.qty-btn:hover {
    color: var(--primary-color);
}

.qty-display {
    width: 30px;
    text-align: center;
    font-weight: 600;
}

.add-to-cart-action {
    flex-grow: 1;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1.5rem;
    transition: var(--transition-fast);
}

.add-to-cart-action:hover {
    background: var(--primary-hover);
}

/* ==================================
   CARRINHO LATERAL (SIDEBAR)
   ================================== */
.cart-sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition-normal);
}

.cart-sidebar-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.cart-sidebar-content {
    position: absolute;
    top: 0;
    right: -100%;
    width: 100%;
    max-width: 400px;
    height: 100%;
    background: var(--surface-color);
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.5);
    transition: var(--transition-normal);
    display: flex;
    flex-direction: column;
}

.cart-sidebar-overlay.active .cart-sidebar-content {
    right: 0;
}

.cart-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-header h2 {
    font-size: 1.25rem;
}

.close-cart-btn {
    background: var(--bg-color);
    color: var(--text-color);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-items {
    flex-grow: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

.empty-cart-message {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    opacity: 0.5;
}

.empty-cart-message i {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.cart-item {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.cart-item-img {
    width: 70px;
    height: 70px;
    border-radius: 12px;
    object-fit: cover;
}

.cart-item-info {
    flex-grow: 1;
}

.cart-item-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.cart-item-price {
    color: var(--primary-color);
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.cart-item-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.remove-item-btn {
    background: transparent;
    border: none;
    color: var(--danger-color);
    cursor: pointer;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.cart-footer {
    padding: 1.5rem;
    background: var(--surface-color);
    border-top: 1px solid var(--border-color);
}

.cart-total-area {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    font-size: 1.2rem;
    font-weight: 700;
}

.cart-final-total {
    color: var(--primary-color);
}

.checkout-btn {
    width: 100%;
    padding: 1rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition-fast);
}

.checkout-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
}

/* Botão Flutuante Comanda */
.comanda-float-btn {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    background: var(--success-color);
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 30px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
    cursor: pointer;
    z-index: 500;
    transition: var(--transition-normal);
}

.comanda-float-btn:hover {
    background: #059669;
    transform: translateX(-50%) translateY(-3px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.5);
}

@media (min-width: 768px) {
    .comanda-float-btn {
        bottom: 3rem;
        left: unset;
        right: 2rem;
        transform: none;
    }

    .comanda-float-btn:hover {
        transform: translateY(-3px);
    }
}

/* ==================================
   RESPONSIVIDADE (MOBILE & TABLET)
   ================================== */

@media (max-width: 1024px) {
    /* Tablet / iPad */
    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    }
}

@media (max-width: 768px) {
    /* Mobile / Celulares */
    
    .header-content {
        padding: 0;
    }
    
    .logo-text h1 {
        font-size: 1.1rem;
    }
    
    .logo-text p {
        font-size: 0.75rem;
    }
    
    /* Menu lateral Carrinho tela cheia */
    .cart-sidebar-content {
        max-width: 100%; 
    }
    
    /* Layout dos produtos: Estilo "Lista Horizontal" em vez de cards empilhados */
    .product-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .product-card {
        flex-direction: row;
        height: 130px;
    }
    
    .product-image {
        width: 110px;
        height: 100%;
        border-radius: 16px 0 0 16px; 
    }
    
    .product-content {
        padding: 0.75rem;
        justify-content: flex-start;
    }
    
    .product-title {
        font-size: 0.95rem;
        margin-bottom: 0.25rem;
    }
    
    .product-desc {
        font-size: 0.75rem;
        margin-bottom: auto;
    }
    
    .product-footer {
        margin-top: auto;
    }
    
    .product-price {
        font-size: 1rem;
    }
    
    .add-btn {
        width: 32px;
        height: 32px;
    }
    
    /* Modais do produto otimizados */
    .product-modal-content {
        max-height: 90vh;
        border-radius: 24px 24px 0 0;
    }
    
    .modal-image-container {
        height: 200px;
    }
    
    .modal-info h2 {
        font-size: 1.25rem;
    }
    
    .modal-price {
        font-size: 1.25rem;
    }
    
    .add-to-cart-action {
        font-size: 0.95rem;
        padding: 0 1rem;
    }
}