/* Catalog Styles */
.catalog-hero { position: relative; padding: 40px 0; overflow: hidden; }
.catalog-hero-bg { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: #0E1B2D; background-image: linear-gradient(135deg, #0E1B2D 0%, #0A4F9C 100%); background-size: cover; background-position: center; z-index: 1; }
.catalog-hero-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(14, 27, 45, 0.85); z-index: 2; }
.catalog-hero-content { position: relative; z-index: 3; }
.catalog-hero-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 24px; }
.catalog-breadcrumb { color: rgba(255,255,255,0.7); font-size: 0.875rem; }
.catalog-breadcrumb a { color: rgba(255,255,255,0.7); text-decoration: none; }
.catalog-breadcrumb a:hover { color: #fff; text-decoration: underline; }
.catalog-hero-badge { text-align: right; color: #fff; font-size: 0.75rem; letter-spacing: 0.05em; line-height: 1.4; border-left: 2px solid var(--psm-performance-amber); padding-left: 12px; font-family: var(--font-body); }
.catalog-hero-title { color: #fff; font-size: 3rem; margin-bottom: 8px; font-family: var(--font-headings); }
.catalog-hero-subtitle { color: rgba(255,255,255,0.9); font-size: 1.125rem; margin-bottom: 32px; font-weight: 400; }
.catalog-search-row { display: flex; gap: 24px; align-items: stretch; margin-bottom: 24px; flex-wrap: wrap; width: 100%; }
.catalog-search-wrapper { flex: 1; min-width: 300px; max-width: 100%; }
.catalog-search-input-group { display: flex; width: 100%; max-width: 100%; background: #fff; border-radius: 4px; overflow: hidden; height: 56px; }
.search-icon { display: flex; align-items: center; justify-content: center; width: 56px; background: #fff; flex-shrink: 0; }
.catalog-search-input { flex: 1; border: none; padding: 0 16px 0 0; font-size: 1.125rem; color: var(--psm-deep-navy); outline: none; font-family: var(--font-body); min-width: 0; }
.catalog-search-button { background: var(--psm-performance-amber); border: none; width: 64px; display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--psm-deep-navy); transition: background 0.2s; flex-shrink: 0; }
.catalog-search-button:hover { background: #e6a200; }
.catalog-support-box { border: 1px solid rgba(255,255,255,0.2); border-radius: 4px; padding: 12px 20px; display: flex; align-items: center; gap: 16px; background: rgba(14,27,45,0.4); max-width: 100%; }
.support-icon { color: var(--psm-performance-amber); display: flex; flex-shrink: 0; }
.support-text { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.support-title { color: #fff; font-weight: 600; font-size: 0.875rem; }
.support-desc { color: rgba(255,255,255,0.7); font-size: 0.75rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.support-btn { border-color: rgba(255,255,255,0.3); color: #fff; padding: 0.5rem 1rem; font-size: 0.875rem; margin-left: 16px; white-space: nowrap; flex-shrink: 0; }
.support-btn:hover { background: #fff; color: var(--psm-deep-navy); }
.catalog-hero-count { color: #fff; font-size: 0.875rem; font-weight: 500; }

.catalog-main-area.section { padding-top: 36px; padding-bottom: 48px; }
.catalog-grid { display: grid; grid-template-columns: 260px 1fr; gap: 40px; align-items: start; }

/* REQUERIMIENTO A: Caja de filtros (Fondo claro, Borde, y Sombra) */
.catalog-sidebar-inner { 
    background-color: #F4F8FB; 
    border: 1px solid #E2E8F0; 
    border-radius: 8px; 
    box-shadow: 0 4px 15px rgba(10, 79, 156, 0.05); 
    padding: 24px; 
}

.filters-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; padding-bottom: 12px; border-bottom: 1px solid #CBD5E0; }
.filters-title { font-size: 1.25rem; margin: 0; font-family: var(--font-headings); }
.filters-clear { font-size: 0.875rem; color: var(--psm-precision-cyan); font-weight: 500; text-decoration: none; }
.filter-group { border-bottom: 1px solid #CBD5E0; padding: 16px 0; }
.filter-group:last-child { border-bottom: none; }
.filter-group-toggle svg, .filter-group-toggle span { pointer-events: none; }
.filter-group-toggle { width: 100%; display: flex; justify-content: space-between; align-items: center; background: none; border: none; padding: 0; font-family: var(--font-headings); font-weight: 600; font-size: 1rem; color: var(--psm-deep-navy); cursor: pointer; }
.filter-group-toggle > svg { transition: transform 0.3s; }
.filter-group.is-collapsed .filter-group-toggle > svg { transform: rotate(-180deg); }
.filter-group-content { margin-top: 16px; display: flex; flex-direction: column; gap: 12px; }
/* Icono y resumen de selección: solo en el diseño del hero móvil */
.filter-group-icon, .filter-group-summary { display: none; }
.catalog-hero-filters:empty { display: none; }
/* Contador de filtros activos por grupo: solo visible en móvil/tablet */
.filter-group-active { display: none; }
@media (max-width: 1024px) { .filter-group-active { display: inline; } }
.filter-group.is-collapsed .filter-group-content { display: none; }

.filter-checkbox-label { display: flex; align-items: center; cursor: pointer; font-size: 0.875rem; color: var(--psm-technical-gray); position: relative; }
.filter-checkbox-label input { position: absolute; opacity: 0; cursor: pointer; height: 0; width: 0; }
.filter-checkbox-custom { height: 18px; width: 18px; background-color: #fff; border: 1px solid #A0ABC0; border-radius: 3px; display: flex; align-items: center; justify-content: center; margin-right: 10px; transition: all 0.2s; flex-shrink: 0; }
.filter-checkbox-label input:checked ~ .filter-checkbox-custom { background-color: var(--psm-industrial-blue); border-color: var(--psm-industrial-blue); }
.filter-checkbox-custom::after { content: ""; display: none; width: 4px; height: 8px; border: solid white; border-width: 0 2px 2px 0; transform: rotate(45deg); margin-bottom: 2px; }
.filter-checkbox-label input:checked ~ .filter-checkbox-custom::after { display: block; }
.filter-label-text { flex: 1; }
.filter-count { color: #A0ABC0; font-size: 0.75rem; margin-left: 4px; }

.catalog-results-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; font-size: 0.875rem; color: var(--psm-technical-gray); }
.results-sort { display: flex; align-items: center; gap: 12px; }
.custom-select-wrapper select { border: 1px solid #E2E8F0; border-radius: 4px; padding: 6px 32px 6px 12px; font-family: var(--font-body); color: var(--psm-deep-navy); font-size: 0.875rem; background-color: #fff; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%230E1B2D' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; outline: none; cursor: pointer; }

.catalog-active-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }

/* REQUERIMIENTO B: Etiquetas/Chips con borde cyan/azulado */
.psm-chip { 
    display: inline-flex; 
    align-items: center; 
    background: #F0F6FC; 
    color: var(--psm-industrial-blue); 
    border: 1px solid #CDE0F5; 
    padding: 6px 14px; 
    border-radius: 20px; 
    font-size: 0.75rem; 
    font-weight: 600; 
    cursor: pointer; 
    transition: all 0.2s; 
}
.psm-chip:hover { background: #DDEBF7; border-color: #A9C9E8; }
.psm-chip-close { margin-left: 6px; font-size: 1rem; line-height: 1; }

.catalog-product-list { display: flex; flex-direction: column; gap: 16px; margin-bottom: 28px; }

/* REQUERIMIENTO C: Borde sólido y sombra muy sutil en las tarjetas de producto */
.psm-product-row { 
    display: flex; 
    background: #fff; 
    border: 1px solid #E2E8F0; 
    border-radius: 8px; 
    padding: 24px; 
    gap: 24px; 
    transition: box-shadow 0.2s, border-color 0.2s; 
    box-shadow: 0 2px 10px rgba(0,0,0,0.02);
}
.psm-product-row:hover { box-shadow: 0 4px 12px rgba(14,27,45,0.06); border-color: #CBD5E0; }

.row-image { width: 120px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.row-image img { max-width: 100%; height: auto; border-radius: 4px; }
.psm-placeholder { width: 100px; height: 100px; background: #F4F6F8; border-radius: 4px; display: flex; align-items: center; justify-content: center; }

.row-info { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; }
.row-pn { font-size: 1.5rem; font-weight: 700; margin-bottom: 4px; font-family: var(--font-headings); }
.row-pn a { color: var(--psm-deep-navy); text-decoration: none; }
.row-pn a:hover { color: var(--psm-industrial-blue); }
.row-desc { color: var(--psm-technical-gray); font-size: 0.875rem; margin-bottom: 16px; text-transform: uppercase; letter-spacing: 0.02em; }

.row-attributes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; border-top: 1px solid var(--psm-border-color); padding-top: 16px; }
.attr-block { display: flex; flex-direction: column; min-width: 0; } 
.attr-label { font-size: 0.65rem; color: #A0ABC0; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 2px; }
.attr-val { font-size: 0.8125rem; font-weight: 600; color: var(--psm-deep-navy); text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.row-actions { width: 232px; flex-shrink: 0; display: flex; flex-direction: column; gap: 8px; justify-content: center; border-left: 1px solid var(--psm-border-color); padding-left: 24px; }
.action-btn { width: 100%; font-size: 0.875rem; padding: 0.6rem 0.75rem; white-space: nowrap; }
.action-link { display: inline-flex; align-items: center; font-size: 0.75rem; font-weight: 600; color: var(--psm-industrial-blue); margin-top: 8px; justify-content: center; text-decoration: none; text-align: center; }
.action-link svg { margin-right: 4px; flex-shrink: 0; }

.psm-pagination ul { display: flex; list-style: none; padding: 0; margin: 0; gap: 8px; justify-content: center; align-items: center; flex-wrap: wrap; }
.psm-pagination li { display: inline-flex; }
.psm-pagination a, .psm-pagination span { display: inline-flex; align-items: center; justify-content: center; min-width: 40px; height: 40px; padding: 0 12px; border: 1px solid var(--psm-border-color); background: #fff; color: var(--psm-deep-navy); border-radius: 4px; font-weight: 500; font-size: 0.875rem; text-decoration: none; transition: all 0.2s; }
.psm-pagination a:hover { border-color: var(--psm-industrial-blue); color: var(--psm-industrial-blue); }
.psm-pagination span.current { background: var(--psm-industrial-blue); border-color: var(--psm-industrial-blue); color: #fff; }
.psm-pagination .prev, .psm-pagination .next { border: none; background: transparent; }

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

@media (max-width: 1024px) {
    .catalog-hero-title { font-size: 2.25rem; }
    .catalog-search-wrapper { min-width: 100%; }
    .catalog-support-box { width: 100%; justify-content: flex-start; }
    .support-desc { white-space: normal; } 
    
    .catalog-grid { grid-template-columns: 1fr; gap: 24px; }
    /* Móvil/tablet: los mismos grupos de filtros como acordeones sobre los resultados (sin botón ni drawer) */
    .catalog-sidebar-inner { padding: 6px 18px; border-radius: 6px; box-shadow: none; }
    .filters-header { margin-bottom: 0; padding: 12px 0; }
    .filters-title { font-size: 1.125rem; }
    .filter-group { padding: 0; }
    .filter-group-toggle { min-height: 52px; padding: 14px 0; font-size: 1rem; }
    .filter-group-toggle:focus-visible { outline: 2px solid var(--psm-precision-cyan); outline-offset: 2px; }
    .filter-group-content { margin-top: 0; padding: 4px 0 16px; }
    .filter-group-active { color: var(--psm-precision-cyan); font-weight: 700; }
    /* Resultados de búsqueda: filtros dentro del hero (diseño de selectores oscuros del Home) */
    .catalog-sidebar.is-moved { display: none; }
    .catalog-hero-filters { width: 100%; }
    .catalog-sidebar-inner.is-in-hero { padding: 0; background: transparent; border: 0; box-shadow: none; border-radius: 0; }
    .is-in-hero .filters-header { border: 0; padding: 0 0 10px; }
    .is-in-hero .filters-title { color: #fff; font-size: 1.5rem; }
    .is-in-hero .filters-clear { color: #fff; opacity: .85; text-decoration: underline; }
    .is-in-hero .filters-body { display: flex; flex-direction: column; gap: 10px; }
    .is-in-hero .filter-group { padding: 0; border: 1px solid rgba(255,255,255,.9); border-radius: 3px; background: rgba(11,22,38,.35); transition: border-color .2s, background .2s; }
    .is-in-hero .filter-group:last-child { border-bottom: 1px solid rgba(255,255,255,.9); }
    .is-in-hero .filter-group:not(.is-collapsed), .is-in-hero .filter-group:focus-within { border-color: var(--psm-performance-amber); background: rgba(11,22,38,.6); }
    .is-in-hero .filter-group-toggle { display: grid; grid-template-columns: auto 1fr auto; column-gap: 14px; align-items: center; width: 100%; min-height: 56px; padding: 8px 14px; color: #fff; text-align: left; cursor: pointer; }
    .is-in-hero .filter-group-icon { display: flex; color: #fff; }
    .is-in-hero .filter-group-label { display: flex; flex-direction: column; font-family: var(--font-body); font-size: .875rem; font-weight: 700; line-height: 1.25; min-width: 0; }
    .is-in-hero .filter-group-active { display: none; }
    .is-in-hero .filter-group-summary { display: block; font-size: .8125rem; font-weight: 400; color: rgba(255,255,255,.85); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .is-in-hero .filter-group.has-active .filter-group-summary { color: var(--psm-performance-amber); font-weight: 600; }
    .is-in-hero .filter-group-toggle svg { color: #fff; }
    .is-in-hero .filter-group-icon svg { transform: none !important; }
    .is-in-hero .filter-group-content { padding: 4px 14px 14px; gap: 10px; }
    .is-in-hero .filter-checkbox-label { color: #fff; }
    .is-in-hero .filter-label-text { color: #fff; }
    .is-in-hero .filter-count { color: rgba(255,255,255,.65); }
    .is-in-hero .filter-checkbox-custom { background: transparent; border-color: rgba(255,255,255,.85); }
    .is-in-hero .filter-group-toggle:focus-visible { outline: 2px solid var(--psm-performance-amber); outline-offset: 2px; }
    /* Chevron: ▼ cerrado / ▲ abierto */
    .filter-group-toggle > svg { transform: rotate(180deg); }
    .filter-group.is-collapsed .filter-group-toggle > svg { transform: rotate(0deg); }
}

@media (max-width: 768px) {
    .catalog-search-row { gap: 16px; margin-right: 0; }
    .catalog-search-input-group { max-width: 100%; }

    .catalog-support-box { flex-direction: column; align-items: flex-start; gap: 12px; padding: 16px; }
    .support-btn { margin-left: 0; width: 100%; text-align: center; }

    .psm-product-row { flex-direction: column; padding: 20px; gap: 20px; }
    
    .row-image { width: 100%; height: auto; justify-content: center; }
    .row-image img { max-height: 200px; object-fit: contain; }
    .psm-placeholder { width: 100%; height: 160px; }
    
    .row-attributes { grid-template-columns: 1fr 1fr; gap: 16px; }
    
    .row-actions { width: 100%; border-left: none; border-top: 1px solid var(--psm-border-color); padding-left: 0; padding-top: 20px; flex-direction: column; align-items: stretch; gap: 12px; }
    .action-btn { width: 100%; margin: 0; }
    .action-link { margin-top: 4px; }
    
    .catalog-results-header { flex-direction: column; align-items: flex-start; gap: 12px; }
    .results-sort { width: 100%; justify-content: space-between; }
}