:root {
    --primary: #ea1d2c;
    --primary-grad: linear-gradient(135deg, #ea1d2c 0%, #ff4d4d 100%);
    --secondary: #202124;
    --accent: #50a773;
    --dark: #121212;
    --light: #f8f9fa;
    --white: #ffffff;
    --gray: #5f6368;
    --border: #e8eaed;
    --shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 16px 32px rgba(234, 29, 44, 0.15);
    --sidebar-width: 280px;
    --admin-bg: #f0f2f5;
    --admin-card-radius: 20px;
    --primary-light: rgba(234, 29, 44, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: #fafafa;
    color: var(--dark);
    line-height: 1.6;
}


/* Layout Main Wrapper */
.main-wrapper {
    display: flex;
    width: 100%;
    max-width: 100%;
    margin: 0;
    position: relative;
    min-height: 100vh;
    background: #fafafa;
}

/* Content Area */
.content-area {
    flex: 1;
    min-width: 0;
    padding-bottom: 90px;
    background: #fafafa;
}

/* Header */
header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    padding: 15px 40px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
}

header h1 {
    font-size: 1.5rem;
    font-weight: 900;
    background: var(--primary-grad);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -1.2px;
}

/* Hero Area */
.hero-banner {
    padding: 60px 40px;
    background: linear-gradient(rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.8)), url('https://images.unsplash.com/photo-1550547660-d9450f859349?ixlib=rb-1.2.1&auto=format&fit=crop&w=1350&q=80');
    background-size: cover;
    background-position: center;
    border-radius: 0 0 50px 50px;
    color: white;
    text-align: center;
    margin-bottom: 30px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.hero-banner h2 {
    font-size: 2.8rem;
    font-weight: 900;
    margin-bottom: 12px;
    text-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    letter-spacing: -1px;
}

.hero-banner p {
    font-size: 1.1rem;
    font-weight: 500;
    opacity: 0.95;
    letter-spacing: 0.5px;
}

/* Search Bar */
.search-container {
    padding: 0 40px;
    margin-top: -45px;
    position: relative;
    z-index: 10;
}

.search-input {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    display: block;
    padding: 22px 30px;
    background: var(--white);
    border: none;
    border-radius: 24px;
    font-size: 1.1rem;
    font-weight: 500;
    outline: none;
    box-shadow: 0 15px 45px rgba(0, 0, 0, 0.12);
    transition: all 0.4s ease;
}

/* Category Nav */
.categories-nav {
    display: flex;
    overflow-x: auto;
    padding: 30px 40px;
    gap: 15px;
    background: transparent;
    scrollbar-width: none;
    position: sticky;
    top: 75px;
    z-index: 999;
}

.category-chip {
    padding: 12px 28px;
    background: var(--white);
    border-radius: 20px;
    white-space: nowrap;
    font-size: 1rem;
    font-weight: 800;
    color: var(--gray);
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(0, 0, 0, 0.02);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.category-chip.active {
    background: var(--primary-grad);
    color: var(--white);
    box-shadow: 0 10px 25px rgba(234, 29, 44, 0.35);
    transform: scale(1.08) translateY(-2px);
    border-color: transparent;
}

/* Product Cards */
.category-block {
    padding: 0 40px;
}

.product-card {
    background: var(--white);
    border: none;
    border-radius: 28px;
    padding: 20px;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    cursor: pointer;
    display: flex;
    flex-direction: row;
    gap: 24px;
    box-shadow: 0 4px 25px rgba(0, 0, 0, 0.04);
    margin-bottom: 20px;
    border: 1px solid rgba(0, 0, 0, 0.01);
}

@media (max-width: 600px) {
    .product-card {
        padding: 12px;
    }
}

.product-card:hover {
    transform: scale(1.02) translateX(10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
}

.product-img-grid {
    width: 130px;
    height: 130px;
    border-radius: 22px;
    object-fit: cover;
    flex-shrink: 0;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.product-body {
    padding: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.product-name {
    font-size: 1.3rem;
    font-weight: 900;
    color: var(--dark);
    margin-bottom: 6px;
    letter-spacing: -0.5px;
}

.product-desc {
    font-size: 0.95rem;
    color: var(--gray);
    line-height: 1.5;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-price {
    font-weight: 900;
    color: var(--accent);
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    gap: 5px;
}

.btn-add-grid {
    display: none;
    /* Hide button in horizontal layout, whole card is clickable */
}

.btn-location {
    width: 100%;
    padding: 12px;
    background: #f0f2f5;
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--dark);
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-location:hover {
    background: #e4e6e9;
}

.btn-location.success {
    background: #e8f5e9;
    color: #2e7d32;
    border-color: #a5d6a7;
}

@keyframes pulse-location {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(26, 115, 232, 0.4);
    }

    70% {
        transform: scale(1.02);
        box-shadow: 0 0 0 10px rgba(26, 115, 232, 0);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(26, 115, 232, 0);
    }
}

.location-loading {
    animation: pulse-location 1.5s infinite;
}

.category-section-title {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--dark);
    margin: 30px 0 20px 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.category-section-title::after {
    content: '';
    flex: 1;
    height: 2px;
    background: linear-gradient(to right, #f0f2f5, transparent);
}

.category-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
}


/* Persistent Side Cart (Desktop) */
.side-cart {
    width: 350px;
    /* Sightly wider for better spacing */
    height: 100vh;
    background: var(--white);
    border-left: 1px solid var(--border);
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    padding: 30px 24px;
    z-index: 10;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.02);
}

.side-cart-header h2 {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--dark);
    display: flex;
    align-items: center;
    gap: 10px;
}

.side-cart-header h2::before {
    content: '👜';
    font-size: 1.2rem;
}

.side-cart-items {
    flex: 1;
    overflow-y: auto;
    margin: 20px 0;
    padding-right: 5px;
}

/* Scrollbar for cart */
.side-cart-items::-webkit-scrollbar {
    width: 4px;
}

.side-cart-items::-webkit-scrollbar-thumb {
    background: #eee;
    border-radius: 10px;
}

.side-cart-footer {
    border-top: 2px dashed var(--border);
    padding-top: 20px;
}

.cart-item-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 18px;
    animation: fadeIn 0.3s ease;
}

.cart-item-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.cart-item-name {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--dark);
}

.cart-item-extras {
    font-size: 0.75rem;
    color: var(--gray);
    font-style: italic;
}

.cart-item-price-qty {
    text-align: right;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.cart-item-price {
    font-weight: 800;
    color: var(--secondary);
    font-size: 0.9rem;
}

.cart-item-qty-badge {
    background: var(--light);
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 800;
    color: var(--primary);
}

/* Modal UI Premium (Pop-up) */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.modal-content {
    background: var(--white);
    width: 100%;
    max-width: 500px;
    border-radius: 32px;
    padding: 30px;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.25);
    animation: slideUp 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.modal-header h2 {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--dark);
    letter-spacing: -0.5px;
}

.close-modal {
    background: var(--light);
    border: none;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    color: var(--gray);
}

.close-modal:hover {
    background: #fee2e2;
    color: var(--primary);
    transform: rotate(90deg);
}

/* Checkout Form Styles */
.checkout-section-title {
    font-size: 0.8rem;
    font-weight: 800;
    color: var(--gray);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.checkout-section-title i {
    color: var(--primary);
}

.checkout-item-card {
    background: #fdfdfd;
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 16px;
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 15px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 8px;
    margin-left: 4px;
}

.form-control {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid #f1f3f4;
    border-radius: 16px;
    background: #f8f9fa;
    font-size: 1rem;
    font-weight: 500;
    outline: none;
    color: var(--dark);
    transition: all 0.3s;
}

.form-control:focus {
    border-color: var(--primary);
    background: var(--white);
    box-shadow: 0 8px 20px rgba(234, 29, 44, 0.08);
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.checkout-footer {
    margin-top: 30px;
    padding-top: 25px;
    border-top: 2px dashed var(--border);
}

.total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.total-label {
    font-size: 1rem;
    font-weight: 700;
    color: var(--gray);
}

.total-amount {
    font-size: 1.8rem;
    font-weight: 900;
    color: var(--dark);
}


/* Buttons & Interactive Elements */
.btn-primary,
.btn-finalize,
.btn-add-grid {
    background: var(--primary);
    color: var(--white);
    border: none;
    padding: 14px 20px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    width: 100%;
    display: inline-block;
}

.btn-add-grid {
    width: auto;
    padding: 8px 16px;
    font-size: 0.9rem;
}

.btn-primary:hover,
.btn-finalize:hover,
.btn-add-grid:hover {
    background: #c21825;
    /* Vermelho mais escuro */
    box-shadow: 0 4px 12px rgba(234, 29, 44, 0.2);
}

.btn-finalize:disabled {
    background: #e0e0e0;
    color: #a0a0a0;
    cursor: not-allowed;
    box-shadow: none;
}

/* Category Nav Chips */
.category-chip {
    padding: 10px 24px;
    background: var(--white);
    border-radius: 14px;
    white-space: nowrap;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--gray);
    cursor: pointer;
    border: 1px solid var(--border);
    transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.category-chip.active {
    background: var(--primary-grad);
    color: var(--white);
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(234, 29, 44, 0.2);
}

.category-chip:hover:not(.active) {
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-2px);
}

/* Administrative Sidebar Layout */
.admin-nav {
    display: flex;
    gap: 12px;
    margin-bottom: 32px;
    overflow-x: auto;
    padding: 8px 4px 16px;
    scrollbar-width: thin;
}

.admin-nav a {
    padding: 12px 24px;
    background: var(--white);
    border-radius: 14px;
    text-decoration: none;
    color: var(--secondary);
    font-weight: 700;
    white-space: nowrap;
    border: 1.5px solid var(--border);
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.admin-nav a:hover,
.admin-nav a.active {
    background: var(--primary-grad);
    color: var(--white);
    border-color: transparent;
    box-shadow: 0 8px 20px rgba(234, 29, 44, 0.2);
    transform: translateY(-2px);
}

/* Cart & Summary Styles */
.cart-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-size: 0.95rem;
    color: var(--gray);
}

.cart-delivery-info {
    color: var(--secondary);
    font-weight: 600;
}

/* Context-aware total styling */
.summary-total {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--dark);
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.modal-footer-total {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--border);
}

/* Floating Cart Footer (Mobile) */
.cart-footer {
    display: none;
    position: fixed;
    bottom: 24px;
    left: 24px;
    right: 24px;
    background: #000;
    color: var(--white);
    padding: 18px 28px;
    border-radius: 20px;
    z-index: 2000;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    justify-content: space-between;
    align-items: center;
}

.cart-total-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.cart-icon-container {
    position: relative;
    display: flex;
    align-items: center;
}

.cart-badge {
    position: absolute;
    top: -8px;
    right: -12px;
    background: var(--white);
    color: var(--primary);
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.cart-label {
    font-weight: 700;
    font-size: 0.95rem;
    white-space: nowrap;
}

.cart-footer .summary-total {
    color: var(--white);
    font-size: 1.1rem;
    font-weight: 700;
    border-left: 1px solid rgba(255, 255, 255, 0.2);
    padding-left: 15px;
}

.cart-footer:hover {
    transform: scale(1.05) translateY(-5px);
    box-shadow: 0 20px 45px rgba(234, 29, 44, 0.5);
}

/* Pop-up Cart List */
.cart-items-modal-list {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 25px;
    padding-right: 5px;
}

.cart-items-modal-list::-webkit-scrollbar {
    width: 6px;
}

.cart-items-modal-list::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 10px;
}

/* Modal UI Premium Adjustments */
.modal-header h2 {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--dark);
}

.close-modal:hover {
    background: #e2e2e2;
    transform: rotate(90deg);
    transition: transform 0.3s;
}

/* Extras List in Modal */
.extra-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.extra-item:hover {
    border-color: var(--primary);
}

.extra-item.selected {
    background: rgba(234, 29, 44, 0.05);
    border-color: var(--primary);
}

/* Mobile Visibility Controls */
@media (max-width: 1024px) {
    .side-cart {
        display: none !important;
    }

    .category-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (min-width: 1025px) {
    .cart-footer {
        display: none !important;
    }
}

@media (max-width: 600px) {
    .category-grid {
        grid-template-columns: 1fr;
    }

    .main-wrapper {
        display: block;
    }

    .category-block {
        padding: 0 16px;
    }

    .modal-content {
        padding: 24px 16px;
        max-height: 95vh;
        border-radius: 20px 20px 0 0;
        align-self: flex-end;
        /* Mobile style modal */
        margin-bottom: 0;
    }
}

.modal-active {
    overflow: hidden;
}