/* ==========================================================================
   MITAD Y MITAD SLIDER - VITRINA DE TROFEOS PREMIUM
   ========================================================================== */

/* --------------------------------------------------------------------------
   ESTRUCTURA BASE Y FONDO DIVIDIDO
   -------------------------------------------------------------------------- */
.mitad-slider-wrapper {
    position: relative;
    width: 100%;
    max-width: 850px;
    margin: 2em auto;
    overflow: hidden;
    background-color: #ffffff;
    border-radius: 18px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.06);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    user-select: none;
    -webkit-user-select: none;
    box-sizing: border-box;
}

.mitad-slider-wrapper *,
.mitad-slider-wrapper *::before,
.mitad-slider-wrapper *::after {
    box-sizing: border-box;
}

.mitad-slider-wrapper img {
    pointer-events: none;
    -webkit-user-drag: none;
    user-select: none;
    -webkit-touch-callout: none;
}

.mitad-slider-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    display: flex;
    flex-direction: column;
    pointer-events: none;
}

.mitad-slider-top-half {
    height: 50%;
    width: 100%;
    background: #ffffff;
    position: relative;
    z-index: 1;
}

.mitad-slider-bottom-half {
    height: 50%;
    width: 100%;
    position: relative;
    overflow: hidden;
    background-color: #0b0f19;
    z-index: 1;
    pointer-events: none !important;
}

/* Video en segundo plano continuo */
.mitad-slider-video {
    position: absolute;
    top: 50%;
    left: 50%;
    min-width: 100%;
    min-height: 100%;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: translate(-50%, -50%);
    z-index: 1;
    pointer-events: none !important;
    user-select: none;
}

/* Ocultar controles nativos de video */
.mitad-slider-video::-webkit-media-controls,
.mitad-slider-video::-webkit-media-controls-start-playback-button,
.mitad-slider-video::-webkit-media-controls-play-button,
.mitad-slider-video::-webkit-media-controls-overlay-play-button,
.mitad-slider-video::-webkit-media-controls-enclosure,
.mitad-slider-video::-webkit-media-controls-panel {
    display: none !important;
    -webkit-appearance: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    width: 0 !important;
    height: 0 !important;
}

video::-webkit-media-controls-overlay-play-button {
    display: none !important;
    -webkit-appearance: none !important;
    opacity: 0 !important;
}

.mitad-slider-video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        180deg, 
        rgba(255, 255, 255, 0.4) 0%, 
        rgba(10, 15, 25, 0.25) 15%, 
        rgba(10, 15, 25, 0.65) 100%
    );
    z-index: 2;
    pointer-events: none;
}

.mitad-slider-fallback-bg {
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 50% 120%, #1e293b 0%, #0f172a 60%, #020617 100%);
}

.ms-progress-bar-wrap {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: rgba(0, 0, 0, 0.06);
    z-index: 25;
    overflow: hidden;
}

.ms-progress-bar {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #d4af37, #f3e5ab, #d4af37);
    border-radius: 0 2px 2px 0;
    transition: width 0.1s linear;
}

.mitad-slider-container {
    position: relative;
    width: 100%;
    height: 100%;
    z-index: 5;
}

.mitad-slider-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.7s ease;
    pointer-events: none;
}

.mitad-slider-slide.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.mitad-slider-content {
    position: relative;
    width: 100%;
    height: 100%;
}

/* Transiciones de entrada de los elementos */
.ms-copa-container {
    transition: transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.6s ease;
    transform: translateY(15px) scale(0.95);
    opacity: 0;
    pointer-events: none;
}

.mitad-slider-slide.active .ms-copa-container {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.ms-polaroid-container {
    transition: transform 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) 0.15s, opacity 0.6s ease 0.15s, box-shadow 0.3s ease;
    transform: rotate(var(--polaroid-rotate, 6deg)) translateY(-15px) scale(0.92);
    opacity: 0;
}

.mitad-slider-slide.active .ms-polaroid-container {
    transform: rotate(var(--polaroid-rotate, 6deg)) translateY(0) scale(1);
    opacity: 1;
}

.ms-texto-container {
    transition: transform 0.6s ease 0.2s, opacity 0.6s ease 0.2s;
    transform: translateY(-10px);
    opacity: 0;
}

.mitad-slider-slide.active .ms-texto-container {
    transform: translateY(0);
    opacity: 1;
}

/* ==========================================================================
   1. MODO ESCRITORIO Y PANTALLAS GRANDES (> 640px)
   ========================================================================== */
@media (min-width: 641px) {
    .mitad-slider-wrapper {
        aspect-ratio: 16 / 10;
    }

    /* Copa Grande y Protagónica en Desktop */
    .ms-copa-container {
        position: absolute;
        left: 0%;
        bottom: 2%;
        width: 48%;
        height: 96%;
        z-index: 10;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: flex-end;
    }

    .ms-copa-glow {
        position: absolute;
        top: 25%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 270px;
        height: 270px;
        background: radial-gradient(circle, rgba(212, 175, 55, 0.42) 0%, rgba(255, 215, 0, 0.12) 50%, transparent 70%);
        filter: blur(32px);
        z-index: -1;
        pointer-events: none;
    }

    .ms-copa-img {
        max-width: 100%;
        max-height: 100%;
        width: auto;
        height: auto;
        object-fit: contain;
        filter: drop-shadow(0 14px 28px rgba(0, 0, 0, 0.4));
        display: block;
    }

    .ms-copa-shadow {
        width: 75%;
        height: 14px;
        background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.65) 0%, rgba(0, 0, 0, 0) 75%);
        border-radius: 50%;
        margin-top: -4px;
    }

    /* Polaroid Alineada Armónicamente con el Texto */
    .ms-polaroid-container {
        position: absolute;
        top: 4%;
        right: 12%;
        width: 30%;
        z-index: 12;
        background-color: #ffffff;
        padding: 6px 6px 20px 6px;
        border-radius: 4px;
        box-shadow: 0 12px 28px rgba(0, 0, 0, 0.24);
    }

    .ms-polaroid-container:hover {
        transform: rotate(0deg) scale(1.04) translateY(-4px);
        box-shadow: 0 16px 34px rgba(0, 0, 0, 0.32);
        z-index: 15;
    }

    .ms-polaroid-pin {
        position: absolute;
        top: -5px;
        left: 50%;
        transform: translateX(-50%);
        width: 26px;
        height: 10px;
        background: rgba(212, 175, 55, 0.85);
        border-radius: 2px;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
        z-index: 2;
    }

    .ms-polaroid-inner {
        width: 100%;
        aspect-ratio: 4 / 3;
        overflow: hidden;
        background-color: #ffffff;
        border-radius: 2px;
    }

    .ms-polaroid-img {
        width: 100% !important;
        height: 100% !important;
        display: block !important;
        object-fit: cover !important;
        object-position: center center !important;
    }

    /* Textos Grandes, Legibles y Alineados Debajo de la Foto */
    .ms-texto-container {
        position: absolute;
        left: 44%;
        right: 5%;
        top: 50%;
        width: 51%;
        z-index: 14;
        display: flex;
        align-items: center;
    }

    .ms-numero-wrap {
        display: flex;
        align-items: center;
        justify-content: center;
        margin-right: 14px;
        flex-shrink: 0;
    }

    .ms-numero {
        font-size: clamp(65px, 8.5vw, 108px);
        font-weight: 900;
        line-height: 0.85;
        letter-spacing: -3px;
        color: #1a202c;
        text-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
        font-variant-numeric: tabular-nums;
    }

    .ms-texto-details {
        display: flex;
        flex-direction: column;
        justify-content: center;
        flex: 1;
        min-width: 0;
    }

    .ms-badge-pill {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-size: clamp(9.5px, 1.1vw, 12.5px);
        line-height: 1;
        padding: 3.5px 12px;
        border-radius: 999px;
        font-weight: 800;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        background: #d4af37;
        color: #0b0f19;
        margin-bottom: 6px;
        box-shadow: 0 2px 6px rgba(212, 175, 55, 0.3);
        width: fit-content;
    }

    .ms-titulo {
        font-size: clamp(22px, 2.8vw, 34px);
        font-weight: 900;
        margin: 0;
        line-height: 1.1;
        color: #ffffff;
        text-shadow: 0 2px 10px rgba(0, 0, 0, 0.6), 0 4px 18px rgba(0, 0, 0, 0.4);
        letter-spacing: -0.02em;
        word-break: normal;
        overflow-wrap: normal;
    }

    .ms-subtitulo {
        font-size: clamp(12.5px, 1.5vw, 16.5px);
        font-weight: 500;
        margin: 4px 0 0 0;
        line-height: 1.3;
        color: #e2e8f0;
        text-shadow: 0 2px 6px rgba(0, 0, 0, 0.7);
    }

    /* Controles en Desktop */
    .mitad-slider-controls {
        position: absolute;
        bottom: 16px;
        right: 20px;
        z-index: 20;
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .ms-slide-counter {
        background: rgba(15, 23, 42, 0.65);
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
        border: 1px solid rgba(255, 255, 255, 0.15);
        padding: 3px 10px;
        border-radius: 999px;
        color: #ffffff;
        font-size: 12px;
        font-weight: 600;
        display: flex;
        align-items: center;
        gap: 3px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    }

    .mitad-slider-nav {
        display: flex;
        align-items: center;
        gap: 6px;
    }

    .mitad-slider-nav button {
        background: rgba(15, 23, 42, 0.65) !important;
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
        border: 1px solid rgba(255, 255, 255, 0.18) !important;
        color: #ffffff !important;
        width: 32px;
        height: 32px;
        border-radius: 50% !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        cursor: pointer;
        padding: 0 !important;
        transition: all 0.25s ease;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    }

    .mitad-slider-nav button:hover {
        background: rgba(212, 175, 55, 0.9) !important;
        color: #0b0f19 !important;
        border-color: #d4af37 !important;
    }

    .mitad-slider-nav button svg {
        width: 14px;
        height: 14px;
    }
}

/* ==========================================================================
   2. MODO MÓVIL (<= 640px)
   ========================================================================== */
@media (max-width: 640px) {
    .mitad-slider-wrapper {
        aspect-ratio: 4 / 3;
        min-height: 285px;
        border-radius: 14px;
        margin: 1.2em auto;
    }

    /* Copa Grande y Protagónica en Móvil */
    .ms-copa-container {
        position: absolute;
        left: 0%;
        bottom: 2%;
        width: 46%;
        height: 96%;
        z-index: 10;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: flex-end;
    }

    .ms-copa-glow {
        position: absolute;
        top: 25%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 150px;
        height: 150px;
        background: radial-gradient(circle, rgba(212, 175, 55, 0.4) 0%, transparent 70%);
        filter: blur(18px);
        z-index: -1;
    }

    .ms-copa-img {
        max-width: 100%;
        max-height: 100%;
        width: auto;
        height: auto;
        object-fit: contain;
        filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.38));
        display: block;
    }

    .ms-copa-shadow {
        width: 75%;
        height: 8px;
        background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.6) 0%, rgba(0, 0, 0, 0) 75%);
        border-radius: 50%;
        margin-top: -3px;
    }

    /* Polaroid a la Izquierda Alineada con el Texto en Móvil */
    .ms-polaroid-container {
        position: absolute;
        top: 4%;
        right: 12%;
        width: 34%;
        z-index: 12;
        background-color: #ffffff;
        padding: 4px 4px 14px 4px;
        border-radius: 3px;
        box-shadow: 0 8px 18px rgba(0, 0, 0, 0.22);
    }

    .ms-polaroid-pin {
        position: absolute;
        top: -4px;
        left: 50%;
        transform: translateX(-50%);
        width: 20px;
        height: 7px;
        background: rgba(212, 175, 55, 0.85);
        border-radius: 2px;
        z-index: 2;
    }

    .ms-polaroid-inner {
        width: 100%;
        aspect-ratio: 4 / 3;
        overflow: hidden;
        background-color: #ffffff;
        border-radius: 2px;
    }

    .ms-polaroid-img {
        width: 100% !important;
        height: 100% !important;
        display: block !important;
        object-fit: cover !important;
        object-position: center center !important;
    }

    /* Textos a la Derecha Alineados con la Polaroid en Móvil */
    .ms-texto-container {
        position: absolute;
        left: 42%;
        right: 4%;
        top: 48%;
        width: 54%;
        z-index: 14;
        display: flex;
        align-items: center;
    }

    .ms-numero-wrap {
        display: flex;
        align-items: center;
        justify-content: center;
        margin-right: 6px;
        flex-shrink: 0;
    }

    .ms-numero {
        font-size: 52px;
        font-weight: 900;
        line-height: 0.85;
        letter-spacing: -2px;
        color: #1a202c;
        text-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
        font-variant-numeric: tabular-nums;
    }

    .ms-texto-details {
        display: flex;
        flex-direction: column;
        justify-content: center;
        flex: 1;
        min-width: 0;
    }

    .ms-badge-pill {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-size: 8.5px;
        line-height: 1;
        padding: 2px 7px;
        border-radius: 999px;
        font-weight: 800;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        background: #d4af37;
        color: #0b0f19;
        margin-bottom: 3px;
        box-shadow: 0 2px 5px rgba(212, 175, 55, 0.3);
        width: fit-content;
    }

    .ms-titulo {
        font-size: 17px;
        font-weight: 900;
        margin: 0;
        line-height: 1.15;
        color: #ffffff;
        text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
        word-break: normal;
        overflow-wrap: normal;
    }

    .ms-subtitulo {
        font-size: 11.5px;
        font-weight: 500;
        margin: 2px 0 0 0;
        line-height: 1.25;
        color: #e2e8f0;
        text-shadow: 0 2px 4px rgba(0, 0, 0, 0.7);
    }

    /* Controles en Móvil */
    .mitad-slider-controls {
        position: absolute;
        bottom: 8px;
        right: 8px;
        z-index: 20;
        display: flex;
        align-items: center;
        gap: 4px;
    }

    .ms-slide-counter {
        background: rgba(15, 23, 42, 0.65);
        border: 1px solid rgba(255, 255, 255, 0.15);
        padding: 2px 6px;
        border-radius: 999px;
        color: #ffffff;
        font-size: 8.5px;
        font-weight: 600;
        display: flex;
        align-items: center;
        gap: 2px;
    }

    .mitad-slider-nav {
        display: flex;
        align-items: center;
        gap: 3px;
    }

    .mitad-slider-nav button {
        background: rgba(15, 23, 42, 0.65) !important;
        border: 1px solid rgba(255, 255, 255, 0.18) !important;
        color: #ffffff !important;
        width: 22px;
        height: 22px;
        border-radius: 50% !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        cursor: pointer;
        padding: 0 !important;
    }

    .mitad-slider-nav button svg {
        width: 9px;
        height: 9px;
    }
}
