* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

:root {
    /* Paleta de Cores Centralizada */
    --primary-color: #f1cd00;
    --primary-dark: #eba100;
    --text-color: #333333;
    --bg-color: #ffffff;
    --bg-light: #f8f9fa;
    --success-color: #2ecc71;
    --success-dark: #27ae60;
    --danger-color: #e74c3c;
    --info-color: #2980b9;
    --border-color: #ddd;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Cabeçalho */
#header {
    background-color: var(--primary-color);
    color: #ffffff;
    padding: 15px 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    width: 95%;
}

.header-container h1 {
    font-size: 1.8rem;
}

/* Navegação com Ícones */
nav {
    display: flex;
    align-items: center;
    gap: 20px;
}

nav a {
    color: #ffffff;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    transition: opacity 0.3s;
}

.nav-icon {
    width: 24px;
    height: 24px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

.nav-text {
    margin-left: 8px;
    font-weight: 600;
    font-size: 1rem;
}

nav a:hover {
    opacity: 0.8;
    text-decoration: none;
}

.nav-btn-login {
    color: #333 !important;
    background: #fff;
    padding: 5px 10px;
    border-radius: 4px;
}

/* Ícone do Carrinho com Badge */
.nav-cart-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
}

.cart-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: var(--danger-color);
    color: white;
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 0.75rem;
    font-weight: bold;
    min-width: 18px;
    height: 18px;
    text-align: center;
    display: flex; justify-content: center; align-items: center;
    border: 2px solid var(--primary-color); /* Borda para destacar do fundo */
}

/* Conteúdo Principal */
main {
    flex: 1;
    padding: 40px 20px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    text-align: center;
}

.content-container h2 {
    color: var(--primary-dark);
    margin-bottom: 15px;
}

/* Barra de Pesquisa */
.search-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-bottom: 30px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
}

#search-input {
    flex: 1;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: 25px; /* Bordas arredondadas modernas */
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s, box-shadow 0.3s;
}

#search-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 5px rgba(241, 205, 0, 0.5);
}

#filter-btn {
    background-color: #fff;
    border: 1px solid var(--border-color);
    color: #555;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
}

#filter-btn:hover {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Grid de Produtos */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.product-card {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
}

/* Aplica o efeito de "levantar" apenas se o dispositivo suportar hover (Mouse) */
@media (hover: hover) {
    .product-card:hover {
        transform: translateY(-5px);
        box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    }
}

/* Mensagem de lista vazia */
.empty-state-msg {
    grid-column: 1 / -1; /* Ocupa toda a largura do grid */
    text-align: center;
    padding: 40px;
    color: #7f8c8d;
    font-size: 1.2rem;
}

/* Carrossel de Imagens */
.carousel-container {
    position: relative;
    width: 100%;
    height: 150px;
    margin-bottom: 10px;
    overflow: hidden;
}

.carousel-container img {
    width: 100%;
    height: 100%;
    object-fit: contain; /* Ajusta a imagem sem cortar */
    display: none; /* Esconde todas por padrão */
}

.carousel-container img.active {
    display: block; /* Mostra apenas a ativa */
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    padding: 5px 10px;
    cursor: pointer;
    font-size: 1.5rem; /* Ícone maior */
    padding: 10px 15px; /* Botão maior para o dedo */
    border-radius: 50%;
    z-index: 10;
}

.product-card h3 {
    font-size: 1.2rem;
    margin: 10px 0;
}

.product-card .price {
    font-size: 1.1rem;
    color: var(--success-color);
    font-weight: bold;
    display: block;
    margin-bottom: 15px;
}

.stock-info {
    display: block;
    font-size: 0.85rem;
    color: #7f8c8d;
    margin-bottom: 10px;
}

.low-stock {
    color: #e67e22; /* Laranja para aviso */
    font-weight: bold;
}

/* Estilo para produto esgotado */
.product-card.out-of-stock {
    opacity: 0.7;
    background-color: #f4f4f4;
}

/* Rodapé */
footer {
    background-color: var(--primary-color);
    color: #ffffff;
    text-align: center;
    padding: 15px;
    margin-top: auto;
    font-size: 0.9rem;
}

/* Painel de Admin (Adicionar Produtos) */
#admin-panel {
    background-color: var(--bg-light);
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 40px;
    border: 1px solid #e9ecef;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

#product-form {
    margin-top: 20px;
}

/* Grid Layout para o Formulário */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr; /* Duas colunas iguais */
    gap: 15px;
}

.full-width {
    grid-column: 1 / -1; /* Ocupa a largura total */
}

#product-form input, #product-form select, #product-form textarea {
    width: 100%;
    padding: 14px; /* Input mais alto para facilitar o toque */
    border: 1px solid #ced4da;
    border-radius: 5px;
    font-size: 1rem; /* Evita zoom automático em iOS (min 16px) */
}

.btn-save {
    background-color: var(--info-color);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.3s;
}

.btn-save:hover {
    background-color: #3498db;
}

/* Tabela de Produtos (Admin) */
.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background: white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    min-width: 600px; /* Garante largura mínima para não esmagar colunas */
}

/* Container para rolagem horizontal da tabela no mobile */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.admin-table th, .admin-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
    white-space: nowrap; /* Evita quebra de texto indesejada em células pequenas */
}

.btn-delete {
    background-color: #e74c3c;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
}

/* Tela de Login (Admin) */
#login-section {
    max-width: 400px;
    margin: 50px auto;
    text-align: center;
}

.login-box {
    background: var(--bg-light);
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-top: 20px;
}

.login-box input {
    width: 100%;
    padding: 14px; /* Input maior */
    margin-bottom: 15px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

/* Layout do Admin (Seções e Subseções) */
.admin-layout {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.admin-sidebar {
    width: 200px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: #fff;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.nav-btn {
    padding: 12px;
    text-align: left;
    background: none;
    border: none;
    cursor: pointer;
    border-radius: 5px;
    font-size: 1rem;
    color: #555;
    transition: background 0.2s;
}

.nav-btn:hover {
    background-color: #f0f0f0;
}

.nav-btn.active {
    background-color: var(--primary-color);
    color: #fff;
    font-weight: bold;
}

.admin-main-area {
    flex: 1;
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.sub-nav {
    border-bottom: 2px solid #eee;
    margin-bottom: 20px;
    padding-bottom: 10px;
}

.sub-nav-btn {
    background: none;
    border: none;
    padding: 10px 20px;
    font-size: 1rem;
    cursor: pointer;
    color: #7f8c8d;
    font-weight: bold;
    border-bottom: 3px solid transparent;
}

.sub-nav-btn.active {
    color: #333;
    border-bottom: 3px solid var(--primary-color);
}

.btn-edit {
    background-color: #f39c12;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    margin-right: 5px;
}

/* Responsividade para Celulares e Tablets */
@media (max-width: 768px) {
    .header-container {
        flex-direction: row; /* Mantém em linha no celular */
        justify-content: space-between;
        align-items: center;
        padding: 0 15px;
    }

    nav {
        margin-top: 0;
        gap: 15px; /* Aproxima os ícones */
    }

    .header-container h1 {
        font-size: 1.1rem; /* Diminui o título para caber */
        margin-bottom: 0;
        text-align: left;
        max-width: 50%; /* Garante espaço para os ícones */
        line-height: 1.2;
    }

    /* Esconde textos no mobile, deixa só ícones */
    .nav-text, .desktop-only {
        display: none;
    }

    .nav-icon {
        width: 28px; /* Ícones levemente maiores no touch */
        height: 28px;
    }

    /* No celular, o formulário fica em uma coluna só */
    .form-grid {
        grid-template-columns: 1fr;
    }

    .admin-layout {
        flex-direction: column;
    }
    .admin-sidebar {
        width: 100%;
        flex-direction: row;
        overflow-x: auto;
        white-space: nowrap; /* Permite scroll horizontal dos botões */
        padding-bottom: 5px; /* Espaço para a barra de rolagem não cobrir */
    }

    /* Botões de ação ocupam largura total no celular */
    .btn-save {
        width: 100%;
        display: block;
        margin-top: 10px;
        padding: 15px; /* Mais fácil de tocar */
    }

    /* Ajuste do grid de produtos para telas muito pequenas */
    .products-grid {
        grid-template-columns: 1fr; /* Uma coluna por vez em telas estreitas */
    }
}

.product-detail-wrapper {
    display: flex;
    gap: 40px;
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    text-align: left;
    margin-bottom: 30px;
}

.detail-gallery {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.main-image {
    width: 100%;
    height: 400px;
    object-fit: contain;
    border: 1px solid #eee;
    border-radius: 8px;
}

.thumbnails {
    display: flex;
    gap: 10px;
    overflow-x: auto;
}

.thumb-img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    opacity: 0.6;
    transition: 0.3s;
}

.thumb-img:hover, .thumb-img.active {
    opacity: 1;
    border-color: var(--primary-color);
}

.detail-info {
    flex: 1;
}

.detail-info h2 {
    font-size: 2rem;
    margin-bottom: 10px;
    color: #333;
}

.detail-price {
    font-size: 2rem;
    color: var(--success-color);
    font-weight: bold;
    margin: 20px 0;
}

.detail-actions {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.btn-fav {
    background: none;
    border: 2px solid #e74c3c;
    color: #e74c3c;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    margin-left: 10px;
    transition: 0.3s;
}

.btn-fav:hover, .btn-fav.active {
    background: #e74c3c;
    color: white;
}

/* Abas de Conteúdo */
.product-tabs-container {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    text-align: left;
}

.tabs-header {
    border-bottom: 2px solid #eee;
    margin-bottom: 20px;
}

.tab-btn {
    background: none;
    border: none;
    padding: 10px 20px;
    font-size: 1.1rem;
    cursor: pointer;
    color: #777;
    border-bottom: 3px solid transparent;
}

.tab-btn.active {
    color: var(--primary-dark);
    border-bottom: 3px solid var(--primary-dark);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

@media (max-width: 768px) {
    .product-detail-wrapper {
        flex-direction: column;
        padding: 20px 15px; /* Otimiza espaço interno */
        gap: 30px;
    }
    .main-image {
        height: auto;
        max-height: 350px; /* Altura máxima controlada */
        width: 100%;
        object-fit: contain;
        margin-bottom: 10px;
    }

    .detail-info {
        text-align: center; /* Centraliza informações */
    }

    .detail-info h2 {
        font-size: 1.6rem; /* Título ajustado */
        line-height: 1.3;
    }

    .detail-price {
        justify-content: center;
        display: flex;
        font-size: 2rem;
        margin: 15px 0;
    }

    .detail-actions {
        flex-direction: column;
        width: 100%;
        gap: 12px;
    }

    .qty-controls {
        justify-content: center;
        width: 100%;
        margin-bottom: 10px;
    }

    /* Botões Grandes e Tácteis para Mobile */
    .detail-actions .btn-fav {
        width: 100%;
        padding: 16px; /* Área de toque maior */
        font-size: 1.1rem;
        margin: 0;
        display: flex;
        justify-content: center;
        align-items: center;
    }
    
    .detail-actions .btn-fav {
        margin-top: 5px;
    }
}

/* --- Modal de Pagamento PIX --- */
.modal {
    display: none; /* Oculto por padrão */
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.6); /* Fundo escuro com transparência */
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: #fefefe;
    margin: auto;
    padding: 30px;
    border: 1px solid #888;
    width: 90%;
    max-width: 450px;
    border-radius: 10px;
    text-align: center;
    position: relative;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.close-modal {
    color: #aaa;
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close-modal:hover,
.close-modal:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

/* Garante que o QR Code não estoure em telas pequenas */
#pix-qr-img {
    max-width: 100%;
    height: auto !important;
}

/* --- Toast Notifications (Melhoria de UX) --- */
#toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none; /* Permite clicar através do container vazio */
}

.toast {
    background-color: #333;
    color: #fff;
    padding: 12px 20px;
    border-radius: 5px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 250px;
    animation: slideIn 0.3s ease-out forwards;
    opacity: 0;
    transform: translateY(20px);
    pointer-events: auto;
}

.toast.success { border-left: 5px solid var(--success-color); }
.toast.error { border-left: 5px solid var(--danger-color); }
.toast.info { border-left: 5px solid var(--info-color); }

@keyframes slideIn { to { opacity: 1; transform: translateY(0); } }
@keyframes fadeOut { to { opacity: 0; transform: translateY(-20px); } }

/* --- Indicador de Força da Senha --- */
.password-strength {
    height: 4px;
    width: 0;
    transition: all 0.4s ease; /* Animação suave */
    border-radius: 2px;
    margin-top: 5px;
}

.password-strength.strength-weak {
    width: 33%;
    background-color: var(--danger-color); /* Vermelho */
}
.password-strength.strength-medium {
    width: 66%;
    background-color: #e67e22; /* Laranja */
}
.password-strength.strength-strong {
    width: 100%;
    background-color: var(--success-color); /* Verde */
}

/* --- Input Validation Indicator --- */
.input-indicator {
    height: 3px;
    width: 0; /* Start with 0 width */
    border-radius: 2px;
    margin-top: 4px;
    transition: all 0.4s ease;
}

.input-indicator.valid {
    width: 100%;
    background-color: var(--success-color); /* Green */
}

.input-indicator.invalid {
    width: 100%;
    background-color: var(--danger-color); /* Red */
}

/* --- Página de Escolha de Cadastro --- */
.choice-container {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 30px;
}

.choice-card {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 40px 20px;
    text-align: center;
    width: 280px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    text-decoration: none;
    color: var(--text-color);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.choice-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
    border-color: var(--primary-color);
}

.choice-icon {
    width: 64px;
    height: 64px;
    margin-bottom: 20px;
    color: var(--primary-color);
    stroke-width: 1.5;
}

.choice-card h3 {
    margin-bottom: 10px;
    font-size: 1.4rem;
}

.choice-card p {
    color: #666;
    font-size: 0.95rem;
}

/* --- Perfil do Cliente --- */
.profile-layout {
    display: flex;
    gap: 30px;
    align-items: flex-start;
    text-align: left;
    margin-top: 20px;
}

.profile-sidebar {
    width: 280px;
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    border: none;
    text-align: center;
    position: sticky;
    top: 20px;
}

.profile-avatar {
    width: 80px;
    height: 80px;
    background: #f0f0f0;
    border-radius: 50%;
    margin: 0 auto 15px auto;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #aaa;
}

.profile-content {
    flex: 1;
}

.profile-section {
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    border: none;
    margin-bottom: 30px;
}

.profile-section h2 {
    font-size: 1.4rem;
    color: #333;
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
    margin-bottom: 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.readonly-input {
    background-color: #e9ecef;
    color: #6c757d;
    cursor: not-allowed;
    border-color: #ced4da;
}

/* Cards de Endereço */
.address-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.address-card {
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 20px;
    position: relative;
    transition: all 0.3s;
    background: #fcfcfc;
}

.address-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    transform: translateY(-2px);
}

.address-card h4 {
    margin-bottom: 10px;
    font-size: 1.1rem;
    color: var(--primary-dark);
    display: flex;
    align-items: center;
    gap: 8px;
}

.address-card p {
    font-size: 0.9rem;
    color: #666;
    line-height: 1.5;
    margin-bottom: 5px;
}

.address-actions {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 0.85rem;
    border-radius: 4px;
    cursor: pointer;
    border: none;
}

.btn-outline {
    background: transparent;
    border: 1px solid #ddd;
    color: #555;
}

.btn-outline:hover {
    border-color: var(--danger-color);
    color: var(--danger-color);
}

@media (max-width: 768px) {
    .profile-layout {
        flex-direction: column;
    }
    .profile-sidebar {
        width: 100%;
    }
}

/* --- NOVO DESIGN DO CARRINHO --- */
.cart-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 30px;
    align-items: start;
    text-align: left;
    margin-top: 20px;
}

.cart-items-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.cart-item {
    display: flex;
    align-items: center;
    background: #fff;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    border: 1px solid #eee;
    gap: 20px;
    transition: transform 0.2s;
}

.cart-item:hover {
    border-color: var(--primary-color);
}

.cart-item-img img {
    width: 90px;
    height: 90px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #eee;
}

.cart-item-info {
    flex: 1;
}

.cart-item-info h3 {
    font-size: 1.1rem;
    margin-bottom: 5px;
    color: #333;
}

.cart-item-info .item-price {
    color: #777;
    font-size: 0.9rem;
}

.cart-item-controls {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
}

.cart-item-total {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--success-color);
}

/* Card de Resumo (Direita) */
.cart-summary {
    background: #fff;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    position: sticky;
    top: 20px;
}

.cart-summary h3 {
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
    margin-bottom: 20px;
    font-size: 1.3rem;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.summary-row.total {
    font-weight: bold;
    font-size: 1.4rem;
    color: var(--success-dark);
    margin-top: 20px;
    border-top: 1px solid #eee;
    padding-top: 20px;
}

.btn-checkout {
    width: 100%;
    background-color: var(--success-color);
    color: white;
    padding: 15px;
    border: none;
    border-radius: 6px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s;
    margin-top: 10px;
}

.btn-checkout:hover {
    background-color: var(--success-dark);
}

@media (max-width: 768px) {
    .cart-layout {
        grid-template-columns: 1fr; /* Uma coluna no mobile */
    }
    
    .cart-item {
        flex-direction: column; /* Itens empilhados no mobile */
        text-align: center;
    }

    .cart-item-controls {
        align-items: center;
        width: 100%;
        flex-direction: row;
        justify-content: space-between;
        margin-top: 10px;
    }
}

/* --- Loader (Spinner) --- */
.loader {
    border: 5px solid #f3f3f3;
    border-top: 5px solid var(--primary-color);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 40px auto;
    grid-column: 1 / -1; /* Centraliza no grid */
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* --- CART SIDEBAR (NOVO) --- */
.cart-backdrop {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 998;
    display: none;
    opacity: 0;
    transition: opacity 0.3s;
    backdrop-filter: blur(2px);
}
.cart-backdrop.open { display: block; opacity: 1; }

.cart-sidebar {
    position: fixed;
    top: 0; right: -400px; /* Escondido à direita */
    width: 100%; max-width: 400px;
    height: 100%;
    background: #fff;
    z-index: 999;
    box-shadow: -5px 0 15px rgba(0,0,0,0.1);
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex; flex-direction: column;
}
.cart-sidebar.open { right: 0; }

.cart-header {
    padding: 20px;
    background: var(--primary-color);
    color: #fff;
    display: flex; justify-content: space-between; align-items: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
.cart-header h2 { margin: 0; font-size: 1.3rem; }
#close-cart-btn {
    background: none; border: none; color: #fff;
    font-size: 2rem; cursor: pointer; line-height: 1;
}

.cart-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f8f9fa;
}

.cart-sidebar-item {
    background: #fff;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    display: flex; gap: 15px;
    position: relative;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    border: 1px solid #eee;
}
.cart-sidebar-item img {
    width: 70px; height: 70px;
    object-fit: cover; border-radius: 6px;
    border: 1px solid #eee;
}
.item-details { flex: 1; }
.item-details h4 {
    font-size: 1rem; margin-bottom: 5px; color: #333;
    padding-right: 20px; /* Espaço para o botão fechar */
}
.item-price { color: var(--success-color); font-weight: bold; margin-bottom: 8px; }

.qty-controls-sm {
    display: flex; align-items: center; gap: 10px;
}
.btn-qty-sm {
    width: 28px; height: 28px;
    border: 1px solid #ddd; background: #fff;
    border-radius: 4px; cursor: pointer;
    font-weight: bold; color: #555;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.2s;
}
.btn-qty-sm:hover { background: var(--primary-color); color: #fff; border-color: var(--primary-color); }

.btn-remove-sm {
    position: absolute; top: 10px; right: 10px;
    background: none; border: none;
    color: #ccc; font-size: 1.5rem; line-height: 1;
    cursor: pointer;
}
.btn-remove-sm:hover { color: var(--danger-color); }

.cart-footer {
    padding: 25px;
    background: #fff;
    border-top: 1px solid #eee;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
}
.cart-total-row {
    display: flex; justify-content: space-between;
    font-size: 1.3rem; font-weight: bold;
    margin-bottom: 20px; color: #333;
}
.btn-checkout-sidebar {
    width: 100%;
    padding: 16px;
    background: var(--success-color);
    color: #fff;
    border: none; border-radius: 8px;
    font-size: 1.1rem; font-weight: bold;
    cursor: pointer;
    transition: background 0.3s, transform 0.2s;
    text-transform: uppercase; letter-spacing: 0.5px;
}
.btn-checkout-sidebar:hover {
    background: var(--success-dark);
    transform: translateY(-2px);
}