/* ========================================
   ESTILOS PROFESIONALES PARA PRODUCTOS.PHP
   (Siguen el estilo de Servicios y Contacto)
   ======================================== */

/* Hero Section de Productos */
.products-hero {
    position: relative;
    padding: 6rem 0 4rem;
    text-align: center;
    overflow: hidden;
}

.products-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at center, rgba(255, 0, 0, 0.1) 0%, transparent 70%);
    z-index: 0;
    pointer-events: none;
}

/* Barra de búsqueda hero */
.search-hero-container {
    max-width: 600px;
    margin: 2rem auto 0;
}

.search-hero-form {
    width: 100%;
}

.search-input-wrapper {
    display: flex;
    align-items: center;
    background: rgba(20, 20, 20, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 100px;
    padding: 0.5rem 0.5rem 0.5rem 1.5rem;
    transition: all 0.3s ease;
}

.search-input-wrapper:focus-within {
    border-color: rgba(255, 0, 0, 0.5);
    box-shadow: 0 0 20px rgba(255, 0, 0, 0.15);
}

.search-icon {
    width: 1.25rem;
    height: 1.25rem;
    color: #666;
    flex-shrink: 0;
}

.search-hero-input {
    flex: 1;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 1rem;
    padding: 0.75rem 1rem;
    outline: none !important;
    box-shadow: none !important;
    -webkit-appearance: none;
    appearance: none;
}

.search-hero-input:focus {
    outline: none !important;
    box-shadow: none !important;
}

.search-hero-input::placeholder {
    color: #666;
}

.search-hero-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, #cc0000, #ff0000);
    color: white;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 100px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.search-hero-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 20px rgba(255, 0, 0, 0.3);
}

/* Layout Principal */
.products-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

@media (min-width: 1024px) {
    .products-layout {
        grid-template-columns: 280px 1fr;
        gap: 3rem;
    }
}

/* Sidebar de Filtros */
.filters-sidebar {
    background: rgba(20, 20, 20, 0.6);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1rem;
    padding: 1.5rem;
    height: fit-content;
    position: sticky;
    top: 100px;
    transition: all 0.3s ease;
}

.filters-sidebar:hover {
    border-color: rgba(255, 0, 0, 0.3);
    box-shadow: 0 0 20px rgba(255, 0, 0, 0.05);
}

.filters-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 1.5rem;
}

.filters-header h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
}

.filters-header h3 svg {
    color: #ff0000;
}

.clear-filters-btn {
    font-size: 0.8rem;
    color: #ff0000;
    text-decoration: none;
    transition: all 0.2s ease;
}

.clear-filters-btn:hover {
    text-decoration: underline;
    text-shadow: 0 0 10px rgba(255, 0, 0, 0.5);
}

/* Grupos de filtros */
.filter-group {
    margin-bottom: 1.5rem;
}

.filter-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.75rem;
}

.filter-select {
    width: 100%;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid #333;
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    color: #fff;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23ff0000'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1.25rem;
    padding-right: 2.5rem;
}

.filter-select:focus {
    outline: none;
    border-color: #ff0000;
    box-shadow: 0 0 10px rgba(255, 0, 0, 0.2);
}

/* Rango de precio */
.price-range {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
}

.filter-input-price {
    flex: 1;
    min-width: 0;
    max-width: calc(50% - 1rem);
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid #333;
    border-radius: 0.5rem;
    padding: 0.75rem 0.5rem;
    color: #fff;
    font-size: 0.85rem;
    transition: all 0.3s ease;
    text-align: center;
    box-sizing: border-box;
}

.filter-input-price:focus {
    outline: none;
    border-color: #ff0000;
    box-shadow: 0 0 10px rgba(255, 0, 0, 0.2);
}

.filter-input-price::placeholder {
    color: #666;
}

.price-separator {
    color: #666;
    font-weight: 500;
    flex-shrink: 0;
}

/* Checkbox de ofertas */
.filter-checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    padding: 0.75rem 1rem;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid #333;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
}

.filter-checkbox-label:hover {
    border-color: rgba(255, 0, 0, 0.5);
    background: rgba(255, 0, 0, 0.05);
}

.filter-checkbox {
    display: none;
}

.checkmark {
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid #444;
    border-radius: 4px;
    position: relative;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.filter-checkbox:checked+.checkmark {
    background: #ff0000;
    border-color: #ff0000;
}

.filter-checkbox:checked+.checkmark::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 2px;
    width: 5px;
    height: 9px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.offers-count {
    margin-left: auto;
    background: rgba(255, 0, 0, 0.2);
    color: #ff0000;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.25rem 0.5rem;
    border-radius: 100px;
}

/* Botón aplicar filtros */
.apply-filters-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, #cc0000, #ff0000);
    color: white;
    font-weight: 700;
    padding: 0.875rem;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 1rem;
}

.apply-filters-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(255, 0, 0, 0.3);
}

/* Contenido de Productos */
.products-content {
    min-width: 0;
}

.products-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.products-count {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
}

.count-number {
    font-size: 1.5rem;
    font-weight: 800;
    color: #ff0000;
}

.count-text {
    color: #888;
    font-size: 0.9rem;
}

.mobile-filter-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(255, 0, 0, 0.1);
    border: 1px solid rgba(255, 0, 0, 0.3);
    border-radius: 0.5rem;
    color: #ff0000;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.mobile-filter-btn:hover {
    background: rgba(255, 0, 0, 0.2);
}

@media (min-width: 1024px) {
    .mobile-filter-btn {
        display: none;
    }
}

/* Grid de Productos */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

/* Cards de Producto */
.product-card {
    background: rgba(20, 20, 20, 0.6);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1rem;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    display: flex;
    flex-direction: column;
}

.product-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 20px;
    height: 20px;
    border-top: 2px solid transparent;
    border-left: 2px solid transparent;
    transition: all 0.3s ease;
    z-index: 10;
}

.product-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 20px;
    height: 20px;
    border-bottom: 2px solid transparent;
    border-right: 2px solid transparent;
    transition: all 0.3s ease;
    z-index: 10;
}

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

.product-card:hover::before {
    width: 100%;
    height: 100%;
    border-top-color: rgba(255, 0, 0, 0.5);
    border-left-color: rgba(255, 0, 0, 0.5);
}

.product-card:hover::after {
    width: 100%;
    height: 100%;
    border-bottom-color: rgba(255, 0, 0, 0.5);
    border-right-color: rgba(255, 0, 0, 0.5);
}

/* Imagen del producto */
.product-image-container {
    position: relative;
    height: 200px;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    overflow: hidden;
}

.product-image-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* Badges */
.product-badges {
    position: absolute;
    top: 1rem;
    left: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    z-index: 5;
    transition: opacity 0.3s ease;
}

.product-card:hover .product-badges {
    opacity: 0;
}



/* Overlay de producto */
.product-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.3s ease;
}

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

.view-product-btn {
    padding: 0.75rem 1.5rem;
    background: transparent;
    border: 2px solid #ff0000;
    color: #ff0000;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.8rem;
    transition: all 0.3s ease;
    transform: translateY(20px);
}

.product-card:hover .view-product-btn {
    transform: translateY(0);
}

.view-product-btn:hover {
    background: #ff0000;
    color: #fff;
    box-shadow: 0 0 20px rgba(255, 0, 0, 0.5);
}

/* Info del producto */
.product-info {
    padding: 1.25rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-category {
    font-size: 0.75rem;
    color: #ff0000;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.product-name {
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 0.75rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.3s ease;
}

.product-card:hover .product-name {
    color: #ff0000;
}

.product-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.product-brand {
    font-size: 0.8rem;
    color: #888;
    padding: 0.25rem 0.5rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.product-stock {
    font-size: 0.75rem;
    font-weight: 600;
}

.product-stock.in-stock {
    color: #10b981;
}

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

/* Footer del producto */
.product-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: auto;
}

.product-price {
    font-size: 1.5rem;
    font-weight: 800;
    color: #ff0000;
    text-shadow: 0 0 10px rgba(255, 0, 0, 0.3);
}

/* Sin productos */
.no-products {
    text-align: center;
    padding: 4rem 2rem;
    background: rgba(20, 20, 20, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1rem;
}

.no-products-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 0, 0, 0.1);
    border: 1px solid rgba(255, 0, 0, 0.3);
    border-radius: 50%;
    color: #ff0000;
}

.no-products h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 0.5rem;
}

.no-products p {
    color: #888;
    margin-bottom: 1.5rem;
}

.reset-search-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, #cc0000, #ff0000);
    color: white;
    font-weight: 600;
    text-decoration: none;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
}

.reset-search-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 0, 0, 0.3);
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-slide-up {
    animation: slideUp 0.6s ease-out forwards;
    opacity: 0;
}

.delay-100 {
    animation-delay: 0.1s;
}

.delay-200 {
    animation-delay: 0.2s;
}

.delay-300 {
    animation-delay: 0.3s;
}

.delay-400 {
    animation-delay: 0.4s;
}

.delay-500 {
    animation-delay: 0.5s;
}

/* Botón cerrar filtros (solo mobile) */
.mobile-filter-close-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: rgba(255, 0, 0, 0.1);
    border: 1px solid rgba(255, 0, 0, 0.3);
    border-radius: 0.5rem;
    color: #ff0000;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mobile-filter-close-btn:hover {
    background: rgba(255, 0, 0, 0.2);
    box-shadow: 0 0 10px rgba(255, 0, 0, 0.2);
}

@media (min-width: 1024px) {
    .mobile-filter-close-btn {
        display: none;
    }
}

/* Sidebar móvil */
@media (max-width: 1023px) {
    .filters-sidebar {
        position: fixed;
        top: 0;
        left: -100%;
        width: 300px;
        max-width: 85vw;
        height: 100vh;
        z-index: 60;
        border-radius: 0;
        border-left: none;
        overflow-y: auto;
        transition: left 0.3s ease;
    }

    .products-hero {
        padding: 4rem 0 2rem;
    }

    .search-hero-container {
        padding: 0 1rem;
    }

    .search-input-wrapper {
        flex-direction: column;
        border-radius: 1rem;
        padding: 0.5rem;
    }

    .search-hero-input {
        width: 100%;
        text-align: center;
    }

    .search-hero-btn {
        width: 100%;
        justify-content: center;
        margin-top: 0.5rem;
    }

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

/* Responsive extra pequeño */
@media (max-width: 480px) {
    .products-grid {
        grid-template-columns: 1fr;
    }

    .product-image-container {
        height: 180px;
    }

    .products-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }

    .mobile-filter-btn {
        width: 100%;
        justify-content: center;
    }
}