/* ======================================================
   VASCONCELLOS — Catálogo de Equipos Médicos
   Identidad Corporativa: Vino Oscuro, Vino Intenso, Silver Mist
   ====================================================== */

@import url('https://fonts.googleapis.com/css2?family=Raleway:wght@300;400;500;600;700;800;900&display=swap');

/* ---- VARIABLES ---- */
:root {
    --vino-oscuro: #72253D;
    --vino-intenso: #BF2673;
    --silver-mist: #DCE3EB;
    --plateado: #dde1ec;

    --bg: #f3f1f2;
    --bg-card: #ffffff;
    --text: #3a1a25;
    --text-muted: #7a6670;
    --border: #e4dce0;

    --shadow-card: 0 10px 30px -10px rgba(114, 37, 61, 0.08);
    --shadow-card-hover: 0 25px 50px -12px rgba(114, 37, 61, 0.18);
    --radius: 4px;
    --transition: 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.imagenlogo{
    height: 2rem;
}

.dark {
    --bg: #1a0c12;
    --bg-card: #2a1420;
    --text: #dde2ec;
    --text-muted: #a0a8b5;
    --border: #3d2030;

    --shadow-card: 0 10px 30px -10px rgba(0, 0, 0, 0.3);
    --shadow-card-hover: 0 25px 50px -12px rgba(191, 38, 115, 0.2);
}

/* ---- RESET ---- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
a { text-decoration: none; color: inherit; }

iframe{
            display: flex;
            justify-content: center;
            align-items: center;
            background-position: center;
        }

body {
    font-family: 'Raleway', 'Century Gothic', sans-serif;
    background-color: var(--bg);
    color: var(--text);
    overflow-x: hidden;
    min-height: 100vh;
}

body.loading { overflow: hidden; }
.hidden { opacity: 0; pointer-events: none; }

/* ---- FONDO SUTIL CON ONDAS RADIALES ---- */
#main-content {
    transition: opacity 0.7s ease;
    background-image:
        radial-gradient(ellipse at 20% 0%, rgba(191, 38, 115, 0.04) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 100%, rgba(114, 37, 61, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(220, 227, 235, 0.06) 0%, transparent 60%);
    background-attachment: fixed;
}

.dark #main-content {
    background-image:
        radial-gradient(ellipse at 20% 0%, rgba(191, 38, 115, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 100%, rgba(114, 37, 61, 0.06) 0%, transparent 50%);
}

/* ================ LOADER ================ */
#loader-wrapper {
    position: fixed; inset: 0;
    z-index: 9999;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    background: var(--vino-oscuro);
    transition: opacity 0.6s ease-out, visibility 0.6s;
}

#loader-wrapper.fade-out {
    opacity: 0; visibility: hidden;
}

.loader-diamonds { position: absolute; inset: 0; overflow: hidden; }

.diamond {
    position: absolute;
    border: 1px solid rgba(191, 38, 115, 0.15);
    transform: rotate(45deg);
    animation: diamond-spin 15s linear infinite;
}
.diamond-1 { top: 10%; left: 15%; width: 80px; height: 80px; }
.diamond-2 { bottom: 20%; right: 10%; width: 120px; height: 120px; animation-direction: reverse; }
.diamond-3 { top: 40%; right: 25%; width: 50px; height: 50px; animation-duration: 12s; border-color: rgba(220, 227, 235, 0.1); }

@keyframes diamond-spin {
    to { transform: rotate(405deg); }
}

.loader-logo { animation: pulse-v 2s ease-in-out infinite; margin-bottom: 1.5rem; filter: drop-shadow(0 4px 20px rgba(0,0,0,0.3)); }
.diamond-pulse { animation: pulse-v 2s ease-in-out infinite 0.5s; }

@keyframes pulse-v {
    0%, 100% { transform-origin: center; opacity: 1; }
    50% { opacity: 0.7; }
}

.loader-brand {
    font-size: 1.6rem; font-weight: 700;
    letter-spacing: 0.3em; color: #fff;
    margin-bottom: 0.25rem;
}
.loader-sub {
    font-size: 0.7rem; letter-spacing: 0.5em;
    text-transform: uppercase;
    color: rgba(220, 227, 235, 0.5);
    margin-bottom: 2rem;
}

.loading-bar-container {
    width: 200px; height: 3px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px; overflow: hidden;
}
.loading-bar {
    width: 0%; height: 100%;
    background: linear-gradient(90deg, var(--vino-intenso), var(--silver-mist));
    border-radius: 2px;
    transition: width 0.1s ease-out;
}
.loader-percent {
    margin-top: 0.75rem;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.4);
}

/* ================ HEADER ================ */
.catalog-header {
    background: var(--bg-card);
    border-bottom: 4px solid var(--vino-oscuro);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    position: sticky; top: 0; z-index: 40;
}

.header-content {
    max-width: 1280px; margin: 0 auto;
    display: flex; align-items: center;
    justify-content: space-between;
    padding: 1rem 2rem;
}

.header-logo-area {
    display: flex; align-items: center; gap: 0.75rem;
}
.header-brand {
    font-size: 1.2rem; font-weight: 700;
    letter-spacing: 0.15em;
    color: var(--vino-oscuro);
}
.dark .header-brand { color: var(--vino-intenso); }

.header-titles { text-align: center; }
.header-titles h1 {
    font-size: 1.1rem; font-weight: 800;
    letter-spacing: 0.15em; text-transform: uppercase;
    color: var(--vino-oscuro);
}
.dark .header-titles h1 { color: var(--vino-intenso); }
.header-titles p {
    font-size: 0.7rem; color: var(--text-muted);
    letter-spacing: 0.1em;
}

.header-actions { display: flex; align-items: center; gap: 1rem; }
.header-link {
    font-size: 0.85rem; color: var(--vino-intenso);
    transition: color var(--transition);
}
.header-link:hover { color: var(--vino-oscuro); }

/* Theme toggle */
.theme-toggle {
    width: 52px; height: 28px;
    border-radius: 14px;
    background: var(--silver-mist);
    border: 1px solid var(--border);
    cursor: pointer; position: relative;
    transition: background var(--transition);
    padding: 0;
}
.dark .theme-toggle { background: #3d2030; }

.toggle-thumb {
    width: 22px; height: 22px;
    border-radius: 50%;
    background: var(--vino-oscuro);
    position: absolute; top: 2px; left: 3px;
    display: flex; align-items: center; justify-content: center;
    transition: transform var(--transition);
    color: #fff;
}
.dark .toggle-thumb {
    transform: translateX(23px);
    background: var(--vino-intenso);
}
.icon-moon { display: none; }
.dark .icon-sun { display: none; }
.dark .icon-moon { display: block; }

/* Mobile title */
.mobile-title {
    display: none; text-align: center;
    padding: 1.5rem 1rem 0;
}
.mobile-title h1 {
    font-size: 1.1rem; font-weight: 800;
    letter-spacing: 0.15em; text-transform: uppercase;
    color: var(--vino-oscuro);
}
.dark .mobile-title h1 { color: var(--vino-intenso); }

/* ================ SECTION TITLES ================ */
.section-title {
    display: flex; align-items: center;
    justify-content: center; gap: 1.5rem;
    margin: 3rem 0; padding: 0 1rem;
}
.section-line {
    display: none; height: 1px; width: 60px;
}
.line-gyn { background: rgba(114, 37, 61, 0.3); }
.line-aes { background: rgba(191, 38, 115, 0.3); }

.section-label {
    display: flex; align-items: center; gap: 0.5rem;
    position: relative;
}
.section-diamond {
    width: 10px; height: 10px;
    transform: rotate(45deg); opacity: 0.6;
}
.diamond-gyn { background: var(--vino-oscuro); }
.diamond-aes { background: var(--vino-intenso); }
.dark .diamond-gyn { background: var(--vino-intenso); }

.section-title h2 {
    font-size: 2.5rem; font-weight: 800;
    letter-spacing: 0.05em;
}
.section-gyn h2 { color: var(--vino-oscuro); }
.section-aes h2 { color: var(--vino-intenso); }
.dark .section-gyn h2 { color: var(--vino-intenso); }

/* ================ CATALOG GRID ================ */
.catalog-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    padding: 0 5% 2rem;
    max-width: 1400px; margin: 0 auto;
}

/* ================ PRODUCT CARD ================ */
.catalog-sheet {
    display: flex; flex-direction: column;
    position: relative;
    height: 500px;
    width: 21rem;
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-card);
    transition: all 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}

.catalog-sheet:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-card-hover);
}

/* Diagonal lines on top portion */
.sheet-bg-lines {
    position: absolute; top: 0; left: 0;
    width: 100%; height: 60%;
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 10px,
        rgba(114, 37, 61, 0.02) 10px,
        rgba(114, 37, 61, 0.02) 20px
    );
    opacity: 0.5;
}

/* Card header */
.sheet-header {
    position: relative; z-index: 1;
    padding: 1.5rem 1.25rem 0;
    text-align: right;
    height: 6rem;
}
.sheet-header h3 {
    font-size: 0.7rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.1em;
    color: var(--text-muted);
    margin: 0;
}
.sheet-model {
    display: block;
    font-size: 1.5rem; font-weight: 800;
    line-height: 1.1; text-transform: uppercase;
}
.sheet-subtitle {
    display: block;
    font-size: 1.1rem; font-weight: 700;
    text-transform: uppercase; opacity: 0.8;
}

/* Variant colors */
.variant-gyn .sheet-model,
.variant-gyn .sheet-subtitle { color: var(--vino-oscuro); }
.variant-aes .sheet-model,
.variant-aes .sheet-subtitle { color: var(--vino-intenso); }
.dark .variant-gyn .sheet-model,
.dark .variant-gyn .sheet-subtitle { color: var(--vino-intenso); }

/* Image area — FILL the card */
.sheet-image {
    height: 15rem;
    position: relative; z-index: 1;
    flex-grow: 1;
    display: flex; align-items: center; justify-content: center;
    padding: 0;
    overflow: hidden;
}
.sheet-image img {
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.catalog-sheet:hover .sheet-image img {
    transform: scale(1.08);
}

/* Placeholder when no image */
.sheet-placeholder {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, rgba(114,37,61,0.03) 0%, rgba(191,38,115,0.05) 100%);
}
.dark .sheet-placeholder {
    background: linear-gradient(135deg, rgba(191,38,115,0.08) 0%, rgba(114,37,61,0.05) 100%);
}

/* Footer */
.sheet-footer {
    position: relative; z-index: 1;
    padding: 0.9rem 1.25rem;
    border-top: 1px solid var(--border);
    display: flex; align-items: center;
    justify-content: space-between;
    background: var(--bg-card);
}
.sheet-footer svg { opacity: 0.3; }
.sheet-footer-btn {
    font-size: 0.7rem; font-weight: 700;
    letter-spacing: 0.15em; text-transform: uppercase;
    transition: letter-spacing 0.3s ease;
}
.variant-gyn .sheet-footer-btn { color: var(--vino-intenso); }
.variant-aes .sheet-footer-btn { color: var(--vino-oscuro); }
.dark .variant-aes .sheet-footer-btn { color: var(--silver-mist); }

.catalog-sheet:hover .sheet-footer-btn {
    letter-spacing: 0.25em;
}

/* Hover accent diamond */
.sheet-accent {
    position: absolute;
    bottom: -12px; right: -12px;
    width: 32px; height: 32px;
    background: rgba(191, 38, 115, 0.1);
    transform: rotate(45deg);
    transition: all 0.5s ease;
}
.catalog-sheet:hover .sheet-accent {
    width: 64px; height: 64px;
    background: rgba(191, 38, 115, 0.05);
}

/* ================ FOOTER ================ */
.site-footer {
    border-top: 1px solid var(--border);
    background: var(--bg-card);
    padding: 2rem 1rem;
}
.footer-content {
    max-width: 1280px; margin: 0 auto;
    display: flex; align-items: center;
    justify-content: space-between;
    flex-wrap: wrap; gap: 1rem;
    padding: 0 1rem;
}
.footer-brand {
    display: flex; align-items: center; gap: 0.75rem;
    font-weight: 700; letter-spacing: 0.15em;
    font-size: 0.85rem; color: var(--vino-oscuro);
}
.dark .footer-brand { color: var(--vino-intenso); }
.footer-copy { font-size: 0.7rem; color: var(--text-muted); }

/* ================ ANIMATIONS ================ */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-fade-up {
    animation: fadeUp 0.5s ease both;
}

/* ================ RESPONSIVE ================ */
@media (min-width: 640px) {
    .section-line { display: block; }
}

@media (max-width: 768px) {
    .header-titles { display: none; }
    .header-link { display: none; }
    .mobile-title { display: block; }
    .header-content { padding: 0.75rem 1rem; }

    .section-title h2 { font-size: 1.8rem; }
    .catalog-container { gap: 1.5rem; }
}

@media (max-width: 600px) {
    .catalog-container {
        grid-template-columns: 1fr;
        max-width: 400px;
        margin: 0 auto;
    }
    .catalog-sheet { height: auto; min-height: 450px; }
    .section-title { margin: 2rem 0; }
}

@media (max-width: 350px) {
    .sheet-model { font-size: 1.2rem; }
    .catalog-sheet { min-height: 400px; }
}

/* ======================================================
   NUEVOS AJUSTES MODO OSCURO (Textos y Logos)
   ====================================================== */

/* 1. Cambio de textos al color #DCE3EB (var(--silver-mist)) */
.dark .header-brand,
.dark .header-titles h1,
.dark .mobile-title h1,
.dark .section-gyn h2,
.dark .section-aes h2,
.dark .variant-gyn .sheet-model,
.dark .variant-gyn .sheet-subtitle,
.dark .variant-aes .sheet-model,
.dark .variant-aes .sheet-subtitle,
.dark .footer-brand {
    color: var(--silver-mist);
}

/* 2. Cambio de color para el SVG del Footer */
.dark .footer-brand svg path {
    stroke: var(--silver-mist);
}

/* 3. Lógica para intercambiar las imágenes (Header) */
.logo-dark { 
    display: none; /* Oculto por defecto en modo claro */
}

.dark .logo-light { 
    display: none; /* Se oculta el logo morado en modo oscuro */
    height: 4rem;
}

.dark .logo-dark { 
    display: block; /* Se muestra el logo claro en modo oscuro */
}

/* Agrega esto a la sección de NAVBAR / HEADER */
.catalog-header {
    /* ... tus estilos actuales ... */
    transition: transform 0.3s ease-in-out; /* Animación suave */
}

/* Clase que aplicaremos con JS para esconderlo */
.nav-up {
    transform: translateY(-100%);
}