/* ============================================================
   IMFESOL Productos Grid - Shortcode [imfesol_productos]
   ============================================================ */

/* --- Layout --- */
#top .imfesol-productos-wrapper {
    display: flex;
    gap: 24px;
    max-width: 1310px;
    margin: 0 auto;
    padding: 0 15px;
    font-family: "Inter", sans-serif;
    align-items: flex-start;
}

/* --- Sidebar --- */
#top .imfesol-productos-sidebar {
    width: 280px;
    flex-shrink: 0;
    position: sticky;
    top: 100px;
}

#top .imfesol-sidebar-toggle {
    display: none;
}

#top .imfesol-sidebar-inner {
    border-radius: 16px;
    overflow: hidden;
    border: none;
    box-shadow: 0 4px 20px rgba(0, 36, 123, 0.08);
}

/* Filter group */
#top .imfesol-filter-group {
    border-bottom: 1px solid rgba(0, 145, 203, 0.1);
}

#top .imfesol-filter-group:last-of-type {
    border-bottom: none;
}

#top .imfesol-filter-title {
    margin: 0;
    padding: 13px 18px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #fff;
    background: linear-gradient(135deg, #00247b 0%, #0062d1 100%);
    position: relative;
}

#top .imfesol-filter-group:first-child .imfesol-filter-title {
    border-radius: 16px 16px 0 0;
}

#top .imfesol-filter-body {
    padding: 10px 0;
    background: linear-gradient(180deg, #f0f8ff 0%, #ffffff 100%);
}

/* Category tree */
#top .imfesol-cat-list,
#top .imfesol-cat-list li {
    list-style: none !important;
    list-style-type: none !important;
    margin: 0;
    padding: 0;
}

#top .imfesol-cat-list li::before,
#top .imfesol-cat-list li::marker {
    content: none !important;
    display: none !important;
}

#top .imfesol-cat-depth-1,
#top .imfesol-cat-depth-2 {
    padding-left: 0;
}

#top .imfesol-cat-children {
    display: none;
}

#top .imfesol-cat-row {
    display: flex;
    align-items: center;
    gap: 4px;
}

#top .imfesol-cat-row label {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 10px 7px 0;
    cursor: pointer;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: #334155;
    flex: 1;
    line-height: 1.3;
    transition: background 0.15s;
}

#top .imfesol-cat-row label:hover {
    background: rgba(0, 145, 203, 0.06);
}

#top .imfesol-cat-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px 4px 6px 6px;
    color: #0091cb;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

#top .imfesol-cat-toggle .imfesol-cat-arrow {
    transition: transform 0.2s;
}

#top .imfesol-cat-toggle.is-expanded .imfesol-cat-arrow {
    transform: rotate(90deg);
}

#top .imfesol-cat-toggle-spacer {
    width: 20px;
    flex-shrink: 0;
}

/* Depth indentation */
#top .imfesol-cat-depth-1 .imfesol-cat-row {
    padding-left: 6px;
}

#top .imfesol-cat-depth-2 .imfesol-cat-row {
    padding-left: 12px;
}

/* Custom checkbox */
#top .imfesol-check-mark {
    width: 16px;
    height: 16px;
    border: 2px solid #c5c5c5;
    border-radius: 3px;
    flex-shrink: 0;
    position: relative;
    transition: all 0.15s;
}

#top .imfesol-cat-row input[type="checkbox"],
#top .imfesol-brand-item input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

#top .imfesol-cat-row input[type="checkbox"]:checked + .imfesol-check-mark,
#top .imfesol-brand-item input[type="checkbox"]:checked + .imfesol-check-mark {
    background: linear-gradient(135deg, #0062d1, #00b4d8);
    border-color: #0091cb;
}

#top .imfesol-cat-row input[type="checkbox"]:checked + .imfesol-check-mark::after,
#top .imfesol-brand-item input[type="checkbox"]:checked + .imfesol-check-mark::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 1px;
    width: 5px;
    height: 9px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

#top .imfesol-check-count {
    color: #999;
    font-size: 11px;
    margin-left: auto;
}

/* Brand list */
#top .imfesol-brand-list,
#top .imfesol-brand-list li {
    list-style: none !important;
    list-style-type: none !important;
    margin: 0;
    padding: 0;
}

#top .imfesol-brand-list li::before,
#top .imfesol-brand-list li::marker {
    content: none !important;
    display: none !important;
}

#top .imfesol-brand-item label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 14px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: #333;
    transition: background 0.15s;
}

#top .imfesol-brand-item label:hover {
    background: rgba(0, 145, 203, 0.06);
}

/* Range inputs */
#top .imfesol-range-inputs {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
}

#top .imfesol-range-inputs input[type="number"] {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 13px;
    font-family: "Inter", sans-serif;
    text-align: center;
    width: 80px;
    -moz-appearance: textfield;
}

#top .imfesol-range-inputs input[type="number"]::-webkit-inner-spin-button,
#top .imfesol-range-inputs input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

#top .imfesol-range-inputs input[type="number"]:focus {
    border-color: #00b4d8;
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 180, 216, 0.15);
}

#top .imfesol-range-sep {
    color: #999;
    font-size: 14px;
    flex-shrink: 0;
}

/* Clear button */
#top .imfesol-clear-filters {
    display: block;
    width: 100%;
    padding: 12px 18px;
    background: linear-gradient(180deg, #f0f4f8 0%, #e2e8f0 100%);
    border: none;
    border-radius: 0 0 16px 16px;
    font-family: "Inter", sans-serif;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s;
}

#top .imfesol-clear-filters:hover {
    background: linear-gradient(180deg, #e2e8f0 0%, #cbd5e1 100%);
    color: #334155;
}

/* --- Main grid area --- */
#top .imfesol-productos-main {
    flex: 1;
    min-width: 0;
    position: relative;
}

#top .imfesol-productos-topbar {
    display: flex !important;
    align-items: center !important;
    gap: 14px !important;
    margin-bottom: 18px !important;
    font-size: 13px !important;
    color: #666 !important;
}

#top .imfesol-productos-topbar strong {
    color: #00247b !important;
    font-weight: 700 !important;
}

#top .imfesol-productos-count {
    white-space: nowrap !important;
    flex-shrink: 0 !important;
}

#top .imfesol-search-bar {
    position: relative !important;
    flex: 1 !important;
    max-width: 360px !important;
    min-width: 180px !important;
}

#top .imfesol-productos-wrapper .imfesol-search-input,
#top input#imfesol-search.imfesol-search-input,
#top .imfesol-search-input {
    width: 100% !important;
    padding: 10px 42px 10px 16px !important;
    border: 2px solid #cdd5e0 !important;
    border-radius: 30px !important;
    font-size: 13px !important;
    color: #333 !important;
    background: linear-gradient(180deg, #ffffff 0%, #f4f7fb 100%) !important;
    outline: none !important;
    transition: all 0.3s ease !important;
    box-sizing: border-box !important;
    box-shadow: 0 1px 3px rgba(0, 36, 123, 0.06) !important;
    height: auto !important;
    line-height: 1.4 !important;
    margin: 0 !important;
    -webkit-appearance: none !important;
    appearance: none !important;
}

#top .imfesol-productos-wrapper .imfesol-search-input:hover,
#top input#imfesol-search.imfesol-search-input:hover {
    border-color: #0062d1 !important;
    box-shadow: 0 2px 8px rgba(0, 98, 209, 0.12) !important;
}

#top .imfesol-productos-wrapper .imfesol-search-input:focus,
#top input#imfesol-search.imfesol-search-input:focus {
    border-color: #00247b !important;
    background: #fff !important;
    box-shadow: 0 0 0 3px rgba(0, 36, 123, 0.12), 0 2px 8px rgba(0, 36, 123, 0.08) !important;
}

#top .imfesol-search-input::placeholder {
    color: #a0a8b4 !important;
    font-size: 12px !important;
    font-weight: 400 !important;
}

#top .imfesol-search-bar .imfesol-search-icon {
    position: absolute !important;
    right: 14px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    color: #0062d1 !important;
    pointer-events: none !important;
    width: 16px !important;
    height: 16px !important;
}

/* Product grid - columns set via inline style from shortcode attr */
#top .imfesol-productos-grid {
    display: grid;
    gap: 16px;
}

/* --- Product card --- */
#top .imfesol-product-card {
    border: 1px solid #e3e3e3;
    border-radius: 20px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: #fff;
    transition: all 0.2s ease;
}

#top .imfesol-product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    border-color: #0091cb;
}

#top .imfesol-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

#top .imfesol-card-media {
    border-radius: 12px;
    overflow: hidden;
    background: #f9f9f9;
    margin-bottom: 12px;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

#top .imfesol-card-media img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    mix-blend-mode: multiply;
}

#top .imfesol-card-info {
    min-height: 70px;
}

#top .imfesol-card-title {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    color: #00247b;
    margin: 0 0 4px;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

#top .imfesol-card-sku {
    display: inline-block;
    font-size: 10px;
    font-weight: 600;
    color: #0091cb;
    background: #eff9fd;
    padding: 2px 8px;
    border-radius: 4px;
    margin-bottom: 6px;
}

#top .imfesol-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 10px;
    margin-top: 6px;
}

#top .imfesol-card-meta-item {
    font-size: 10px;
    color: #555;
    line-height: 1.3;
}

#top .imfesol-card-meta-item strong {
    color: #00247b;
    font-weight: 600;
}

#top .imfesol-card-desc {
    font-size: 11px;
    color: #666;
    margin: 6px 0 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

#top .imfesol-card-price {
    font-size: 16px;
    font-weight: 700;
    color: #00247b;
    padding: 8px 0;
}

#top .imfesol-card-price del {
    color: #999;
    font-size: 13px;
    font-weight: 400;
}

#top .imfesol-card-price ins {
    text-decoration: none;
}

/* Card action buttons */
#top .imfesol-card-actions {
    display: flex;
    gap: 5px;
    margin-top: auto;
    padding-top: 8px;
}

#top .imfesol-btn-whatsapp {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    flex: 1;
    padding: 7px 6px;
    background: linear-gradient(135deg, #00b4d8 0%, #0091cb 100%);
    color: #fff !important;
    border-radius: 8px;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    text-decoration: none !important;
    letter-spacing: 0.3px;
    transition: background 0.3s ease;
    line-height: 1.2;
    white-space: nowrap;
}

#top .imfesol-btn-whatsapp:hover {
    background: linear-gradient(135deg, #25D366 0%, #1DAA52 100%);
    color: #fff !important;
}

#top .imfesol-btn-whatsapp .imfesol-icon-wa {
    display: inline-block;
    width: 13px;
    height: 13px;
    flex-shrink: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347m-5.421 7.403h-.004a9.87 9.87 0 01-5.031-1.378l-.361-.214-3.741.982.998-3.648-.235-.374a9.86 9.86 0 01-1.51-5.26c.001-5.45 4.436-9.884 9.888-9.884 2.64 0 5.122 1.03 6.988 2.898a9.825 9.825 0 012.893 6.994c-.003 5.45-4.437 9.884-9.885 9.884m8.413-18.297A11.815 11.815 0 0012.05 0C5.495 0 .16 5.335.157 11.892c0 2.096.547 4.142 1.588 5.945L.057 24l6.305-1.654a11.882 11.882 0 005.683 1.448h.005c6.554 0 11.89-5.335 11.893-11.893a11.821 11.821 0 00-3.48-8.413z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-size: contain;
}

#top .imfesol-btn-ver {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    padding: 7px 6px;
    background: linear-gradient(135deg, #00247b 0%, #0062d1 100%);
    color: #fff !important;
    border-radius: 8px;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    text-decoration: none !important;
    text-align: center;
    letter-spacing: 0.3px;
    transition: all 0.2s;
    line-height: 1.2;
    white-space: nowrap;
}

#top .imfesol-btn-ver:hover {
    background: linear-gradient(135deg, #0062d1 0%, #0091cb 100%);
    color: #fff !important;
}

/* --- Pagination --- */
#top .imfesol-productos-pagination {
    margin-top: 32px;
}

#top .imfesol-pagination-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: #f5f5f5;
    border-radius: 12px;
    padding: 10px 16px;
}

#top .imfesol-page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 4px 8px;
    border-radius: 50%;
    font-family: "Inter", sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: #333;
    text-decoration: none;
    transition: all 0.2s;
    cursor: pointer;
}

#top .imfesol-page-link:hover {
    background: #e0e0e0;
    color: #333;
}

#top .imfesol-page-link.is-active {
    background: #0091cb;
    color: #fff;
}

#top .imfesol-page-link.is-active:hover {
    background: #007bb0;
    color: #fff;
}

#top .imfesol-page-dots {
    padding: 0 4px;
    color: #999;
}

/* No results */
#top .imfesol-no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: #999;
    font-size: 15px;
}

/* --- Loading overlay --- */
#top .imfesol-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.6);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 120px;
    z-index: 10;
    border-radius: 16px;
}

#top .imfesol-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid #e3e3e3;
    border-top-color: #0091cb;
    border-radius: 50%;
    animation: imfesol-spin 0.7s linear infinite;
}

@keyframes imfesol-spin {
    to { transform: rotate(360deg); }
}

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

@media (max-width: 989px) {
    #top .imfesol-productos-wrapper {
        flex-direction: column;
    }

    #top .imfesol-productos-sidebar {
        width: 100%;
        position: static;
    }

    #top .imfesol-sidebar-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        width: 100%;
        padding: 14px 20px;
        background: linear-gradient(135deg, #00247b 0%, #0062d1 100%);
        color: #fff;
        border: none;
        border-radius: 12px;
        font-family: "Inter", sans-serif;
        font-size: 14px;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        cursor: pointer;
        transition: all 0.2s;
        box-shadow: 0 4px 12px rgba(0, 98, 209, 0.25);
    }

    #top .imfesol-sidebar-toggle:hover {
        background: linear-gradient(135deg, #001a5c 0%, #004db3 100%);
    }

    #top .imfesol-sidebar-toggle .imfesol-sidebar-toggle-icon {
        transition: transform 0.2s;
    }

    #top .imfesol-sidebar-toggle.is-active .imfesol-sidebar-toggle-icon {
        transform: rotate(180deg);
    }

    #top .imfesol-sidebar-inner {
        display: none;
        margin-top: 8px;
    }

    #top .imfesol-sidebar-inner.is-open {
        display: block;
    }
}

@media (max-width: 767px) {
    #top .imfesol-productos-grid {
        gap: 10px;
    }

    #top .imfesol-card-title {
        font-size: 11px;
    }

    #top .imfesol-card-desc {
        display: none;
    }

    #top .imfesol-btn-whatsapp,
    #top .imfesol-btn-ver {
        font-size: 8px;
        padding: 6px 4px;
    }

    #top .imfesol-card-price {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    #top .imfesol-productos-wrapper {
        padding: 0 8px;
    }

    #top .imfesol-productos-grid {
        gap: 8px;
    }

    #top .imfesol-product-card {
        padding: 10px;
        border-radius: 14px;
    }

    #top .imfesol-card-media {
        border-radius: 8px;
    }
}
