/* ========================================
   CATÁLOGO PREMIUM - ESTILOS
   Aesthetic: Luxury Editorial Magazine
   Light & Dark Mode
   ======================================== */

/* ----------------------------------------
   FUENTES PERSONALIZADAS
   ---------------------------------------- */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400&family=Outfit:wght@300;400;500;600;700&display=swap');

/* ----------------------------------------
   VARIABLES CSS - MODO OSCURO (DEFAULT)
   ---------------------------------------- */
:root {
    --bg-deep: #0A0A0A;
    --bg-surface: #111111;
    --bg-elevated: #1A1A1A;
    --bg-hover: #222222;
    
    --text-primary: #F5F3EF;
    --text-secondary: #9A9590;
    --text-muted: #5A5754;
    
    --gold: #C9A962;
    --gold-light: #E5D4A1;
    --gold-dark: #8B7642;
    
    --border-color: rgba(201, 169, 98, 0.1);
    --border-hover: rgba(201, 169, 98, 0.4);
    --border-btn: rgba(201, 169, 98, 0.3);
    
    --gradient-gold: linear-gradient(135deg, var(--gold) 0%, var(--gold-light) 50%, var(--gold) 100%);
    --bg-overlay: rgba(10, 10, 10, 0.95);
    --shadow-color: rgba(0, 0, 0, 0.5);
    --shadow-gold-color: rgba(201, 169, 98, 0.15);
    
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2.5rem;
    --space-2xl: 4rem;
    --space-3xl: 6rem;
    
    --font-display: 'Cormorant Garamond', Georgia, serif;
    --font-body: 'Outfit', sans-serif;
    
    --radius-xs: 4px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    
    --shadow-soft: 0 4px 20px rgba(0, 0, 0, 0.3);
    --shadow-elevated: 0 8px 40px var(--shadow-color);
    --shadow-gold: 0 0 30px var(--shadow-gold-color);
    
    --ease-elegant: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ----------------------------------------
   MODO CLARO
   ---------------------------------------- */
[data-theme="light"] {
    --bg-deep: #FAF9F7;
    --bg-surface: #FFFFFF;
    --bg-elevated: #F5F3F0;
    --bg-hover: #EEEBE6;
    
    --text-primary: #1A1A1A;
    --text-secondary: #5A5754;
    --text-muted: #9A9590;
    
    --gold: #B8860B;
    --gold-light: #DAA520;
    --gold-dark: #8B6914;
    
    --border-color: rgba(184, 134, 11, 0.15);
    --border-hover: rgba(184, 134, 11, 0.5);
    --border-btn: rgba(184, 134, 11, 0.4);
    
    --bg-overlay: rgba(250, 249, 247, 0.95);
    --shadow-color: rgba(0, 0, 0, 0.1);
    --shadow-gold-color: rgba(184, 134, 11, 0.1);
    
    --shadow-soft: 0 4px 20px rgba(0, 0, 0, 0.08);
    --shadow-elevated: 0 8px 40px rgba(0, 0, 0, 0.12);
    --shadow-gold: 0 0 30px var(--shadow-gold-color);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-deep);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: 
        radial-gradient(ellipse 80% 50% at 20% -10%, var(--shadow-gold-color) 0%, transparent 50%),
        radial-gradient(ellipse 60% 40% at 80% 110%, var(--shadow-gold-color) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

/* ----------------------------------------
   HEADER
   ---------------------------------------- */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: var(--space-lg) var(--space-xl);
    background: var(--bg-surface);
    backdrop-filter: blur(30px);
    border-bottom: 1px solid var(--border-color);
}

.header-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-xl);
}

.logo {
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 400;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--text-primary);
}

.logo span {
    color: var(--gold);
    font-style: italic;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.theme-toggle {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    cursor: pointer;
    transition: border-color 0.3s, transform 0.3s;
}

.theme-toggle:hover {
    border-color: var(--gold);
    transform: rotate(20deg);
}

.theme-toggle svg {
    width: 20px;
    height: 20px;
    color: var(--gold);
}

.icon-sun { display: none; }
[data-theme="light"] .icon-moon { display: none; }
[data-theme="light"] .icon-sun { display: block; }

.search-wrapper {
    position: relative;
    flex: 1;
    max-width: 500px;
}

.search-input {
    width: 100%;
    padding: var(--space-md) var(--space-lg);
    padding-left: 3.5rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.95rem;
    letter-spacing: 0.02em;
    transition: border-color 0.3s, box-shadow 0.3s, background 0.3s;
}

.search-input:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: var(--shadow-gold);
    background: var(--bg-hover);
}

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

.search-icon {
    position: absolute;
    left: var(--space-md);
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: var(--gold);
    opacity: 0.7;
}

.categories {
    display: flex;
    gap: var(--space-sm);
    justify-content: center;
}

.category-btn {
    padding: var(--space-sm) var(--space-lg);
    background: transparent;
    border: 1px solid var(--border-btn);
    border-radius: var(--radius-lg);
    color: var(--text-secondary);
    font-family: var(--font-body);
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    cursor: pointer;
    transition: border-color 0.3s, color 0.3s, transform 0.3s;
}

.category-btn:hover {
    border-color: var(--gold);
    color: var(--gold);
    transform: translateY(-2px);
}

.category-btn.active {
    background: var(--gold);
    border-color: var(--gold);
    color: var(--bg-deep);
    font-weight: 600;
}

/* ----------------------------------------
   HERO
   ---------------------------------------- */
.hero {
    padding: calc(80px + var(--space-3xl)) var(--space-xl) var(--space-2xl);
    text-align: center;
    position: relative;
}

.hero::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 300px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.hero-title {
    font-family: var(--font-display);
    font-size: clamp(3rem, 8vw, 6rem);
    font-weight: 300;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--text-primary);
    margin-bottom: var(--space-md);
    animation: fadeInUp 1s var(--ease-elegant);
}

.hero-subtitle {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-style: italic;
    color: var(--text-secondary);
    letter-spacing: 0.2em;
    animation: fadeInUp 1s var(--ease-elegant) 0.2s both;
}

/* ----------------------------------------
   MAIN - GRID
   ---------------------------------------- */
.main {
    max-width: 1400px;
    margin: 0 auto;
    padding: var(--space-xl);
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--space-xl);
}

/* ----------------------------------------
   TARJETA DE PRODUCTO
   ---------------------------------------- */
.product-card {
    position: relative;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.5s var(--ease-elegant), border-color 0.5s, box-shadow 0.5s;
    animation: fadeInUp 0.8s var(--ease-elegant) both;
}

.product-card:nth-child(1) { animation-delay: 0.1s; }
.product-card:nth-child(2) { animation-delay: 0.15s; }
.product-card:nth-child(3) { animation-delay: 0.2s; }
.product-card:nth-child(4) { animation-delay: 0.25s; }
.product-card:nth-child(5) { animation-delay: 0.3s; }
.product-card:nth-child(6) { animation-delay: 0.35s; }
.product-card:nth-child(7) { animation-delay: 0.4s; }
.product-card:nth-child(8) { animation-delay: 0.45s; }
.product-card:nth-child(9) { animation-delay: 0.5s; }
.product-card:nth-child(10) { animation-delay: 0.55s; }
.product-card:nth-child(11) { animation-delay: 0.6s; }
.product-card:nth-child(12) { animation-delay: 0.65s; }
.product-card:nth-child(13) { animation-delay: 0.7s; }

.product-card:hover {
    transform: translateY(-12px);
    border-color: var(--border-hover);
    box-shadow: var(--shadow-elevated), var(--shadow-gold);
}

.product-card:hover .product-image {
    transform: scale(1.08);
}

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

.product-card:hover .product-line {
    transform: scaleX(1);
}

.product-image-container {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    background: var(--bg-elevated);
}

.product-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s var(--ease-elegant);
}

.product-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 40%, var(--bg-deep) 100%);
    opacity: 0;
    transition: opacity 0.4s;
}

.product-badge {
    position: absolute;
    top: var(--space-md);
    left: var(--space-md);
    padding: var(--space-xs) var(--space-md);
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    border: 1px solid var(--gold);
    border-radius: var(--radius-xs);
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--gold);
}

.product-line {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--gradient-gold);
    transform: scaleX(0);
    transition: transform 0.5s var(--ease-elegant);
}

.product-info {
    padding: var(--space-lg);
}

.product-name {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: var(--space-xs);
    letter-spacing: 0.02em;
}

.product-price {
    font-family: var(--font-body);
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gold);
    margin-bottom: var(--space-md);
}

.product-description {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: var(--space-lg);
}

.product-actions {
    display: flex;
    gap: var(--space-sm);
}

.btn-details {
    flex: 1;
    padding: var(--space-sm) var(--space-md);
    background: transparent;
    border: 1px solid var(--border-btn);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: background 0.3s, border-color 0.3s, color 0.3s;
}

.btn-details:hover {
    background: var(--gold);
    border-color: var(--gold);
    color: var(--bg-deep);
}

.btn-whatsapp-small {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gold);
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.3s, transform 0.3s;
}

.btn-whatsapp-small:hover {
    background: var(--gold-light);
    transform: scale(1.1);
}

.btn-whatsapp-small svg {
    width: 22px;
    height: 22px;
    color: var(--bg-deep);
}

/* ----------------------------------------
   MODAL
   ---------------------------------------- */
.modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-lg);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s, visibility 0.4s;
}

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

.modal-overlay {
    position: absolute;
    inset: 0;
    background: var(--bg-overlay);
    backdrop-filter: blur(20px);
}

.modal-content {
    position: relative;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    max-width: 1000px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    transform: scale(0.9) translateY(30px);
    transition: transform 0.5s var(--ease-elegant);
}

.modal-close {
    position: absolute;
    top: var(--space-lg);
    right: var(--space-lg);
    width: 48px;
    height: 48px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 10;
    transition: background 0.3s, color 0.3s, transform 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: var(--gold);
    color: var(--bg-surface);
    transform: rotate(90deg);
}

.modal-content {
    position: relative;
    background: var(--bg-surface);
    border: 1px solid rgba(201, 169, 98, 0.2);
    border-radius: var(--radius-lg);
    max-width: 1000px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    transform: scale(0.9) translateY(30px);
    transition: transform 0.5s var(--ease-elegant);
}

.modal.active .modal-content {
    transform: scale(1) translateY(0);
}

.modal-close {
    position: absolute;
    top: var(--space-lg);
    right: var(--space-lg);
    width: 48px;
    height: 48px;
    background: var(--bg-elevated);
    border: 1px solid rgba(201, 169, 98, 0.2);
    border-radius: 50%;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 10;
    transition: background 0.3s, color 0.3s, transform 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: var(--gold);
    color: var(--bg-deep);
    transform: rotate(90deg);
}

.modal-body {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    min-height: 500px;
}

.modal-image-section {
    background: var(--bg-elevated);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

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

.modal-info-section {
    padding: var(--space-2xl);
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.modal-badge {
    display: inline-block;
    padding: var(--space-xs) var(--space-md);
    background: transparent;
    border: 1px solid var(--gold);
    border-radius: var(--radius-xs);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--gold);
    width: fit-content;
}

.modal-title {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 400;
    color: var(--text-primary);
    line-height: 1.2;
    letter-spacing: 0.02em;
}

.modal-price {
    font-family: var(--font-body);
    font-size: 2rem;
    font-weight: 600;
    color: var(--gold);
}

.modal-description {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.8;
    flex: 1;
}

.modal-divider {
    width: 60px;
    height: 1px;
    background: var(--gold);
    opacity: 0.5;
}

.btn-whatsapp {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-xl);
    background: var(--gold);
    border: none;
    border-radius: var(--radius-sm);
    color: var(--bg-deep);
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.3s, transform 0.3s, box-shadow 0.3s;
    margin-top: auto;
}

.btn-whatsapp:hover {
    background: var(--gold-light);
    transform: translateY(-3px);
    box-shadow: var(--shadow-gold);
}

.btn-whatsapp svg {
    width: 24px;
    height: 24px;
}

/* ----------------------------------------
   SIN RESULTADOS
   ---------------------------------------- */
.no-results {
    text-align: center;
    padding: var(--space-3xl);
    color: var(--text-secondary);
}

.no-results svg {
    width: 80px;
    height: 80px;
    margin-bottom: var(--space-lg);
    opacity: 0.3;
    color: var(--gold);
}

.no-results p {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-style: italic;
}

/* ----------------------------------------
   FOOTER
   ---------------------------------------- */
.footer {
    text-align: center;
    padding: var(--space-2xl);
    margin-top: var(--space-2xl);
    border-top: 1px solid rgba(201, 169, 98, 0.1);
}

.footer p {
    font-size: 0.8rem;
    color: var(--text-muted);
    letter-spacing: 0.1em;
}

/* ----------------------------------------
   ANIMACIONES
   ---------------------------------------- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ----------------------------------------
   RESPONSIVE
   ---------------------------------------- */
@media (max-width: 900px) {
    .header-inner {
        flex-direction: column;
        gap: var(--space-md);
    }
    
    .search-wrapper {
        max-width: 100%;
        width: 100%;
    }
    
    .categories {
        justify-content: center;
    }
    
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-lg);
    }
    
    .modal-body {
        grid-template-columns: 1fr;
    }
    
    .modal-image-section {
        max-height: 300px;
    }
    
    .modal-info-section {
        padding: var(--space-lg);
    }
    
    .modal-title {
        font-size: 1.8rem;
    }
}

@media (max-width: 600px) {
    .hero-title {
        letter-spacing: 0.15em;
    }
    
    .products-grid {
        grid-template-columns: 1fr;
    }
    
    .product-info {
        padding: var(--space-md);
    }
    
    .modal-close {
        top: var(--space-sm);
        right: var(--space-sm);
        width: 40px;
        height: 40px;
    }
}

/* ----------------------------------------
   SCROLLBAR
   ---------------------------------------- */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-surface);
}

::-webkit-scrollbar-thumb {
    background: rgba(201, 169, 98, 0.3);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(201, 169, 98, 0.5);
}