/**
 * Black Friday Catalog Reader - Styles
 * Version: 1.1.2
 * Author: Josue Baloy
 * License: GPL-2.0-or-later
 * Description: Estilos modernos y responsive para el catálogo Black Friday
 */

/* Black Friday Catalog - Estilos Modernos */

:root {
    --bf-primary: #513685;
    --bf-primary-light: #6b4b9e;
    --bf-primary-dark: #3d2866;
    --bf-secondary: #ffbb3a;
    --bf-accent: #93D50A;
    --bf-success: #93D50A;
    --bf-danger: #e63946;
    --bf-light: #F8F9FA;
    --bf-dark: #1A1A1A;
    --bf-border: #E0E0E0;
    --bf-shadow: rgba(0, 0, 0, 0.08);
    --bf-shadow-hover: rgba(0, 0, 0, 0.15);
    --bf-gradient-1: linear-gradient(135deg, #ba07d3 0%, #7707d3 100%);
    --bf-gradient-2: linear-gradient(135deg, #ffbb3a 0%, #ffd166 100%);
    --bf-gradient-3: linear-gradient(135deg, #93D50A 0%, #a8e024 100%);

    --bf-stats-gradient: #158af3;

    --bf-product-card-gradient: linear-gradient(135deg, #7707d3 0%, #4707d3 100%);
}

* {
    box-sizing: border-box;
}

.bf-catalog-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Header */
.bf-header {
    text-align: center;
    margin-bottom: 40px;
    padding: 40px 20px;
    background: var(--bf-gradient-1);
    border-radius: 20px;
    color: white;
    box-shadow: 0 10px 30px rgba(81, 54, 133, 0.25);
}

.bf-title {
    font-size: 3em;
    font-weight: 800;
    margin: 0 0 10px 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.bf-subtitle {
    font-size: 1.3em;
    margin: 0;
    opacity: 0.95;
}

/* Controles */
.bf-controls {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 15px;
    margin-bottom: 30px;
    align-items: stretch;
}

.bf-search-box {
    position: relative;
}

.bf-search-box input {
    width: 100%;
    height: 50px;
    padding: 0 25px;
    font-size: 15px;
    border: 2px solid var(--bf-border);
    border-radius: 25px;
    outline: none;
    transition: all 0.3s ease;
    background: white;
}

.bf-search-box input:focus {
    border-color: var(--bf-primary);
    box-shadow: 0 0 0 3px rgba(81, 54, 133, 0.1);
}

.bf-filters {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

.bf-filters select {
    min-width: 180px;
    height: 50px;
    padding: 0 20px;
    font-size: 15px;
    border: 2px solid var(--bf-border);
    border-radius: 25px;
    outline: none;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23513685' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    padding-right: 40px;
}

.bf-filters select:hover {
    border-color: var(--bf-primary);
}

.bf-filters select:focus {
    border-color: var(--bf-primary);
    box-shadow: 0 0 0 3px rgba(81, 54, 133, 0.1);
}

/* Estadísticas */
.bf-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.bf-stat-card {
    background: var(--bf-stats-gradient);
    padding: 30px 25px;
    border-radius: 15px;
    text-align: center;
    color: white;
    box-shadow: 0 4px 15px rgba(81, 54, 133, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.bf-stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(81, 54, 133, 0.3);
}

.bf-stat-card:nth-child(2) {
    background: var(--bf-stats-gradient);
    box-shadow: 0 4px 15px rgba(255, 187, 58, 0.2);
}

.bf-stat-card:nth-child(2):hover {
    box-shadow: 0 8px 25px rgba(255, 187, 58, 0.3);
}

.bf-stat-card:nth-child(3) {
    background: var(--bf-stats-gradient);
    box-shadow: 0 4px 15px rgba(147, 213, 10, 0.2);
}

.bf-stat-card:nth-child(3):hover {
    box-shadow: 0 8px 25px rgba(147, 213, 10, 0.3);
}

.bf-stat-number {
    display: block;
    font-size: 2.8em;
    font-weight: 800;
    margin-bottom: 8px;
    line-height: 1;
}

.bf-stat-label {
    display: block;
    font-size: 0.95em;
    opacity: 0.95;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

/* Loading */
.bf-loading {
    text-align: center;
    padding: 60px 20px;
}

.bf-spinner {
    width: 60px;
    height: 60px;
    margin: 0 auto 20px;
    border: 4px solid var(--bf-light);
    border-top: 4px solid var(--bf-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.bf-loading p {
    font-size: 1.1em;
    color: var(--bf-secondary);
}

/* Grid de productos */
.bf-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.bf-product-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 20px var(--bf-shadow);
    transition: all 0.3s ease;
    position: relative;
    border: 2px solid transparent;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.bf-product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 40px var(--bf-shadow-hover);
    border-color: var(--bf-primary);
}

.bf-product-header {
    background: var(--bf-product-card-gradient);
    padding: 20px;
    color: white;
    position: relative;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.bf-product-item {
    font-size: 0.8em;
    opacity: 0.85;
    margin-bottom: 8px;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.bf-product-title {
    font-size: 1.05em;
    font-weight: 600;
    margin: 0;
    line-height: 1.4;
}

.bf-discount-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: var(--bf-danger);
    color: white;
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 800;
    font-size: 1em;
    box-shadow: 0 3px 10px rgba(230, 57, 70, 0.4);
    line-height: 1;
    min-width: 60px;
    text-align: center;
}

.bf-product-body {
    padding: 25px 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.bf-prices {
    margin-bottom: 0;
}

.bf-price-original {
    font-size: 1.05em;
    color: #999;
    text-decoration: line-through;
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.bf-price-black-friday {
    font-size: 2.2em;
    font-weight: 800;
    color: var(--bf-primary);
    display: block;
    line-height: 1;
}

.bf-price-symbol {
    font-size: 0.55em;
    vertical-align: super;
    font-weight: 700;
    margin-right: 2px;
}

.bf-product-footer {
    padding: 20px;
    background: var(--bf-light);
    display: flex;
    flex-direction: column;
    gap: 12px;
    border-top: 1px solid var(--bf-border);
}

.bf-stock {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.95em;
    font-weight: 600;
    width: 100%;
    color: var(--bf-dark);
}

.bf-stock-icon {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--bf-success);
    flex-shrink: 0;
}

.bf-stock.low-stock .bf-stock-icon {
    background: var(--bf-secondary);
}

.bf-stock.very-low-stock .bf-stock-icon {
    background: var(--bf-danger);
    animation: blink 1s ease-in-out infinite;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.3;
    }
}

.bf-savings {
    font-size: 0.9em;
    color: #2d6a1f;
    font-weight: 700;
    background: #e8f5e9;
    padding: 8px 14px;
    border-radius: 8px;
    text-align: center;
    width: 100%;
    border: 1px solid #c8e6c9;
}

/* Sin resultados */
.bf-no-results {
    text-align: center;
    padding: 80px 20px;
    background: var(--bf-light);
    border-radius: 15px;
    border: 2px dashed var(--bf-border);
}

.bf-no-results p {
    font-size: 1.3em;
    color: var(--bf-secondary);
    margin: 0;
}

/* Version Footer */
.bf-version-footer {
    text-align: center;
    padding: 20px;
    margin-top: 40px;
    border-top: 2px solid var(--bf-border);
    color: #999;
    font-size: 0.85em;
}

.bf-version-footer span {
    opacity: 0.7;
    font-weight: 500;
}

/* Error */
.bf-error {
    background: var(--bf-danger);
    color: white;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    font-weight: 600;
}

/* Responsive */
@media (max-width: 768px) {
    .bf-title {
        font-size: 2em;
    }

    .bf-subtitle {
        font-size: 1em;
    }

    .bf-controls {
        grid-template-columns: 1fr;
    }

    .bf-filters {
        flex-direction: column;
        width: 100%;
    }

    .bf-filters select {
        width: 100%;
    }

    .bf-products-grid {
        grid-template-columns: 1fr;
    }

    .bf-product-footer {
        flex-direction: column;
        gap: 12px;
    }
}

@media (max-width: 480px) {
    .bf-catalog-container {
        padding: 10px;
    }

    .bf-header {
        padding: 30px 15px;
        margin-bottom: 20px;
    }

    .bf-title {
        font-size: 1.5em;
    }

    .bf-stats {
        gap: 10px;
    }

    .bf-stat-card {
        padding: 25px 20px;
    }

    .bf-stat-number {
        font-size: 2.2em;
    }

    .bf-product-header {
        min-height: 100px;
        padding: 15px;
    }

    .bf-discount-badge {
        top: 10px;
        right: 10px;
        padding: 6px 12px;
        font-size: 0.9em;
    }
}

/* Animaciones de entrada */
.bf-product-card {
    animation: fadeInUp 0.5s ease-out forwards;
    opacity: 0;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.bf-product-card:nth-child(1) {
    animation-delay: 0.05s;
}

.bf-product-card:nth-child(2) {
    animation-delay: 0.1s;
}

.bf-product-card:nth-child(3) {
    animation-delay: 0.15s;
}

.bf-product-card:nth-child(4) {
    animation-delay: 0.2s;
}

.bf-product-card:nth-child(5) {
    animation-delay: 0.25s;
}

.bf-product-card:nth-child(6) {
    animation-delay: 0.3s;
}

/* Smooth transitions */
* {
    transition: opacity 0.3s ease, transform 0.3s ease;
}