:root {
    --primary-color: #E50914;
    --bg-dark: #0a0a0a;
    --bg-card: #141414;
    --bg-input: #1f1f1f;
    --text-main: #ffffff;
    --text-muted: #a3a3a3;
    --border-color: #262626;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Preloader */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #000;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 1;
    transition: opacity 0.5s ease;
}

#preloader img {
    width: 80px; /* Ícone centralizado e menor */
    height: auto;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(1.1); opacity: 1; }
    100% { transform: scale(1); opacity: 0.8; }
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.5;
    overflow-x: hidden;
}

/* Navbar Moderna */
.navbar {
    background-color: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(10px);
    padding: 12px 5%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--border-color);
}

.navbar .logo img {
    height: 45px;
    width: auto;
    transition: var(--transition);
}

.navbar .logo img:hover {
    transform: scale(1.05);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.search-bar {
    position: relative;
    display: none; /* Ativado no JS para mobile se necessário */
}

@media (min-width: 768px) {
    .search-bar {
        display: block;
        width: 300px;
    }
}

.search-bar input {
    width: 100%;
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 8px 15px 8px 35px;
    color: #fff;
    font-size: 14px;
    transition: var(--transition);
}

.search-bar input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(229, 9, 20, 0.2);
    outline: none;
}

.search-bar i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

/* Carrinho Icon */
.cart-icon {
    position: relative;
    cursor: pointer;
    font-size: 20px;
    color: #fff;
    padding: 8px;
    border-radius: 50%;
    background-color: var(--bg-input);
    transition: var(--transition);
}

.cart-icon:hover {
    background-color: var(--border-color);
}

.cart-count {
    position: absolute;
    top: -2px;
    right: -2px;
    background-color: var(--primary-color);
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    min-width: 18px;
    height: 18px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--bg-dark);
}

/* Layout Principal: Sidebar + Grid */
.main-layout {
    display: flex;
    max-width: 1400px;
    margin: 0 auto;
    padding: 30px 5%;
    gap: 30px;
}

.sidebar {
    width: 260px;
    flex-shrink: 0;
    display: none;
}

@media (min-width: 1024px) {
    .sidebar {
        display: block;
    }
}

.sidebar-section {
    margin-bottom: 30px;
}

.sidebar-section h3 {
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 15px;
}

.category-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.category-item {
    padding: 10px 15px;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-muted);
    font-size: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.category-item:hover, .category-item.active {
    background-color: var(--bg-card);
    color: #fff;
}

.category-item.active {
    border-left: 3px solid var(--primary-color);
}

/* Grid de Produtos */
.shop-content {
    flex-grow: 1;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 25px;
}

/* Card de Produto Ecommerce */
.product-card {
    background-color: var(--bg-card);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: var(--transition);
    position: relative;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-5px);
    border-color: #404040;
    box-shadow: 0 10px 20px rgba(0,0,0,0.4);
}

.product-image-wrapper {
    position: relative;
    aspect-ratio: 1/1;
    background-color: #000;
    overflow: hidden;
}

.product-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 15px;
    transition: var(--transition);
}

.product-card:hover .product-image-wrapper img {
    transform: scale(1.08);
}

.product-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background-color: var(--primary-color);
    color: #fff;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: bold;
    z-index: 1;
}

.product-info {
    padding: 15px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.product-category {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 5px;
}

.product-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 10px;
    color: #fff;
}

.product-price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}

.product-price {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-color);
}

.add-to-cart-btn {
    background-color: transparent;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    width: 35px;
    height: 35px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

/* Botões de Pedidos na Navbar */
.btn-orders {
    background-color: #fff;
    color: #000;
    border: 1px solid #ddd;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.btn-orders:hover {
    background-color: #f0f0f0;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.btn-orders i {
    font-size: 14px;
    color: #000;
}

/* Modais Refinados */
/* Modais e Popups Globais */
.modal, .popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 3000;
    padding: 20px;
}

.modal-content, .popup-content {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    width: 100%;
    max-width: 450px;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
    text-align: center;
}

/* Seletor de Quantidade com Slider */
.quantity-selector {
    margin-bottom: 25px;
}

.quantity-selector input[type="number"] {
    width: 100px;
    background-color: var(--bg-input);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 10px;
    color: #fff;
    font-size: 24px;
    text-align: center;
    font-weight: 800;
    margin-bottom: 20px;
    display: inline-block;
}

.quantity-selector input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    height: 8px;
    background: var(--bg-input);
    border-radius: 5px;
    outline: none;
    margin-top: 10px;
}

.quantity-selector input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    background: var(--primary-color);
    cursor: pointer;
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(229, 9, 20, 0.5);
}

.quantity-selector input[type="range"]::-moz-range-thumb {
    width: 24px;
    height: 24px;
    background: var(--primary-color);
    cursor: pointer;
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(229, 9, 20, 0.5);
}

.button-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.btn-secondary {
    background-color: transparent;
    color: var(--text-muted);
    border: none;
    padding: 10px;
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
}

.btn-secondary:hover {
    color: #fff;
}

/* Histórico de Pedidos no Modal */
.order-item-card {
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 15px;
}

.order-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 12px;
    color: var(--text-muted);
}

.order-code {
    font-weight: bold;
    color: var(--primary-color);
}

.order-total {
    font-weight: bold;
    color: #fff;
    font-size: 16px;
}

/* Botão Fechar Modal */
.close-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 24px;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
}

.close-modal:hover {
    color: var(--primary-color);
    transform: rotate(90deg);
}

.add-to-cart-btn:hover {
    background-color: var(--primary-color);
    color: #fff;
}

.add-to-cart-btn:disabled {
    border-color: #444;
    color: #444;
    cursor: not-allowed;
}

/* Swiper Estilo Ecommerce */
.hero-swiper {
    width: 100%;
    max-width: 1400px;
    margin: 20px auto;
    border-radius: 15px;
    overflow: hidden;
}

.hero-swiper img {
    width: 100%;
    height: auto;
    max-height: 450px;
    object-fit: cover;
}

/* Popup de Carrinho Lateral */
.cart-sidebar {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    max-width: 400px;
    height: 100vh;
    background-color: var(--bg-card);
    z-index: 2000;
    transition: 0.4s ease;
    display: flex;
    flex-direction: column;
    box-shadow: -10px 0 30px rgba(0,0,0,0.5);
}

.cart-sidebar.active {
    right: 0;
}

.cart-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-items-list {
    flex-grow: 1;
    overflow-y: auto;
    padding: 20px;
}

.cart-item {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.cart-item img {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 8px;
}

.cart-item-details {
    flex-grow: 1;
}

.cart-footer {
    padding: 20px;
    background-color: #1a1a1a;
    border-top: 1px solid var(--border-color);
}

.cart-total-row {
    display: flex;
    justify-content: space-between;
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 20px;
}

.checkout-btn {
    width: 100%;
    padding: 15px;
    background-color: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    font-size: 16px;
    transition: var(--transition);
}

.checkout-btn:hover {
    background-color: #b20710;
}

/* Responsividade Mobile */
@media (max-width: 767px) {
    .product-grid {
        grid-template-columns: 1fr 1fr;
        gap: 15px;
    }
    
    .navbar {
        padding: 10px 15px;
    }
    
    .navbar .logo img {
        height: 35px;
    }
    
    .product-card {
        border-radius: 8px;
    }
    
    .product-info {
        padding: 10px;
    }
    
    .product-title {
        font-size: 14px;
    }
    
    .product-price {
        font-size: 16px;
    }
}

/* Overlay para fechar sidebar/carrinho */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.7);
    display: none;
    z-index: 1500;
}

.overlay.active {
    display: block;
}
