/* =============================================
   ACEITE DE JABALÍ SUPPLY CO.
   Retro-Utility Design System
   ============================================= */

/* CSS Variables */
:root {
    /* Colors - Brand Palette (New Light Minimalist) */
    --bg-main-start: #f5f2e8;
    /* Soft Cream/Beige */
    --bg-main-end: #e8f3f0;
    /* Very Light Blue-Green/Mint */

    --text-primary: #1a1a1a;
    /* Near Black for readability */
    --text-secondary: #4a4a4a;
    /* Dark Grey for secondary info */
    --text-muted: #8a8a8a;
    /* Muted grey for metadata */

    --accent-color: #2d5a44;
    /* Deep Forest Green from logo for accents */

    --sidebar-bg: transparent;
    --border-color: rgba(0, 0, 0, 0.05);

    /* Typography */
    --font-mono: 'IBM Plex Mono', monospace;
    --font-sans: 'Inter', sans-serif;

    /* Spacing */
    --sidebar-width: 200px;
    --grid-gap: 16px;
    --padding-base: 40px;

    /* Transitions */
    --transition-fast: 200ms ease;
    --transition-normal: 400ms cubic-bezier(0.16, 1, 0.3, 1);
}

/* Reset & Base */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-primary);
    background-color: var(--bg-main-start);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Background Gradient */
.site-background {
    position: fixed;
    inset: 0;
    z-index: -1;
    background: linear-gradient(135deg, var(--bg-main-start) 40%, var(--bg-main-end) 100%);
}

/* Decorative Star */
.decorative-star {
    position: fixed;
    bottom: 30px;
    right: 30px;
    font-size: 24px;
    color: rgba(0, 0, 0, 0.15);
    z-index: 10;
    pointer-events: none;
    user-select: none;
    animation: pulse-spin 8s infinite linear;
}

@keyframes pulse-spin {
    0% {
        transform: scale(1) rotate(0deg);
        opacity: 0.15;
    }

    50% {
        transform: scale(1.1) rotate(180deg);
        opacity: 0.25;
    }

    100% {
        transform: scale(1) rotate(360deg);
        opacity: 0.15;
    }
}

/* =============================================
   SIDEBAR
   ============================================= */

.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--sidebar-width);
    padding: var(--padding-base);
    display: flex;
    flex-direction: column;
    background-color: var(--sidebar-bg);
    z-index: 100;
}

.sidebar-header {
    margin-bottom: 60px;
}

.logo {
    display: block;
}

.logo-image {
    width: 100%;
    max-width: 160px;
    height: auto;
    display: block;
    /* Remove invert filter as we are now on light background */
    filter: none;
    transition: transform var(--transition-fast);
}

.logo:hover .logo-image {
    transform: scale(1.02);
}

/* Sidebar Navigation */
.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 32px;
    flex: 1;
}

.nav-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.nav-link-main,
.nav-link {
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--text-secondary);
    text-decoration: none;
    text-transform: capitalize;
    transition: all var(--transition-fast);
    cursor: pointer;
    position: relative;
    width: fit-content;
}

.nav-link-main {
    font-weight: 500;
}

.nav-link:hover,
.nav-link-main:hover,
.nav-link.active {
    color: var(--text-primary);
}

.nav-link.active::before {
    content: '';
    position: absolute;
    left: -12px;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 4px;
    background-color: var(--text-primary);
    border-radius: 50%;
}

/* Sidebar Footer */
.sidebar-footer {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 40px;
}

/* =============================================
   MAIN CONTENT
   ============================================= */

.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    padding: var(--padding-base);
}

/* Products Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 32px;
    max-width: 1400px;
}

/* Loading State */
.loading-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 100px 20px;
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--text-muted);
}

/* Product Card */
.product-card {
    aspect-ratio: 1;
    cursor: pointer;
    transition: transform var(--transition-normal);
    background: white;
    overflow: hidden;
    position: relative;
}

.product-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.03);
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.product-card:hover::after {
    opacity: 1;
}

.product-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-normal);
}

.product-card:hover img {
    transform: scale(1.05);
}

/* Category Section */
.category-section {
    grid-column: 1 / -1;
    margin-top: 80px;
    margin-bottom: 24px;
}

.category-section:first-of-type {
    margin-top: 0;
}

.category-title {
    font-family: var(--font-mono);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* =============================================
   MODAL
   ============================================= */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-normal), visibility var(--transition-normal);
}

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

.modal-window {
    background: white;
    max-width: 900px;
    width: 95%;
    max-height: 90vh;
    overflow-y: auto;
    transform: translateY(20px);
    transition: transform var(--transition-normal);
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.1);
}

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

/* Modal Header - Minimalist */
.modal-header {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 10;
}

.modal-close {
    background: white;
    border: none;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    color: var(--text-primary);
    transition: transform var(--transition-fast);
    border-radius: 50%;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.modal-close:hover {
    transform: rotate(90deg);
}

/* Modal Body */
.modal-body {
    display: contents;
    /* Allow grid to work on direct children */
}

.modal-image-container {
    background: #f9f9f9;
    padding: 0;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.modal-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.modal-info {
    padding: 60px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: left;
}

.modal-title {
    font-family: var(--font-sans);
    font-size: 32px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 24px;
    line-height: 1.2;
}

.modal-description {
    margin-bottom: 32px;
    font-family: var(--font-sans);
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.8;
}

.modal-price {
    font-family: var(--font-mono);
    font-size: 24px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 40px;
}

.modal-meta {
    font-family: var(--font-mono);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: 12px;
}

/* Contact Button */
.modal-contact {
    margin-top: auto;
}

.contact-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 500;
    color: white;
    text-decoration: none;
    padding: 18px 32px;
    background: var(--text-primary);
    transition: all var(--transition-fast);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    width: 100%;
}

.contact-button:hover {
    background: #333;
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

/* =============================================
   RESPONSIVE
   ============================================= */

@media (max-width: 1024px) {
    :root {
        --sidebar-width: 180px;
        --padding-base: 30px;
    }

    .modal-window {
        grid-template-columns: 1fr;
    }

    .modal-info {
        padding: 40px;
    }

    .modal-image-container {
        height: 400px;
    }
}

@media (max-width: 768px) {
    .sidebar {
        position: static;
        width: 100%;
        padding: 20px;
        height: auto;
        border-bottom: 1px solid var(--border-color);
    }

    .sidebar-header {
        margin-bottom: 20px;
    }

    .sidebar-nav {
        flex-direction: row;
        gap: 20px;
        overflow-x: auto;
        padding-bottom: 10px;
    }

    .nav-section {
        flex-direction: row;
        gap: 20px;
    }

    .main-content {
        margin-left: 0;
        padding: 20px;
    }

    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 16px;
    }

    .decorative-star {
        bottom: 20px;
        right: 20px;
        font-size: 18px;
    }
}

/* Empty State */
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 80px 20px;
    font-family: var(--font-mono);
}

.empty-state h2 {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.empty-state p {
    font-size: 12px;
    color: var(--text-secondary);
}