/*==================================================
        CATÁLOGO — BLUES INFORMÁTICA
        Opción A: Lienzo Luminoso con Marco Dark
==================================================*/

/* ============================
   RESETEO Y LIENZO LUMINOSO
============================ */
html,
body,
body.catalogo-page,
.catalogo-page {
    background-color: #F8FAFC !important;
    background-image: radial-gradient(at 50% 0%, #EDF2F7 0%, #F8FAFC 70%) !important;
    background-attachment: fixed !important;
    color: #0F172A !important;
}

.catalogo-page {
    --cat-bg: #F8FAFC;
    --cat-surface: #FFFFFF;
    --cat-border: #E2E8F0;
    --cat-primary: #007BC4;
    --cat-primary-dark: #005D96;
    --cat-cyan: #007BC4;
    --cat-text: #0F172A;
    --cat-text-muted: #64748B;
    --cat-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

/* ============================
   HERO / ENCABEZADO
   (Despeje suficiente para el menú fijo de 88px)
============================ */
.catalog-hero {
    position: relative;
    padding-top: 140px !important;
    padding-bottom: 32px;
    background: transparent;
    border-bottom: 1px solid #E2E8F0;
}

.catalog-hero-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--cat-primary);
    background: rgba(0, 123, 196, 0.08);
    border: 1px solid rgba(0, 123, 196, 0.25);
    padding: 4px 14px;
    border-radius: 999px;
    margin-bottom: 12px;
}

.catalog-hero h1 {
    font-size: clamp(1.9rem, 3.2vw, 2.6rem);
    font-weight: 800;
    color: #0F172A;
    line-height: 1.15;
    letter-spacing: -0.02em;
    margin: 0 0 10px;
}

.catalog-hero p {
    font-size: 0.96rem;
    color: var(--cat-text-muted);
    line-height: 1.6;
    margin: 0 auto;
    max-width: 620px;
}

/* ============================
   SECCIÓN PRINCIPAL
============================ */
.catalog-main {
    padding: 30px 0 80px;
}

/* ============================
   BUSCADOR TECNOLÓGICO
============================ */
.catalogo-page .search {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 auto 36px;
    padding: 8px 10px 8px 18px;
    border-radius: 16px;
    max-width: 680px;
    width: 100%;
    background: #FFFFFF;
    border: 1px solid #CBD5E1;
    box-shadow: 0 4px 16px -2px rgba(15, 23, 42, 0.06);
    transition: all 0.25s ease;
    box-sizing: border-box;
}

.catalogo-page .search:focus-within {
    border-color: var(--cat-primary);
    box-shadow: 0 0 0 3px rgba(0, 123, 196, 0.18), 0 8px 24px -4px rgba(0, 123, 196, 0.12);
    background: #FFFFFF;
}

.catalogo-page .search i,
.catalogo-page .search svg,
.catalogo-page .search .search-icon {
    width: 20px;
    height: 20px;
    color: var(--cat-primary);
    flex-shrink: 0;
}

.catalogo-page .search input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #0F172A;
    font-size: 0.95rem;
    font-family: inherit;
    padding: 6px 0;
}

.catalogo-page .search input::placeholder {
    color: #94A3B8;
}

.catalogo-page .search button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 22px;
    font-size: 0.88rem;
    font-weight: 700;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    background: linear-gradient(135deg, var(--cat-primary), var(--cat-primary-dark));
    color: #FFFFFF;
    box-shadow: 0 4px 12px rgba(0, 123, 196, 0.25);
    transition: all 0.25s ease;
    white-space: nowrap;
}

.catalogo-page .search button:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(0, 123, 196, 0.35);
}

/* ============================
   TÍTULOS DE SECCIÓN
============================ */
.catalog-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 1px solid #E2E8F0;
}

.catalog-section-title {
    font-size: 1.45rem;
    font-weight: 800;
    color: #0F172A;
    margin: 0;
    letter-spacing: -0.02em;
}

/* ============================
   SECCIÓN CATEGORÍAS
============================ */
.catalog-categories-section {
    margin-bottom: 40px;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.category-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 16px 12px 14px;
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 16px;
    cursor: pointer;
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
    font-family: inherit;
    position: relative;
    overflow: hidden;
    width: 100%;
    box-sizing: border-box;
}

.category-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--cat-accent, var(--cat-primary));
    opacity: 0.9;
    transition: height 0.25s ease;
}

.category-card:hover {
    transform: translateY(-3px);
    border-color: var(--cat-accent, var(--cat-primary));
    box-shadow: 0 10px 24px -6px rgba(0, 123, 196, 0.16);
}

.category-card:hover::before {
    height: 4px;
}

.category-card.is-selected {
    border-color: var(--cat-accent, var(--cat-primary));
    background: #FFFFFF;
    box-shadow: 0 0 0 2px var(--cat-accent, var(--cat-primary)), 0 8px 20px -4px rgba(0, 123, 196, 0.18);
}

.category-card-media {
    width: 100%;
    height: 95px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #F8FAFC;
    border-radius: 10px;
    padding: 8px;
    margin-bottom: 10px;
    overflow: hidden;
    box-sizing: border-box;
}

.category-card-img {
    width: 100%;
    height: 100%;
    max-height: 80px;
    object-fit: contain;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.category-card:hover .category-card-img {
    transform: scale(1.08);
}

.category-card-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    width: 100%;
}

.category-card-name {
    font-size: 0.92rem;
    font-weight: 700;
    color: #0F172A;
    letter-spacing: -0.01em;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.category-card-count {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--cat-primary);
    background: rgba(0, 123, 196, 0.08);
    border: 1px solid rgba(0, 123, 196, 0.2);
    padding: 2px 8px;
    border-radius: 999px;
    display: inline-block;
    margin-top: 2px;
}

/* ============================
   SECCIÓN DESTACADOS
============================ */
.catalog-featured-section {
    margin-bottom: 40px;
}

/* ============================
   ACCIONES DEL CATÁLOGO (VER TODOS / OCULTAR)
============================ */
.catalog-all-action {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin: 32px 0 40px;
}

.btn-ver-todos {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 11px 26px;
    font-size: 0.90rem;
    font-weight: 700;
    border-radius: 11px;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0, 123, 196, 0.25);
    transition: all 0.25s ease;
    border: none;
    background: linear-gradient(135deg, var(--cat-primary), var(--cat-primary-dark));
    color: #FFFFFF;
}

.btn-ver-todos:hover {
    filter: brightness(1.1);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 123, 196, 0.35);
}

.btn-ver-todos i,
.btn-ver-todos svg {
    width: 18px;
    height: 18px;
}

.btn-ocultar-productos {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 11px 24px;
    font-size: 0.90rem;
    font-weight: 600;
    border-radius: 11px;
    border: 1px solid #CBD5E1;
    background: #FFFFFF;
    color: #334155;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

.btn-ocultar-productos:hover {
    background: #F1F5F9;
    border-color: #94A3B8;
    color: #0F172A;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}

.btn-ocultar-productos i,
.btn-ocultar-productos svg {
    width: 18px;
    height: 18px;
}

/* ============================
   SECCIÓN RESULTADOS COMPLETOS
============================ */
.catalog-results-section {
    margin-top: 10px;
}

/* ============================
   TOOLBAR (SELECTOR + CONTADOR)
============================ */
.catalog-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
    padding-bottom: 14px;
    border-bottom: 1px solid #E2E8F0;
}

.catalog-toolbar #searchResult {
    margin: 0;
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--cat-text-muted);
    white-space: nowrap;
}

/* ============================
   SELECTOR DE CATEGORÍA
============================ */
.category-select {
    display: flex;
    align-items: center;
    gap: 12px;
}

.category-select label {
    font-size: 0.86rem;
    font-weight: 600;
    color: #334155;
    white-space: nowrap;
}

.category-select-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.category-select-wrap select {
    appearance: none;
    -webkit-appearance: none;
    border: 1px solid #CBD5E1;
    background: #FFFFFF;
    color: #0F172A;
    font-family: inherit;
    font-size: 0.86rem;
    font-weight: 500;
    padding: 8px 34px 8px 12px;
    border-radius: 9px;
    cursor: pointer;
    min-width: 200px;
    max-width: 280px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.category-select-wrap select:hover {
    border-color: var(--cat-primary);
}

.category-select-wrap select:focus {
    outline: none;
    border-color: var(--cat-primary);
    box-shadow: 0 0 0 3px rgba(0, 123, 196, 0.18);
}

.category-select-wrap select option {
    background: #FFFFFF;
    color: #0F172A;
}

.category-select-wrap i,
.category-select-wrap svg {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 15px;
    height: 15px;
    color: #64748B;
    pointer-events: none;
}

/* ========================================================
   GRID DE PRODUCTOS: 4 COLUMNAS EN ESCRITORIO (COMPACTAS)
   ======================================================== */
.catalogo-page .products-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    align-items: stretch;
}

/* ========================================================
   TARJETA DE PRODUCTO — LIENZO LUMINOSO COMPACTO
   ======================================================== */
.catalogo-page .product-card {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 16px;
    overflow: hidden;
    padding: 14px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1),
                border-color 0.25s ease,
                box-shadow 0.25s ease;
    box-sizing: border-box;
}

.catalogo-page .product-card:hover {
    transform: translateY(-4px);
    border-color: var(--cat-accent, #007BC4);
    box-shadow: 0 12px 24px -6px rgba(0, 123, 196, 0.18), 0 0 0 1px var(--cat-accent, #007BC4);
}

/* Pedestal de imagen: limpio, blanco puro, integra fotos sin cortes */
.catalogo-page .product-media {
    position: relative;
    width: 100%;
    height: 130px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    border-radius: 10px;
    background: #FFFFFF;
    overflow: hidden;
    margin-bottom: 10px;
    text-decoration: none;
    box-sizing: border-box;
}

.catalogo-page .product-image {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    user-select: none;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.catalogo-page .product-card:hover .product-image {
    transform: scale(1.06);
}

/* Badges sobre la imagen */
.catalogo-page .product-badges {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 5;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    pointer-events: none;
}

.catalogo-page .product-badge {
    padding: 3px 7px;
    border-radius: 999px;
    color: #FFFFFF;
    font-size: 0.60rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    line-height: 1;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.15);
}

/* Información del producto */
.catalogo-page .product-info {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    justify-content: space-between;
    padding: 0 2px;
    min-width: 0;
}

.catalogo-page .product-brand {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
}

.catalogo-page .product-brand-logo {
    height: 12px;
    width: auto;
    max-width: 50px;
    object-fit: contain;
}

.catalogo-page .product-brand-name {
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #007BC4;
}

.catalogo-page .product-name {
    font-size: 0.88rem;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -0.01em;
    margin: 0 0 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.4em;
}

.catalogo-page .product-name a {
    color: #0F172A;
    text-decoration: none;
    transition: color 0.2s ease;
}

.catalogo-page .product-card:hover .product-name a {
    color: #007BC4;
}

/* DESCRIPCIÓN OCULTA EN EL CATÁLOGO PARA MANTENER LA TARJETA COMPACTA Y ÁGIL */
.catalogo-page .product-desc {
    display: none !important;
}

.catalogo-page .product-price {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 1px;
    margin-bottom: 4px;
    padding-top: 8px;
    border-top: 1px solid #F1F5F9;
}

.catalogo-page .product-price-main {
    font-size: 1.20rem;
    font-weight: 800;
    color: #0F172A;
    letter-spacing: -0.02em;
    line-height: 1.15;
}

.catalogo-page .product-price-secondary {
    display: none !important;
}

.catalogo-page .product-msi {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin: 0 0 8px;
    padding: 2px 7px;
    border-radius: 6px;
    background: rgba(0, 123, 196, 0.08);
    color: #007BC4;
    border: 1px solid rgba(0, 123, 196, 0.2);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.catalogo-page .product-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 9px 14px;
    border: none;
    border-radius: 9px;
    background: linear-gradient(135deg, #007BC4, #005D96);
    color: #FFFFFF;
    font-size: 0.82rem;
    font-weight: 700;
    text-decoration: none;
    box-sizing: border-box;
    box-shadow: 0 3px 10px rgba(0, 123, 196, 0.2);
    transition: all 0.25s ease;
    cursor: pointer;
}

.catalogo-page .product-button:hover {
    filter: brightness(1.1);
    box-shadow: 0 5px 14px rgba(0, 123, 196, 0.35);
    transform: translateY(-2px);
}

.catalogo-page .product-button svg,
.catalogo-page .product-button [data-lucide] {
    width: 14px;
    height: 14px;
    transition: transform 0.2s ease;
}

.catalogo-page .product-button:hover svg,
.catalogo-page .product-button:hover [data-lucide] {
    transform: translateX(3px);
}

/* ========================================================
   RESPONSIVE DESIGN (4 COLS -> 2 COLS -> 1 COL)
   ======================================================== */
@media (max-width: 1100px) {
    .catalogo-page .products-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 16px;
    }

    .categories-grid {
        grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
        gap: 12px;
    }
}

@media (max-width: 768px) {
    .catalog-hero {
        padding-top: 130px !important;
        padding-bottom: 24px;
    }

    .catalog-hero h1 {
        font-size: 1.8rem;
    }

    .catalog-hero p {
        font-size: 0.90rem;
    }

    .catalog-main {
        padding-top: 16px;
        padding-bottom: 60px;
    }
}

/* Móvil (≤ 640px) */
@media (max-width: 640px) {
    .catalog-hero {
        padding-top: 125px !important;
    }

    .catalog-hero h1 {
        font-size: 1.5rem;
    }

    .catalogo-page .search {
        padding: 6px 8px 6px 14px;
        margin-bottom: 20px;
    }

    .catalogo-page .search input {
        font-size: 0.88rem;
    }

    .categories-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .category-card {
        padding: 12px 8px 10px;
        border-radius: 12px;
    }

    .category-card-media {
        height: 75px;
        margin-bottom: 6px;
        padding: 4px;
    }

    .category-card-img {
        max-height: 60px;
    }

    .category-card-name {
        font-size: 0.82rem;
    }

    .category-card-count {
        font-size: 0.65rem;
        padding: 1px 6px;
    }

    .catalog-section-title {
        font-size: 1.20rem;
    }

    .catalog-all-action {
        margin-bottom: 20px;
        flex-direction: column;
        gap: 10px;
    }

    .btn-ver-todos,
    .btn-ocultar-productos {
        width: 100%;
        justify-content: center;
        padding: 10px 18px;
        font-size: 0.86rem;
    }

    .category-select {
        width: 100%;
    }

    .category-select-wrap {
        flex: 1;
    }

    .category-select-wrap select {
        width: 100%;
        max-width: none;
        min-width: 0;
    }

    .catalog-toolbar #searchResult {
        margin-left: 0;
    }

    .catalogo-page .products-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .catalogo-page .product-card {
        border-radius: 14px;
        padding: 12px;
    }

    .catalogo-page .product-media {
        border-radius: 10px;
        margin-bottom: 10px;
        height: 140px;
    }

    .catalogo-page .product-name {
        font-size: 0.90rem;
        min-height: auto;
    }
}
