
/**
 * TopSaver Club - Estilos para Página de Promociones de una Empresa
 * listado de ofertas
 */

 /* ===== CONTROLES DE ORDENAMIENTO ===== */
.sort-select {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    padding: 12px 15px;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.sort-select:focus {
    background: white;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(98, 0, 234, 0.15);
}

.btn-filter-toggle {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    color: #495057;
    border-radius: 10px;
    padding: 12px 15px;
    transition: all 0.3s ease;
    min-width: 50px;
}

.btn-filter-toggle:hover,
.btn-filter-toggle[aria-expanded="true"] {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

/* ===== FILTROS AVANZADOS ===== */
.advanced-filters-container {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 15px;
    border: 1px solid #e9ecef;
}

.advanced-filters-container .form-label {
    color: #495057;
    font-weight: 600;
    margin-bottom: 8px;
}

.advanced-filters-container .form-select {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.advanced-filters-container .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(98, 0, 234, 0.15);
}

/* ===== FILTROS RÁPIDOS (CHIPS) ===== */
.quick-filters-container {
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

.filter-chip {
    background: white;
    border: 1px solid #dee2e6;
    color: #6c757d;
    border-radius: 25px;
    padding: 8px 16px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    white-space: nowrap;
    cursor: pointer;
    display: flex;
    align-items: center;
}

.filter-chip:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: rgba(98, 0, 234, 0.05);
    transform: translateY(-1px);
}

.filter-chip.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
    box-shadow: 0 4px 12px rgba(98, 0, 234, 0.3);
}

.filter-chip i {
    font-size: 0.85rem;
}

/* ===== HEADER DE RESULTADOS ===== */
.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    border-bottom: 1px solid #e9ecef;
}

.results-count {
    color: #495057;
    font-size: 1rem;
}

.search-term {
    color: var(--primary-color);
    font-weight: 600;
    font-style: italic;
}

.view-controls {
    display: flex;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 4px;
}

.btn-view-control {
    background: transparent;
    border: none;
    color: #6c757d;
    border-radius: 6px;
    padding: 8px 12px;
    transition: all 0.2s ease;
    font-size: 1rem;
}

.btn-view-control:hover {
    background: #dee2e6;
    color: #495057;
}

.btn-view-control.active {
    background: white;
    color: var(--primary-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* ===== TARJETAS DE PROMOCIONES ===== */
.promociones-container {
    margin-top: 30px;
    min-height: 400px;
}

.promo-item {
    transition: all 0.3s ease;
}

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

.promo-card {
    border: none;
    border-radius: 20px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    height: 100%;
    background: white;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.promo-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
}

.promo-img-wrapper {
    position: relative;
    overflow: hidden;
    height: 220px;
    background: #f8f9fa;
}

.promo-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

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

/* ===== 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); }

.badge-is-consummed {
    position: absolute;
    top: 45px;
    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-is-consummed.bg-purple { background: linear-gradient(45deg, #6200ea, #8a4fff); }
.badge-is-consummed.bg-blue { background: linear-gradient(45deg, #1976d2, #42a5f5); }
.badge-is-consummed.bg-green { background: linear-gradient(45deg, #388e3c, #66bb6a); }
.badge-is-consummed.bg-orange { background: linear-gradient(45deg, #f57c00, #ffb74d); }
.badge-is-consummed.bg-pink { background: linear-gradient(45deg, #e91e63, #f8bbd9); }

.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;
}

.urgency-badge {
    position: absolute;
    top: 65px;
    left: 15px;
    background: linear-gradient(45deg, #ff5722, #ff8a65);
    color: white;
    padding: 6px 10px;
    border-radius: 15px;
    font-size: 0.75rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
    z-index: 3;
    animation: pulse 2s infinite;
}

@keyframes heartbeat {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.3); }
}

/* ===== 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);
}

/* ===== TARJETAS DESHABILITADAS ===== */
.promo-card-disabled {
    background: #e9ecef !important;
    filter: grayscale(1) brightness(0.95);
    pointer-events: none;
    opacity: 0.7;
}
.promo-card-disabled img {
    filter: grayscale(1) brightness(0.9);
    opacity: 0.8;
}
.promo-card-disabled .btn,
.promo-card-disabled a {
    pointer-events: none !important;
    cursor: not-allowed !important;
    opacity: 0.7 !important;
}

/* ===== VISTA EN LISTA ===== */
.view-list .promo-card {
    border-radius: 15px;
    margin-bottom: 20px;
}

.view-list .promo-item {
    width: 100%;
}

.view-list .card-body {
    display: flex;
    align-items: center;
    padding: 20px;
}

.view-list .promo-img-wrapper {
    width: 120px;
    height: 90px;
    flex-shrink: 0;
    margin-right: 20px;
    border-radius: 12px;
}

.view-list .card-content {
    flex-grow: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.view-list .card-title {
    font-size: 1.1rem;
    margin-bottom: 8px;
}

.view-list .card-text {
    margin-bottom: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.view-list .promo-meta {
    margin-left: 20px;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
    min-width: 120px;
}

/* ===== ESTADOS DE CARGA Y VACÍO ===== */
.loading-state,
.empty-state {
    padding: 60px 20px;
}

.empty-icon {
    font-size: 4rem;
    color: #dee2e6;
    margin-bottom: 20px;
}

.loading-state .spinner-border {
    width: 3rem;
    height: 3rem;
}

/* ===== PAGINACIÓN ===== */
.pagination {
    margin-bottom: 0;
}

.page-link {
    border-radius: 8px;
    margin: 0 2px;
    border: 1px solid #dee2e6;
    color: #495057;
    padding: 8px 12px;
    transition: all 0.2s ease;
}

.page-link:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.page-item.active .page-link {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 992px) {
    .header-banner {
        padding: 40px 0 80px 0;
    }
    
    .search-filter-container {
        padding: 25px 20px;
        margin-top: -50px;
    }
    
    .stats-container {
        margin-top: 20px;
    }
}

@media (max-width: 768px) {
    .header-banner {
        padding: 30px 0 70px 0;
        text-align: center;
    }
    
    .search-filter-container {
        padding: 20px 15px;
        margin-top: -40px;
        border-radius: 15px;
    }
    
    .advanced-filters-container .row {
        row-gap: 15px;
    }
    
    .quick-filters-container {
        overflow-x: auto;
        padding-bottom: 10px;
    }
    
    .quick-filters-container .d-flex {
        /* min-width: max-content; */
        gap: 8px;
    }
    
    .results-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .promo-img-wrapper {
        height: 180px;
    }
    
    .card-body {
        padding: 20px;
    }
    
    .view-list .card-body {
        flex-direction: column;
        align-items: stretch;
    }
    
    .view-list .promo-img-wrapper {
        width: 100%;
        height: 120px;
        margin-right: 0;
        margin-bottom: 15px;
    }
    
    .view-list .card-content {
        flex-direction: column;
        align-items: stretch;
    }
    
    .view-list .promo-meta {
        margin-left: 0;
        margin-top: 15px;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        min-width: auto;
    }
    
    .pagination {
        flex-direction: column;
        gap: 10px;
        align-items: center;
    }

    /* Ajuste para filtros rápidos en móvil */
    .quick-filters-row {
        display: block !important;
        width: 90% !important;
        max-width: 90% !important;
        margin: 10px !important;
    }
    .quick-filters-row .col-md-8,
    .quick-filters-row .col-md-4 {
        width: 100% !important;
        max-width: 100% !important;
        flex: none !important;
        display: block !important;
    }
}

@media (max-width: 576px) {
    .search-filter-container {
        padding: 1rem;
    }
    
    .search-input {
        font-size: 0.9rem;
        padding: 12px 40px 12px 16px;
    }
    
    .sort-select,
    .btn-filter-toggle {
        font-size: 0.9rem;
        padding: 10px 12px;
    }
    
    .filter-chip {
        font-size: 0.85rem;
        padding: 6px 12px;
    }
    
    .promo-card {
        border-radius: 15px;
    }
    
    .promo-img-wrapper {
        height: 160px;
    }
    
    .card-body {
        padding: 15px;
    }
    
    .card-title {
        font-size: 1rem;
    }
    
    .card-text {
        font-size: 0.85rem;
    }
    
    .btn-ver-mas {
        padding: 6px 16px;
        font-size: 0.85rem;
    }

    .stats-container {
        display: none;
    }
}