/* ===================================
   CATÁLOGO PREMIUM - ESTILOS ESPECÍFICOS
   Solo para catalogo-repuestos.php
   ================================== */

/* Contenedor principal del catálogo premium */
.catalogo-repuestos-premium {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* ===== GRID MEJORADO ===== */
.catalogo-repuestos-premium .products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 25px;
    /* El grid debe alinearse con el contenedor padre (.products-section) */
    padding: 0; /* El padding ya lo aporta .products-section */
    max-width: none; /* Evita centrar y estrechar el grid */
    margin: 0; /* Mantiene alineación con el título y los filtros */
}

/* Responsive breakpoints */
@media (max-width: 1200px) {
    .catalogo-repuestos-premium .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 20px;
        padding: 0; /* Mantener sin padding para alinear con el contenedor */
    }
}

@media (max-width: 768px) {
    .catalogo-repuestos-premium .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 15px;
        padding: 0; /* Sin padding para evitar descuadres en móvil */
    }
}

@media (max-width: 480px) {
    .catalogo-repuestos-premium .products-grid {
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 0; /* Sin padding en móviles */
    }
}

/* ===== CARDS PREMIUM ===== */
.catalogo-repuestos-premium .product-card {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    position: relative;
    border: 1px solid rgba(0, 0, 0, 0.04);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.catalogo-repuestos-premium .product-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
    border-color: rgba(255, 99, 72, 0.2);
}

/* ===== IMAGEN DEL PRODUCTO ===== */
.catalogo-repuestos-premium .product-image {
    position: relative;
    overflow: hidden;
    border-radius: 12px 12px 0 0;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.catalogo-repuestos-premium .product-card:hover .product-image img {
    transform: scale(1.1);
}

/* ===== BADGES PREMIUM ===== */
.catalogo-repuestos-premium .product-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 10;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.catalogo-repuestos-premium .badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.catalogo-repuestos-premium .badge.hot {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
}

.catalogo-repuestos-premium .badge.sale {
    background: linear-gradient(135deg, #fd7e14, #ff6b35);
    color: white;
}

.catalogo-repuestos-premium .badge.new {
    background: linear-gradient(135deg, #e83e8c, #fd1d92);
    color: white;
}

/* ===== CONTENIDO DEL PRODUCTO ===== */
.catalogo-repuestos-premium .product-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    justify-content: space-between;
}

/* ===== MARCA ===== */
.catalogo-repuestos-premium .product-brand {
    font-size: 0.85rem;
    color: #6c757d;
    margin-bottom: 8px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.8;
}

/* ===== NOMBRE DEL PRODUCTO ===== */
.catalogo-repuestos-premium .product-name {
    color: #2c3e50;
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 12px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: 2.8rem;
    transition: color 0.3s ease;
}

.catalogo-repuestos-premium .product-name:hover {
    color: #ff6348;
}

/* ===== RATING ===== */
.catalogo-repuestos-premium .product-rating {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.catalogo-repuestos-premium .stars {
    display: flex;
    gap: 2px;
}

.catalogo-repuestos-premium .star {
    color: #ffc107;
    font-size: 0.9rem;
}

.catalogo-repuestos-premium .rating-text {
    font-size: 0.8rem;
    color: #6c757d;
}

/* ===== PRECIO PREMIUM ===== */
.catalogo-repuestos-premium .product-price {
    color: #ff6348;
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 16px;
    text-shadow: 0 1px 3px rgba(255, 99, 72, 0.3);
    display: flex;
    align-items: center;
    gap: 4px;
}

.catalogo-repuestos-premium .product-price::before {
    content: '$';
    font-size: 1.2rem;
    opacity: 0.8;
}

/* ===== BOTÓN PREMIUM ===== */
.catalogo-repuestos-premium .add-to-cart-btn {
    background: linear-gradient(135deg, #ff6348, #ff4757);
    color: white;
    border: none;
    padding: 14px 24px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(255, 99, 72, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
    position: relative;
    overflow: hidden;
}

.catalogo-repuestos-premium .add-to-cart-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.catalogo-repuestos-premium .add-to-cart-btn:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 25px rgba(255, 99, 72, 0.4);
    background: linear-gradient(135deg, #ff4757, #ff3742);
}

.catalogo-repuestos-premium .add-to-cart-btn:hover::before {
    left: 100%;
}

.catalogo-repuestos-premium .add-to-cart-btn:active {
    transform: translateY(0) scale(1.01);
    box-shadow: 0 4px 15px rgba(255, 99, 72, 0.3);
}

/* ===== STOCK INDICATOR ===== */
.catalogo-repuestos-premium .stock-info {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    font-size: 0.85rem;
}

.catalogo-repuestos-premium .stock-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.75rem;
}

.catalogo-repuestos-premium .stock-badge.in-stock {
    background: rgba(40, 167, 69, 0.1);
    color: #28a745;
    border: 1px solid rgba(40, 167, 69, 0.2);
}

.catalogo-repuestos-premium .stock-badge.low-stock {
    background: rgba(255, 193, 7, 0.1);
    color: #ffc107;
    border: 1px solid rgba(255, 193, 7, 0.2);
}

.catalogo-repuestos-premium .stock-badge.out-of-stock {
    background: rgba(220, 53, 69, 0.1);
    color: #dc3545;
    border: 1px solid rgba(220, 53, 69, 0.2);
}

/* ===== ANIMACIONES DE ENTRADA ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.catalogo-repuestos-premium .product-card {
    animation: fadeInUp 0.6s ease-out;
}

.catalogo-repuestos-premium .product-card:nth-child(1) { animation-delay: 0.1s; }
.catalogo-repuestos-premium .product-card:nth-child(2) { animation-delay: 0.2s; }
.catalogo-repuestos-premium .product-card:nth-child(3) { animation-delay: 0.3s; }
.catalogo-repuestos-premium .product-card:nth-child(4) { animation-delay: 0.4s; }
.catalogo-repuestos-premium .product-card:nth-child(5) { animation-delay: 0.5s; }
.catalogo-repuestos-premium .product-card:nth-child(6) { animation-delay: 0.6s; }

/* ===== LOADING STATES ===== */
.catalogo-repuestos-premium .btn-loading {
    pointer-events: none;
    opacity: 0.7;
}

.catalogo-repuestos-premium .btn-loading::after {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 8px;
}

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

/* ===== WISHLIST BUTTON ===== */
.catalogo-repuestos-premium .wishlist-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    z-index: 10;
}

.catalogo-repuestos-premium .wishlist-btn:hover {
    background: rgba(255, 255, 255, 1);
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.catalogo-repuestos-premium .wishlist-btn.active {
    background: #ff6348;
    color: white;
}

.catalogo-repuestos-premium .wishlist-btn svg {
    width: 18px;
    height: 18px;
    transition: transform 0.3s ease;
}

.catalogo-repuestos-premium .wishlist-btn:hover svg {
    transform: scale(1.2);
}

/* ===== QUICK VIEW BUTTON ===== */
.catalogo-repuestos-premium .quick-view-btn {
    position: absolute;
    bottom: 12px;
    right: 12px;
    padding: 8px 16px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    border: none;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.catalogo-repuestos-premium .product-card:hover .quick-view-btn {
    opacity: 1;
    transform: translateY(0);
}

.catalogo-repuestos-premium .quick-view-btn:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: scale(1.05);
}

/* ===== TOAST NOTIFICATIONS ===== */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
}

.toast {
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    padding: 16px 20px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 300px;
    transform: translateX(400px);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.toast.show {
    transform: translateX(0);
}

.toast.success {
    border-left: 4px solid #28a745;
}

.toast.error {
    border-left: 4px solid #dc3545;
}

.toast-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
}

.toast.success .toast-icon {
    background: #28a745;
}

.toast.error .toast-icon {
    background: #dc3545;
}

.toast-message {
    flex: 1;
    font-weight: 600;
    color: #2c3e50;
}

.toast-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: #6c757d;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toast-close:hover {
    color: #2c3e50;
}