/* ========================================
   TopSaver Club - Estilos Página de Promoción
   ======================================== */

/* ========================================
   BANNER DE FONDO
   ======================================== */

.promo-banner {
    position: relative;
    height: 400px;
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* Overlay para oscurecer y desenfocar el fondo */
.promo-banner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg,
            rgba(98, 0, 234, 0.4) 0%,
            rgba(0, 0, 0, 0.3) 100%);
    backdrop-filter: blur(8px);
    z-index: 1;
}

/* Efecto parallax sutil */
.promo-banner {
    background-attachment: fixed;
}

@media (max-width: 768px) {
    .promo-banner {
        background-attachment: scroll;
        height: 300px;
    }
}

/* ===== CONTENIDO DE TARJETAS ===== */
.card-body {
    padding: 25px;
}

.company-info {
    margin-bottom: 15px;
}

.company-logo-sm {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid #e9ecef;
}

.company-name {
    font-weight: 500;
    color: #6c757d !important;
    font-size: 0.9rem;
}

.card-title {
    color: #212529;
    font-size: 1.1rem;
    line-height: 1.4;
    margin-bottom: 12px;
    font-weight: 600;
}

.card-text {
    color: #6c757d;
    line-height: 1.5;
    margin-bottom: 20px;
    font-size: 0.9rem;
}

.promo-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.expiry-date {
    color: #6c757d;
    font-size: 0.85rem;
    font-weight: 500;
    display: flex;
    align-items: center;
}

.expiry-date i {
    margin-right: 6px;
    font-size: 0.8rem;
}

.btn-ver-mas {
    background: linear-gradient(45deg, var(--primary-color), #8a4fff);
    color: white;
    border: none;
    border-radius: 10px;
    padding: 8px 20px;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s ease;
    text-decoration: none;
}

.btn-ver-mas:hover {
    background: linear-gradient(45deg, #4f46e5, #7c3aed);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(98, 0, 234, 0.3);
}

/* ========================================
   Favoritos
   ======================================== */

.heart-icon-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
    cursor: pointer;
    z-index: 3;
    transition: all 0.3s ease;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.heart-icon-btn:hover {
    background: white;
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.heart-icon-btn.favorited {
    background: rgba(255, 107, 107, 0.1);
    border-color: #ff6b6b;
}

.heart-icon-btn.favorited i {
    color: #ff6b6b;
    animation: heartbeat 0.6s ease;
}

/* ========================================
   Favoritos para empresas
   ======================================== */

.heart-icon-company-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
    cursor: pointer;
    z-index: 3;
    transition: all 0.3s ease;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.heart-icon-company-btn:hover {
    background: white;
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.heart-icon-company-btn.favorited {
    background: rgba(255, 107, 107, 0.1);
    border-color: #ff6b6b;
}

.heart-icon-company-btn.favorited i {
    color: #ff6b6b;
    animation: heartbeat 0.6s ease;
}

/* ===== BADGES Y ELEMENTOS FLOTANTES ===== */
.badge-discount {
    position: absolute;
    top: 15px;
    left: 15px;
    color: white;
    padding: 8px 12px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.8rem;
    z-index: 3;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.badge-discount.bg-purple {
    background: linear-gradient(45deg, #6200ea, #8a4fff);
}

.badge-discount.bg-blue {
    background: linear-gradient(45deg, #1976d2, #42a5f5);
}

.badge-discount.bg-green {
    background: linear-gradient(45deg, #388e3c, #66bb6a);
}

.badge-discount.bg-orange {
    background: linear-gradient(45deg, #f57c00, #ffb74d);
}

.badge-discount.bg-pink {
    background: linear-gradient(45deg, #e91e63, #f8bbd9);
}

/* ========================================
   CONTENEDOR PRINCIPAL
   ======================================== */

.main-content-container {
    position: relative;
    margin-top: -260px;
    z-index: 10;
    padding-bottom: 3rem;
}

@media (max-width: 768px) {
    .main-content-container {
        margin-top: -200px;
        padding-bottom: 2rem;
    }
}

/* ========================================
   TARJETAS DE DETALLE
   ======================================== */


.promo-detail-card {
    background: white;
    border-radius: var(--border-radius-lg);
    /*padding: 2rem;*/
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    border: none;
    max-width: 800px;
    margin: 0 auto;
    backdrop-filter: blur(10px);
    transition: all var(--transition-normal);
}

.promo-detail-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

/* Imagen en blanco y negro: promo no reclamable ahora para el actor */
.promo-img-grayscale {
    filter: grayscale(1);
}

/* ========================================
   HEADER DE EMPRESA
   ======================================== */

.company-header {
    position: relative;
    cursor: pointer;
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 1.25rem;
    border-radius: var(--border-radius-sm);
    margin-bottom: 1.5rem;
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: all var(--transition-normal);
}

/* Flotante sobre el header, como .heart-icon-btn sobre la imagen: no ocupa espacio en el flujo */
.company-header .company-favorite {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    z-index: 3;
}

.company-header .company-favorite .favorite-btn {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.company-header .company-favorite .favorite-btn:hover {
    background: white;
}

.company-header .company-favorite .favorite-btn.favorited {
    background: #fee2e2;
    border-color: #fecaca;
}

.company-header:hover {
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
    transform: translateY(-1px);
}

.company-logo {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: var(--border-radius-sm);
    border: 2px solid white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all var(--transition-normal);
}

.company-logo:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

/* ========================================
   CONTENIDO DE PROMOCIÓN
   ======================================== */

.promo-title {
    font-size: clamp(1.5rem, 4vw, 2rem);
    color: #2d3748;
    line-height: 1.2;
    margin-bottom: 1rem;
}

.promo-dates {
    font-size: 0.95rem;
    padding: 0.5rem 0;
}

.promo-dates i {
    color: var(--primary-color);
}

.promo-description {
    color: #4a5568;
    line-height: 1.6;
    font-weight: 400;
}

/* Información de descuento */
.promo-discount-info {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.discount-badge {
    background: var(--primary-gradient);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 12px rgba(98, 0, 234, 0.3);
}

.discount-badge i {
    font-size: 0.9rem;
}

.level-badge {
    /*background: var(--primary-gradient);*/
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    display: inline-block;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 12px rgba(98, 0, 234, 0.3);
}

.level-badge i {
    font-size: 0.9rem;
}

.level-badge.bg-purple {
    background: var(--primary-gradient);
}

.level-badge.bg-silver {
    background: var(--primary-gradient);
}

.level-badge.bg-gold {
    background: var(--primary-gradient);
}

.level-badge.bg-vip {
    background: var(--primary-gradient);
}

/* ========================================
   BOTÓN PRINCIPAL DE ACCIÓN
   ======================================== */

.btn-purple-lg {
    background: var(--primary-gradient);
    color: white;
    font-weight: 600;
    padding: 0.875rem 1.5rem;
    border-radius: var(--border-radius-sm);
    border: none;
    transition: all var(--transition-normal);
    font-size: 1rem;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(98, 0, 234, 0.3);
}

.btn-purple-lg:hover {
    background: linear-gradient(135deg, #7c4dff 0%, #5e35b1 100%);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(98, 0, 234, 0.4);
}

.btn-purple-lg:active {
    transform: translateY(0);
    box-shadow: 0 4px 15px rgba(98, 0, 234, 0.3);
}

.btn-purple-lg:disabled {
    background: #6c757d;
    color: white;
    transform: none;
    box-shadow: none;
    cursor: not-allowed;
}

/* Efecto de ripple en el botón */
.btn-purple-lg::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.3s, height 0.3s;
}

.btn-purple-lg:active::before {
    width: 300px;
    height: 300px;
}

/* ========================================
   ESTADÍSTICAS DE PROMOCIÓN
   ======================================== */

.promo-stats {
    background: #f8f9fa;
    border-radius: var(--border-radius-sm);
    padding: 1.5rem 1rem;
    margin-top: 1.5rem;
}

.stat-item {
    text-align: center;
    transition: all var(--transition-normal);
    cursor: default;
}

.stat-item:hover {
    transform: translateY(-2px);
}

.stat-item i {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.stat-number {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1;
    margin-bottom: 0.25rem;
}

.stat-item small {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.8;
}

/* ========================================
   BOTÓN DE FAVORITOS
   ======================================== */

.favorite-btn {
    border: 1px solid rgba(0, 0, 0, 0.1);
    background: white;
    color: #6c757d;
    padding: 0.5rem;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    transition: all var(--transition-normal);
    display: flex;
    align-items: center;
    justify-content: center;
}

.favorite-btn:hover {
    background: #fee2e2;
    color: #dc2626;
    border-color: #fecaca;
    transform: scale(1.05);
}

.favorite-btn.favorited {
    background: #fee2e2;
    color: #dc2626;
    border-color: #fecaca;
}

.favorite-btn i {
    font-size: 1rem;
    transition: transform var(--transition-fast);
}

.favorite-btn:hover i {
    transform: scale(1.1);
}

/* ========================================
   INFORMACIÓN DE CONTACTO
   ======================================== */

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0;
    transition: all var(--transition-fast);
}

.contact-item:hover {
    transform: translateX(4px);
}

.contact-item i {
    width: 16px;
    text-align: center;
    color: var(--primary-color);
}

.contact-item a {
    color: #4a5568;
    transition: color var(--transition-fast);
}

.contact-item a:hover {
    color: var(--primary-color);
}

/* ========================================
   PROMOCIONES RELACIONADAS
   ======================================== */

.related-promos h5 {
    color: #2d3748;
    position: relative;
}

.related-promos h5::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 60px;
    height: 3px;
    background: var(--primary-gradient);
    border-radius: 2px;
}

.related-promo-card {
    border: none;
    border-radius: var(--border-radius-md);
    overflow: hidden;
    transition: all var(--transition-normal);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.related-promo-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.1);
}

.related-promo-card img {
    height: 150px;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.related-promo-card:hover img {
    transform: scale(1.05);
}

.related-promo-card .card-body {
    padding: 1.25rem;
}

/* ========================================
   ACCIONES SECUNDARIAS
   ======================================== */

.secondary-actions .btn {
    border-radius: var(--border-radius-sm);
    padding: 0.625rem 1.25rem;
    font-weight: 500;
    transition: all var(--transition-normal);
}

.secondary-actions .btn:hover {
    transform: translateY(-2px);
}

.share-btn:hover {
    background: #17a2b8;
    border-color: #17a2b8;
    color: white;
}

.report-btn:hover {
    background: #ffc107;
    border-color: #ffc107;
    color: #212529;
}

/* ========================================
   MODALES
   ======================================== */

.modal-content {
    border: none;
    border-radius: var(--border-radius-lg);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

.modal-header {
    background: linear-gradient(135deg, #f8f9fa 0%, white 100%);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0;
}

.modal-title {
    font-weight: 600;
    color: #2d3748;
}

#qrCodeContainer {
    background: white;
    padding: 1rem;
    border-radius: var(--border-radius-sm);
    border: 2px dashed #dee2e6;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#promoCodeText {
    font-family: 'Courier New', monospace;
    letter-spacing: 2px;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ========================================
   BADGES Y ETIQUETAS
   ======================================== */

.badge {
    font-size: 0.7rem;
    padding: 0.35rem 0.65rem;
    border-radius: 12px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.badge.bg-warning {
    color: #212529 !important;
}

.badge.bg-info {
    color: #212529 !important;
}

/* ========================================
   TÉRMINOS Y CONDICIONES
   ======================================== */

.terms-content {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: var(--border-radius-sm);
    border-left: 4px solid var(--primary-color);
}

.terms-content p {
    line-height: 1.6;
}

/* ========================================
   ANIMACIONES PERSONALIZADAS
   ======================================== */

@keyframes fadeInScale {
    0% {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }

    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.promo-detail-card {
    animation: fadeInScale 0.6s ease-out;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

.favorite-btn.favorited i {
    animation: pulse 0.6s ease-in-out;
    color: #dc2626;
}

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

@media (max-width: 768px) {

    .card-body {
        padding: 20px;
    }

    .promo-detail-card {
        padding: 0;
        margin: 0 1rem;
    }

    .company-header {
        padding: 1rem;
        flex-direction: column;
        text-align: center;
        gap: 0.75rem;
    }

    .company-header .company-favorite {
        top: 0.5rem;
        right: 0.5rem;
    }

    .promo-title {
        font-size: 1.5rem;
        text-align: center;
    }

    .promo-discount-info {
        justify-content: center;
    }

    .promo-stats .row {
        gap: 1rem 0;
    }

    .stat-item {
        border-right: none;
        border-bottom: 1px solid #dee2e6;
        padding-bottom: 1rem;
    }

    .stat-item:last-child {
        border-bottom: none;
        padding-bottom: 0;
    }
}

@media (max-width: 576px) {

    .promo-card-body {
        padding: 1rem;
    }

    .promo-detail-card {
        padding: 0;
    }

    .terms-card {
        padding: 0;
    }

    .company-logo {
        width: 40px;
        height: 40px;
    }

    .btn-purple-lg {
        padding: 0.75rem 1rem;
        font-size: 0.95rem;
    }

    .modal-dialog {
        margin: 1rem;
    }
}

/* ========================================
   ESTADOS ESPECIALES
   ======================================== */

.loading {
    opacity: 0.6;
    pointer-events: none;
}

.success-state {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border-color: #28a745;
    color: #155724;
}

.error-state {
    background: linear-gradient(135deg, #f8d7da 0%, #f1b0b7 100%);
    border-color: #dc3545;
    color: #721c24;
}

/* ========================================
   UTILIDADES ADICIONALES
   ======================================== */

.text-gradient {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Estado gráfico de la promoción. Las casillas se reparten el ancho del cuerpo
   y la letra se queda pequeña. overflow-x solo: si el eje Y queda en auto,
   el navegador pinta un scroll vertical. */
.promo-state {
    font-size: 0.8rem;
    line-height: 1;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
}

.promo-state-board {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    width: 100%;
}

.promo-state-row {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.15rem;
    width: 100%;
}

.promo-state-cell {
    min-width: 1.35rem;
    height: 1.75rem;
    padding: 0 0.12rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 1 1 0;
    border: 1px solid #6200ea;
    border-radius: 2px;
    box-sizing: border-box;
    font-size: 0.75rem;
    line-height: 1;
    color: #6200ea;
}

.promo-state-cell.is-on {
    background: #6200ea;
    color: #fff;
}

.promo-state-caption,
.promo-state-prize {
    margin: 0;
}

.promo-state-caption {
    flex: 0 0 auto;
    font-size: 0.8rem;
    white-space: nowrap;
}

.promo-state-prize {
    padding: 0.45rem 0.6rem;
    border: 1px solid #6200ea;
    border-radius: 6px;
    background: rgba(98, 0, 234, 0.08);
    line-height: 1.3;
}

.promo-state-prize-label {
    display: block;
    margin-bottom: 0.15rem;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #6200ea;
}

.promo-state-prize-text {
    display: block;
    font-size: 0.85rem;
    white-space: normal;
}