:root {
    /* Colors */
    --primary: #1E1B4B; 
    --primary-light: #312E81;
    --accent: #4F46E5;
    --background: #F8FAFC;
    --surface: #FFFFFF;
    --text-main: #0F172A;
    --text-muted: #64748B;
    --border: #E2E8F0;
    --whatsapp: #25D366;
    
    /* Spacing & Sizes */
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.05);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.08);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--background);
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Base Layout */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.section-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

.narrow-container {
    max-width: 800px;
}

/* Header */
.main-header {
    background-color: var(--surface);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 50;
    width: 100%;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary);
}

.logo i {
    font-size: 1.8rem;
    color: var(--accent);
}

.desktop-nav {
    display: none; /* hidden on mobile */
    gap: 24px;
}

.nav-link {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
    font-size: 1rem;
    cursor: pointer;
}

.nav-link:hover, .nav-link.active {
    color: var(--primary);
    font-weight: 600;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.icon-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-main);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    border-radius: 50%;
    transition: background 0.2s;
}

.icon-btn:hover {
    background: var(--border);
}

.mobile-menu-btn {
    display: flex;
}

/* Drawer (Mobile Nav) */
.mobile-drawer {
    position: fixed;
    top: 0;
    right: -300px;
    width: 300px;
    height: 100%;
    background-color: var(--surface);
    z-index: 100;
    box-shadow: -5px 0 15px rgba(0,0,0,0.1);
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
}

.mobile-drawer.active {
    right: 0;
}

.drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--border);
}

.logo-drawer {
    font-weight: 700;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.drawer-nav {
    display: flex;
    flex-direction: column;
    padding: 20px;
    gap: 20px;
}

.drawer-link {
    font-size: 1.2rem;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--background);
}

.drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    z-index: 99;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.drawer-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* View Sections (SPA) */
.view-section {
    display: none; /* hidden by default */
    padding-bottom: 60px;
    animation: fadeIn 0.3s ease;
}

.view-section.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Hero Banner */
.hero-banner {
    max-width: 1200px;
    margin: 20px auto;
    width: calc(100% - 40px);
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    padding: 40px 24px;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: flex-start;
}

.hero-banner h2 {
    font-size: 2rem;
    font-weight: 700;
    z-index: 1;
}

.hero-banner p {
    font-size: 1.1rem;
    opacity: 0.9;
    z-index: 1;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background-color: var(--surface);
    color: var(--primary);
    border: none;
    padding: 12px 28px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    text-decoration: none;
}

.btn:active {
    transform: scale(0.98);
}

.btn-small {
    padding: 10px 20px;
    font-size: 0.95rem;
    border-radius: 20px;
}

.btn-whatsapp {
    background-color: var(--whatsapp);
    color: white;
    width: 100%;
    font-size: 1.1rem;
    padding: 16px;
    border-radius: var(--radius-md);
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
}

/* Horizontal Scroll Utilities */
.scroll-horizontal-hidden {
    display: flex;
    overflow-x: auto;
    scroll-behavior: smooth;
    -ms-overflow-style: none; /* IE and Edge */
    scrollbar-width: none;    /* Firefox */
}
.scroll-horizontal-hidden::-webkit-scrollbar {
    display: none; /* Chrome, Safari and Opera */
}

/* Search Bar */
.search-bar-container {
    margin-top: 16px;
    width: 100%;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--surface);
    border-radius: var(--radius-md);
    padding: 0 16px;
    box-shadow: inset 0 0 0 1px var(--border);
    transition: box-shadow 0.2s;
}

.search-input-wrapper:focus-within {
    box-shadow: inset 0 0 0 2px var(--primary);
}

.search-input-wrapper i {
    color: var(--text-muted);
    font-size: 1.2rem;
}

.search-input {
    width: 100%;
    border: none;
    background: transparent;
    padding: 16px 12px;
    font-size: 1rem;
    color: var(--text-main);
    outline: none;
    font-family: inherit;
}

.search-input::placeholder {
    color: var(--text-muted);
}

/* Section Titles */
.section-title {
    font-size: 1.4rem;
    margin: 30px 0 20px;
    color: var(--primary);
}

/* Categories Image Grid */
.categories-grid {
    display: flex;
    overflow-x: auto;
    gap: 16px;
    padding-bottom: 10px;
}

.category-card {
    display: flex;
    flex-direction: column;
    width: 120px;
    flex-shrink: 0;
    cursor: pointer;
    transition: transform 0.2s;
    text-decoration: none;
    align-items: center;
}

.category-card:hover {
    transform: translateY(-3px);
}

.category-card:active {
    transform: scale(0.95);
}

.category-card-img-wrapper {
    width: 120px;
    height: 120px;
    border-radius: var(--radius-md);
    overflow: hidden;
    background-color: var(--border);
    margin-bottom: 12px;
    box-shadow: var(--shadow-sm);
    border: 3px solid transparent;
    transition: border-color 0.2s;
}

.category-card.active .category-card-img-wrapper {
    border-color: var(--primary);
}

.category-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.category-card-title {
    font-size: 0.9rem;
    color: var(--text-muted);
    text-align: center;
    font-weight: 500;
}

.category-card.active .category-card-title {
    color: var(--primary);
    font-weight: 700;
}

/* Products Grid */
.category-group-title {
    font-size: 1.5rem;
    color: var(--primary);
    margin: 40px 0 20px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--border);
    width: 100%;
}
.all-products-container > .category-group-title:first-child {
    margin-top: 10px;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.products-grid.large-grid {
    margin-top: 24px;
}

/* Product Card */
.product-card {
    background: var(--surface);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-3px);
}

.product-card:active {
    transform: scale(0.98);
}

.product-img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    background-color: var(--border);
}

.product-info {
    padding: 16px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.product-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-main);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-price {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
    margin-top: auto;
}

.product-installments {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Text Pages (Sobre, Assistencia, Cadastro) */
.page-header {
    margin: 40px 0 20px;
}
.page-header h2 {
    font-size: 2rem;
    color: var(--primary);
    margin-bottom: 8px;
}
.page-header p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

.text-page {
    margin-top: 40px;
}

.text-page h2 {
    color: var(--primary);
    margin-bottom: 24px;
    font-size: 2rem;
}

.text-page h3 {
    color: var(--primary);
    margin: 32px 0 16px;
    font-size: 1.4rem;
}

.text-page p {
    line-height: 1.6;
    margin-bottom: 16px;
    font-size: 1.05rem;
    color: var(--text-main);
}

.instructions-box {
    background-color: var(--surface);
    padding: 24px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    margin: 24px 0;
}

.instructions-box h3 {
    margin-top: 0;
}

.instructions-box ol, .instructions-box ul {
    margin-left: 20px;
    line-height: 1.6;
}

.instructions-box li {
    margin-bottom: 12px;
}

/* Category Filters (Pills) text-only pages */
.categories-filter {
    margin-bottom: 20px;
}
.category-pill {
    padding: 8px 20px;
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    color: var(--text-main);
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
    margin-right: 12px;
    list-style: none;
    transition: all 0.2s;
}
.category-pill.active {
    background-color: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Footer */
.app-footer {
    background-color: var(--surface);
    border-top: 1px solid var(--border);
    padding: 30px 20px;
    text-align: center;
    color: var(--text-muted);
    margin-top: auto;
}

/* Modal (Popup / Bottom Sheet) */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: flex-end; /* Default for mobile */
    pointer-events: none;
}

.modal.active {
    pointer-events: auto;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(2px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.active .modal-overlay {
    opacity: 1;
}

.modal-sheet {
    background: var(--background);
    width: 100%;
    height: 85vh;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.1, 0.8, 0.2, 1);
    position: relative;
    z-index: 1001;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
}

.modal.active .modal-sheet {
    transform: translateY(0);
}

.modal-header {
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: absolute;
    top: 0;
    width: 100%;
    z-index: 10;
}

.drag-handle {
    width: 40px;
    height: 5px;
    background: rgba(255,255,255,0.7);
    border-radius: 10px;
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
}

.modal-header .icon-btn {
    background: rgba(0,0,0,0.4);
    color: white;
    margin-left: auto;
}

.modal-header .icon-btn:hover {
    background: rgba(0,0,0,0.6);
}

.modal-content {
    flex: 1;
    overflow-y: auto;
    padding-bottom: 40px;
    display: flex;
    flex-direction: column;
}

.modal-img-container {
    position: relative;
    overflow: hidden;
    background-color: var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
}

#modal-img {
    width: 100%;
    height: 350px;
    object-fit: contain;
    transition: transform 0.1s ease-out; /* Smooth follow mouse */
}

.gallery-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.7);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--text-main);
    cursor: pointer;
    z-index: 5;
    transition: background 0.2s;
    box-shadow: var(--shadow-sm);
}

.gallery-btn:hover {
    background: white;
}

#btn-prev-img {
    left: 10px;
}

#btn-next-img {
    right: 10px;
}

.modal-info {
    padding: 24px 20px;
    background: var(--surface);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    margin-top: -20px; /* Overlap image */
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 16px;
    flex: 1;
}

.tag {
    align-self: flex-start;
    background: var(--primary-light);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.2;
}

.product-metadata {
    margin: 10px 0;
    font-size: 1.05rem;
    color: var(--text-main);
    line-height: 1.6;
}

.product-metadata p {
    margin-bottom: 6px;
    padding-bottom: 6px;
    border-bottom: 1px dashed var(--border);
}

.product-metadata span {
    white-space: pre-wrap;
    display: block;
    margin-top: 4px;
    color: var(--text-muted);
}

.product-metadata strong {
    color: var(--primary);
}

.disclaimer-text {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-style: italic;
    margin-bottom: 20px;
    line-height: 1.4;
}

/* Representative Calculator */
.calculator-box {
    margin-top: 24px;
    padding: 20px;
    background-color: var(--background);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.calc-label {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-main);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.calc-input {
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 1.1rem;
    width: 100%;
    outline: none;
    transition: border-color 0.2s;
}

.calc-input:focus {
    border-color: var(--primary);
}

.calc-result {
    margin-top: 8px;
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-main);
}

#calc-final-price {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--primary);
    display: block;
    margin-top: 4px;
}

/* =========================================
   MEDIA QUERIES (DESKTOP ADJUSTMENTS)
   ========================================= */

@media (min-width: 768px) {
    /* Header */
    .mobile-menu-btn {
        display: none;
    }
    
    .desktop-nav {
        display: flex;
    }

    /* Products Grid */
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 20px;
    }
    
    .product-img {
        height: 200px;
    }
    
    /* Hero Banner */
    .hero-banner {
        padding: 60px 48px;
    }
    
    .hero-banner h2 {
        font-size: 2.8rem;
    }
    
    .hero-banner p {
        font-size: 1.25rem;
    }
    
    /* Modal (Become a Lightbox Popup instead of Bottom sheet) */
    .modal {
        align-items: center; /* Center vertically on desktop */
    }
    
    .modal-sheet {
        height: auto;
        max-height: 90vh;
        max-width: 900px;
        border-radius: var(--radius-lg);
        transform: scale(0.95);
        opacity: 0;
        transition: transform 0.3s ease, opacity 0.3s ease;
    }
    
    .modal.active .modal-sheet {
        transform: scale(1);
        opacity: 1;
    }
    
    .modal-content {
        flex-direction: row;
        overflow: hidden;
        padding-bottom: 0;
    }
    
    .modal-img-container {
        flex: 1;
        min-height: 500px;
        background-color: transparent; /* Reset bg for desktop if needed */
    }
    
    #modal-img {
        height: 100%;
        border-radius: var(--radius-lg) 0 0 var(--radius-lg);
    }
    
    .modal-info {
        flex: 1;
        margin-top: 0;
        border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
        padding: 40px;
        overflow-y: auto;
    }
    
    .desktop-hidden {
        display: none;
    }
}
