@font-face {
    font-family: 'Galano Grotesque';
    src: url('./GalanoGrotesque-Medium.woff2') format('woff2');
    font-weight: 500;
    font-style: normal;
}

@font-face {
    font-family: 'Galano Grotesque';
    src: url('./GalanoGrotesqueAlt-Bold.woff2') format('woff2');
    font-weight: bold;
    font-style: normal;
}

:root {
    --bg-color: #F7F5F0;
    --text-color: #1A1A1A;
    --card-bg: #FFFFFF;
    --accent-color: #E20074; /* Magenta Crediéxito */
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Galano Grotesque', 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    overflow-x: hidden;
    min-height: 100vh;
}

h1, h2, .header-logo {
    font-family: 'Galano Grotesque', serif;
    font-weight: bold;
}

#app {
    width: 100vw;
    min-height: 100vh;
    position: relative;
    padding-bottom: 5rem;
    overflow-y: auto;
    overflow-x: hidden;
}

.hidden {
    display: none !important;
}

.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.6s ease-in-out;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.screen.active {
    opacity: 1;
    pointer-events: all;
}

#main-header {
    text-align: center;
    padding-top: 3rem;
}

#header-text {
    transition: opacity 0.5s ease, height 0.5s ease;
    overflow: hidden;
}

#header-text.fade-out {
    opacity: 0;
    height: 0;
    margin: 0;
}

.header-logo-centered {
    margin-bottom: 1.5rem;
    transition: opacity 0.4s ease;
}

.header-logo-centered img {
    height: 80px;
    display: block;
    margin: 0 auto;
    object-fit: contain;
}

.header-moda {
    font-size: 1.5rem;
    font-weight: bold;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
    color: var(--text-color);
    font-family: 'Galano Grotesque', serif;
    transition: opacity 0.4s ease;
}

.main-title {
    font-size: 3rem;
    margin-bottom: 0.5rem;
    transition: opacity 0.4s ease;
}

.magenta-text {
    color: var(--accent-color);
}

.subtitle {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 3rem;
    transition: opacity 0.4s ease;
}

.split-layout {
    display: flex;
    width: 95%;
    max-width: 850px; /* Reducido un poco para acercarlos más */
    margin: 4vh auto 0; 
    gap: 3rem; /* Reducido para que no queden tan separados */
    align-items: flex-start;
    justify-content: center;
}

.side {
    flex: 1;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-start; /* ARREGLA EL SCROLL: evita que se corte por arriba */
    align-items: center;
}

.gender-card {
    width: 100%;
    background: #FFFFFF;
    border-radius: 24px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.04);
    cursor: pointer;
    text-align: center;
    transition: all 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
}

.gender-card:hover:not(.fade-out):not(.active-model) {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
}

.gender-card.fade-out {
    opacity: 0;
    transform: scale(0.9);
    pointer-events: none;
    position: absolute;
}

.gender-card.active-model {
    cursor: default;
}

.gender-card.active-model h2 {
    display: none;
}

.video-wrapper {
    position: relative;
    width: 100%;
    max-width: 320px;
    margin: 0 auto 1.5rem auto;
}

.pure-video {
    width: 100%;
    height: auto;
    max-height: 55vh;
    object-fit: contain; /* NUNCA RECORTAR EL VIDEO */
    display: block;
    border-radius: 12px; /* Un poco de borde suave interno */
    transition: transform 0.4s ease;
}

.video-wrapper .dressed-video {
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

/* Modos de Drag and drop en tarjeta */
.gender-card.active-model .video-wrapper {
    /* Mantener el mismo tamaño que en la portada */
    max-width: 320px;
}
.gender-card.active-model .pure-video {
    /* Mantener el mismo tamaño que en la portada */
    max-height: 55vh;
}

.model-img-dressed {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 20px;
    transition: opacity 0.5s ease;
}

/* Contenedor dinámico (menús) */
.dynamic-menu {
    width: 100%;
    padding: 0;
    margin-top: 2rem; /* Espacio extra arriba de las marcas */
    transition: opacity 0.5s ease;
}

.panel-view {
    width: 100%;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease, transform 0.4s ease;
    transform: translateX(-20px);
    display: none; /* Asegurar que no tome espacio si no está activo */
}

.panel-view.active {
    display: block;
    opacity: 1;
    pointer-events: all;
    transform: translateX(0);
}
.back-button {
    position: absolute;
    top: 2rem;
    left: 2rem;
    background: none;
    border: none;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    cursor: pointer;
    color: #666;
    transition: color 0.3s;
    z-index: 10;
}

.back-button:hover {
    color: var(--text-color);
}

/* --- Vistas de los paneles --- */
.panel-view h2 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.instruction {
    color: #666;
    margin-bottom: 4rem; /* Más espacio entre el título y los botones en la pantalla de marcas */
    font-size: 1.1rem;
}

#view-categories .instruction {
    margin-bottom: 1.5rem; /* Menor espacio en la pantalla de categorías como solicitó el usuario */
}

#view-categories {
    margin-top: -1.5rem; /* Sube todo el bloque ligeramente para alinearlo con el contenedor del video derecho */
}

#view-items {
    margin-top: -2rem; /* Sube todo el bloque de prendas como solicitó el usuario */
}

.list-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.list-item {
    padding: 1.2rem 2rem;
    font-size: 1.2rem;
    border: 1px solid #ccc;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: transparent;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.list-item:hover {
    background: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
    transform: translateX(10px);
}

/* Grilla de ropa */
.items-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.clothing-item {
    background: white;
    border-radius: 12px;
    padding: 1rem;
    cursor: grab;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    transition: transform 0.2s, box-shadow 0.2s;
}

.clothing-item:active {
    cursor: grabbing;
}

.clothing-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}

.clothing-item img {
    width: 100%;
    height: 180px;
    object-fit: contain;
}

/* Modelo Derecho */
.model-container {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    cursor: default;
}

.model-container.rotatable {
    cursor: ew-resize;
}

.model-container img, .model-container video {
    height: 90%;
    object-fit: cover;
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.model-container .hidden {
    display: none;
}

.drop-hint {
    position: absolute;
    top: 40px;
    background: rgba(255,255,255,0.9);
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 0.9rem;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.rotate-hint {
    position: absolute;
    bottom: 40px;
    background: rgba(26, 26, 26, 0.8);
    color: white;
    padding: 12px 24px;
    border-radius: 30px;
    font-size: 0.9rem;
    opacity: 1;
    transition: opacity 0.3s;
    pointer-events: none;
}

.rotate-hint.hidden {
    opacity: 0;
}

.gender-card.drag-over .pure-video {
    transform: scale(1.05);
    filter: brightness(0.8);
}

/* Etiqueta de Precio */
.price-tag {
    position: absolute;
    top: 25%; /* Subido al pecho aproximado */
    left: 55%; /* Sale un poco más a la derecha del centro para extender la línea */
    display: flex;
    align-items: center;
    opacity: 1;
    transition: opacity 0.4s;
    animation: slideInRight 0.5s forwards;
    z-index: 20;
    pointer-events: none;
}

.price-tag.hidden {
    opacity: 0;
    pointer-events: none;
    animation: none;
}

.price-tag .line {
    width: 0;
    height: 2px;
    background-color: var(--accent-color);
    margin-right: 15px;
    position: relative;
    transform-origin: left center;
    animation: extendLine 0.5s ease-out 0.2s forwards; /* La línea crece animada */
}

.price-tag .line::before {
    content: '';
    position: absolute;
    left: 0;
    top: -4px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--accent-color);
    box-shadow: 0 0 10px rgba(226, 0, 116, 0.5);
}

.price-box {
    background: transparent;
    padding: 0;
    box-shadow: none;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    opacity: 0;
    animation: fadeIn 0.5s ease-out 0.7s forwards; /* Aparece después de la línea */
}

.price-value {
    font-size: 3rem;
    font-weight: bold;
    color: var(--text-color);
    line-height: 1;
    margin-bottom: 2px;
}

.date-gusto {
    font-size: 1rem;
    color: #666;
    margin-bottom: 8px;
    font-family: 'Inter', sans-serif;
    font-style: italic;
}

.crediexito-logo-small {
    height: 40px;
    object-fit: contain;
    opacity: 1; /* Transparencia eliminada y tamaño aumentado */
}

.cta-button-small {
    background-color: var(--accent-color);
    color: #FFF;
    border: none;
    padding: 10px 22px;
    border-radius: 30px;
    font-size: 0.95rem;
    font-weight: bold;
    font-family: 'Galano Grotesque', sans-serif;
    cursor: pointer;
    margin-top: 15px;
    box-shadow: 0 4px 15px rgba(226, 0, 116, 0.3);
    transition: background-color 0.3s ease;
    white-space: nowrap; /* Fuerza a que el texto quede en un solo renglón */
    animation: floatButton 3s ease-in-out infinite; /* Animación de flotación */
}

.cta-button-small:hover {
    background-color: #c20063;
}

/* Animaciones */
@keyframes floatButton {
    0% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
    100% { transform: translateY(0); }
}
@keyframes slideInRight {
    from { transform: translateX(30px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes extendLine {
    from { width: 0; }
    to { width: 220px; } /* Línea magenta más larga */
}

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

/* ==========================================
   RESPONSIVE: TABLET (<= 850px) & MOBILE (<= 560px)
   ========================================== */
@media (max-width: 850px) {
    #main-header {
        padding-top: 1.5rem;
    }

    .header-logo-centered img {
        height: 58px;
    }

    .header-moda {
        font-size: 1.15rem;
    }

    .main-title {
        font-size: 2rem;
        padding: 0 1rem;
    }

    .subtitle {
        font-size: 0.98rem;
        margin-bottom: 1.5rem;
        padding: 0 1rem;
    }

    .split-layout {
        width: 94%;
        gap: 1.25rem;
        margin-top: 1.5vh;
    }

    .gender-card {
        padding: 1.25rem;
    }

    .panel-view h2 {
        font-size: 1.75rem;
    }

    .instruction {
        margin-bottom: 1.5rem;
        font-size: 0.95rem;
    }

    .list-item {
        padding: 0.9rem 1.25rem;
        font-size: 1rem;
    }

    .price-tag {
        left: 52%;
        min-width: 160px;
    }
}

@media (max-width: 560px) {
    #app {
        padding-bottom: 3rem;
    }

    #main-header {
        padding-top: 2.6rem;
    }

    .back-button {
        top: 0.85rem;
        left: 1rem;
        font-size: 0.9rem;
        background: #FFFFFF;
        padding: 6px 12px;
        border-radius: 999px;
        box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    }

    .header-logo-centered img {
        height: 48px;
    }

    .header-moda {
        font-size: 1rem;
    }

    .main-title {
        font-size: 1.55rem;
    }

    .subtitle {
        font-size: 0.88rem;
        margin-bottom: 1.1rem;
    }

    .split-layout {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
        width: 92%;
    }

    .side {
        width: 100%;
    }

    .gender-card.fade-out {
        display: none !important;
    }

    .gender-card {
        padding: 1rem;
        border-radius: 18px;
    }

    .video-wrapper,
    .gender-card.active-model .video-wrapper {
        max-width: 230px;
        margin-bottom: 0.75rem;
    }

    .pure-video,
    .gender-card.active-model .pure-video {
        max-height: 36vh;
    }

    .dynamic-menu {
        margin-top: 0.5rem;
    }

    #view-categories,
    #view-items {
        margin-top: 0;
    }

    .panel-view h2 {
        font-size: 1.4rem;
        text-align: center;
    }

    .instruction {
        text-align: center;
        margin-bottom: 1rem;
        font-size: 0.88rem;
    }

    .list-item {
        padding: 0.85rem 1.1rem;
        font-size: 0.95rem;
    }

    .items-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .price-tag {
        position: relative !important;
        left: auto !important;
        top: auto !important;
        transform: none !important;
        margin: 0.75rem auto 0 auto;
        width: 100%;
        justify-content: center;
    }

    .price-tag .line {
        display: none !important;
    }
}
