/* ==========================================================================
   ESTILOS PARA POPUP PROMOCIONAL DE OUTLET
   ========================================================================== */

/* Overlay - Fondo oscuro semitransparente */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.75);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    padding: 20px;
    overflow-y: auto;
}

.popup-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* Contenedor principal del popup */
.popup-container {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 20px;
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.8);
    transition: transform 0.3s ease;
    animation: popupSlideIn 0.4s ease forwards;
}

.popup-overlay.show .popup-container {
    transform: scale(1);
}

@keyframes popupSlideIn {
    from {
        transform: translateY(-50px) scale(0.9);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

/* Botón de cerrar */
.popup-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 10;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.popup-close:hover {
    background: #ff5252;
    color: white;
    transform: rotate(90deg);
}

/* Header del popup */
.popup-header {
    background: linear-gradient(135deg, #02b8ac 0%, #09d3c6 100%);
    padding: 40px 30px;
    text-align: center;
    border-radius: 20px 20px 0 0;
    color: white;
    position: relative;
    overflow: hidden;
}

.popup-header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 10px,
        rgba(255, 255, 255, 0.05) 10px,
        rgba(255, 255, 255, 0.05) 20px
    );
    animation: popupHeaderAnimation 20s linear infinite;
}

@keyframes popupHeaderAnimation {
    0% { transform: translate(0, 0); }
    100% { transform: translate(50px, 50px); }
}

.popup-header h2 {
    font-size: 32px;
    margin: 0 0 10px 0;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
    position: relative;
    z-index: 1;
    animation: popupTitlePulse 2s ease-in-out infinite;
}

@keyframes popupTitlePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.popup-header p {
    font-size: 18px;
    margin: 0;
    opacity: 0.95;
    position: relative;
    z-index: 1;
}

/* Grid de productos */
.popup-products-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    padding: 30px;
}

/* Tarjeta de producto en el popup */
.popup-product-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
}

.popup-product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 24px rgba(2, 184, 172, 0.2);
}

/* Imagen del producto */
.popup-product-image {
    position: relative;
    width: 100%;
    padding-top: 100%; /* Ratio 1:1 */
    overflow: hidden;
    background: #f5f5f5;
}

.popup-product-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.popup-product-card:hover .popup-product-image img {
    transform: scale(1.1);
}

/* Badge de descuento */
.popup-discount-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: linear-gradient(135deg, #ff5252 0%, #ff1744 100%);
    color: white;
    padding: 8px 12px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 14px;
    box-shadow: 0 4px 12px rgba(255, 23, 68, 0.4);
    z-index: 2;
    animation: popupBadgePulse 1.5s ease-in-out infinite;
}

@keyframes popupBadgePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Información del producto */
.popup-product-info {
    padding: 15px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.popup-product-info h4 {
    font-size: 14px;
    margin: 0 0 10px 0;
    color: #333;
    font-weight: 600;
    line-height: 1.3;
    min-height: 36px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Precios */
.popup-price {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.popup-original-price {
    font-size: 13px;
    color: #888;
    text-decoration: line-through;
}

.popup-sale-price {
    font-size: 18px;
    font-weight: bold;
    color: #02b8ac;
}

/* Footer del popup */
.popup-footer {
    padding: 20px 30px 30px;
    text-align: center;
}

.popup-view-all-btn {
    display: inline-block;
    background: linear-gradient(135deg, #02b8ac 0%, #09d3c6 100%);
    color: white;
    padding: 15px 40px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: bold;
    font-size: 16px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(2, 184, 172, 0.3);
}

.popup-view-all-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(2, 184, 172, 0.4);
}

/* ==========================================================================
   RESPONSIVE - TABLETS
   ========================================================================== */
@media (max-width: 768px) {
    .popup-container {
        max-width: 95%;
        border-radius: 15px;
    }

    .popup-header {
        padding: 30px 20px;
        border-radius: 15px 15px 0 0;
    }

    .popup-header h2 {
        font-size: 24px;
    }

    .popup-header p {
        font-size: 16px;
    }

    .popup-products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
        padding: 20px;
    }

    .popup-product-info h4 {
        font-size: 13px;
        min-height: 32px;
    }

    .popup-sale-price {
        font-size: 16px;
    }

    .popup-footer {
        padding: 15px 20px 20px;
    }

    .popup-view-all-btn {
        padding: 12px 30px;
        font-size: 14px;
    }
}

/* ==========================================================================
   RESPONSIVE - MÓVILES
   ========================================================================== */
@media (max-width: 480px) {
    .popup-overlay {
        padding: 10px;
    }

    .popup-container {
        max-height: 95vh;
        border-radius: 12px;
    }

    .popup-close {
        width: 35px;
        height: 35px;
        font-size: 24px;
        top: 10px;
        right: 10px;
    }

    .popup-header {
        padding: 25px 15px;
        border-radius: 12px 12px 0 0;
    }

    .popup-header h2 {
        font-size: 20px;
    }

    .popup-header p {
        font-size: 14px;
    }

    .popup-products-grid {
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 15px;
    }

    .popup-product-card {
        display: grid;
        grid-template-columns: 100px 1fr;
        gap: 12px;
    }

    .popup-product-image {
        padding-top: 0;
        height: 100px;
    }

    .popup-product-info {
        padding: 10px;
    }

    .popup-product-info h4 {
        font-size: 14px;
        min-height: auto;
        -webkit-line-clamp: 3;
    }

    .popup-discount-badge {
        font-size: 12px;
        padding: 6px 10px;
        top: 5px;
        right: 5px;
    }

    .popup-footer {
        padding: 12px 15px 15px;
    }

    .popup-view-all-btn {
        padding: 12px 25px;
        font-size: 14px;
        border-radius: 25px;
    }
}