/* =========================================================
   STORE CATALOG UNIFIED CSS
   Fuente única de verdad para:
   - tienda
   - categoría
   - subcategoría
   - buscador inteligente
   - toast carrito

   Reemplaza los dos bloques <style> actuales por este archivo.
========================================================= */

/* =========================================================
   TOKENS
========================================================= */
:root {
    --store-bg: #f8fafc;
    --store-surface: #ffffff;
    --store-surface-soft: #fbfdff;
    --store-border: #e2e8f0;
    --store-border-soft: #eef2f8;
    --store-border-strong: #dbe5ef;
    --store-primary: #0a2c4e;
    --store-primary-2: #1c4d84;
    --store-primary-3: #2f67a7;
    --store-primary-hover: #163c67;
    --store-text: #0f172a;
    --store-text-soft: #334155;
    --store-muted: #64748b;
    --store-placeholder: #94a3b8;
    --store-success: #10b981;
    --store-success-bg: #ecfdf5;
    --store-danger: #dc2626;
    --store-shadow-sm: 0 2px 12px rgba(0, 0, 0, 0.04);
    --store-shadow-md: 0 4px 20px rgba(0, 0, 0, 0.05);
    --store-shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.15);

    --ss-height: 54px;
    --ss-height-mobile: 52px;
    --ss-radius: 16px;
    --ss-radius-mobile: 14px;
    --ss-border: #dbe5ef;
    --ss-border-hover: #c7d6e5;
    --ss-border-focus: #1c4d84;
    --ss-bg: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
    --ss-text: #0f172a;
    --ss-placeholder: #94a3b8;
    --ss-icon: #64748b;
    --ss-shadow: 0 6px 18px rgba(15, 23, 42, 0.04);
    --ss-shadow-hover: 0 10px 22px rgba(15, 23, 42, 0.06);
    --ss-shadow-focus: 0 0 0 4px rgba(28, 77, 132, 0.10), 0 10px 24px rgba(28, 77, 132, 0.08);
    --ss-gap: 10px;
    --ss-font-size: 14px;
    --ss-status-size: 13px;
    --ss-status-color: #64748b;
}

/* =========================================================
   BASE LAYOUT CATALOGO
========================================================= */
html,
body {
    overflow-x: hidden !important;
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
}

.cat-page {
    overflow-x: hidden !important;
    background: var(--store-bg);
    padding: 20px 0 60px;
    width: 100%;
}

.cat-page .container {
    overflow-x: hidden !important;
    padding-left: 15px !important;
    padding-right: 15px !important;
    width: 100%;
    max-width: 100%;
}

.cat-page .row {
    margin-left: 0 !important;
    margin-right: 0 !important;
}

.cat-page [class*="col-"] {
    padding-left: 12px !important;
    padding-right: 12px !important;
}

/* =========================================================
   ARCHIVE HEADER
========================================================= */
.cat-page .archive-header {
    background: linear-gradient(135deg, #eef2ff 0%, #e6f0fa 100%);
    border-radius: 28px;
    padding: 32px 40px;
    margin-bottom: 32px;
    width: 100%;
    overflow: hidden;
}

.cat-page .archive-header h1 {
    font-size: 2rem;
    font-weight: 800;
    color: var(--store-primary);
    margin-bottom: 8px;
    word-break: break-word;
}

/* =========================================================
   FILTROS SIDEBAR
========================================================= */
.cat-page .filter-card {
    background: var(--store-surface);
    border-radius: 24px;
    box-shadow: var(--store-shadow-md);
    overflow: visible !important;
    position: sticky;
    top: 20px;
    border: 1px solid var(--store-border-soft);
    width: 100%;
}

.cat-page .filter-header {
    background: var(--store-surface);
    padding: 16px 20px;
    border-bottom: 1px solid var(--store-border-soft);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.cat-page .filter-header h5 {
    margin: 0;
    font-weight: 700;
    color: var(--store-primary);
    font-size: 1rem;
}

.cat-page .filter-body {
    padding: 20px;
    min-height: calc(100vh + 150px);
    overflow-y: auto !important;
    overflow-x: hidden !important;
}

.cat-page .filter-section {
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid #edf2f7;
    width: 100%;
}

.cat-page .filter-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.cat-page .filter-section h6 {
    font-size: 13px;
    font-weight: 700;
    color: #1e3a5f;
    margin-bottom: 12px;
}

.cat-page .filter-options {
    max-height: 180px;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    padding-right: 8px;
}

.cat-page .filter-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px;
    border-radius: 10px;
    cursor: pointer;
    width: 100%;
    transition: background 0.2s ease;
}

.cat-page .filter-option:hover {
    background: #f1f5f9;
}

.cat-page .filter-option input {
    width: 16px;
    height: 16px;
    cursor: pointer;
    flex-shrink: 0;
}

.cat-page .filter-option label {
    margin: 0;
    font-size: 13px;
    cursor: pointer;
    color: var(--store-text-soft);
    word-break: break-word;
}

.cat-page .filter-options::-webkit-scrollbar,
.cat-page .filter-body::-webkit-scrollbar {
    width: 4px;
    height: 0;
}

.cat-page .filter-options::-webkit-scrollbar-track,
.cat-page .filter-body::-webkit-scrollbar-track {
    background: var(--store-border-soft);
    border-radius: 4px;
}

.cat-page .filter-options::-webkit-scrollbar-thumb,
.cat-page .filter-body::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

/* =========================================================
   PRICE SLIDER
========================================================= */
.cat-page #price-slider {
    margin: 20px 0 16px;
}

.cat-page .noUi-target {
    border-radius: 10px;
    border: 1px solid var(--store-border);
    background: #f1f5f9;
    height: 6px;
}

.cat-page .noUi-connect {
    background: var(--store-primary);
}

.cat-page .noUi-handle {
    width: 18px !important;
    height: 18px !important;
    border-radius: 50%;
    border: 2px solid var(--store-primary);
    background: white;
    top: -7px !important;
    right: -9px !important;
    cursor: pointer;
}

.cat-page .noUi-handle:before,
.cat-page .noUi-handle:after {
    display: none;
}

.cat-page .price-range-values {
    display: flex;
    justify-content: space-between;
    margin-top: 12px;
    font-size: 13px;
    font-weight: 600;
    background: var(--store-bg);
    padding: 8px 12px;
    border-radius: 30px;
}

/* =========================================================
   SMART SEARCH UNIFICADO
========================================================= */
.js-smart-search {
    width: 100%;
    margin-bottom: 10px;
}

.js-smart-search .js-smart-search-form {
    margin: 0;
}

.js-smart-search .row {
    --bs-gutter-x: 14px;
    --bs-gutter-y: 0;
    align-items: center !important;
}

.js-smart-search .search-input-wrap {
    position: relative;
    width: 100%;
}

.js-smart-search .search-input-wrap i {
    position: absolute;
    top: 50%;
    left: 16px;
    transform: translateY(-50%);
    z-index: 3;
    color: var(--ss-icon);
    font-size: 15px;
    pointer-events: none;
    transition: color 0.22s ease;
}

.js-smart-search .js-search-input,
.js-smart-search .search-input-wrap .form-control {
    width: 100%;
    height: var(--ss-height);
    border-radius: var(--ss-radius);
    border: 1px solid var(--ss-border);
    background: var(--ss-bg);
    padding-left: 46px !important;
    padding-right: 16px;
    font-size: var(--ss-font-size);
    font-weight: 500;
    color: var(--ss-text);
    box-shadow: var(--ss-shadow);
    transition: all 0.22s ease;
    outline: none;
}

.js-smart-search .js-search-input::placeholder,
.js-smart-search .search-input-wrap .form-control::placeholder {
    color: var(--ss-placeholder);
    font-weight: 400;
}

.js-smart-search .js-search-input:hover,
.js-smart-search .search-input-wrap .form-control:hover {
    border-color: var(--ss-border-hover);
    box-shadow: var(--ss-shadow-hover);
}

.js-smart-search .js-search-input:focus,
.js-smart-search .search-input-wrap .form-control:focus {
    border-color: var(--ss-border-focus);
    box-shadow: var(--ss-shadow-focus);
    background: #fff;
    outline: none;
}

.js-smart-search .search-input-wrap:focus-within i {
    color: var(--store-primary-2);
}

.js-smart-search .search-actions {
    display: flex;
    align-items: stretch;
    justify-content: flex-end;
    height: var(--ss-height);
    gap: var(--ss-gap);
}

.js-smart-search .js-search-submit,
.js-smart-search .js-search-clear {
    height: var(--ss-height);
    border-radius: var(--ss-radius);
    font-size: 14px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    white-space: nowrap;
    box-shadow: none;
    transition: all 0.22s ease;
    padding: 0 18px;
    line-height: 1;
}

.js-smart-search .js-search-submit {
    background: linear-gradient(135deg, var(--store-primary-2), var(--store-primary-3));
    border: 1px solid var(--store-primary-2);
    color: #fff;
}

.js-smart-search .js-search-submit:hover {
    background: linear-gradient(135deg, var(--store-primary-hover), #25588f);
    border-color: var(--store-primary-hover);
    color: #fff;
    transform: translateY(-1px);
}

.js-smart-search .js-search-clear {
    background: #fff;
    border: 1px solid var(--ss-border);
    color: var(--store-primary-2);
}

.js-smart-search .js-search-clear:hover {
    background: #f8fbff;
    border-color: var(--store-primary-2);
    color: var(--store-primary-hover);
    transform: translateY(-1px);
}

.js-smart-search .js-search-submit:focus,
.js-smart-search .js-search-clear:focus {
    box-shadow: 0 0 0 4px rgba(28, 77, 132, 0.10);
    outline: none;
}

.js-smart-search .js-search-submit i,
.js-smart-search .js-search-clear i {
    font-size: 13px;
}

.js-smart-search .search-actions>.js-search-clear:only-child {
    width: 100%;
    min-width: 100%;
}

.js-smart-search .live-search-status {
    min-height: 20px;
    padding: 6px 4px 0;
    font-size: var(--ss-status-size);
    color: var(--ss-status-color);
    line-height: 1.35;
}

/* Variante home */
#home-smart-search {
    --ss-height: 56px;
    --ss-height-mobile: 52px;
    --ss-radius: 18px;
    --ss-radius-mobile: 16px;
    --ss-font-size: 15px;
    --ss-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
    --ss-shadow-hover: 0 12px 28px rgba(15, 23, 42, 0.07);
}

/* Variante store */
#store-smart-search {
    --ss-height: 54px;
    --ss-height-mobile: 52px;
    --ss-radius: 16px;
    --ss-radius-mobile: 14px;
}

/* =========================================================
   PRODUCTS SUMMARY
========================================================= */
.cat-page .products-summary-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: white;
    border: 1px solid var(--store-border-soft);
    border-radius: 18px;
    padding: 14px 18px;
    margin: 18px 0 22px;
}

.cat-page .products-summary-box .count {
    color: var(--store-primary);
    font-weight: 700;
}

.cat-page .products-summary-box .hint {
    color: var(--store-muted);
    font-size: 13px;
}

/* =========================================================
   PRODUCT CARD
========================================================= */
.cat-page .product-card {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--store-shadow-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    height: 100%;
    border: 1px solid var(--store-border-soft);
    width: 100%;
}

.cat-page .product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.08);
}

.cat-page .product-img-action-wrap {
    position: relative;
    overflow: hidden;
}

.cat-page .product-image {
    width: 100%;
    height: 240px;
    object-fit: cover;
}

.cat-page .product-action-1 {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    opacity: 0;
    transition: all 0.2s ease;
    z-index: 2;
}

.cat-page .product-card:hover .product-action-1 {
    opacity: 1;
}

.cat-page .action-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: white;
    border: 1px solid var(--store-border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--store-primary);
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
}

.cat-page .action-btn:hover {
    background: var(--store-primary);
    color: white;
}

.cat-page .product-content-wrap {
    padding: 12px 12px 16px;
}

.cat-page .product-category {
    font-size: 10px;
    font-weight: 600;
    margin-bottom: 6px;
}

.cat-page .product-category a,
.cat-page .product-category span {
    color: var(--store-muted);
    text-decoration: none;
}

.cat-page .product-content-wrap h5 {
    font-size: 14px;
    font-weight: 600;
    margin: 6px 0 8px;
    line-height: 1.4;
}

.cat-page .product-content-wrap h5 a {
    color: var(--store-primary);
    text-decoration: none;
}

.cat-page .product-price {
    font-size: 18px;
    font-weight: 800;
    color: var(--store-primary);
    margin-bottom: 8px;
}

.cat-page .btn-add-cart {
    background: white;
    border: 1px solid var(--store-border);
    color: var(--store-primary);
    border-radius: 30px;
    padding: 8px 12px;
    font-weight: 600;
    font-size: 12px;
    width: 100%;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cat-page .btn-add-cart:hover {
    background: var(--store-primary);
    color: white;
}

/* =========================================================
   CART TOAST
========================================================= */
.cart-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 99999;
    min-width: 280px;
    background: white;
    border-radius: 16px;
    box-shadow: var(--store-shadow-lg);
    transform: translateX(400px);
    transition: transform 0.3s ease;
}

.cart-toast.show {
    transform: translateX(0);
}

.cart-toast-header {
    background: var(--store-primary);
    color: white;
    padding: 10px 14px;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
}

.cart-toast-body {
    padding: 12px 14px;
    display: flex;
    gap: 10px;
    align-items: center;
}

.cart-toast-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--store-success-bg);
    color: var(--store-success);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.hidden {
    display: none !important;
}

/* =========================================================
   RESPONSIVE
========================================================= */
@media (max-width: 991.98px) {
    .js-smart-search .search-actions {
        justify-content: stretch;
    }

    .js-smart-search .js-search-submit,
    .js-smart-search .js-search-clear {
        flex: 1 1 auto;
    }
}

@media (max-width: 768px) {
    .cat-page .archive-header {
        padding: 20px;
    }

    .cat-page .archive-header h1 {
        font-size: 1.5rem;
    }

    .cat-page .filter-body {
        display: none;
        min-height: auto;
    }

    .cat-page .filter-body.show {
        display: block;
    }

    .cat-page .products-summary-box {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 767.98px) {
    .js-smart-search .row {
        --bs-gutter-x: 0;
        --bs-gutter-y: 12px;
    }

    .js-smart-search .search-actions {
        height: auto;
        flex-direction: column;
    }

    .js-smart-search .js-search-input,
    .js-smart-search .search-input-wrap .form-control,
    .js-smart-search .js-search-submit,
    .js-smart-search .js-search-clear {
        width: 100%;
        height: var(--ss-height-mobile);
        border-radius: var(--ss-radius-mobile);
    }

    .js-smart-search .live-search-status {
        padding-top: 2px;
    }
}