/* Products Main Layout */
.products-main {
    background-color: #f8f9fa;
    min-height: 100vh;
    padding: 20px 0;
}

.products-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 30px;
    margin-top: 20px;
}

/* Breadcrumbs */
.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    margin-bottom: 15px;
}

.breadcrumbs a {
    color: #2563eb;
    text-decoration: none;
}

.breadcrumbs a:hover {
    text-decoration: underline;
}

.breadcrumbs .separator {
    color: #9ca3af;
}

.breadcrumbs .current {
    color: #4b5563;
    font-weight: 500;
}

/* Page Header */
.page-header {
    margin-bottom: 20px;
}

.page-title {
    font-size: 28px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 10px;
}

.results-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 15px;
}

.results-count {
    color: #6b7280;
    font-size: 14px;
}

.active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.filter-tag {
    background-color: #2563eb;
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.filter-tag .remove-filter {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 0;
    font-size: 14px;
}

/* Sidebar */
.products-sidebar {
    background-color: white;
    border-radius: 8px;
    padding: 20px;
    height: fit-content;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 20px;
}

/* Loading States */
.filters-loading,
.products-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: #6b7280;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e5e7eb;
    border-top: 3px solid #2563eb;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

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

/* Filter Sections */
.filter-section {
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 20px;
    margin-bottom: 20px;
}

.filter-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.filter-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 15px;
    cursor: pointer;
}

.filter-title i {
    color: #2563eb;
    margin-right: 8px;
}

.filter-toggle {
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    padding: 4px;
    transition: transform 0.2s ease;
}

.filter-section.collapsed .filter-toggle {
    transform: rotate(180deg);
}

.filter-section.collapsed .filter-content {
    display: none;
}

/* Brand Filter */
.search-brand {
    position: relative;
    margin-bottom: 15px;
}

.brand-search {
    width: 100%;
    padding: 8px 35px 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    outline: none;
}

.brand-search:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.search-brand i {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
}

.brand-list {
    max-height: 300px;
    overflow-y: auto;
}

.brand-item,
.price-range-item,
.category-item-filter {
    display: flex;
    align-items: center;
    padding: 8px 0;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.brand-item:hover,
.price-range-item:hover,
.category-item-filter:hover {
    background-color: #f9fafb;
    border-radius: 4px;
}

.brand-item input,
.price-range-item input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.checkmark {
    height: 18px;
    width: 18px;
    background-color: white;
    border: 2px solid #d1d5db;
    border-radius: 3px;
    margin-right: 10px;
    position: relative;
    transition: all 0.2s ease;
}

.brand-item input:checked ~ .checkmark,
.price-range-item input:checked ~ .checkmark {
    background-color: #2563eb;
    border-color: #2563eb;
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
    left: 5px;
    top: 1px;
    width: 6px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.brand-item input:checked ~ .checkmark:after,
.price-range-item input:checked ~ .checkmark:after {
    display: block;
}

.brand-name,
.price-text {
    flex: 1;
    font-size: 14px;
    color: #374151;
}

.product-count {
    font-size: 12px;
    color: #9ca3af;
}

.show-more-brands {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 8px;
    background: none;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    color: #2563eb;
    cursor: pointer;
    margin-top: 10px;
    transition: all 0.2s ease;
}

.show-more-brands:hover {
    background-color: #f0f9ff;
    border-color: #2563eb;
}

/* Price Filter */
.custom-price-range {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #e5e7eb;
}

.custom-price-range h4 {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 10px;
}

.price-inputs {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.price-input-group {
    flex: 1;
    position: relative;
}

.price-input-group label {
    display: block;
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 4px;
}

.price-input {
    width: 100%;
    padding: 8px 25px 8px 8px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 14px;
    outline: none;
}

.price-input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.currency {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    color: #9ca3af;
    margin-top: 10px;
}

.price-separator {
    font-weight: 600;
    color: #6b7280;
    margin-top: 20px;
}

.apply-custom-price {
    width: 100%;
    padding: 8px 16px;
    background-color: #2563eb;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.apply-custom-price:hover {
    background-color: #1d4ed8;
}

/* Filter Actions */
.filter-actions {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
}

.clear-filters {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 10px;
    background-color: #f3f4f6;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s ease;
}

.clear-filters:hover {
    background-color: #e5e7eb;
}

/* Products Content */
.products-content {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.products-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid #e5e7eb;
    flex-wrap: wrap;
    gap: 15px;
}

.controls-left,
.controls-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.view-toggle {
    display: flex;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    overflow: hidden;
}

.view-btn {
    padding: 8px 12px;
    background-color: white;
    border: none;
    cursor: pointer;
    color: #6b7280;
    transition: all 0.2s ease;
}

.view-btn.active {
    background-color: #2563eb;
    color: white;
}

.view-btn:hover:not(.active) {
    background-color: #f9fafb;
}

.items-per-page,
.sort-options {
    display: flex;
    align-items: center;
    gap: 8px;
}

.items-per-page label,
.sort-options label {
    font-size: 14px;
    color: #374151;
    white-space: nowrap;
}

.items-per-page select,
.sort-options select {
    padding: 6px 10px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 14px;
    background-color: white;
    cursor: pointer;
}

/* Products Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    padding: 20px;
}

.products-grid.list-view {
    grid-template-columns: 1fr;
}

/* Product Card */
.product-card {
    background-color: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.2s ease;
    height: fit-content;
}

.product-card:hover {
    border-color: #2563eb;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.1);
    transform: translateY(-2px);
}

.product-item {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.product-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.product-image {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
    background-color: #f9fafb;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform 0.2s ease;
}

.product-card:hover .product-image img {
    transform: scale(1.05);
}

/* Badges de especificaciones */
.product-badges {
    display: flex;
    gap: 4px;
    margin-top: 8px;
    justify-content: center;
    flex-wrap: wrap;
    padding: 0 10px;
}

.spec-badge {
    height: 24px;
    width: auto;
    border-radius: 4px;
    border: 1px solid #e5e7eb;
    background-color: white;
    object-fit: contain;
}

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

.product-brand {
    font-size: 12px;
    color: #6b7280;
    font-weight: 500;
    text-transform: uppercase;
}

.product-name {
    font-size: 14px;
    font-weight: 500;
    color: #1f2937;
    line-height: 1.4;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-price {
    margin-top: auto;
    padding-top: 10px;
}

.price {
    font-size: 18px;
    font-weight: 700;
    color: #dc2626;
}

.tax-info {
    font-size: 11px;
    color: #6b7280;
    margin-left: 4px;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #6b7280;
}

.empty-icon {
    font-size: 48px;
    color: #d1d5db;
    margin-bottom: 20px;
}

.empty-state h3 {
    font-size: 20px;
    color: #374151;
    margin-bottom: 10px;
}

.clear-filters-btn {
    margin-top: 20px;
    padding: 10px 20px;
    background-color: #2563eb;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.clear-filters-btn:hover {
    background-color: #1d4ed8;
}

/* Pagination */
.pagination-container {
    padding: 20px;
    border-top: 1px solid #e5e7eb;
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin-bottom: 15px;
}

.pagination a,
.pagination span {
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    text-decoration: none;
    color: #374151;
    transition: all 0.2s ease;
}

.pagination a:hover {
    background-color: #f9fafb;
    border-color: #2563eb;
    color: #2563eb;
}

.pagination .active {
    background-color: #2563eb;
    border-color: #2563eb;
    color: white;
}

.pagination-info {
    text-align: center;
    font-size: 14px;
    color: #6b7280;
}

/* Responsive */
@media (max-width: 1024px) {
    .products-layout {
        grid-template-columns: 250px 1fr;
        gap: 20px;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 15px;
    }
}

@media (max-width: 768px) {
    .products-layout {
        grid-template-columns: 1fr;
    }
    
    .products-sidebar {
        position: static;
        margin-bottom: 20px;
    }
    
    .products-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .controls-left,
    .controls-right {
        justify-content: space-between;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 10px;
        padding: 15px;
    }
}