/* --- RESET & VARIABLES --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Montserrat', sans-serif;
    -webkit-tap-highlight-color: transparent;
}

/* Dark Mode Palette (Default) */
:root {
    --bg-gradient: radial-gradient(circle at 50% 0%, #1e222b 0%, #0d0f12 100%);
    --header-bg: rgba(13, 15, 18, 0.8);
    --menu-bg: rgba(13, 15, 18, 0.98);
    
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shine: rgba(255, 255, 255, 0.15);
    --glass-shadow: rgba(0, 0, 0, 0.4);
    --card-hover-shadow: rgba(255, 255, 255, 0.03);

    --text-primary: #f5f5f7;
    --text-secondary: #a1a1a6;
    --silver: #e2e8f0;
    --button-bg: rgba(255, 255, 255, 0.9);
    --button-text: #0d0f12;
    --button-hover: #ffffff;
    --overlay-bg: rgba(7, 8, 10, 0.6);
    
    --transition-smooth: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Light Mode Palette */
[data-theme="light"] {
    --bg-gradient: radial-gradient(circle at 50% 0%, #f4f1ea 0%, #e5dfd3 100%);
    --header-bg: rgba(244, 241, 234, 0.85);
    --menu-bg: rgba(229, 223, 211, 0.98);
    
    --glass-bg: rgba(255, 255, 255, 0.45);
    --glass-border: rgba(255, 255, 255, 0.5);
    --glass-shine: rgba(255, 255, 255, 0.6);
    --glass-shadow: rgba(142, 136, 122, 0.15);
    --card-hover-shadow: rgba(255, 255, 255, 0.8);

    --text-primary: #2c2a27;
    --text-secondary: #706b63;
    --silver: #8a95a5;
    --button-bg: rgba(44, 42, 39, 0.9);
    --button-text: #f4f1ea;
    --button-hover: #1c1a18;
    --overlay-bg: rgba(229, 223, 211, 0.6);
}

body {
    background: var(--bg-gradient);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    transition: var(--transition-smooth);
    line-height: 1.5;
}

/* --- UTILITIES --- */
.liquid-glass {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    box-shadow: 0 8px 32px 0 var(--glass-shadow),
                inset 0 1px 0 0 rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    transition: var(--transition-smooth);
}

/* --- HEADER & NAVIGATION --- */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 70px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 5%;
    z-index: 100;
    background: var(--header-bg);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-bottom: 1px solid var(--glass-border);
    transition: var(--transition-smooth);
}

.logo {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 3px;
    color: var(--text-primary);
    text-transform: uppercase;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Botão Tema */
.theme-toggle-btn {
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle-btn svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
}

.theme-toggle-btn .sun-icon { display: none; }
[data-theme="light"] .theme-toggle-btn .sun-icon { display: block; }
[data-theme="light"] .theme-toggle-btn .moon-icon { display: none; }

/* Carrinho */
.cart-trigger {
    position: relative;
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
}

.cart-badge {
    position: absolute;
    top: 0;
    right: 0;
    background: var(--text-primary);
    color: var(--button-text);
    font-size: 0.65rem;
    font-weight: 700;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: scale(1);
    transition: var(--transition-smooth);
}

/* Esconde badge do snipcart se estiver vazia (nativamente controlado pelo snipcart-items-count) */
.cart-badge.snipcart-items-count-empty {
    display: none;
}

/* Menu Lateral */
.menu-btn {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 24px;
    height: 15px;
    cursor: pointer;
    z-index: 102;
}

.menu-btn span {
    width: 100%;
    height: 2px;
    background-color: var(--text-primary);
    transition: var(--transition-smooth);
    border-radius: 2px;
}

.menu-btn.active span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.menu-btn.active span:nth-child(2) { opacity: 0; }
.menu-btn.active span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

.nav-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    max-width: 320px;
    height: 100vh;
    background: var(--menu-bg);
    backdrop-filter: blur(20px);
    z-index: 101;
    display: flex;
    flex-direction: column;
    padding: 40px;
    transition: var(--transition-smooth);
    border-left: 1px solid var(--glass-border);
}

.nav-menu.open {
    right: 0;
}

.nav-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 20px;
    margin-bottom: 30px;
}

.nav-menu h3 {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-secondary);
}

.nav-menu ul { list-style: none; }
.nav-menu ul li { margin-bottom: 1.5rem; }
.nav-menu ul li a {
    font-size: 1.2rem;
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 300;
    transition: var(--transition-smooth);
    display: block;
}

.nav-menu ul li a.active, .nav-menu ul li a:hover {
    color: var(--text-primary);
    transform: translateX(5px);
}

/* --- CATEGORY TITLE --- */
.category-header {
    width: 100%;
    margin: 100px auto 0;
    padding: 0 20px;
    text-align: center;
}

.category-header h1 {
    font-size: 1.8rem;
    font-weight: 300;
    letter-spacing: 2px;
    text-transform: uppercase;
}

/* --- PRODUCT GRID --- */
.container {
    width: 100%;
    max-width: 1400px;
    margin: 30px auto 60px;
    padding: 0 20px;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 24px;
    width: 100%;
}

/* Cartão do Produto */
.product-card {
    position: relative;
    overflow: hidden;
    cursor: pointer;
    padding: 12px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border-radius: 16px;
    transition: var(--transition-smooth);
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 30px 0 var(--glass-shadow);
    border-color: rgba(255, 255, 255, 0.3);
}

.product-image-container {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    margin-bottom: 12px;
}

.product-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-smooth);
}

.product-card:hover .product-image-container img {
    transform: scale(1.05);
}

.product-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 4px 2px;
}

.product-title {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-price {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--silver);
}

/* --- DETAIL POPUP (MODAL) --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--overlay-bg);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 15px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease, backdrop-filter 0.4s ease;
    backdrop-filter: blur(0px);
    -webkit-backdrop-filter: blur(0px);
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.modal-content {
    width: 100%;
    max-width: 800px;
    max-height: 90vh;
    padding: 30px;
    position: relative;
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 30px;
    overflow-y: auto;
    border-radius: 20px;
    transform: scale(0.95);
    transition: var(--transition-smooth);
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255, 255, 255, 0.05);
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 10;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-smooth);
}

.close-btn:hover {
    transform: rotate(90deg);
    background: var(--glass-border);
}

.modal-gallery {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.main-modal-img-container {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--glass-border);
}

.main-modal-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.thumbnail-row {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.thumbnail {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    opacity: 0.5;
    border: 1px solid transparent;
    transition: var(--transition-smooth);
    flex-shrink: 0;
}

.thumbnail.active, .thumbnail:hover {
    opacity: 1;
    border-color: var(--text-primary);
}

.modal-details {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.modal-category {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.modal-title {
    font-size: 1.6rem;
    font-weight: 400;
    margin-bottom: 12px;
    line-height: 1.2;
}

.modal-price {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--silver);
    margin-bottom: 15px;
}

.modal-description {
    font-size: 0.85rem;
    line-height: 1.5;
    color: var(--text-secondary);
    margin-bottom: 25px;
}

.buy-btn {
    background: var(--button-bg);
    color: var(--button-text);
    border: none;
    padding: 14px;
    border-radius: 25px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
    text-align: center;
}

.buy-btn:hover {
    background: var(--button-hover);
    transform: translateY(-2px);
}

/* --- CUSTOM STYLING OVERRIDES PARA O POPUP DO SNIPCART --- */
/* Customização opcional para o próprio Snipcart se adequar ainda mais ao nosso estilo de vidro líquido */
.snipcart-modal {
    backdrop-filter: blur(15px) !important;
    background-color: var(--overlay-bg) !important;
}

/* --- RESPONSIVIDADE --- */
@media (max-width: 820px) {
    .modal-content {
        grid-template-columns: 1fr;
        max-height: 85vh;
        gap: 20px;
        padding: 20px;
    }
    .modal-details { justify-content: flex-start; }
}

@media (max-width: 500px) {
    header { height: 60px; }
    .category-header { margin-top: 80px; }
    .category-header h1 { font-size: 1.4rem; }

    .grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        padding: 0;
    }

    .container {
        padding: 0 12px;
        margin-bottom: 40px;
    }

    .product-card {
        padding: 8px;
        border-radius: 12px;
    }

    .product-title { font-size: 0.8rem; }
    .product-price { font-size: 0.85rem; }
}