:root {
    --primary-color: #333;
    --accent-color: #8d6e63;
    --bg-color: #f5e6d3;
    --white: #ffffff;
    --text-dark: #2c2c2c;
    --text-light: #666;
    --shadow: 0 4px 12px rgba(0,0,0,0.08);
    --header-bg: rgba(245, 230, 211, 0.95);
}

/* Tema Padrão (Classic / Cream & Brown) */
body.theme-default {
    --primary-color: #333;
    --accent-color: #8d6e63;
    --bg-color: #f5e6d3;
    --white: #ffffff;
    --text-dark: #2c2c2c;
    --text-light: #666;
    --shadow: 0 4px 12px rgba(0,0,0,0.08);
    --header-bg: rgba(245, 230, 211, 0.95);
}

/* Tema Escuro Elegante (Dark Mode) */
body.theme-dark {
    --primary-color: #f5f5f5;
    --accent-color: #d7ccc8;
    --bg-color: #121212;
    --white: #1e1e1e;
    --text-dark: #f5f5f5;
    --text-light: #aaa;
    --shadow: 0 4px 12px rgba(0,0,0,0.5);
    --header-bg: rgba(18, 18, 18, 0.95);
}

/* Tema Romântico / Floral (Rosa e Dourado) */
body.theme-romantic {
    --primary-color: #4a2c3a;
    --accent-color: #d4a373;
    --bg-color: #fae1dd;
    --white: #ffffff;
    --text-dark: #4a2c3a;
    --text-light: #8b5e6c;
    --shadow: 0 4px 12px rgba(139,94,108,0.1);
    --header-bg: rgba(250, 225, 221, 0.95);
}

/* Tema Minimalista Moderno (Azul Petróleo / Escandinavo) */
body.theme-modern {
    --primary-color: #2b2d42;
    --accent-color: #ef233c;
    --bg-color: #edf2f4;
    --white: #ffffff;
    --text-dark: #2b2d42;
    --text-light: #8d99ae;
    --shadow: 0 4px 16px rgba(43,45,66,0.08);
    --header-bg: rgba(237, 242, 244, 0.95);
}

/* Tema Natureza / Rústico (Verde Oliva) */
body.theme-nature {
    --primary-color: #2c3531;
    --accent-color: #b88a44;
    --bg-color: #f1f2eb;
    --white: #ffffff;
    --text-dark: #2c3531;
    --text-light: #606c38;
    --shadow: 0 4px 12px rgba(96,108,56,0.08);
    --header-bg: rgba(241, 242, 235, 0.95);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-color);
    color: var(--text-dark);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background-color 0.3s, color 0.3s;
}

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: var(--header-bg);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    transition: background 0.3s;
}

.logo {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.logo span {
    font-weight: 300;
    color: var(--accent-color);
}

.header-icons {
    display: flex;
    gap: 18px;
    font-size: 20px;
    align-items: center;
}

.cart-icon {
    position: relative;
    cursor: pointer;
}

#cart-count {
    position: absolute;
    top: -8px;
    right: -10px;
    background: #e74c3c;
    color: white;
    font-size: 11px;
    font-weight: bold;
    min-width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 2px solid var(--bg-color);
}

/* Navegação de Categorias */
.categories-nav {
    display: flex;
    overflow-x: auto;
    padding: 15px 20px;
    gap: 10px;
    scrollbar-width: none;
    -ms-overflow-style: none;
    background: var(--bg-color);
}

.categories-nav::-webkit-scrollbar {
    display: none;
}

.category-btn {
    padding: 10px 22px;
    border: 1.5px solid var(--accent-color);
    background: transparent;
    border-radius: 25px;
    white-space: nowrap;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: var(--accent-color);
}

.category-btn.active {
    background: var(--accent-color);
    color: white;
    box-shadow: 0 4px 10px rgba(141, 110, 99, 0.3);
}

/* Título da Categoria */
.category-title {
    text-align: center;
    padding: 30px 20px;
}

.category-title h1 {
    font-size: 26px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 8px;
    position: relative;
    display: inline-block;
}

.category-title h1::after {
    content: '';
    display: block;
    width: 50%;
    height: 3px;
    background: var(--accent-color);
    margin: 5px auto 0;
    border-radius: 2px;
}

.category-title p {
    font-size: 13px;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Grid de Produtos */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    padding: 0 20px 40px;
    max-width: 1200px;
    margin: 0 auto;
}

.product-card {
    background: var(--white);
    border-radius: 20px;
    padding: 20px;
    position: relative;
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: var(--shadow);
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.12);
}

.product-image {
    width: 100%;
    height: 220px;
    object-fit: contain;
    margin-bottom: 15px;
    transition: transform 0.5s;
}

.product-card:hover .product-image {
    transform: scale(1.05);
}

.product-info {
    text-align: center;
    width: 100%;
}

.product-info h3 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-dark);
}

.product-info p {
    font-size: 13px;
    color: var(--text-light);
    margin-bottom: 15px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 40px;
}

.product-price {
    font-size: 18px;
    font-weight: 800;
    color: var(--accent-color);
}

.add-to-cart {
    position: absolute;
    top: 15px;
    right: 15px;
    background: var(--accent-color);
    color: white;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: none;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    transition: all 0.3s;
    z-index: 5;
}

.add-to-cart i {
    pointer-events: none;
}

/* Menu Sidebar (Esquerdo) */
.menu-sidebar {
    position: fixed;
    top: 0;
    left: -100%;
    width: 100%;
    max-width: 320px;
    height: 100%;
    background: var(--white);
    z-index: 1000;
    transition: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    box-shadow: 10px 0 30px rgba(0,0,0,0.1);
}

.menu-sidebar.active {
    left: 0;
}

.menu-header {
    padding: 25px 20px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.close-menu {
    font-size: 28px;
    cursor: pointer;
    color: var(--text-light);
}

.menu-body {
    flex: 1;
    overflow-y: auto;
    padding: 25px 20px;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    border-radius: 12px;
    text-decoration: none;
    color: var(--text-dark);
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s;
    margin-bottom: 8px;
}

.menu-item:hover {
    background: var(--bg-color);
    color: var(--accent-color);
}

.menu-item.active {
    background: var(--accent-color);
    color: white;
}

.menu-item i {
    width: 18px;
    text-align: center;
    font-size: 16px;
}

/* Carrinho Sidebar */
.cart-sidebar {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    max-width: 400px;
    height: 100%;
    background: var(--white);
    z-index: 1000;
    transition: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    box-shadow: -10px 0 30px rgba(0,0,0,0.1);
}

.cart-sidebar.active {
    right: 0;
}

.cart-header {
    padding: 25px 20px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-header h2 {
    font-size: 20px;
    font-weight: 800;
}

.close-cart {
    font-size: 28px;
    cursor: pointer;
    color: var(--text-light);
}

.cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.cart-item {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #f9f9f9;
}

.cart-item img {
    width: 70px;
    height: 70px;
    object-fit: contain;
    background: #fdfdfd;
    border-radius: 10px;
}

.cart-item-info {
    flex: 1;
}

.cart-item-info h4 {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 4px;
}

.cart-item-info p {
    font-size: 14px;
    font-weight: 600;
    color: var(--accent-color);
}

.remove-item {
    color: #e74c3c;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 5px;
    display: inline-block;
}

.cart-footer {
    padding: 25px 20px;
    background: #fafafa;
    border-top: 1px solid #f0f0f0;
}

.total {
    font-size: 20px;
    font-weight: 800;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
}

.checkout-btn {
    width: 100%;
    padding: 18px;
    background: #25d366;
    color: white;
    border: none;
    border-radius: 15px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: transform 0.2s, background 0.3s;
}

.checkout-btn:active {
    transform: scale(0.98);
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(4px);
    z-index: 999;
    display: none;
    opacity: 0;
    transition: opacity 0.3s;
}

.overlay.active {
    display: block;
    opacity: 1;
}

/* Responsividade */
@media (max-width: 768px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
        padding: 0 15px 30px;
    }
    
    .product-card {
        padding: 15px;
        border-radius: 15px;
    }
    
    .product-image {
        height: 160px;
    }
    
    .product-info h3 {
        font-size: 14px;
    }
    
    .product-info p {
        font-size: 11px;
        height: 34px;
    }
    
    .product-price {
        font-size: 16px;
    }
    
    .category-title h1 {
        font-size: 22px;
    }
}

@media (max-width: 480px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .cart-sidebar {
        max-width: 100%;
    }
    
    .logo {
        font-size: 20px;
    }
    
    .add-to-cart {
        width: 36px;
        height: 36px;
        top: 10px;
        right: 10px;
    }
}
