﻿/* Sin etiqueta "PRODUCTO" sobre la imagen de cada tarjeta */
.product-card::after {
    content: none !important;
    display: none !important;
}

/* CATEGORY CIRCLE SLIDER - HORIZONTAL SCROLL WITH ARROWS */
.category-slider-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 25px;
    margin-top: 90px;
    margin-bottom: 80px;
    padding: 0 40px;
    position: relative;
    width: 100%;
    flex-wrap: wrap;
}

@media (max-width: 992px) {
    .category-slider-wrapper {
        margin-top: 60px;
        margin-bottom: 60px;
        padding: 0 20px;
        gap: 15px;
    }
}

@media (max-width: 768px) {
    .category-slider-wrapper {
        margin-top: 50px;
        margin-bottom: 50px;
        padding: 0 15px;
        gap: 12px;
    }
}

@media (max-width: 576px) {
    .category-slider-wrapper {
        margin-top: 40px;
        margin-bottom: 40px;
        padding: 0 10px;
        gap: 10px;
    }
}

.category-slider-inner {
    display: flex;
    align-items: center;
    gap: 25px;
    justify-content: center;
}

.category-nav-btn.hidden {
    display: none !important;
}

.category-todos-btn {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}

    .category-todos-btn span.category-circle-name {
        color: white;
        font-size: 14px;
        font-weight: 600;
        max-width: 120px;
        word-wrap: break-word;
        text-shadow: 0 2px 4px rgba(0,0,0,0.3);
        transition: all 0.25s ease;
    }

    .category-todos-btn.active span.category-circle-name {
        color: #10b981;
        font-weight: 700;
        text-shadow: 0 2px 4px rgba(0,0,0,0.5);
    }

/* BADGE DE CATEGORÍA DEBAJO DE IMAGEN - DINÁMICO Y MINIMALISTA */
.product-content {
    display: flex !important;
    flex-direction: column !important;
}

.product-category-badge {
    display: inline-block !important;
    width: fit-content !important;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    background: linear-gradient(135deg, #0F3D5E 0%, #1a4d6d 100%);
    border: 1px solid #0F3D5E;
    border-radius: 3px;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 2px 0 6px 0;
    transition: all 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
    cursor: default;
    box-shadow: 0 3px 8px rgba(15, 61, 94, 0.2);
    white-space: nowrap;
    height: fit-content;
    line-height: 1;
}

    .product-category-badge:hover {
        background: linear-gradient(135deg, #1a4d6d 0%, #0F3D5E 100%);
        border-color: #0F3D5E;
        color: white;
        transform: translateY(-2px) scale(1.08);
        box-shadow: 0 5px 14px rgba(15, 61, 94, 0.3);
    }

.category-filter-container {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    flex: 1;
    height: auto;
    padding: 20px 60px;
    justify-content: flex-start;
    align-items: center;
    gap: 20px;
    margin-top: 60px;
}

    .category-filter-container::-webkit-scrollbar {
        height: 6px;
    }

    .category-filter-container::-webkit-scrollbar-track {
        background: rgba(15, 61, 94, 0.08);
        border-radius: 3px;
    }

    .category-filter-container::-webkit-scrollbar-thumb {
        background: #0F3D5E;
        border-radius: 3px;
    }

        .category-filter-container::-webkit-scrollbar-thumb:hover {
            background: #1a4d6d;
        }

.category-filter {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    gap: 20px !important;
    width: 100% !important;
    padding: 0 10px !important;
    margin: 0 !important;
    height: auto !important;
}

    .category-filter > * {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        gap: 20px !important;
        margin: 0 !important;
    }

.category-circle-item {
    text-align: center;
    text-decoration: none;
    display: flex !important;
    flex-direction: column !important;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: all 0.25s ease;
    flex-shrink: 0;
    width: auto !important;
    min-width: fit-content;
    white-space: nowrap;
}

/* ========== CÍRCULOS DE CATEGORÍA - TAMAÑO ADAPTABLE ==========
   Un solo punto de control: --cat-size. Ícono, borde, nombre y separación se calculan a partir de él.
   Se usa !important y el prefijo .category-filter-container para imponerse a overrides antiguos. */
.category-filter-container {
    --cat-size: 120px;
    --cat-gap: 22px;
    --cat-name-size: 14px;
    --cat-border: 3px;
}

@media (max-width: 992px) {
    .category-filter-container {
        --cat-size: 104px;
        --cat-gap: 18px;
        --cat-name-size: 13.5px;
    }
}

@media (max-width: 768px) {
    .category-filter-container {
        --cat-size: 88px;
        --cat-gap: 16px;
        --cat-name-size: 13px;
    }
}

@media (max-width: 576px) {
    .category-filter-container {
        --cat-size: 76px;
        --cat-gap: 14px;
        --cat-name-size: 12.5px;
        --cat-border: 2px;
    }
}

@media (max-width: 400px) {
    .category-filter-container {
        --cat-size: 68px;
        --cat-gap: 12px;
        --cat-name-size: 12px;
    }
}

@media (max-width: 340px) {
    .category-filter-container {
        --cat-size: 60px;
        --cat-gap: 10px;
        --cat-name-size: 11.5px;
    }
}

/* Separación entre círculos (el UpdatePanel es el contenedor flex real) */
.category-filter-container > div {
    gap: var(--cat-gap) !important;
}

.category-filter-container .category-circle {
    width: var(--cat-size) !important;
    height: var(--cat-size) !important;
    border-radius: 50%;
    border: var(--cat-border) solid white;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    transition: all 0.25s ease;
    overflow: hidden;
}

.category-filter-container .category-circle-todos {
    background: linear-gradient(135deg, #0F3D5E 0%, #1a4d6d 100%);
    color: white;
    font-weight: 700;
    border-color: rgba(255,255,255,0.2);
}

.category-filter-container .category-circle-icon {
    font-size: calc(var(--cat-size) * 0.35) !important;
    line-height: 1 !important;
}

.category-circle-item:hover .category-circle {
    border-color: #f59e0b;
    box-shadow: 0 8px 20px rgba(245, 158, 11, 0.3);
    transform: scale(1.08);
}

.category-circle-item.active .category-circle {
    border-color: #10b981;
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.4);
}

/* Nombre: hasta 2 líneas, centrado bajo el círculo y un poco más ancho que él.
   Especificidad alta para superar ".category-todos-btn span.category-circle-name" de style.css,
   que en móvil le daba a "TODOS" otro tamaño y un padding que lo desalineaba del resto. */
.category-filter-container .category-circle-item .category-circle-name {
    padding: 0 !important;
    color: white;
    font-size: var(--cat-name-size) !important;
    font-weight: 600;
    line-height: 1.25;
    width: calc(var(--cat-size) + 24px);
    max-width: calc(var(--cat-size) + 24px) !important;
    white-space: normal;
    overflow-wrap: anywhere;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-align: center;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
    transition: all 0.25s ease;
}

.category-circle-item.active .category-circle-name {
    color: #10b981;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

@media (max-width: 576px) {
    .category-filter-container .category-circle {
        box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    }

    .category-circle-item {
        gap: 8px !important;
    }

    /* En táctil el hover queda "pegado" tras tocar: sin zoom del círculo */
    .category-circle-item:hover .category-circle {
        transform: none;
    }
}

/* NAVIGATION ARROWS */
.category-nav-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.6);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex !important;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
    transition: all 0.25s ease;
    flex-shrink: 0;
    padding: 0;
    z-index: 10;
    min-height: 44px;
    min-width: 44px;
}

@media (max-width: 768px) {
    .category-nav-btn {
        width: 36px;
        height: 36px;
        min-height: 40px;
        min-width: 40px;
        font-size: 16px;
        border: 2px solid rgba(255, 255, 255, 0.5);
    }
}

@media (max-width: 576px) {
    .category-nav-btn {
        width: 32px;
        height: 32px;
        min-height: 40px;
        min-width: 40px;
        font-size: 14px;
        border: 2px solid rgba(255, 255, 255, 0.4);
    }
}

@media (max-width: 450px) {
    .category-nav-btn {
        width: 28px;
        height: 28px;
        min-height: 36px;
        min-width: 36px;
        font-size: 12px;
    }
}

#btnNavLeft {
    flex-shrink: 0;
}

#btnNavRight {
    flex-shrink: 0;
}

.category-nav-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.35);
    border-color: white;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    transform: scale(1.1);
}

.category-nav-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.category-nav-btn.hidden {
    display: none !important;
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 50px;
    flex-wrap: wrap;
    align-items: center;
}

    .pagination a, .pagination span {
        padding: 10px 14px;
        border: 1px solid #d1d5db;
        border-radius: 6px;
        text-decoration: none;
        color: #0F3D5E;
        cursor: pointer;
        font-weight: 500;
        font-size: 14px;
        transition: all 0.25s ease;
        display: inline-block;
        min-height: 40px;
        min-width: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

@media (max-width: 768px) {
    .pagination {
        margin-top: 40px;
        gap: 6px;
    }

        .pagination a, .pagination span {
            padding: 8px 12px;
            font-size: 13px;
            min-height: 38px;
            min-width: 38px;
        }
}

@media (max-width: 576px) {
    .pagination {
        margin-top: 30px;
        gap: 4px;
    }

        .pagination a, .pagination span {
            padding: 6px 10px;
            font-size: 13px;
            min-height: 36px;
            min-width: 36px;
            border-radius: 4px;
        }
}

.pagination a:hover {
    background: #f3f4f6;
    border-color: #f59e0b;
    color: #d97706;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

.pagination .active {
    background: #10b981;
    color: white;
    border-color: #10b981;
    box-shadow: 0 4px 10px rgba(16, 185, 129, 0.2);
    font-weight: 700;
}

.pagination .disabled {
    color: #9ca3af;
    cursor: not-allowed;
    background: #f9fafb;
    border-color: #e5e7eb;
}

.pagination-ellipsis {
    color: #9ca3af;
    padding: 10px 4px;
}

/* ========== HERO SECTION RESPONSIVE OPTIMIZATION ========== */

/* Default: Desktop (1200px+) */
.hero h1 {
    font-size: 62px !important;
    margin-top: 120px !important;
    line-height: 1.2;
}

.hero p {
    font-size: 20px !important;
    line-height: 1.6;
}

/* Tablets y pantallas medianas (≤ 992px) */
@media (max-width: 992px) {
    .hero {
        padding: 160px 0 40px !important;
    }

        .hero h1 {
            font-size: 52px !important;
            margin-top: 80px !important;
            margin-bottom: 20px !important;
        }

        .hero p {
            font-size: 18px !important;
            max-width: 600px !important;
        }
}

/* Tablets (≤ 768px) */
@media (max-width: 768px) {
    .hero {
        padding: 120px 20px 35px !important;
    }

        .hero h1 {
            font-size: 42px !important;
            margin-top: 60px !important;
            margin-bottom: 15px !important;
        }

        .hero p {
            font-size: 16px !important;
            max-width: 100% !important;
            padding: 0 15px;
        }

    .category-filter-container {
        padding: 15px 30px !important;
        margin-top: 40px !important;
    }
}

/* Móviles Landscape/pequeños (≤ 576px) */
@media (max-width: 576px) {
    .hero {
        padding: 100px 15px 30px !important;
    }

        .hero h1 {
            font-size: 32px !important;
            margin-top: 40px !important;
            margin-bottom: 12px !important;
            font-weight: 800;
        }

        .hero p {
            font-size: 15px !important;
            max-width: 100% !important;
            margin-bottom: 0 !important;
            padding: 0 10px;
        }

    .category-filter-container {
        padding: 12px 20px !important;
        margin-top: 30px !important;
    }
}

/* Móviles pequeños (≤ 450px) */
@media (max-width: 450px) {
    .hero {
        padding: 90px 10px 25px !important;
    }

        .hero h1 {
            font-size: 28px !important;
            margin-top: 30px !important;
            margin-bottom: 10px !important;
        }

        .hero p {
            font-size: 15px !important;
            line-height: 1.5;
        }

    .category-filter-container {
        padding: 8px 12px !important;
        margin-top: 20px !important;
        gap: 8px !important;
    }

    .category-circle-item {
        gap: 6px;
    }
}

/* Extra pequeños (≤ 380px) */
@media (max-width: 380px) {
    .hero {
        padding: 80px 8px 20px !important;
    }

        .hero h1 {
            font-size: 24px !important;
            margin-top: 25px !important;
        }

        .hero p {
            font-size: 15px !important;
        }

    .category-filter-container {
        padding: 6px 10px !important;
        gap: 6px !important;
    }

    .category-circle-item {
        gap: 4px;
    }

    .category-nav-btn {
        width: 24px !important;
        height: 24px !important;
        min-height: 32px !important;
        min-width: 32px !important;
        font-size: 12px !important;
    }
}

/* ========== PRODUCT CARD CONTAINER RESPONSIVE ========== */

@media (max-width: 992px) {
    .product-category-badge {
        font-size: 10px;
        padding: 3px 7px;
    }
}

@media (max-width: 768px) {
    .product-category-badge {
        font-size: 12px;
        padding: 2px 6px;
    }
}

@media (max-width: 576px) {
    .product-category-badge {
        font-size: 12px;
        padding: 2px 5px;
    }
}

/* ========== SEARCH SECTION RESPONSIVE ========== */

@media (max-width: 768px) {
    .search-box {
        padding: 25px !important;
    }

    .search-input input {
        height: 50px !important;
        font-size: 16px;
        padding-left: 50px !important;
    }

    .search-input i {
        font-size: 18px;
        left: 18px;
    }
}

@media (max-width: 576px) {
    .search-box {
        padding: 20px !important;
    }

    .search-input input {
        height: 44px !important;
        font-size: 16px;
        padding-left: 45px !important;
        border-radius: 40px;
    }

    .search-input i {
        font-size: 16px;
        left: 15px;
    }
}

@media (max-width: 450px) {
    .search-box {
        padding: 15px !important;
    }

    .search-input input {
        height: 40px !important;
        font-size: 16px;
        padding-left: 40px !important;
    }

    .search-input i {
        font-size: 14px;
        left: 12px;
    }
}

/* ========== LANDSCAPE ORIENTATION ========== */

@media (max-height: 600px) and (orientation: landscape) {
    .hero {
        padding: 40px 0 30px !important;
    }

        .hero h1 {
            font-size: 28px !important;
            margin-bottom: 6px !important;
        }

        .hero p {
            font-size: 14px !important;
        }

    .category-filter-container {
        margin-top: 15px !important;
        padding: 8px 20px !important;
    }

    /* Horizontal con poca altura: círculos compactos para no ocupar media pantalla */
    .category-filter-container {
        --cat-size: 60px;
        --cat-name-size: 12px;
    }

    .search-input input {
        height: 36px !important;
        font-size: 12px;
    }
}

/* ========== UNIFIED CARD STYLING FOR MOBILE ========== */

/* DESKTOP: 4-COLUMN GRID (col-lg-3) */
.col-lg-3.col-md-6 {
    display: flex;
    flex-direction: column;
}

/* TABLET (768px-991px): Keep 2 columns */
@media (max-width: 991px) {
    .col-lg-3.col-md-6 {
        flex: 0 0 50%;
        max-width: 50%;
    }
}

/* TABLET (576px-767px): Keep 2 columns */
@media (max-width: 767px) {
    .col-lg-3.col-md-6 {
        flex: 0 0 50%;
        max-width: 50%;
    }
}

/* MOBILE (450px-575px): 1 COLUMN - FULL WIDTH */
@media (max-width: 575px) {
    .col-lg-3.col-md-6 {
        flex: 0 0 100%;
        max-width: 100%;
        margin-bottom: 15px;
    }
}

/* MOBILE SMALL (≤450px): 1 COLUMN - FULL WIDTH */
@media (max-width: 450px) {
    .col-lg-3.col-md-6 {
        flex: 0 0 100%;
        max-width: 100%;
        margin-bottom: 12px;
    }
}

/* ========== UNIFORM CARD STYLING ========== */

/* Base Product Card */
.product-card {
    display: flex !important;
    flex-direction: column !important;
    height: 100%;
    border-radius: 12px !important;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(15, 61, 94, 0.1);
    transition: all 0.3s ease;
    background: white;
    border: 1px solid #e5e7eb;
}

    .product-card:hover {
        box-shadow: 0 8px 20px rgba(15, 61, 94, 0.15);
        transform: translateY(-2px);
    }

/* Product Image */
.product-img {
    width: 100% !important;
    height: 200px;
    object-fit: cover;
    object-position: center;
    display: block;
    flex-shrink: 0;
}

/* Product Content Container */
.product-content {
    display: flex !important;
    flex-direction: column !important;
    flex-grow: 1;
    padding: 16px 12px;
    gap: 8px;
}

    /* Product Title */
    .product-content h4 {
        margin: 0 !important;
        font-size: 16px !important;
        font-weight: 600;
        color: #0F3D5E;
        line-height: 1.3;
        /* style.css fija min-height: 70px en el título global y separa la descripción */
        min-height: 0 !important;
    }

/* Product Description/Excerpt */
.product-excerpt {
    margin: 0 !important;
    font-size: 13px !important;
    color: #6B7280;
    line-height: 1.4;
    flex-grow: 1;
}

/* Product Footer (buttons) */
.product-footer {
    margin-top: auto;
    padding-top: 8px;
}

/* Action Link/Button */
.btn-industrial {
    display: inline-block;
    min-height: 40px;
    padding: 10px 16px !important;
    background: #F4B400;
    color: #000 !important;
    font-size: 13px !important;
    font-weight: 600;
    border-radius: 6px;
    text-decoration: none;
    border: 1px solid #F4B400;
    transition: all 0.3s ease;
    cursor: pointer;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

    .btn-industrial:hover {
        background: #d49700;
        border-color: #d49700;
        color: white !important;
        transform: scale(1.02);
        box-shadow: 0 4px 12px rgba(244, 180, 0, 0.3);
    }

/* ========== MOBILE CARD ADAPTATIONS ========== */

@media (max-width: 768px) {
    .product-card {
        border-radius: 10px !important;
    }

    .product-img {
        height: 180px;
    }

    .product-content {
        padding: 14px 11px;
        gap: 6px;
    }

        .product-content h4 {
            font-size: 17px !important;
        }

    .product-excerpt {
        font-size: 15px !important;
    }

    .btn-industrial {
        min-height: 38px;
        padding: 8px 14px !important;
        font-size: 15px !important;
    }
}

@media (max-width: 576px) {
    .product-card {
        border-radius: 9px !important;
    }

    .product-img {
        height: 160px;
    }

    .product-content {
        padding: 12px 10px;
        gap: 5px;
    }

        .product-content h4 {
            font-size: 17px !important;
        }

    .product-excerpt {
        font-size: 15px !important;
    }

    .btn-industrial {
        min-height: 40px;
        padding: 8px 12px !important;
        font-size: 15px !important;
    }
}

@media (max-width: 450px) {
    .product-card {
        border-radius: 8px !important;
    }

    .product-img {
        height: 140px;
    }

    .product-content {
        padding: 11px 9px;
        gap: 4px;
    }

        .product-content h4 {
            font-size: 17px !important;
            line-height: 1.2;
        }

    .product-excerpt {
        font-size: 15px !important;
        max-height: 40px;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .btn-industrial {
        min-height: 38px;
        padding: 7px 10px !important;
        font-size: 15px !important;
    }

    .product-category-badge {
        font-size: 12px !important;
        padding: 2px 5px !important;
    }
}

@media (max-width: 380px) {
    .product-img {
        height: 120px;
    }

    .product-content {
        padding: 10px 8px;
    }

        .product-content h4 {
            font-size: 17px !important;
        }

    .product-excerpt {
        font-size: 15px !important;
    }

    .btn-industrial {
        min-height: 36px;
        padding: 6px 8px !important;
        font-size: 15px !important;
    }
}

/* ========== CARD TITLE LINK - Interactive and Elegant ========== */
.card-title-link {
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: block;
    position: relative;
}

    .card-title-link:hover {
        color: #0F3D5E;
    }

    /* Línea de acento sutil al hover */
    .card-title-link::after {
        content: "";
        position: absolute;
        bottom: -2px;
        left: 0;
        width: 0;
        height: 2px;
        background: linear-gradient(90deg, #F4B400, #d49700);
        transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .card-title-link:hover::after {
        width: 30px;
    }

/* ========== TARJETAS EN MÓVIL (1 columna) ==========
   style.css fija ".product-card img { height: 95px !important }" en <=480px pensando en miniaturas;
   aquí cada tarjeta ocupa todo el ancho, así que se restablece imagen y espaciado. */
@media (max-width: 768px) {
    .product-card img.product-img {
        height: 210px !important;
        object-fit: cover;
    }

    .product-card .product-content {
        padding: 18px 18px 20px !important;
        gap: 8px;
    }

    .product-card .product-content h4 {
        line-height: 1.3 !important;
    }

    .product-card .product-excerpt {
        line-height: 1.6 !important;
        max-height: none;
    }

    .product-card .btn-industrial {
        min-height: 46px !important;
        padding: 12px 18px !important;
    }
}

@media (max-width: 450px) {
    .product-card img.product-img {
        height: 190px !important;
    }

    .product-card .product-content {
        padding: 16px 16px 18px !important;
    }
}

/* Los círculos de categoría y el paginador enlazan a #productos: al recargar, el navegador baja solo
   hasta la grilla. La barra superior es fija (120px): sin este margen taparía la primera fila. */
/* El margen deja la primera fila de productos unos 24px por debajo de la barra */
#productos {
    scroll-margin-top: 64px;
}

@media (max-width: 767.98px) {
    #productos {
        scroll-margin-top: 94px;
    }
}
