/*--------------------------------------------------------------
# Offers & Promotions Components - Modern Design
--------------------------------------------------------------*/

/* Offer Cards Container */
.oferta-card-container {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    padding: 40px 0;
    justify-content: center;
}

.oferta-card {
    flex: 0 0 calc(25% - 23px);
    max-width: calc(25% - 23px);
    margin-bottom: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.oferta-card:hover {
    transform: translateY(-12px) scale(1.02);
}

.content-card-oferta {
    background: #ffffff;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    height: 100%;
    border: 2px solid transparent;
    position: relative;
}

.content-card-oferta::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #24b540 0%, #1e9535 100%);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease;
}

.oferta-card:hover .content-card-oferta {
    box-shadow: 0 16px 48px rgba(36, 181, 64, 0.2), 0 0 0 1px rgba(36, 181, 64, 0.1);
    border-color: rgba(36, 181, 64, 0.2);
}

.oferta-card:hover .content-card-oferta::before {
    transform: scaleX(1);
}

.imagen-container-oferta {
    position: relative;
    width: 100%;
    height: 240px;
    overflow: hidden;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    display: flex;
    align-items: center;
    justify-content: center;
}

.imagen-oferta-card {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 20px;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    filter: brightness(1);
}

.oferta-card:hover .imagen-oferta-card {
    transform: scale(1.08) rotate(2deg);
    filter: brightness(1.05);
}

.card-content-body {
    padding: 32px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    flex-grow: 1;
    background: linear-gradient(180deg, #ffffff 0%, #fafbfc 100%);
}

.card-title-oferta {
    font-size: 1.125rem;
    font-weight: 700;
    color: #1a252f;
    margin: 0;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.4;
    min-height: 3em;
    letter-spacing: -0.3px;
}

.card-description-oferta {
    font-size: 0.9375rem;
    color: #5a6268;
    line-height: 1.6;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    margin: 0;
    flex-grow: 1;
    min-height: 4em;
}

.stock-banner {
    background: linear-gradient(135deg, #ff4757 0%, #ff6b6b 50%, #e84118 100%);
    color: white;
    text-align: center;
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    box-shadow: 0 4px 12px rgba(255, 71, 87, 0.4);
    margin: 10px 0;
    position: relative;
    overflow: hidden;
    animation: pulse-stock 2s ease-in-out infinite;
}

.stock-banner::before {
    content: '⚡';
    margin-right: 6px;
    font-size: 0.9rem;
    animation: flash 1.5s ease-in-out infinite;
}

@keyframes pulse-stock {
    0%, 100% { box-shadow: 0 4px 12px rgba(255, 71, 87, 0.4); }
    50% { box-shadow: 0 4px 20px rgba(255, 71, 87, 0.6); }
}

@keyframes flash {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.precio-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.precio-anterior-oferta::before {
    content: '';
    display: none;
}

.precio-anterior-oferta del {
    color: #6c757d;
    font-weight: 600;
    text-decoration: line-through;
    opacity: 0.8;
}

.precio-anterior-placeholder {
    height: 24px;
}

.btn-precio-card-oferta {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    cursor: default;
}

.oferta-card .btn-precio-card-oferta span,
.content-card-oferta .btn-precio-card-oferta span,
p.btn-precio-card-oferta span {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%) !important;
    color: white !important;
    font-size: 1.75rem !important;
    font-weight: 800 !important;
    padding: 16px 28px !important;
    border-radius: 16px !important;
    box-shadow: 0 8px 20px rgba(220, 53, 69, 0.4) !important;
    transition: all 0.3s ease;
    letter-spacing: -0.5px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    animation: precio-pulse 2s ease-in-out infinite;
}

.oferta-card .btn-precio-card-oferta span::before,
.content-card-oferta .btn-precio-card-oferta span::before,
p.btn-precio-card-oferta span::before {
    content: '' !important;
    display: none !important;
}

@keyframes precio-pulse {
    0%, 100% { 
        transform: scale(1);
        box-shadow: 0 8px 20px rgba(220, 53, 69, 0.4);
    }
    50% { 
        transform: scale(1.02);
        box-shadow: 0 10px 28px rgba(220, 53, 69, 0.6);
    }
}

.btn-detalle-card-oferta {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
    border: none;
    border-radius: 16px;
    font-weight: 700;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(44, 62, 80, 0.25);
    position: relative;
    overflow: hidden;
}

.btn-detalle-card-oferta::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.6s ease;
}

.btn-detalle-card-oferta:hover::before {
    left: 100%;
}

.btn-detalle-card-oferta:hover {
    background: linear-gradient(135deg, #28a745 0%, #218838 100%);
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(40, 167, 69, 0.4);
    color: white;
    letter-spacing: 1.5px;
}

.overlay-ofertas {
    position: absolute;
    top: 28px;
    right: -38px;
    width: 170px;
    height: 36px;
    background: linear-gradient(135deg, #ff4757 0%, #ff6b6b 50%, #e84118 100%);
    color: #ffffff;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    z-index: 10;
    transform: rotate(45deg);
    transform-origin: center;
    pointer-events: none;
    box-shadow: 0 4px 16px rgba(255, 71, 87, 0.5);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    animation: ribbon-glow 2s ease-in-out infinite;
}

.overlay-ofertas::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: ribbon-shine 3s ease-in-out infinite;
}

@keyframes ribbon-glow {
    0%, 100% { box-shadow: 0 4px 16px rgba(255, 71, 87, 0.5); }
    50% { box-shadow: 0 4px 24px rgba(255, 71, 87, 0.8); }
}

@keyframes ribbon-shine {
    0% { left: -100%; }
    100% { left: 200%; }
}

/* Responsive Design */
@media (min-width: 1401px) and (max-width: 1700px) {
    .oferta-card {
        flex: 0 0 calc(33.333% - 20px);
        max-width: calc(33.333% - 20px);
    }
}

@media (max-width: 992px) {
    .oferta-card {
        flex: 0 0 calc(50% - 15px);
        max-width: calc(50% - 15px);
    }
    
    .oferta-card-container {
        gap: 20px;
    }
    
    .imagen-container-oferta {
        height: 220px;
    }
    
    .card-title-oferta {
        font-size: 0.95rem;
    }
}

@media (max-width: 768px) {
    .oferta-card {
        flex: 0 0 100%;
        max-width: 100%;
    }
    
    .oferta-card-container {
        gap: 24px;
        padding: 20px 0;
    }
    
    .imagen-container-oferta {
        height: 200px;
    }
    
    .card-content-body {
        padding: 20px;
    }
    
    .btn-precio-card-oferta span {
        font-size: 1.5rem;
        padding: 10px 16px !important;
    }
    
    .card-title-oferta {
        font-size: 0.9rem;
        min-height: 2.7em;
    }
}

/* Large Screens */
@media (min-width: 1701px) {
    .imagen-container-oferta {
        height: 280px;
    }
    
    .card-title-oferta {
        font-size: 1.1rem;
    }
}

.precio-anterior-oferta {
    position: relative;
    color: #b9b5b5;
    padding: 2px 8px;
    padding-left: 25px;
    font-size: 12px;
    font-weight: bold;
    text-decoration: line-through;
    text-align: left;
}

.precio-original {
    text-decoration: line-through;
    color: #212529;
    margin-left: 10px;
    font-size: 14px;
}

/* Banda de oferta dentro de GLightbox */
.gslide.loaded.current .overlay-ofertas {
    top: 20px;
    right: 20px;
    border-radius: 8px;
    padding: 8px 24px;
    font-size: 0.75rem;
    letter-spacing: 1.5px;
}

/* GLightbox Container Modernization */
.glightbox-container .ginner-container {
    display: flex;
    flex-direction: column;
    background: white;
    border-radius: 20px;
    overflow: hidden;
    max-width: 500px;
    margin: 0 auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

.glightbox-container .gslide-description {
    background: transparent !important;
    position: relative !important;
    padding: 0 !important;
}

.glightbox-container .gslide-media {
    box-shadow: none;
    border-radius: 0;
    overflow: hidden;
    background: #ffffff;
    padding: 40px 40px 0 40px;
}

.glightbox-container .gslide-image img {
    border-radius: 0;
    object-fit: contain;
    max-height: 300px;
    width: 100%;
}

.glightbox-container .gdesc-inner {
    padding: 0 !important;
    background: white;
    border-radius: 0;
}

/* Precio anterior tachado dentro de GLightbox */
.gdesc-inner .precio-anterior-oferta {
    position: relative;
    top: 0;
    transform: none;
    color: #6c757d;
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: line-through;
    z-index: 10;
    text-align: center;
}

.gdesc-inner .btn-precio-card-oferta {
    margin-bottom: 0px;
}

/* Banda de oferta dentro de Modal Detalle */
#mModalDetalle .overlay-ofertas {
    top: 45px;
    right: -180px;
    font-size: 20px;
    width: 500px;
    height: 40px;
}

/* Franja Negra Ofertas */
.franja-negra {
    background-color: #42474a;
    color: white;
    text-align: center;
    padding: 0;
}

.franja-negra .oferta-container {
    max-width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-around;
    flex-wrap: wrap;
}

.franja-negra .item {
    display: flex;
    align-items: center;
    font-size: 16px;
    color: #ffffff;
    padding: 5px 15px;
}

.franja-negra .icon {
    color: #ffffff;
    margin-right: 8px;
    font-size: 18px;
}

.franja-negra h2 {
    width: 100%;
    color: yellow;
    margin-bottom: 15px;
}

/* Popup Oferta en Lightbox - Clean Professional Design */
.popup-oferta-content-compact {
    padding: 0 32px 32px 32px;
    background: white;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Legacy duplicated styles - now handled by .ginner-container above */
.glightbox-container .gslide-description {
    background: white !important;
    padding: 0 !important;
}

/* Remove duplicated styles - now handled by .ginner-container */

/* Title and Description */
.popup-title-oferta {
    font-size: 1.35rem;
    font-weight: 800;
    margin: 0;
    color: #2c3e50;
    line-height: 1.3;
    text-align: center;
}

.popup-description-oferta {
    font-size: 0.95rem;
    color: #7f8c8d;
    margin: 0;
    line-height: 1.4;
    text-align: center;
}

/* Stock Banner */
.popup-stock-banner {
    padding: 10px 20px;
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
    text-align: center;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.25);
}

/* Price Section */
.popup-precio-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.popup-precio-anterior {
    color: #95a5a6;
    font-size: 1.05rem;
    font-weight: 600;
    text-decoration: line-through;
}

.popup-precio-placeholder {
    height: 28px;
}

.popup-precio-actual {
    margin: 0;
}

.popup-oferta-content-compact .popup-precio-actual span,
.gdesc-inner .popup-precio-actual span {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%) !important;
    color: white !important;
    font-size: 2.5rem !important;
    font-weight: 900 !important;
    padding: 16px 48px !important;
    border-radius: 12px !important;
    box-shadow: 0 8px 24px rgba(231, 76, 60, 0.3) !important;
    letter-spacing: -1px;
    transition: all 0.3s ease;
}

.popup-oferta-content-compact .popup-precio-actual span:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(231, 76, 60, 0.4) !important;
}

/* Add to Cart Button */
.popup-btn-carrito {
    width: 100%;
    padding: 16px 24px;
    font-size: 1rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    border-radius: 12px !important;
    background: linear-gradient(135deg, #27ae60 0%, #229954 100%) !important;
    color: white !important;
    border: none !important;
    box-shadow: 0 6px 20px rgba(39, 174, 96, 0.3);
    transition: all 0.3s ease;
    cursor: pointer;
}

.popup-btn-carrito:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 28px rgba(39, 174, 96, 0.4);
    background: linear-gradient(135deg, #229954 0%, #1e8449 100%) !important;
}

/* Badge */
.gslide.loaded.current .overlay-ofertas {
    position: absolute;
    top: 20px;
    right: 20px;
    padding: 8px 20px;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 1.5px;
    border-radius: 8px;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Responsive */
@media (max-width: 576px) {
    .glightbox-container .gslide-image {
        padding: 30px 20px;
    }
    
    .glightbox-container .gslide-image img {
        max-height: 240px;
    }
    
    .popup-oferta-content-compact {
        padding: 24px 20px;
        gap: 16px;
    }
    
    .popup-title-oferta {
        font-size: 1.15rem;
    }
    
    .popup-oferta-content-compact .popup-precio-actual span {
        font-size: 2rem !important;
        padding: 14px 36px !important;
    }
    
    .popup-btn-carrito {
        padding: 14px 20px;
        font-size: 0.95rem;
    }
}

/* Backwards compatibility */
.popup-oferta-container,
.popup-oferta-container-full {
    display: none;
}
    margin-top: 5px;
}

/* Responsive */
@media only screen and (min-width: 1701px) {
    .swiper-slide img {
        width: 100%;
    }

    .content-card-oferta {
        height: 600px;
    }

    .imagen-container-oferta {
        height: 280px;
    }
}

.card-footer-oferta {
    padding: 0 24px 24px 24px;
    margin-top: auto;
    background: #ffffff;
}
