/**
 * Category Explorer Styles
 */

.category-explorer-container {
    padding: 30px 0;
    background: #fff;
}

.category-explorer-wrapper {
    display: flex;
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Sidebar de Categorias */
.category-explorer-sidebar {
    flex: 0 0 200px;
    display: flex;
    flex-direction: column;
}

.sidebar-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #011374;
}

.category-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.category-btn {
    padding: 12px 20px;
    background: #fff;
    border: 2px solid #65656D;
    border-radius: 25px;
    color: #65656D;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.category-btn:hover {
    background: #f5f5f5;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.category-btn.active {
    background: #011374;
    border-color: #011374;
    color: #fff;
    box-shadow: 0 4px 12px rgba(1, 19, 116, 0.3);
}

.category-btn:focus,
.category-btn:active {
    outline: none;
    border-color: #65656D;
}

.category-btn.active:focus,
.category-btn.active:active {
    outline: none;
    background: #011374;
    border-color: #011374;
}

/* Grid de Productos */
.category-explorer-products {
    flex: 1;
    min-height: 400px;
    position: relative;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

/* Card de Producto */
.product-card-explorer {
    background: #fff;
    border: 1px solid #949393;
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.product-card-explorer:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.product-image-link {
    display: block;
    padding: 15px;
    text-align: center;
    background: #fafafa;
}

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

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

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

.product-brand {
    font-size: 11px;
    color: #65656D;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
}

.product-name {
    font-size: 14px;
    font-weight: 500;
    margin: 0 0 8px 0;
    line-height: 1.4;
    min-height: 40px;
}

.product-name a {
    color: #65656D;
    text-decoration: none;
}

.product-name a:hover {
    color: #011374;
}

.product-stock {
    font-size: 12px;
    margin-bottom: 10px;
    color: #65656D;
}

.product-stock .in-stock {
    color: #65656D;
}

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

.product-prices {
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin-bottom: 10px;
}

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

.price-usd {
    font-size: 13px;
    color: #011374;
}

.add-to-cart-btn {
    position: absolute;
    bottom: 15px;
    right: 15px;
    width: 45px;
    height: 45px;
    border: none;
    border-radius: 50%;
    background: #2196F3;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 3px 10px rgba(33, 150, 243, 0.3);
}

.add-to-cart-btn:hover {
    background: #1976D2;
    transform: scale(1.1);
    box-shadow: 0 5px 15px rgba(33, 150, 243, 0.4);
}

.add-to-cart-btn i {
    font-size: 20px;
}

.add-to-cart-btn.added {
    background: #28a745;
}

/* Loading */
.products-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.loader {
    width: 50px;
    height: 50px;
    border: 4px solid #e3f2fd;
    border-top: 4px solid #2196F3;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Responsive */
@media (max-width: 992px) {
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .category-explorer-wrapper {
        flex-direction: column;
    }

    .category-explorer-sidebar {
        flex: none;
    }

    .category-buttons {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .category-btn {
        flex: 1;
        min-width: 120px;
        text-align: center;
    }

    .products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .products-grid {
        grid-template-columns: 1fr;
    }

    .category-btn {
        min-width: 100%;
    }
}
