/* ======= POPUP DE DESCUENTO PREMIUM - SLIDE BAR ======= */

/* Overlay del popup */
.discount-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
}

.discount-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Container principal del popup - Slide Bar */
.discount-popup {
    position: fixed;
    top: 0;
    right: 0;
    width: 420px;
    height: 100vh;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.3);
    transform: translateX(100%);
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.discount-overlay.active .discount-popup {
    transform: translateX(0);
}

/* Botón de cerrar */
.popup-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    font-size: 24px;
    color: #666;
    cursor: pointer;
    z-index: 10001;
    transition: all 0.3s ease;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    backdrop-filter: blur(10px);
}

.popup-close:hover {
    color: #000;
    background: rgba(255, 255, 255, 1);
    transform: scale(1.1);
}

/* Contenido principal */
.popup-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Sección superior - Hero con imagen */
.popup-left {
    background: #000;
    padding: 0;
    text-align: center;
    position: relative;
    overflow: hidden;
    height: 45vh;
    max-height: 350px;
    min-height: 280px;
    display: flex;
    align-items: stretch;
}

.popup-image-container {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.popup-main-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

/* Sección inferior - Formulario */
.popup-right {
    padding: 25px 30px;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex: 1;
    min-height: 250px;
}

/* Header del popup */
.popup-header {
    margin-bottom: 25px;
    text-align: center;
}

.popup-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: 2.2rem;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 10px 0;
    line-height: 1.1;
    letter-spacing: 1px;
}

.popup-title .highlight {
    color: #d4af37;
    display: block;
    font-size: 2.8rem;
    margin-top: 5px;
    font-weight: 800;
}

.popup-subtitle {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1rem;
    color: #666;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 400;
}

/* Formulario */
.popup-form {
    margin-bottom: 20px;
}

.form-description {
    font-family: 'Cormorant Garamond', serif;
    font-size: 0.9rem;
    color: #555;
    margin-bottom: 25px;
    line-height: 1.5;
    text-align: center;
}

.email-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.email-input {
    padding: 15px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    font-family: 'Cormorant Garamond', serif;
    background: #fafafa;
    transition: all 0.3s ease;
    outline: none;
}

.email-input:focus {
    border-color: #d4af37;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
}

.submit-btn {
    padding: 16px 30px;
    background: linear-gradient(135deg, #d4af37, #b8860b);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-family: 'Cormorant Garamond', serif;
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.submit-btn:hover {
    background: linear-gradient(135deg, #b8860b, #d4af37);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(212, 175, 55, 0.3);
}

/* Footer del popup */
.popup-footer {
    margin-top: auto;
    padding-top: 20px;
}

.terms {
    font-family: 'Cormorant Garamond', serif;
    font-size: 0.75rem;
    color: #999;
    margin: 0;
    line-height: 1.4;
    text-align: center;
}

/* Animaciones */
@keyframes popupFadeIn {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(50px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes popupFadeOut {
    from {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
    to {
        opacity: 0;
        transform: scale(0.8) translateY(50px);
    }
}

/* Estados de éxito */
.popup-success {
    text-align: center;
    padding: 20px;
}

.success-icon {
    font-size: 3rem;
    color: #4CAF50;
    margin-bottom: 15px;
}

.success-message {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.1rem;
    color: #333;
    margin-bottom: 10px;
}

.success-code {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: #d4af37;
    margin-bottom: 15px;
}

/* ======= RESPONSIVE DESIGN MEJORADO ======= */

/* Pantallas muy grandes (Desktop XL) */
@media (min-width: 1400px) {
    .discount-popup {
        width: 450px;
    }
    
    .popup-title {
        font-size: 2.4rem;
    }
    
    .popup-title .highlight {
        font-size: 3rem;
    }
}

/* Desktop estándar */
@media (max-width: 1200px) and (min-width: 769px) {
    .discount-popup {
        width: 420px;
    }
}

/* Tablets horizontales */
@media (max-width: 1024px) and (min-width: 769px) {
    .discount-popup {
        width: 400px;
    }
    
    .popup-left {
        height: 42vh;
        max-height: 320px;
    }
}

/* Tablets verticales */
@media (max-width: 768px) and (min-width: 481px) {
    .discount-popup {
        width: 90%;
        max-width: 400px;
        right: 5%;
    }
    
    .popup-left {
        height: 38vh;
        max-height: 300px;
        min-height: 240px;
    }
    
    .popup-right {
        padding: 22px 25px;
        min-height: 200px;
    }
    
    .popup-title {
        font-size: 1.9rem;
        margin-bottom: 12px;
    }
    
    .popup-title .highlight {
        font-size: 2.3rem;
        margin-top: 3px;
    }
    
    .popup-subtitle {
        font-size: 0.95rem;
        letter-spacing: 1.5px;
    }
    
    .form-description {
        font-size: 0.9rem;
        margin-bottom: 20px;
    }
    
    .email-input {
        padding: 14px 18px;
        font-size: 0.95rem;
    }
    
    .submit-btn {
        padding: 15px 25px;
        font-size: 0.95rem;
    }
    
    .popup-close {
        top: 15px;
        right: 15px;
        width: 32px;
        height: 32px;
        font-size: 22px;
    }
}

/* Móviles grandes (iPhone Plus, etc.) */
@media (max-width: 480px) and (min-width: 376px) {
    .discount-popup {
        width: 95%;
        max-width: none;
        right: 2.5%;
    }
    
    .popup-left {
        height: 35vh;
        max-height: 260px;
        min-height: 200px;
    }
    
    .popup-right {
        padding: 18px 20px;
        min-height: 180px;
    }
    
    .popup-title {
        font-size: 1.7rem;
        margin-bottom: 10px;
    }
    
    .popup-title .highlight {
        font-size: 2.1rem;
        margin-top: 2px;
    }
    
    .popup-subtitle {
        font-size: 0.9rem;
        letter-spacing: 1px;
    }
    
    .form-description {
        font-size: 0.85rem;
        margin-bottom: 18px;
        line-height: 1.4;
    }
    
    .email-form {
        gap: 12px;
    }
    
    .email-input {
        padding: 12px 15px;
        font-size: 0.9rem;
        border-radius: 6px;
    }
    
    .submit-btn {
        padding: 13px 20px;
        font-size: 0.9rem;
        border-radius: 6px;
        letter-spacing: 1px;
    }
    
    .popup-close {
        top: 12px;
        right: 12px;
        width: 30px;
        height: 30px;
        font-size: 20px;
    }
    
    .terms {
        font-size: 0.7rem;
        line-height: 1.3;
    }
}

/* Móviles pequeños (iPhone SE, etc.) */
@media (max-width: 375px) {
    .discount-popup {
        width: 100%;
        right: 0;
        border-radius: 0;
    }
    
    .popup-left {
        height: 32vh;
        max-height: 240px;
        min-height: 180px;
    }
    
    .popup-right {
        padding: 15px 18px;
        min-height: 160px;
    }
    
    .popup-title {
        font-size: 1.5rem;
        margin-bottom: 8px;
        line-height: 1.1;
    }
    
    .popup-title .highlight {
        font-size: 1.9rem;
        margin-top: 2px;
    }
    
    .popup-subtitle {
        font-size: 0.85rem;
        letter-spacing: 0.5px;
    }
    
    .form-description {
        font-size: 0.8rem;
        margin-bottom: 15px;
        line-height: 1.3;
    }
    
    .email-form {
        gap: 10px;
    }
    
    .email-input {
        padding: 11px 14px;
        font-size: 0.85rem;
        border-radius: 5px;
    }
    
    .submit-btn {
        padding: 12px 18px;
        font-size: 0.85rem;
        border-radius: 5px;
        letter-spacing: 0.5px;
    }
    
    .popup-close {
        top: 10px;
        right: 10px;
        width: 28px;
        height: 28px;
        font-size: 18px;
    }
    
    .popup-footer {
        padding-top: 15px;
    }
    
    .terms {
        font-size: 0.65rem;
        line-height: 1.2;
    }
}

/* Móviles muy pequeños */
@media (max-width: 320px) {
    .discount-popup {
        width: 100%;
        right: 0;
    }
    
    .popup-left {
        height: 30vh;
        max-height: 200px;
        min-height: 160px;
    }
    
    .popup-right {
        padding: 12px 15px;
        min-height: 140px;
    }
    
    .popup-title {
        font-size: 1.3rem;
        margin-bottom: 6px;
    }
    
    .popup-title .highlight {
        font-size: 1.7rem;
    }
    
    .popup-subtitle {
        font-size: 0.8rem;
    }
    
    .form-description {
        font-size: 0.75rem;
        margin-bottom: 12px;
    }
    
    .email-input {
        padding: 10px 12px;
        font-size: 0.8rem;
    }
    
    .submit-btn {
        padding: 11px 15px;
        font-size: 0.8rem;
    }
    
    .popup-close {
        top: 8px;
        right: 8px;
        width: 26px;
        height: 26px;
        font-size: 16px;
    }
}

/* Landscape móviles */
@media (max-height: 500px) and (orientation: landscape) {
    .discount-popup {
        width: 100%;
        height: 100vh;
        overflow-y: auto;
    }
    
    .popup-content {
        flex-direction: row;
        height: auto;
        min-height: 100vh;
    }
    
    .popup-left {
        width: 50%;
        height: 100vh;
        max-height: none;
        min-height: auto;
    }
    
    .popup-right {
        width: 50%;
        padding: 20px;
        justify-content: center;
        min-height: auto;
    }
    
    .popup-title {
        font-size: 1.8rem;
    }
    
    .popup-title .highlight {
        font-size: 2.2rem;
    }
    
    .form-description {
        font-size: 0.85rem;
        margin-bottom: 15px;
    }
    
    .popup-close {
        top: 15px;
        right: 15px;
        z-index: 10002;
    }
}

/* Pantallas de alta densidad */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .popup-main-image {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Preferencias de movimiento reducido */
@media (prefers-reduced-motion: reduce) {
    .discount-popup,
    .discount-overlay,
    .popup-close,
    .submit-btn {
        transition: none;
    }
    
    .discount-overlay.active .discount-popup {
        transform: translateX(0);
        transition: none;
    }
}
