* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #DC143C;
    --primary-dark: #B01030;
    --secondary-color: #FF6B6B;
    --dark-color: #1A1A1A;
    --text-color: #333;
    --text-light: #666;
    --border-color: #E0E0E0;
    --bg-light: #F5F5F5;
    --white: #FFFFFF;
    --success-color: #10B981;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 30px rgba(0,0,0,0.15);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-light);
    color: var(--text-color);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
}

/* Header */
.header {
    background: var(--primary-color);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(220,20,60,0.3);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 0;
}

.logo {
    font-size: 22px;
    font-weight: 700;
    color: var(--white);
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: -0.3px;
}

.cart-icon {
    position: relative;
    background: rgba(255,255,255,0.2);
    color: var(--white);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 22px;
    border: 2px solid rgba(255,255,255,0.4);
}

.cart-icon:hover {
    background: rgba(255,255,255,0.35);
    transform: scale(1.05);
}

.cart-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #FFD700;
    color: var(--dark-color);
    border-radius: 12px;
    min-width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 800;
    padding: 0 6px;
    border: 2px solid var(--primary-color);
}

/* Main Content */
.main-content {
    padding: 0;
    min-height: calc(100vh - 76px);
}

/* Search */
.search-section {
    padding: 16px 16px 0;
    max-width: 1200px;
    margin: 0 auto;
}

.search-input {
    width: 100%;
    padding: 13px 20px 13px 44px;
    font-size: 15px;
    border: 2px solid transparent;
    border-radius: 50px;
    outline: none;
    transition: all 0.2s;
    background: var(--white);
    box-shadow: var(--shadow-sm);
    background-image: url(data:image/svg+xml,%3Csvg xmlns=http://www.w3.org/2000/svg width=18 height=18 viewBox=0 0 24 24 fill=none stroke=%23999 stroke-width=2%3E%3Ccircle cx=11 cy=11 r=8/%3E%3Cpath d=m21 21-4.35-4.35/%3E%3C/svg%3E);
    background-repeat: no-repeat;
    background-position: 15px center;
}

.search-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(220, 20, 60, 0.1);
}

/* Categories Bar — scroll horizontal em todos os tamanhos */
.categories-wrapper {
    background: var(--white);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 76px;
    z-index: 90;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

.categories {
    display: flex;
    gap: 0;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 0;
    scroll-behavior: smooth;
    max-width: 1200px;
    margin: 0 auto;
}

.categories::-webkit-scrollbar {
    display: none;
}

.category-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 12px 20px;
    border: none;
    border-bottom: 3px solid transparent;
    background: transparent;
    cursor: pointer;
    font-weight: 500;
    font-size: 13px;
    white-space: nowrap;
    transition: all 0.2s;
    color: var(--text-light);
    min-width: 80px;
    flex-shrink: 0;
    position: relative;
}

.category-btn:hover {
    color: var(--primary-color);
    background: rgba(220, 20, 60, 0.04);
}

.category-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    font-weight: 700;
}

.category-icon {
    font-size: 26px;
    line-height: 1;
    display: block;
}

.category-name {
    font-size: 11px;
    font-weight: 600;
    text-align: center;
    line-height: 1.2;
    color: inherit;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.category-count {
    display: none;
}

/* Section Title */
.section-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--dark-color);
    padding: 20px 16px 12px;
    max-width: 1200px;
    margin: 0 auto;
}

/* Products Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
    padding: 0 16px 24px;
    max-width: 1200px;
    margin: 0 auto;
}

.product-card {
    background: var(--white);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s;
    cursor: pointer;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.product-image-container {
    position: relative;
    width: 100%;
    height: 185px;
    background: var(--bg-light);
    overflow: hidden;
}

.product-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.product-card:hover .product-image {
    transform: scale(1.04);
}

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

.product-name {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 5px;
    color: var(--dark-color);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
}

.product-description {
    font-size: 13px;
    color: var(--text-light);
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.5;
    flex: 1;
}

.product-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-top: auto;
}

.product-price {
    font-size: 18px;
    font-weight: 800;
    color: var(--primary-color);
}

.btn-add {
    background: var(--primary-color);
    color: var(--white);
    border: none;
    padding: 9px 18px;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 700;
    font-size: 13px;
    transition: all 0.2s;
    white-space: nowrap;
    flex-shrink: 0;
}

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

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

/* Cart Sidebar */
.cart-sidebar {
    position: fixed;
    right: -100%;
    top: 0;
    width: 400px;
    max-width: 100%;
    height: 100vh;
    background: var(--white);
    box-shadow: var(--shadow-lg);
    transition: right 0.3s ease;
    z-index: 1000;
    display: flex;
    flex-direction: column;
}

.cart-sidebar.active {
    right: 0;
}

.cart-header {
    padding: 20px;
    background: var(--primary-color);
    color: var(--white);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-header h2 {
    font-size: 20px;
    font-weight: 700;
}

.close-cart {
    background: none;
    border: none;
    color: var(--white);
    font-size: 26px;
    cursor: pointer;
    padding: 0;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
    line-height: 1;
}

.close-cart:hover {
    background: rgba(255,255,255,0.2);
}

.cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.empty-cart {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-light);
}

.cart-item {
    display: flex;
    gap: 12px;
    padding: 14px;
    border-radius: 12px;
    background: var(--bg-light);
    margin-bottom: 10px;
}

.cart-item-image {
    width: 72px;
    height: 72px;
    object-fit: cover;
    border-radius: 10px;
    background: var(--white);
    flex-shrink: 0;
}

.cart-item-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.cart-item-name {
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 4px;
    color: var(--dark-color);
}

.cart-item-price {
    color: var(--primary-color);
    font-weight: 700;
    font-size: 15px;
    margin-bottom: 8px;
}

.cart-item-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-quantity {
    background: var(--white);
    border: 1.5px solid var(--border-color);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    font-weight: 700;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    color: var(--text-color);
}

.btn-quantity:hover {
    background: var(--primary-color);
    color: var(--white);
    border-color: var(--primary-color);
}

.item-quantity {
    font-weight: 700;
    min-width: 24px;
    text-align: center;
    font-size: 15px;
}

.btn-remove {
    background: none;
    color: var(--text-light);
    border: none;
    padding: 4px 8px;
    cursor: pointer;
    font-size: 12px;
    margin-left: auto;
    text-decoration: underline;
}

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

.cart-footer {
    padding: 20px;
    border-top: 1px solid var(--border-color);
    background: var(--white);
}

.cart-total {
    display: flex;
    justify-content: space-between;
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--dark-color);
}

.cart-total-value {
    color: var(--primary-color);
}

.btn-checkout {
    width: 100%;
    padding: 16px;
    background: var(--success-color);
    color: var(--white);
    border: none;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-checkout:hover:not(:disabled) {
    background: #0D9668;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-checkout:active:not(:disabled) {
    transform: translateY(0);
}

.btn-checkout:disabled {
    background: var(--border-color);
    cursor: not-allowed;
    color: var(--text-light);
}

/* Overlay */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: none;
    z-index: 999;
    backdrop-filter: blur(2px);
}

.overlay.active {
    display: block;
}

/* Loading */
.loading {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-light);
    grid-column: 1 / -1;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

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

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-light);
    grid-column: 1 / -1;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1100;
    background: rgba(0,0,0,0.55);
    backdrop-filter: blur(3px);
    align-items: flex-end;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--white);
    border-radius: 24px 24px 0 0;
    width: 100%;
    max-width: 600px;
    max-height: 92vh;
    overflow-y: auto;
    position: relative;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    background: rgba(0,0,0,0.08);
    border: none;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: background 0.2s;
    color: var(--dark-color);
}

.modal-close:hover {
    background: rgba(0,0,0,0.15);
}

.modal-product-image {
    width: 100%;
    height: 240px;
    object-fit: cover;
    border-radius: 24px 24px 0 0;
}

.modal-product-info {
    padding: 20px 20px 28px;
}

.modal-product-name {
    font-size: 22px;
    font-weight: 800;
    color: var(--dark-color);
    margin-bottom: 8px;
    line-height: 1.3;
}

.modal-product-description {
    font-size: 14px;
    color: var(--text-light);
    line-height: 1.6;
    margin-bottom: 16px;
}

.modal-product-price {
    font-size: 26px;
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.modal-quantity {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    background: var(--bg-light);
    padding: 12px 16px;
    border-radius: 12px;
}

.modal-quantity label {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-color);
    flex: 1;
}

.modal-quantity .btn-quantity {
    width: 36px;
    height: 36px;
    font-size: 18px;
}

.modal-quantity input[type=number] {
    width: 50px;
    text-align: center;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 6px;
    font-size: 16px;
    font-weight: 700;
    -moz-appearance: textfield;
}

.modal-quantity input[type=number]::-webkit-outer-spin-button,
.modal-quantity input[type=number]::-webkit-inner-spin-button {
    -webkit-appearance: none;
}

.btn-add-to-cart {
    width: 100%;
    padding: 16px;
    background: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-add-to-cart:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Mobile */
@media (max-width: 768px) {
    .container {
        padding: 0 12px;
    }

    .cart-sidebar {
        width: 100%;
    }

    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        padding: 0 12px 80px;
    }

    .product-image-container {
        height: 150px;
    }

    .product-info {
        padding: 10px;
    }

    .product-name {
        font-size: 13px;
    }

    .product-description {
        font-size: 12px;
        -webkit-line-clamp: 1;
    }

    .product-price {
        font-size: 15px;
    }

    .btn-add {
        padding: 8px 12px;
        font-size: 12px;
    }

    .category-btn {
        padding: 10px 16px;
        min-width: 72px;
    }

    .category-icon {
        font-size: 22px;
    }

    .category-name {
        font-size: 10px;
    }

    .logo {
        font-size: 19px;
    }

    .cart-icon {
        width: 44px;
        height: 44px;
        font-size: 20px;
    }

    .section-title {
        padding: 14px 12px 10px;
        font-size: 16px;
    }

    .search-section {
        padding: 12px 12px 0;
    }

    .categories-wrapper {
        top: 72px;
    }

    .modal-content {
        border-radius: 20px 20px 0 0;
        max-height: 88vh;
    }

    .modal-product-image {
        height: 200px;
    }

    .modal-product-name {
        font-size: 18px;
    }

    .modal-product-price {
        font-size: 22px;
    }
}

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

    .product-image-container {
        height: 180px;
    }
}

/* Tablet e Desktop — cards maiores */
@media (min-width: 1024px) {
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 20px;
        padding: 0 0 32px;
    }

    .section-title {
        padding: 24px 0 14px;
    }

    .search-section {
        padding: 20px 0 0;
    }

    .product-image-container {
        height: 200px;
    }

    .main-content .container {
        padding: 0 16px;
    }
}

/* Pizza card extras */
.btn-add-pizza {
    background: #FF6B00;
    font-size: 13px;
    padding: 9px 14px;
}
.btn-add-pizza:hover {
    background: #e05d00;
}
.product-price-label {
    font-size: 10px;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 1px;
}
.product-price-veja {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-light);
}
