:root {
    --blanco: #FFFFFF;
    --marfil: #F9F9F7;
    --plata: #E2E2E2;
    --dorado-tenue: #D4AF37;
    --dorado-hover: #B8961E;
    --rosa-atelier: #FDF0F0;
    --negro-ebano: #1A1A1A;
    --gris-seda: #666666;
    --gris-claro: #999999;
    --font-prada: 'Playfair Display', serif;
    --shadow-lux: 0 20px 50px rgba(0,0,0,0.08);
    --shadow-md: 0 8px 24px rgba(0,0,0,0.10);
    --transition-smooth: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--marfil);
    color: var(--negro-ebano);
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ══════════════════════════════════════════════════
   ESTRUCTURA DE PANTALLAS
══════════════════════════════════════════════════ */
.pantalla {
    position: absolute;
    width: 100vw;
    height: 100vh;
    display: none;
    opacity: 0;
    transition: opacity var(--transition-smooth);
}
.pantalla.activa {
    display: flex;
    flex-direction: column;
    opacity: 1;
}

/* ══════════════════════════════════════════════════
   1. PANTALLA INICIO
══════════════════════════════════════════════════ */
#inicio {
    justify-content: center;
    align-items: center;
    background: radial-gradient(ellipse at 50% 40%, #ffffff 0%, #f5f3ef 60%, var(--marfil) 100%);
}
.marca-logo {
    font-family: var(--font-prada);
    font-size: clamp(3rem, 10vw, 6rem);
    letter-spacing: 0.25em;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 18px;
    animation: fadeInDown 1.5s ease both;
}
.subtitulo {
    font-family: var(--font-prada);
    font-style: italic;
    color: var(--gris-seda);
    font-size: 1.15rem;
    letter-spacing: 2px;
    margin-bottom: 48px;
    animation: fadeInUp 1.5s ease both;
}
.btn-lujo {
    background: transparent;
    border: 1px solid var(--negro-ebano);
    padding: 20px 80px;
    font-family: var(--font-prada);
    font-style: italic;
    font-size: 1.1rem;
    cursor: pointer;
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
    letter-spacing: 1px;
}
.btn-lujo::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--negro-ebano);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform var(--transition-smooth);
    z-index: -1;
}
.btn-lujo:hover {
    color: var(--blanco);
    letter-spacing: 5px;
}
.btn-lujo:hover::before { transform: scaleX(1); }

/* ══════════════════════════════════════════════════
   2. EL ATELIER
══════════════════════════════════════════════════ */
#atelier {
    padding: 80px 40px;
    align-items: center;
    background: var(--marfil);
}
.titulo-atelier {
    font-family: var(--font-prada);
    font-size: 3rem;
    margin-bottom: 70px;
    position: relative;
    text-align: center;
}
.titulo-atelier::after {
    content: '';
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 1px;
    background: var(--dorado-tenue);
}
.contenedor-carpetas {
    display: flex;
    gap: 50px;
    perspective: 1000px;
}
.carpeta {
    width: 280px;
    height: 380px;
    background: var(--blanco);
    position: relative;
    cursor: pointer;
    box-shadow: var(--shadow-lux);
    transition: var(--transition-smooth);
    border: 1px solid rgba(0,0,0,0.04);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 30px;
}
.carpeta:hover {
    transform: translateY(-15px) rotateY(5deg);
    border-color: var(--dorado-tenue);
    box-shadow: 0 30px 60px rgba(0,0,0,0.12), 0 0 0 1px var(--dorado-tenue);
}
.pestana {
    position: absolute;
    top: -38px;
    left: 0;
    background: var(--blanco);
    padding: 12px 45px;
    border-radius: 5px 25px 0 0;
    font-family: var(--font-prada);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 2px;
    border: 1px solid rgba(0,0,0,0.04);
    border-bottom: none;
}
.carpeta-descripcion {
    color: var(--gris-seda);
    font-size: 0.9rem;
    line-height: 1.7;
    font-weight: 300;
}

/* ══════════════════════════════════════════════════
   3. ESTUDIO DE DISEÑO
══════════════════════════════════════════════════ */
#estudio { flex-direction: row; }

.sidebar {
    width: 320px;
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    padding: 36px;
    border-right: 1px solid rgba(0,0,0,0.05);
    z-index: 10;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.1); border-radius: 4px; }

.lienzo {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(ellipse at 50% 35%, #ffffff 0%, #eeeceb 100%);
    position: relative;
    overflow: hidden;
}

/* Subtle grid */
.lienzo::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: linear-gradient(rgba(0,0,0,0.03) 1px, transparent 1px),
                      linear-gradient(90deg, rgba(0,0,0,0.03) 1px, transparent 1px);
    background-size: 30px 30px;
    pointer-events: none;
}

.glass-panel {
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-radius: 3px;
    border: 1px solid rgba(255,255,255,0.9);
    box-shadow: var(--shadow-lux), 0 0 0 1px rgba(0,0,0,0.04);
}

.btn-volver {
    background: none;
    border: none;
    font-family: var(--font-prada);
    font-style: italic;
    cursor: pointer;
    margin-bottom: 36px;
    color: var(--gris-seda);
    text-align: left;
    font-size: 1rem;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 6px;
}
.btn-volver:hover {
    color: var(--negro-ebano);
    transform: translateX(-5px);
}

.opcion-btn {
    width: 100%;
    padding: 14px 16px;
    margin-bottom: 10px;
    background: var(--blanco);
    border: 1px solid rgba(0,0,0,0.06);
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    text-align: left;
    transition: var(--transition-fast);
    font-size: 0.88rem;
    letter-spacing: 0.4px;
    color: var(--negro-ebano);
    position: relative;
    overflow: hidden;
}
.opcion-btn::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    background: var(--dorado-tenue);
    transform: scaleY(0);
    transition: transform var(--transition-fast);
}
.opcion-btn:hover {
    border-color: rgba(212,175,55,0.4);
    background: var(--marfil);
    padding-left: 20px;
}
.opcion-btn:hover::before { transform: scaleY(1); }

.opcion-btn.activo {
    background: var(--negro-ebano);
    color: var(--blanco);
    border-color: var(--negro-ebano);
    padding-left: 20px;
}
.opcion-btn.activo::before {
    background: var(--dorado-tenue);
    transform: scaleY(1);
}

/* ══════════════════════════════════════════════════
   SVG FIGURIN CONTAINER
══════════════════════════════════════════════════ */
#contenedor-figurin {
    width: 330px;
    height: 580px;
    position: relative;
    cursor: crosshair;
    overflow: visible;
    z-index: 1;
    display: flex;
    align-items: stretch;
}
#svg-figurin {
    width: 100%;
    height: 100%;
    display: block;
    transform-origin: center center;
    transition: transform 0.18s ease-out;
}

/* Layer transition */
#layer-textura { transition: opacity 0.45s ease; }
#layer-prenda  { transition: opacity 0.3s ease; }

/* Estado vacío */
#estado-inicio {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    pointer-events: none;
    z-index: 2;
}
#estado-inicio .icono-figurin {
    font-size: 2.4rem;
    opacity: 0.18;
    animation: pulsar 2.8s infinite ease-in-out;
}
#estado-inicio p {
    color: var(--dorado-tenue);
    font-family: var(--font-prada);
    font-style: italic;
    font-size: 0.95rem;
    text-align: center;
    line-height: 1.7;
    opacity: 0.75;
}

/* Panel de información flotante (inferior) */
#panel-info {
    position: absolute;
    bottom: -40px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(26,26,26,0.88);
    color: rgba(255,255,255,0.92);
    padding: 7px 18px;
    border-radius: 40px;
    font-size: 0.72rem;
    letter-spacing: 0.6px;
    white-space: nowrap;
    z-index: 20;
    opacity: 0;
    transition: opacity 0.38s ease, transform 0.38s ease;
    transform: translateX(-50%) translateY(4px);
}
#panel-info.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Badge estado superior */
#badge-estado {
    position: absolute;
    top: -36px;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 0.68rem;
    letter-spacing: 1.5px;
    color: var(--gris-claro);
    text-transform: uppercase;
    font-weight: 600;
    opacity: 0;
    transition: opacity 0.4s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
#badge-estado.visible { opacity: 1; }

/* Hint teclado */
#hint-teclado {
    position: absolute;
    bottom: -56px;
    right: 0;
    font-size: 0.65rem;
    color: var(--gris-claro);
    letter-spacing: 0.5px;
    opacity: 0;
    transition: opacity 0.5s;
}
#hint-teclado.visible { opacity: 0.65; }

/* ══════════════════════════════════════════════════
   SIDEBAR UTILITIES
══════════════════════════════════════════════════ */
.sidebar-label {
    font-size: 0.65rem;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    color: var(--dorado-tenue);
    margin-bottom: 14px;
    margin-top: 2px;
    font-weight: 600;
}
.sidebar-sep {
    height: 1px;
    background: rgba(0,0,0,0.06);
    margin: 22px 0;
}

/* ══════════════════════════════════════════════════
   PALETA DE COLORES
══════════════════════════════════════════════════ */
.color-muestra {
    height: 44px;
    cursor: pointer;
    border: 1.5px solid rgba(0,0,0,0.06);
    transition: var(--transition-fast);
    position: relative;
    border-radius: 2px;
}
.color-muestra::after {
    content: attr(title);
    position: absolute;
    bottom: -22px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.58rem;
    color: var(--gris-claro);
    white-space: nowrap;
    letter-spacing: 0.5px;
    opacity: 0;
    transition: opacity 0.2s;
}
.color-muestra:hover {
    transform: scale(1.12);
    z-index: 2;
    box-shadow: var(--shadow-md);
}
.color-muestra:hover::after { opacity: 1; }
.color-muestra.activo {
    outline: 2.5px solid var(--dorado-tenue);
    outline-offset: 2px;
    transform: scale(1.08);
    z-index: 2;
}

/* ══════════════════════════════════════════════════
   TOOLTIP
══════════════════════════════════════════════════ */
.tooltip-atelier {
    position: absolute;
    top: 10%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--dorado-tenue);
    color: white;
    padding: 12px 28px;
    border-radius: 50px;
    font-style: italic;
    font-size: 0.85rem;
    box-shadow: 0 10px 25px rgba(212,175,55,0.25);
    animation: flotar 3s infinite ease-in-out;
    pointer-events: none;
    z-index: 30;
    white-space: nowrap;
}

/* ══════════════════════════════════════════════════
   ANIMATIONS
══════════════════════════════════════════════════ */
@keyframes flotar {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50%       { transform: translateX(-50%) translateY(-10px); }
}
@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-30px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes pulsar {
    0%, 100% { opacity: 0.14; }
    50%       { opacity: 0.30; }
}

.hidden { display: none !important; }
