/* =========================================
   VARIÁVEIS E REGRAS GLOBAIS
   ========================================= */
:root {
    --primary: #007aff;
    --primary-dark: #0056b3;
    --success: #25d366;
    --danger: #ef4444;
    --bg-body: #f8fafc;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --radius-lg: 20px;
    --radius-md: 12px;
    --shadow-soft: 0 10px 25px -5px rgba(0, 0, 0, 0.05);
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
}

.hidden { display: none !important; }

/* =========================================
   HEADER
   ========================================= */
header {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: white;
    padding: 60px 20px;
    text-align: center;
}

header h1 { font-size: 2.2rem; font-weight: 700; margin-bottom: 5px; }
header p { opacity: 0.8; font-size: 1rem; }

/* =========================================
   SEÇÃO ADMIN (ÍCONES E BOTÕES CORRIGIDOS)
   ========================================= */
#admin-access-section {
    max-width: 1100px;
    margin: 20px auto 0;
    padding: 0 20px;
    display: flex;
    justify-content: flex-end;
}

#admin-access-section .button {
    padding: 14px 24px;
    font-size: 1rem;
    gap: 12px; /* Espaço entre ícone e texto */
}

/* Aumenta o tamanho dos ícones do Admin */
#admin-access-section .button i {
    font-size: 1.2rem;
}

#btnHideAdminPanel {
    background-color: var(--danger);
    color: white;
}

@media (max-width: 600px) {
    #admin-access-section { justify-content: center; }
    #admin-access-section .button { 
        width: 100%; 
        justify-content: center;
        height: 55px;
    }
}

/* =========================================
   BARRA DE BUSCA E FILTROS
   ========================================= */
#search-section {
    max-width: 1100px;
    margin: 20px auto 40px;
    padding: 0 20px;
}

.search-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.search-box {
    position: relative;
    background: white;
    border-radius: 50px;
    display: flex;
    align-items: center;
    box-shadow: var(--shadow-soft);
    border: 1px solid #e2e8f0;
    width: 100%;
}

.search-box i {
    position: absolute;
    left: 20px;
    color: var(--text-muted);
}

.search-box input {
    width: 100%;
    padding: 15px 20px 15px 55px;
    border: none;
    border-radius: 50px;
    outline: none;
    font-size: 1rem;
}

.filter-box {
    display: flex;
    gap: 10px;
    width: 100%;
}

.filter-box select, #search-button {
    height: 50px;
    border-radius: 50px;
    border: 1px solid #e2e8f0;
    background: white;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    box-shadow: var(--shadow-soft);
}

.filter-box select {
    flex: 2;
    padding: 0 20px;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2364748b' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 20px center;
}

#search-button {
    flex: 1;
    background: var(--primary);
    color: white;
    border: none;
}

@media (min-width: 850px) {
    .search-container { flex-direction: row; align-items: center; }
    .filter-box { width: auto; min-width: 450px; }
}

/* =========================================
   CARRINHO SIDEBAR (CORREÇÃO DE IMAGEM GIGANTE)
   ========================================= */
.cart-sidebar {
    position: fixed;
    right: 0; top: 0;
    width: 400px; max-width: 100%;
    height: 100%;
    background: white;
    box-shadow: -10px 0 40px rgba(0,0,0,0.15);
    z-index: 3000;
    display: flex;
    flex-direction: column;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.cart-sidebar.hidden { transform: translateX(100%); display: flex !important; }

.cart-header { 
    padding: 20px 25px; background: #0f172a; color: white;
    display: flex; justify-content: space-between; align-items: center;
}

.close-cart-btn {
    background: none; border: none; color: white;
    font-size: 2rem; cursor: pointer; line-height: 1;
}

.cart-body { flex: 1; overflow-y: auto; padding: 15px; background: #f8fafc; }

/* FIX DA IMAGEM NO CARRINHO */
.cart-item {
    display: flex;
    align-items: center;
    gap: 15px;
    background: white;
    padding: 10px;
    margin-bottom: 10px;
    border-radius: var(--radius-md);
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.cart-item img {
    width: 70px !important;  /* Força a largura da miniatura */
    height: 70px !important; /* Força a altura da miniatura */
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0; /* Não deixa a imagem ser espremida */
}

.cart-item-info { flex: 1; }
.cart-item-info h4 { font-size: 0.9rem; margin-bottom: 2px; }
.cart-item-info p { font-weight: 700; color: var(--primary); font-size: 0.95rem; }

.cart-footer { padding: 25px; border-top: 1px solid #eee; background: white; }
.cart-total-row { display: flex; justify-content: space-between; margin-bottom: 20px; font-size: 1.3rem; font-weight: 700; }

#checkout-button {
    width: 100%; padding: 16px; background: var(--success);
    color: white; border: none; border-radius: 50px;
    font-weight: 700; font-size: 1.1rem; cursor: pointer;
}

/* =========================================
   BOTÃO FLUTUANTE E GRID
   ========================================= */
.floating-cart {
    position: fixed; bottom: 30px; right: 30px;
    width: 65px; height: 65px; background: var(--primary);
    color: white; border-radius: 50%; display: flex;
    align-items: center; justify-content: center;
    box-shadow: 0 10px 25px rgba(0,122,255,0.3);
    cursor: pointer; z-index: 2000; font-size: 1.5rem;
}

#cart-count-badge {
    position: absolute; top: 0; right: 0;
    background: var(--danger); color: white;
    width: 24px; height: 24px; border-radius: 50%;
    font-size: 0.8rem; display: flex; align-items: center; justify-content: center;
}

.products-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px; max-width: 1100px; margin: 0 auto; padding: 0 20px;
}

.button {
    padding: 12px 24px; border-radius: 50px; border: none;
    font-weight: 600; cursor: pointer; display: inline-flex;
    align-items: center; gap: 8px; transition: 0.3s;
}
.button-primary { background: var(--primary); color: white; }
.button-success { background: var(--success); color: white; }

.footer-simple { background: #0f172a; color: #94a3b8; padding: 30px; text-align: center; margin-top: 50px; }

/* Paginação */
#pagination { display: flex; justify-content: center; gap: 10px; margin: 40px 0; }
.pagination-button { 
    min-width: 40px; height: 40px; border: 1px solid #e2e8f0; 
    background: white; border-radius: 8px; cursor: pointer; font-weight: 700;
}
.pagination-button.active { background: var(--primary); color: white; border-color: var(--primary); }
