/**
 * Catálogo CT Online Style - Moranda Systems
 * Diseño con sidebar de filtros y lista expandible
 */

/* ========== SECCIÓN DE BÚSQUEDA ========== */
.search-section {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--secondary-blue) 100%);
    padding: 60px 20px;
    margin-bottom: 0;
}

.search-container {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.search-title {
    color: white;
    font-size: 32px;
    font-weight: 700;
    margin: 0 0 30px 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.search-bar {
    display: flex;
    gap: 10px;
    max-width: 600px;
    margin: 0 auto;
}

.search-input {
    flex: 1;
    padding: 15px 20px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.search-input:focus {
    outline: none;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.search-btn {
    padding: 15px 30px;
    background: white;
    color: var(--primary-blue);
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.search-btn:hover {
    background: #f8f9fa;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

/* ========== BREADCRUMB ========== */
.breadcrumb {
    margin: 0;
    padding: 0;
}

.breadcrumb-list {
    display: flex;
    list-style: none;
    padding: 10px 0;
    margin: 0;
    gap: 8px;
}

.breadcrumb-item {
    color: #666;
    font-size: 14px;
}

.breadcrumb-item:not(:last-child)::after {
    content: '›';
    margin-left: 8px;
    color: #999;
}

.breadcrumb-link {
    color: var(--primary-blue);
    text-decoration: none;
    transition: color 0.3s ease;
}

.breadcrumb-link:hover {
    color: var(--secondary-blue);
    text-decoration: underline;
}

/* ========== LAYOUT ========== */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 15px;
    border-left: 1px solid #e0e0e0;
    border-right: 1px solid #e0e0e0;
}

.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -15px;
}

.col-md-3 {
    flex: 0 0 25%;
    max-width: 25%;
    padding: 0 15px;
}

.col-md-9 {
    flex: 0 0 75%;
    max-width: 75%;
    padding: 0 15px;
}

/* ========== SIDEBAR DE FILTROS ========== */
.sidebar-wrapper {
    position: relative;
}

.sidebar-filters {
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
}

.filters-header {
    background: var(--secondary-blue);
    color: white;
    padding: 15px 20px;
    border-radius: 8px 8px 0 0;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.filters-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    color: white;
    text-align: center;
}

.close-filters {
    background: none;
    border: none;
    position: absolute;
    right: 15px;
    color: white;
    font-size: 28px;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 30px;
    height: 30px;
    display: none;
}

/* Botones de acción */
.filter-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 15px;
    border-bottom: 1px solid #eee;
}

.btn-apply-filters,
.btn-clear-filters {
    padding: 10px 12px;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    white-space: nowrap;
}

.btn-apply-filters svg,
.btn-clear-filters svg {
    flex-shrink: 0;
}

.btn-apply-filters {
    background: var(--primary-blue);
    color: white;
}

.btn-apply-filters:hover {
    background: #1e5a9e;
}

.btn-clear-filters {
    background: #f5f5f5;
    color: #333;
    border: 1px solid #ddd;
}

.btn-clear-filters:hover {
    background: #e0e0e0;
}

/* Cajas de filtros */
.filter-box {
    border-bottom: 1px solid #eee;
    padding: 15px;
}

.filter-box-title {
    font-size: 14px;
    font-weight: 700;
    color: #333;
    margin: 0 0 12px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Estilos para la caja de búsqueda */
.search-box-ct {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.search-input-ct {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.search-input-ct:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.search-btn-ct {
    padding: 10px 14px;
    background: var(--primary-blue);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.search-btn-ct:hover {
    background: var(--secondary-blue);
    transform: translateY(-2px);
}

.search-btn-ct svg {
    width: 18px;
    height: 18px;
}

.filter-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.filter-item {
    margin-bottom: 2px;
}

/* Lista compacta para filtros de precio */
.filter-list-compact .filter-item {
    margin-bottom: 2px;
}

/* Lista compacta para filtros de precio */
.filter-list-compact .filter-item {
    margin-bottom: 2px;
}

.filter-list-compact .checkbox-label-ct {
    padding: 2px 0;
}

/* Checkboxes estilo CT Online */
.checkbox-label-ct {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 2px 0;
    transition: all 0.2s;
}

.checkbox-label-ct:hover {
    background: #f8f8f8;
    padding-left: 5px;
    margin-left: -5px;
}

.checkbox-label-ct input[type="checkbox"] {
    display: none;
}

.checkbox-custom {
    width: 16px;
    height: 16px;
    border: 2px solid #ccc;
    border-radius: 3px;
    margin-right: 10px;
    flex-shrink: 0;
    position: relative;
    transition: all 0.2s;
    background: white;
}

.checkbox-label-ct input[type="checkbox"]:checked + .checkbox-custom {
    background: var(--primary-blue);
    border-color: var(--primary-blue);
}

.checkbox-label-ct input[type="checkbox"]:checked + .checkbox-custom::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
}

.checkbox-text {
    flex: 1;
    font-size: 13px;
    color: #555;
}

.product-count {
    font-size: 12px;
    color: #999;
    margin-left: 5px;
}

.show-more-btn,
.btn-show-more {
    background: none;
    border: none;
    color: var(--primary-blue);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    padding: 8px 0;
    margin-top: 5px;
    text-decoration: underline;
    width: 100%;
    text-align: left;
}

.show-more-btn:hover,
.btn-show-more:hover {
    color: #1e5a9e;
}

.filter-checkbox input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.checkbox-custom {
    width: 18px;
    height: 18px;
    border: 2px solid #ccc;
    border-radius: 3px;
    margin-right: 10px;
    flex-shrink: 0;
    position: relative;
    transition: all 0.2s;
}

.filter-checkbox input[type="checkbox"]:checked ~ .checkbox-custom {
    background: var(--primary-blue);
    border-color: var(--primary-blue);
}

.filter-checkbox input[type="checkbox"]:checked ~ .checkbox-custom::after {
    content: '✓';
    position: absolute;
    color: white;
    font-size: 12px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.filter-label {
    font-size: 14px;
    color: #555;
    flex: 1;
}

.filter-count {
    font-size: 12px;
    color: #999;
    margin-left: auto;
    padding-left: 5px;
}

/* Botón mostrar más */
.show-more-btn {
    background: none;
    border: none;
    color: var(--primary-blue);
    font-size: 14px;
    cursor: pointer;
    padding: 10px 0;
    width: 100%;
    text-align: left;
    font-weight: 600;
}

.show-more-btn:hover {
    text-decoration: underline;
}

/* ========== CONTENIDO DE PRODUCTOS ========== */
.products-content {
    position: relative;
}

/* Botón filtros móvil */
.btn-show-filters {
    display: none;
    width: 100%;
    padding: 12px;
    background: var(--secondary-blue);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 20px;
    gap: 10px;
    align-items: center;
    justify-content: center;
}

/* Controles de productos */
.products-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid #ddd;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.products-summary {
    font-size: 14px;
    color: #666;
}

.products-view-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.view-toggle-btn {
    width: 36px;
    height: 36px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.2s;
}

.view-toggle-btn.active {
    background: var(--primary-blue);
    color: white;
    border-color: var(--primary-blue);
}

.view-toggle-btn:hover:not(.active) {
    background: #f5f5f5;
}

.sort-select-ct {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    background: white;
}

/* ========== PAGINACIÓN ========== */
.pagination-ct {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    padding: 20px 0;
    flex-wrap: nowrap;
}

.page-btn-ct {
    padding: 6px 12px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
    white-space: nowrap;
}

.page-btn-ct:hover:not(:disabled) {
    background: #f5f5f5;
}

.page-btn-ct:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.page-numbers {
    display: flex;
    gap: 4px;
    flex-wrap: nowrap;
}

.page-number {
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.page-number.active {
    background: var(--primary-blue);
    color: white;
    border-color: var(--primary-blue);
}

.page-number:hover:not(.active) {
    background: #f5f5f5;
}

.page-dots {
    padding: 0 8px;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    user-select: none;
}

/* ========== LISTA DE PRODUCTOS ========== */
.products-list-ct {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.product-item-ct {
    background: white;
    border-bottom: 1px solid #ddd;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
}

.product-item-ct:hover {
    background: #fafafa;
}

.product-main-ct {
    display: flex;
    gap: 20px;
    padding: 20px;
    align-items: flex-start;
}

.product-image-ct {
    width: 150px;
    height: 150px;
    flex-shrink: 0;
    object-fit: contain;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 10px;
    background: white;
}

.product-info-ct {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.product-title-ct {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin: 0;
    line-height: 1.4;
}

.product-code-ct {
    font-size: 13px;
    color: #666;
    margin: 0;
}

.product-brand-ct {
    font-size: 14px;
    color: #555;
    margin: 0;
}

.product-brand-logo-ct {
    max-height: 32px;
    max-width: 100px;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    margin: 6px 0;
    opacity: 0.9;
    transition: opacity 0.2s ease;
    filter: brightness(0.95);
}

.product-brand-logo-ct:hover {
    opacity: 1;
    filter: brightness(1);
}

.product-price-stock-ct {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
    margin: 8px 0;
}

.product-price-ct {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-blue);
    margin: 0;
}

.stock-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.stock-badge.in-stock {
    background: #e8f5e9;
    color: #2e7d32;
}

.stock-badge.out-stock {
    background: #ffebee;
    color: #c62828;
}

.product-actions-ct {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 0 20px 0 0;
    min-width: 140px;
}

/* Controles de cantidad */
.quantity-controls-ct {
    display: flex;
    align-items: center;
    gap: 5px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 4px;
}

.qty-btn-ct {
    width: 32px;
    height: 32px;
    border: none;
    background: var(--primary-blue);
    color: white;
    font-size: 18px;
    font-weight: 600;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.qty-btn-ct:hover:not(:disabled) {
    background: var(--secondary-blue);
}

.qty-btn-ct:active:not(:disabled) {
    transform: scale(0.95);
}

.qty-btn-ct:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #cccccc;
}

.qty-input-ct {
    width: 50px;
    border: none;
    text-align: center;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    background: transparent;
}

.qty-input-ct:focus {
    outline: none;
}

/* Ocultar flechas del input number */
.qty-input-ct::-webkit-inner-spin-button,
.qty-input-ct::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.qty-input-ct {
    -moz-appearance: textfield;
}

.btn-expand-ct {
    background: white;
    border: 1px solid var(--primary-blue);
    color: var(--primary-blue);
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    white-space: nowrap;
    transition: background 0.2s, color 0.2s;
    width: 140px;
    text-align: center;
}

.btn-expand-ct:hover {
    background: var(--primary-blue);
    color: white;
}

.btn-cart-ct {
    background: var(--primary-blue);
    border: 1px solid var(--primary-blue);
    color: white;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    white-space: nowrap;
    transition: background 0.2s, border-color 0.2s;
    width: 140px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-cart-ct svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.btn-cart-ct:hover:not(:disabled) {
    background: #0052a3;
    border-color: #0052a3;
}

.btn-cart-ct:disabled {
    background: #cccccc;
    border-color: #cccccc;
    cursor: not-allowed;
    opacity: 0.6;
}

.product-details-ct {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.3s ease, opacity 0.3s ease, padding 0.3s ease;
    background: #f8f9fa;
    border-top: 1px solid transparent;
}

.product-details-ct.open {
    max-height: 500px;
    opacity: 1;
    padding: 20px;
    border-top: 1px solid #e0e0e0;
}

.description-title {
    font-size: 15px;
    font-weight: 700;
    color: #2c3e50;
    margin: 0 0 12px 0;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--primary-blue);
    display: inline-block;
}

.product-description-text {
    color: #333;
    font-size: 14px;
    line-height: 1.8;
    text-align: justify;
    margin: 0;
    padding: 0;
    display: block;
    width: 100%;
    max-width: 100%;
    column-count: 1 !important;
    columns: 1 !important;
    break-inside: avoid;
}

/* Detail rows - deprecated, mantener por compatibilidad */
.detail-row {
    display: none;
}

.product-content-ct {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-title-ct {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin: 0 0 10px 0;
    line-height: 1.4;
}

.product-title-link {
    color: var(--primary-blue);
    text-decoration: none;
    display: block;
    transition: all 0.3s ease;
    position: relative;
    border-bottom: 2px solid transparent;
    padding-bottom: 2px;
}

.product-title-link:hover {
    color: var(--secondary-blue);
    border-bottom-color: var(--secondary-blue);
}

.product-title-link:active {
    color: #003d7a;
}

.product-title-link h3 {
    margin: 0 0 10px 0;
    color: inherit;
    transition: transform 0.2s ease;
}

.product-title-link:hover h3 {
    transform: translateX(3px);
}

.product-title-ct a {
    color: var(--primary-blue);
    text-decoration: none;
    transition: all 0.3s ease;
}

.product-title-ct a:hover {
    color: var(--secondary-blue);
}

.product-meta-ct {
    display: flex;
    gap: 15px;
    margin-bottom: 10px;
    font-size: 13px;
    color: #666;
}

.product-details-ct {
    list-style: none;
    padding: 0;
    margin: 10px 0;
    display: block !important;
    grid-template-columns: none !important;
    gap: 0;
}

.product-details-ct li {
    font-size: 13px;
    color: #555;
    display: flex;
    gap: 5px;
}

.detail-key {
    font-weight: 600;
    color: #333;
}

.product-sidebar-ct {
    width: 200px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.product-brand-ct {
    width: 100%;
    text-align: center;
}

.product-brand-ct img {
    max-width: 80px;
    max-height: 40px;
    object-fit: contain;
}

.product-price-ct {
    font-size: 24px;
    font-weight: bold;
    color: var(--primary-blue);
    text-align: center;
}

.product-stock-ct {
    font-size: 13px;
    padding: 5px 10px;
    border-radius: 4px;
    font-weight: 600;
}

.stock-in {
    background: #d4edda;
    color: #155724;
}

.stock-low {
    background: #fff3cd;
    color: #856404;
}

.stock-out {
    background: #f8d7da;
    color: #721c24;
}

.btn-add-cart-ct {
    width: 100%;
    padding: 10px 15px;
    background: var(--primary-blue);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-add-cart-ct:hover {
    background: #1e5a9e;
}

.btn-add-cart-ct:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Expandir detalles */
.expand-details-btn {
    background: none;
    border: none;
    color: var(--primary-blue);
    font-size: 14px;
    cursor: pointer;
    padding: 10px 0;
    font-weight: 600;
    align-self: flex-start;
}

.expand-details-btn:hover {
    text-decoration: underline;
}

.product-expanded-details {
    display: none;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.product-expanded-details.show {
    display: block;
}

/* ========== VISTA DE CUADRÍCULA ========== */
.products-grid-ct {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

.products-grid-ct .product-item-ct {
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border-bottom: none;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.products-grid-ct .product-item-ct:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.products-grid-ct .product-main-ct {
    flex-direction: column;
    padding: 15px;
    gap: 10px;
}

.products-grid-ct .product-image-ct {
    width: 100%;
    height: 200px;
    margin-bottom: 10px;
}

.products-grid-ct .product-info-ct {
    text-align: center;
    flex: 1;
}

.products-grid-ct .product-title-ct {
    font-size: 14px;
    height: 40px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.products-grid-ct .product-price-stock-ct {
    flex-direction: column;
    gap: 8px;
}

.products-grid-ct .product-actions-ct {
    padding: 0;
    min-width: 100%;
}

.products-grid-ct .btn-expand-ct {
    display: none;
}

.products-grid-ct .btn-cart-ct {
    width: 100%;
}

.products-grid-ct .product-details-ct {
    display: none !important;
}

.product-card-ct {
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.2s;
}

.product-card-ct:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.product-card-image {
    width: 100%;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: white;
    border-bottom: 1px solid #eee;
}

.product-card-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.product-card-body {
    padding: 15px;
}

.product-card-title {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin: 0 0 10px 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-card-price {
    font-size: 20px;
    font-weight: bold;
    color: var(--primary-blue);
    margin-bottom: 10px;
}

.product-card-btn {
    width: 100%;
    padding: 10px;
    background: var(--primary-blue);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

/* ========== BADGES DE PRODUCTO ========== */
.product-badges-ct {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.product-badge-ct {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.badge-nuevo {
    background: linear-gradient(135deg, #4caf50 0%, #66bb6a 100%);
    color: white;
    box-shadow: 0 2px 4px rgba(76, 175, 80, 0.3);
}

.badge-descuento {
    background: linear-gradient(135deg, #ff5722 0%, #ff7043 100%);
    color: white;
    box-shadow: 0 2px 4px rgba(255, 87, 34, 0.3);
}

.badge-oferta {
    background: linear-gradient(135deg, #ff9800 0%, #ffb74d 100%);
    color: white;
    box-shadow: 0 2px 4px rgba(255, 152, 0, 0.3);
}

.badge-pocas-piezas {
    background: linear-gradient(135deg, #ffc107 0%, #ffca28 100%);
    color: #333;
    box-shadow: 0 2px 4px rgba(255, 193, 7, 0.3);
}

.badge-agotandose {
    background: linear-gradient(135deg, #ff9800 0%, #ffa726 100%);
    color: white;
    box-shadow: 0 2px 4px rgba(255, 152, 0, 0.3);
}

.badge-disponible {
    background: linear-gradient(135deg, #2196f3 0%, #42a5f5 100%);
    color: white;
    box-shadow: 0 2px 4px rgba(33, 150, 243, 0.3);
}

.badge-envio-gratis {
    background: linear-gradient(135deg, #00bcd4 0%, #26c6da 100%);
    color: white;
    box-shadow: 0 2px 4px rgba(0, 188, 212, 0.3);
}

.badge-popular {
    background: linear-gradient(135deg, #9c27b0 0%, #ba68c8 100%);
    color: white;
    box-shadow: 0 2px 4px rgba(156, 39, 176, 0.3);
}

.product-badge-ct::before {
    content: '●';
    font-size: 6px;
}

/* ========== LOADING Y ESTADOS ========== */
.loading-ct {
    text-align: center;
    padding: 60px 20px;
}

.loading-spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--primary-blue);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.empty-state-ct {
    text-align: center;
    padding: 80px 20px;
    background: white;
    border-radius: 12px;
    border: 2px dashed #e0e0e0;
    margin: 40px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.empty-icon {
    font-size: 120px;
    margin-bottom: 24px;
    line-height: 1;
}

.empty-state-ct h3 {
    color: #333;
    font-size: 24px;
    font-weight: 600;
    margin: 0 0 12px 0;
}

.empty-state-ct p {
    color: #666;
    font-size: 16px;
    margin: 0;
    max-width: 400px;
    line-height: 1.6;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 991px) {
    .col-md-3,
    .col-md-9 {
        flex: 0 0 100%;
        max-width: 100%;
        padding: 0 !important;
    }

    .sidebar-wrapper {
        position: fixed;
        top: 0;
        left: -100%;
        width: 320px;
        height: 100vh;
        z-index: 9999;
        transition: left 0.3s;
        background: white;
    }

    .sidebar-wrapper.active {
        left: 0;
    }

    .sidebar-filters {
        max-height: 100vh;
        border-radius: 0;
        border: none;
        position: static;
    }

    .close-filters {
        display: block;
    }

    .btn-show-filters {
        display: flex;
    }

    .products-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .products-view-controls {
        justify-content: space-between;
    }
}

@media (max-width: 768px) {
    /* Eliminar padding del container principal */
    .container {
        padding-left: 5px !important;
        padding-right: 5px !important;
    }
    
    /* Eliminar padding de la fila */
    .row {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
    
    /* Ocultar botón de vista de cuadrícula */
    #viewGrid {
        display: none !important;
    }
    
    /* Búsqueda */
    .search-section {
        padding: 30px 15px;
    }
    
    .search-title {
        font-size: 22px;
        margin-bottom: 20px;
    }
    
    .search-bar {
        flex-direction: column;
        gap: 10px;
    }
    
    .search-input,
    .search-btn {
        width: 100%;
        font-size: 14px;
        padding: 12px 16px;
    }
    
    /* FORZAR VISTA DE GRID EN MÓVIL */
    .products-list-ct {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 10px !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    
    /* Productos en vista de lista - convertir a cards */
    .products-list-ct .product-item-ct {
        display: flex !important;
        flex-direction: column !important;
        background: white !important;
        border: 1px solid #e0e0e0 !important;
        border-radius: 12px !important;
        padding: 15px !important;
        margin: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        box-shadow: 0 2px 4px rgba(0,0,0,0.05) !important;
    }
    
    .products-list-ct .product-main-ct {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
    }
    
    .products-list-ct .product-image-ct {
        width: 100% !important;
        height: 200px !important;
        object-fit: contain !important;
        margin: 0 auto 12px auto !important;
        padding: 15px !important;
    }
    
    .products-list-ct .product-info-ct {
        width: 100% !important;
        padding: 0 !important;
        text-align: center !important;
    }
    
    .products-list-ct .product-title-ct {
        font-size: 20px !important;
        line-height: 1.4 !important;
        margin: 8px 0 !important;
        height: auto !important;
        overflow: hidden !important;
        display: -webkit-box !important;
        -webkit-line-clamp: 2 !important;
        -webkit-box-orient: vertical !important;
    }
    
    .products-list-ct .product-code-ct {
        font-size: 11px !important;
        margin: 4px 0 !important;
    }
    
    .products-list-ct .product-price-ct {
        font-size: 26px !important;
        font-weight: 700 !important;
        margin: 8px 0 !important;
        color: #0696d9 !important;
    }
    
    .products-list-ct .product-stock-ct {
        font-size: 12px !important;
        padding: 6px 12px !important;
        margin: 8px auto !important;
        display: inline-block !important;
    }
    
    .products-list-ct .product-actions-ct {
        width: 100% !important;
        margin-top: 12px !important;
        display: flex !important;
        flex-direction: column !important;
        gap: 8px !important;
        align-items: center !important;
    }
    
    .products-list-ct .quantity-controls-ct {
        width: 60% !important;
        max-width: 200px !important;
        margin: 0 auto !important;
        justify-content: center !important;
    }
    
    .products-list-ct .btn-cart-ct {
        width: 60% !important;
        max-width: 200px !important;
        padding: 12px !important;
        font-size: 14px !important;
        margin: 0 !important;
    }
    
    .products-list-ct .btn-expand-ct {
        display: none !important;
    }
    
    .products-list-ct .product-sidebar-ct,
    .products-list-ct .product-details-ct {
        display: none !important;
    }

    /* Productos en grid */
    .products-grid-ct {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
        padding: 0 !important;
        margin: 0 !important;
        width: 100% !important;
    }
    
    .products-grid-ct .product-item-ct {
        width: 100% !important;
        max-width: 100% !important;
        font-size: 14px !important;
        margin: 0 !important;
        padding: 15px !important;
    }
    
    .products-grid-ct .product-actions-ct {
        align-items: center !important;
    }
    
    .products-grid-ct .quantity-controls-ct {
        width: 60% !important;
        max-width: 200px !important;
        margin: 0 auto !important;
        justify-content: center !important;
    }
    
    .product-card-ct {
        padding: 15px !important;
        margin: 0 !important;
    }
    
    .product-card-image-ct {
        height: 200px !important;
        padding: 15px !important;
    }
    
    .product-card-title-ct {
        font-size: 20px !important;
        line-height: 1.4 !important;
        margin: 8px 0 !important;
        height: auto !important;
        overflow: hidden !important;
        display: -webkit-box !important;
        -webkit-line-clamp: 2 !important;
        -webkit-box-orient: vertical !important;
    }
    
    .product-card-price-ct {
        font-size: 26px !important;
        margin: 8px 0 !important;
        font-weight: 700 !important;
    }
    
    .product-card-code-ct {
        font-size: 11px !important;
        margin: 4px 0 !important;
    }
    
    .btn-add-cart-ct,
    .btn-buy-now-ct {
        padding: 12px !important;
        font-size: 14px !important;
        width: 60% !important;
        max-width: 200px !important;
        margin: 0 auto !important;
    }
    
    /* Paginación móvil */
    .pagination-ct {
        gap: 2px !important;
        padding: 15px 5px !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }
    
    .page-numbers {
        flex-wrap: nowrap !important;
        gap: 2px !important;
    }
    
    .page-btn-ct {
        padding: 5px 10px !important;
        font-size: 12px !important;
        min-width: 30px !important;
        white-space: nowrap !important;
        flex-shrink: 0 !important;
    }
    
    .page-number {
        min-width: 30px !important;
        height: 30px !important;
        padding: 0 6px !important;
        font-size: 12px !important;
        flex-shrink: 0 !important;
    }
    
    .page-dots {
        padding: 0 4px !important;
        font-size: 12px !important;
        flex-shrink: 0 !important;
    }
    
    .page-btn-ct.prev-btn,
    .page-btn-ct.next-btn {
        padding: 5px 8px !important;
        flex-shrink: 0 !important;
    }
    
    /* Filtros móvil */
    .sidebar-filters {
        position: fixed;
        top: 0;
        left: -100%;
        width: 85%;
        max-width: 320px;
        height: 100vh;
        background: white;
        z-index: 2000;
        overflow-y: auto;
        transition: left 0.3s ease;
        box-shadow: 2px 0 10px rgba(0,0,0,0.2);
    }
    
    .sidebar-filters.active {
        left: 0;
    }
    
    .btn-show-filters {
        display: flex !important;
        width: 100%;
        margin-bottom: 15px;
        padding: 12px;
        background: var(--primary-blue);
        color: white;
        border: none;
        border-radius: 6px;
        font-size: 14px;
        font-weight: 600;
        justify-content: center;
        align-items: center;
        gap: 8px;
    }
    
    .close-filters {
        display: block !important;
        position: absolute;
        top: 15px;
        right: 15px;
        background: none;
        border: none;
        font-size: 28px;
        color: #666;
        cursor: pointer;
        z-index: 10;
    }
    
    .filters-header {
        padding-top: 50px;
    }
    
    /* Controles de productos */
    .products-controls {
        flex-direction: column;
        gap: 10px;
    }
    
    .products-view-controls {
        width: 100%;
        justify-content: space-between;
    }
    
    .products-count {
        font-size: 13px;
    }
    
    .sort-select {
        font-size: 13px;
        padding: 8px 30px 8px 10px;
    }
    
    /* Paginación */
    .pagination {
        gap: 5px;
    }
    
    .pagination button {
        padding: 8px 12px;
        font-size: 13px;
        min-width: 36px;
    }
    
    .pagination .page-info {
        font-size: 12px;
        padding: 8px 10px;
    }
}

/* Móvil pequeño */
@media (max-width: 480px) {
    .products-grid-ct {
        grid-template-columns: 1fr !important;
    }
    
    .product-card-image-ct {
        height: 180px;
    }
    
    .product-card-title-ct {
        font-size: 13px;
    }
    
    /* Paginación extra compacta para móvil pequeño */
    .pagination-ct {
        gap: 1px !important;
        padding: 10px 3px !important;
    }
    
    .page-btn-ct {
        padding: 4px 8px !important;
        font-size: 11px !important;
        min-width: 28px !important;
    }
    
    .page-number {
        min-width: 28px !important;
        height: 28px !important;
        padding: 0 5px !important;
        font-size: 11px !important;
    }
    
    .page-dots {
        padding: 0 3px !important;
        font-size: 11px !important;
    }
}


@media (max-width: 1200px) {
    .products-grid-ct {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1400px) {
    .products-grid-ct {
        grid-template-columns: repeat(4, 1fr);
    }
}
