/* ===================================
   ARCHIVO: assets/css/catalog.css
   Estilos del catálogo de productos
   =================================== */

/* Variables específicas del catálogo */
:root {
    --catalog-primary: #2c3e50;
    --catalog-accent: #3498db;
    --catalog-success: #27ae60;
    --catalog-warning: #f39c12;
    --catalog-danger: #e74c3c;
    --catalog-light: #ecf0f1;
    --catalog-border: #ddd;
    --catalog-shadow: 0 2px 8px rgba(0,0,0,0.1);
    --catalog-hover-shadow: 0 4px 16px rgba(0,0,0,0.15);
    --product-card-width: 280px;
}

/* Layout principal */
.catalog-main {
    min-height: 100vh;
    background: #f8f9fa;
}

/* Banner de acceso */
.access-banner {
    background: linear-gradient(135deg, var(--catalog-accent), #2980b9);
    color: white;
    padding: 1.5rem 0;
    margin-bottom: 2rem;
}

.access-banner.pending {
    background: linear-gradient(135deg, var(--catalog-warning), #e67e22);
}

.banner-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.banner-content h2 {
    margin: 0;
    font-size: 1.2rem;
}

.banner-content p {
    margin: 0.25rem 0 0 0;
    opacity: 0.9;
}

.banner-actions {
    display: flex;
    gap: 0.75rem;
}

.banner-actions .btn {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

/* Header del catálogo */
.catalog-header {
    text-align: center;
    margin-bottom: 2rem;
}

.catalog-header h1 {
    margin: 0 0 0.5rem 0;
    color: var(--catalog-primary);
    font-size: 2.5rem;
}

.catalog-header p {
    color: #666;
    font-size: 1.1rem;
    margin: 0;
}

/* Layout del catálogo */
.catalog-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 2rem;
    align-items: start;
}

/* Sidebar de filtros */
.filters-sidebar {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--catalog-shadow);
    position: sticky;
    top: 20px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
}

.filters-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--catalog-light);
}

.filters-header h3 {
    margin: 0;
    color: var(--catalog-primary);
    font-size: 1.2rem;
}

.clear-filters {
    color: var(--catalog-danger);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
}

.clear-filters:hover {
    text-decoration: underline;
}

.filters-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.filter-group {
    display: flex;
    flex-direction: column;
}

.filter-group label {
    font-weight: 600;
    color: var(--catalog-primary);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.filter-group input[type="text"],
.filter-group input[type="number"],
.filter-group select {
    padding: 0.5rem;
    border: 1px solid var(--catalog-border);
    border-radius: 6px;
    font-size: 0.9rem;
    transition: border-color 0.3s ease;
}

.filter-group input:focus,
.filter-group select:focus {
    outline: none;
    border-color: var(--catalog-accent);
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

/* Opciones de filtro tipo radio */
.filter-options {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.filter-option:hover {
    background-color: var(--catalog-light);
}

.filter-option input[type="radio"] {
    margin: 0;
}

.filter-option span {
    font-size: 0.9rem;
    color: var(--catalog-primary);
}

/* Inputs de precio */
.price-inputs {
    display: flex;
    gap: 0.5rem;
}

.price-inputs input {
    flex: 1;
}

.filter-submit {
    margin-top: 1rem;
    padding: 0.75rem;
    font-weight: 600;
}

/* Contenido del catálogo */
.catalog-content {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--catalog-shadow);
}

/* Toolbar */
.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--catalog-light);
}

.results-count {
    color: #666;
    font-weight: 500;
}

.toolbar-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.toolbar-right label {
    font-size: 0.9rem;
    color: var(--catalog-primary);
    font-weight: 500;
}

.toolbar-right select {
    padding: 0.5rem;
    border: 1px solid var(--catalog-border);
    border-radius: 4px;
    background: white;
}

/* Grid de productos */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(var(--product-card-width), 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* Tarjeta de producto */
.product-card {
    background: white;
    border: 1px solid var(--catalog-border);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
}

.product-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--catalog-hover-shadow);
    border-color: var(--catalog-accent);
}

/* Imagen del producto */
.product-image {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: var(--catalog-light);
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

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

.no-image {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #999;
}

.no-image span {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

/* Badges del producto */
.product-badges {
    position: absolute;
    top: 8px;
    left: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.badge {
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-hombre {
    background: rgba(52, 152, 219, 0.9);
    color: white;
}

.badge-mujer {
    background: rgba(231, 76, 60, 0.9);
    color: white;
}

.badge-unisex {
    background: rgba(155, 89, 182, 0.9);
    color: white;
}

.badge-niño, .badge-niña {
    background: rgba(243, 156, 18, 0.9);
    color: white;
}

.badge-half {
    background: rgba(39, 174, 96, 0.9);
    color: white;
}

/* Indicador de colores */
.color-indicator {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 500;
}

/* Información del producto */
.product-info {
    padding: 1rem;
}

.product-name {
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--catalog-primary);
    line-height: 1.3;
}

.product-sku {
    margin: 0 0 0.5rem 0;
    font-size: 0.8rem;
    color: #999;
    font-family: monospace;
}

.product-factory {
    margin: 0 0 0.75rem 0;
    font-size: 0.9rem;
    color: #666;
}

.product-details {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.detail-item {
    background: var(--catalog-light);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    color: var(--catalog-primary);
    font-weight: 500;
}

.product-colors {
    margin: 0 0 1rem 0;
    font-size: 0.8rem;
    color: #666;
}

/* Precios */
.product-pricing {
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: #f8f9fa;
    border-radius: 6px;
}

.price-wholesale {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
}

.price-wholesale strong {
    font-size: 1.2rem;
    color: var(--catalog-success);
    font-weight: 700;
}

.price-wholesale span {
    font-size: 0.8rem;
    color: #666;
}

.price-suggested {
    margin-top: 0.25rem;
    font-size: 0.8rem;
    color: #999;
}

.price-hidden {
    text-align: center;
    color: #999;
}

.price-placeholder {
    font-size: 1.5rem;
    font-weight: bold;
    display: block;
    margin-bottom: 0.25rem;
}

/* Acciones del producto */
.product-actions {
    display: flex;
    gap: 0.5rem;
}

.product-details-btn {
    flex: 2;
    padding: 0.5rem;
    font-size: 0.9rem;
}

.add-to-cart-btn {
    flex: 1;
    padding: 0.5rem;
    font-size: 0.8rem;
}

/* Estado sin productos */
.no-products {
    text-align: center;
    padding: 4rem 2rem;
    color: #666;
}

.no-products-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.no-products h3 {
    margin: 0 0 1rem 0;
    color: var(--catalog-primary);
}

.no-products p {
    margin: 0 0 2rem 0;
}

/* Paginación */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 2rem;
}

.page-btn {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--catalog-border);
    border-radius: 4px;
    text-decoration: none;
    color: var(--catalog-primary);
    font-weight: 500;
    transition: all 0.3s ease;
}

.page-btn:hover {
    background: var(--catalog-accent);
    color: white;
    border-color: var(--catalog-accent);
}

.page-btn.active {
    background: var(--catalog-accent);
    color: white;
    border-color: var(--catalog-accent);
}

.page-ellipsis {
    padding: 0.5rem;
    color: #999;
}

/* Modal de producto */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
}

.modal-content {
    position: relative;
    background: white;
    border-radius: 12px;
    width: 100%;
    max-width: 800px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--catalog-light);
}

.modal-header h2 {
    margin: 0;
    color: var(--catalog-primary);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #999;
    padding: 0.25rem;
}

.modal-close:hover {
    color: var(--catalog-danger);
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    max-height: calc(90vh - 100px);
}

.loading {
    text-align: center;
    padding: 2rem;
    color: #666;
}

/* Badges de estado en header */
.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    margin-left: 0.5rem;
}

.status-badge.approved {
    background: rgba(39, 174, 96, 0.2);
    color: var(--catalog-success);
}

.status-badge.pending {
    background: rgba(243, 156, 18, 0.2);
    color: var(--catalog-warning);
}

.user-info {
    color: #666;
    font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .catalog-layout {
        grid-template-columns: 250px 1fr;
        gap: 1.5rem;
    }
    
    :root {
        --product-card-width: 240px;
    }
}

@media (max-width: 768px) {
    .catalog-layout {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .filters-sidebar {
        position: static;
        max-height: none;
        margin-bottom: 1rem;
    }
    
    .banner-content {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    
    .toolbar {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .toolbar-right {
        justify-content: space-between;
    }
    
    :root {
        --product-card-width: 200px;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 1rem;
    }
    
    .product-image {
        height: 150px;
    }
    
    .catalog-header h1 {
        font-size: 2rem;
    }
    
    .pagination {
        flex-wrap: wrap;
        gap: 0.25rem;
    }
    
    .page-btn {
        padding: 0.5rem;
        min-width: 44px;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .catalog-main {
        padding: 0;
    }
    
    .container {
        padding: 0 1rem;
    }
    
    .filters-sidebar,
    .catalog-content {
        margin: 0 -1rem;
        border-radius: 0;
    }
    
    .product-actions {
        flex-direction: column;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
    
    :root {
        --product-card-width: 150px;
    }
    
    .modal-content {
        margin: 0;
        border-radius: 0;
        height: 100vh;
        max-height: 100vh;
    }
    
    .filter-options {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.25rem;
    }
}

/* Animaciones */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.product-card {
    animation: fadeIn 0.5s ease-out;
}

/* Estados de hover mejorados */
.filter-option:hover,
.page-btn:hover,
.product-card:hover {
    transition: all 0.2s ease;
}

/* Scroll suave */
html {
    scroll-behavior: smooth;
}