/**
 * TIENDAYA - Catálogo Styles
 * Estilos para las páginas de catálogo público
 */

/* Default colors - will be overridden by inline styles */
:root {
    --catalog-primary: var(--catalog-primary);
    --catalog-secondary: var(--catalog-secondary);
    --catalog-primary-rgb: 255, 0, 0;
}

/* ===== CATALOG HEADER ===== */
.catalog-header {
    background: linear-gradient(180deg, rgba(2, 2, 2, 0.98) 0%, rgba(2, 2, 2, 0.9) 100%);
    border-bottom: 1px solid var(--border);
    padding: 60px 0 40px;
    position: relative;
    overflow: hidden;
}

.catalog-header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 30%, rgba(var(--catalog-primary-rgb), 0.08) 0%, transparent 50%),
                radial-gradient(circle at 70% 70%, rgba(var(--catalog-primary-rgb), 0.05) 0%, transparent 50%);
    animation: headerGlow 20s ease-in-out infinite;
    pointer-events: none;
}

@keyframes headerGlow {
    0%, 100% { transform: scale(1) rotate(0deg); }
    50% { transform: scale(1.1) rotate(5deg); }
}

.catalog-header-content {
    position: relative;
    z-index: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    text-align: center;
}

.catalog-logo {
    width: 80px;
    height: 80px;
    border-radius: 20px;
    background: linear-gradient(135deg, var(--catalog-primary) 0%, var(--catalog-secondary) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 32px;
    color: white;
    box-shadow: 0 10px 40px rgba(var(--catalog-primary-rgb), 0.4);
}

.catalog-title {
    font-size: 2.5rem;
    font-weight: 900;
    font-style: italic;
    text-transform: uppercase;
    letter-spacing: -0.02em;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #fff 0%, var(--catalog-primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.catalog-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 24px;
}

.catalog-stats {
    display: flex;
    justify-content: center;
    gap: 32px;
    margin-bottom: 24px;
}

.catalog-stat {
    text-align: center;
}

.catalog-stat-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
}

.catalog-stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ===== SEARCH BAR ===== */
.search-container {
    max-width: 500px;
    margin: 0 auto 24px;
    position: relative;
}

.search-input {
    width: 100%;
    padding: 16px 24px 16px 52px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 16px;
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--catalog-primary);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 4px rgba(var(--catalog-primary-rgb), 0.15);
}

.search-input::placeholder {
    color: var(--text-muted);
}

.search-icon {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 18px;
}

/* ===== CATEGORY FILTERS ===== */
.category-filters {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 32px;
}

.category-filter {
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 24px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.category-filter:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
    color: var(--text-primary);
}

.category-filter.active {
    background: var(--catalog-primary);
    border-color: var(--catalog-primary);
    color: white;
}

/* ===== PRODUCTS GRID ===== */
.products-section {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 24px;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

.product-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
}

.product-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--catalog-primary), #FF3333);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}

.product-card:hover {
    transform: translateY(-8px);
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.product-card:hover::before {
    opacity: 1;
}

.product-image-container {
    position: relative;
    aspect-ratio: 1;
    background: var(--bg-tertiary);
    overflow: hidden;
}

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

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

.product-badges {
    position: absolute;
    top: 12px;
    left: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    z-index: 2;
}

.product-badge {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.product-badge.featured {
    background: var(--catalog-primary);
    color: white;
}

.product-badge.sale {
    background: #22c55e;
    color: white;
}

.product-badge.out {
    background: rgba(0, 0, 0, 0.7);
    color: white;
}

.product-actions-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 12px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    display: flex;
    justify-content: center;
    gap: 10px;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
}

.product-card:hover .product-actions-overlay {
    opacity: 1;
    transform: translateY(0);
}

.product-action-btn {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.2s ease;
}

.product-action-btn.cart {
    background: var(--catalog-primary);
    color: white;
}

.product-action-btn.cart:hover {
    background: var(--catalog-secondary);
    transform: scale(1.1);
}

.product-action-btn.whatsapp {
    background: #25D366;
    color: white;
}

.product-action-btn.whatsapp:hover {
    background: #22c55e;
    transform: scale(1.1);
}

.product-content {
    padding: 20px;
}

.product-category {
    font-size: 0.75rem;
    color: var(--catalog-primary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 600;
    margin-bottom: 8px;
}

.product-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
    line-height: 1.3;
}

.product-description {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 16px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.product-price {
    font-size: 1.25rem;
    font-weight: 800;
    color: #22c55e;
}

.product-price-original {
    font-size: 0.9rem;
    color: var(--text-muted);
    text-decoration: line-through;
    margin-left: 8px;
}

.product-stock {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}

.product-stock.low {
    color: #f59e0b;
}

.product-stock.out {
    color: #ef4444;
}

/* ===== EMPTY CATALOG ===== */
.empty-catalog {
    text-align: center;
    padding: 80px 24px;
}

.empty-catalog-icon {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(var(--catalog-primary-rgb), 0.1) 0%, rgba(255, 0, 0, 0.05) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    font-size: 40px;
    color: var(--catalog-primary);
}

.empty-catalog h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.empty-catalog p {
    color: var(--text-muted);
    margin-bottom: 24px;
}

/* ===== FOOTER CATALOG ===== */
.catalog-footer {
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    padding: 40px 24px;
    margin-top: 60px;
}

.catalog-footer-content {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}

.catalog-footer-logo {
    font-size: 1.5rem;
    font-weight: 900;
    font-style: italic;
    text-transform: uppercase;
    margin-bottom: 16px;
}

.catalog-footer-logo span {
    color: var(--catalog-primary);
}

.catalog-footer-text {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ===== LOADING ===== */
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--catalog-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 40px auto;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .catalog-title {
        font-size: 1.75rem;
    }
    
    .catalog-stats {
        gap: 20px;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 16px;
    }
    
    .product-content {
        padding: 12px;
    }
    
    .product-name {
        font-size: 0.95rem;
    }
    
    .product-price {
        font-size: 1rem;
    }
}
