/* ============================================
   ECOMMERCE.CSS - ESTILOS PARA TIENDA PETSHOP
   ============================================ */

/* Variables CSS */
:root {
    --primary-color: #3A1916;
    --secondary-color: #f8f9fa;
    --accent-color: #ff6b6b;
    --text-color: #6c757d;
    --white-color: #ffffff;
    --border-color: #e9ecef;
    --hover-color: #fef5f5;
    --success-color: #4caf50;
    --bg-color: #ffffff;
}

/* ============================================
   MOBILE FILTER TOGGLE
   ============================================ */

.mobile-filter-toggle {
    display: none;
    width: 100%;
    padding: 15px 20px;
    background: var(--accent-color);
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 20px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.mobile-filter-toggle:hover {
    background: #ff5252;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
}

.mobile-filter-toggle i {
    margin-right: 8px;
}

/* ============================================
   SIDEBAR SHOP
   ============================================ */

.sidebar-shop {
    background: var(--white-color);
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.08);
    position: sticky;
    top: 20px;
}

.sidebar-section {
    margin-bottom: 30px;
    padding-bottom: 25px;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.sidebar-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 15px;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-title i {
    color: var(--accent-color);
    font-size: 1rem;
}

/* ============================================
   CATEGORÍAS
   ============================================ */

.category-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.category-item {
    padding: 12px 15px;
    margin-bottom: 8px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.95rem;
}

.category-item:hover {
    background: var(--hover-color);
    color: var(--accent-color);
    transform: translateX(5px);
}

.category-item.active {
    background: var(--accent-color);
    color: white;
    font-weight: 600;
}

.category-count {
    font-size: 0.85rem;
    color: var(--text-color);
    background: var(--secondary-color);
    padding: 3px 10px;
    border-radius: 12px;
    font-weight: 600;
}

.category-item.active .category-count {
    background: rgba(255,255,255,0.25);
    color: white;
}

/* ============================================
   FILTRO DE PRECIO
   ============================================ */

.price-range {
    margin-top: 15px;
}

.price-input {
    display: flex;
    gap: 12px;
    margin-bottom: 18px;
}

.price-input input {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.price-input input:focus {
    outline: none;
    border-color: var(--accent-color);
}

.price-slider {
    width: 100%;
    height: 8px;
    background: var(--border-color);
    border-radius: 5px;
    position: relative;
    margin-top: 10px;
}

.price-slider-fill {
    position: absolute;
    height: 100%;
    background: var(--accent-color);
    border-radius: 5px;
    transition: all 0.3s ease;
}

/* ============================================
   FILTRO DE RATING
   ============================================ */

.rating-filter {
    list-style: none;
    margin: 0;
    padding: 0;
}

.rating-item {
    padding: 10px 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
}

.rating-item:hover {
    color: var(--accent-color);
}

.rating-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--accent-color);
}

.rating-item label {
    cursor: pointer;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 5px;
}

.stars {
    color: #ffc107;
    font-size: 1rem;
}

/* ============================================
   MAIN CONTENT SHOP
   ============================================ */

.main-content-shop {
    min-height: 600px;
}

/* ============================================
   SEARCH & FILTER BAR
   ============================================ */

.search-filter-bar {
    background: var(--white-color);
    padding: 20px 25px;
    border-radius: 15px;
    margin-bottom: 25px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.08);
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: center;
}

/* Buscador */
.search-box {
    flex: 1;
    min-width: 250px;
    position: relative;
}

.search-box input {
    width: 100%;
    padding: 13px 50px 13px 20px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    font-family: inherit;
}

.search-box input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.1);
}

.search-box input::placeholder {
    color: #adb5bd;
}

.search-box button {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--accent-color);
    color: white;
    border: none;
    padding: 10px 18px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.search-box button:hover {
    background: #ff5252;
    transform: translateY(-50%) scale(1.05);
}

/* Dropdown de Ordenamiento */
.sort-dropdown {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sort-dropdown label {
    font-weight: 600;
    color: var(--primary-color);
    white-space: nowrap;
    margin: 0;
}

.sort-dropdown select {
    padding: 13px 40px 13px 18px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 0.95rem;
    cursor: pointer;
    background: white;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14'%3E%3Cpath fill='%236c757d' d='M7 10L2 5h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    transition: all 0.3s ease;
    font-family: inherit;
}

.sort-dropdown select:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.1);
}

.sort-dropdown select:hover {
    border-color: var(--accent-color);
}

/* Toggle de Vista */
.view-toggle {
    display: flex;
    gap: 6px;
}

.view-toggle button {
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    background: white;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    color: var(--text-color);
}

.view-toggle button:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
}

.view-toggle button.active {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: white;
}

/* ============================================
   RESULTS INFO
   ============================================ */

.results-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding: 0 5px;
    flex-wrap: wrap;
    gap: 15px;
}

.results-count {
    color: var(--text-color);
    font-size: 0.95rem;
}

.results-count strong {
    color: var(--primary-color);
    font-weight: 700;
}

.active-filters {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-tag {
    background: var(--secondary-color);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--primary-color);
}

.filter-tag button {
    background: none;
    border: none;
    color: var(--text-color);
    cursor: pointer;
    font-size: 1.2rem;
    line-height: 1;
    padding: 0;
    transition: all 0.3s ease;
}

.filter-tag button:hover {
    color: var(--accent-color);
    transform: scale(1.2);
}

/* ============================================
   PRODUCT ITEM MEJORADO
   ============================================ */

.product-item {
    background: var(--bg-color);
    border-radius: 15px;
    text-align: center;
    height: calc(100% - 30px);
    margin-bottom: 30px;
    padding: 15px;
    transition: all 0.4s ease;
    position: relative;
    overflow: visible;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
}

.product-item:hover {
    transform: translateY(-10px);
    box-shadow: 0 12px 25px rgba(0,0,0,0.15);
}

/* Badge de Producto */
.product-badge {
    position: absolute;
    top: 25px;
    right: 25px;
    background: var(--accent-color);
    color: white;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    z-index: 3;
    box-shadow: 0 2px 8px rgba(255, 107, 107, 0.4);
}

.product-badge.sale {
    background: #ff6b6b;
}

.product-badge.new {
    background: #4caf50;
}

/* Imagen del Producto */
.product-item-img {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 15px;
}

.product-item-img a {
    display: block;
    cursor: pointer;
}

.product-item-img figure {
    display: block;
    margin: 0;
}

.product-item-img img {
    width: 100%;
    aspect-ratio: 1 / 0.914;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.product-item:hover .product-item-img img {
    transform: scale(1.1);
}

/* Acciones Rápidas del Producto */
.product-actions {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    opacity: 0;
    transition: all 0.4s ease;
    z-index: 2;
}

.product-item:hover .product-actions {
    opacity: 1;
    bottom: 20px;
}

.action-btn {
    width: 42px;
    height: 42px;
    background: white;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    color: var(--primary-color);
}

.action-btn:hover {
    background: var(--accent-color);
    color: white;
    transform: scale(1.15);
}

/* Contenido del Producto */
.product-item-content {
    padding: 15px 10px;
}

.product-rating-star {
    display: flex;
    justify-content: center;
    gap: 4px;
    margin-bottom: 12px;
}

.product-rating-star i {
    font-size: 15px;
    color: #ffc107;
}

.product-item-content h3 {
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 12px;
    min-height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-item-content h3 a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

.product-item-content h3 a:hover {
    color: var(--accent-color);
}

/* Precios del Producto */
.product-price {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin: 12px 0 18px;
}

.current-price {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--accent-color);
}

.old-price {
    font-size: 1.05rem;
    color: var(--text-color);
    text-decoration: line-through;
    font-weight: 400;
}

/* Botón Agregar al Carrito */
.add-to-cart-btn {
    width: 100%;
    padding: 10px 10px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 0.95rem;
}

.add-to-cart-btn:hover {
    background: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(255, 107, 107, 0.3);
}

.add-to-cart-btn i {
    font-size: 1rem;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

/* Tablets y pantallas medianas */
@media (max-width: 992px) {
    .mobile-filter-toggle {
        display: block;
    }

    .sidebar-shop {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 320px;
        height: 100vh;
        z-index: 9999;
        overflow-y: auto;
        border-radius: 0;
        margin: 0;
    }

    .sidebar-shop.show-sidebar {
        display: block;
        animation: slideInLeft 0.3s ease;
    }

    @keyframes slideInLeft {
        from {
            transform: translateX(-100%);
        }
        to {
            transform: translateX(0);
        }
    }

    .search-filter-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .search-box {
        width: 100%;
        min-width: auto;
    }

    .sort-dropdown {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
    }

    .sort-dropdown label {
        margin-bottom: 5px;
    }

    .sort-dropdown select {
        width: 100%;
    }

    .view-toggle {
        justify-content: center;
    }

    .results-info {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Smartphones */
@media (max-width: 576px) {
    .sidebar-shop {
        width: 280px;
    }

    .search-filter-bar {
        padding: 15px;
    }

    .product-item {
        padding: 12px;
    }

    .product-badge {
        top: 18px;
        right: 18px;
        padding: 5px 12px;
        font-size: 0.7rem;
    }

    .current-price {
        font-size: 1.4rem;
    }

    .old-price {
        font-size: 0.95rem;
    }

    .add-to-cart-btn {
        padding: 12px 16px;
        font-size: 0.9rem;
    }

    .product-item-content h3 {
        font-size: 1rem;
        min-height: 45px;
    }
}

/* Overlay para sidebar móvil */
@media (max-width: 992px) {
    .sidebar-shop.show-sidebar::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(0,0,0,0.5);
        z-index: -1;
    }
}

/* Paginación Bootstrap Personalizada */
.pagination {
    gap: 8px;
}

.page-link {
    border: 2px solid #e9ecef;
    border-radius: 8px !important;
    color: #2c3e50;
    font-weight: 600;
    padding: 10px 16px;
    transition: all 0.3s ease;
}

.page-link:hover {
    background-color: #fef5f5;
    border-color: #ff6b6b;
    color: #ff6b6b;
}

.page-item.active .page-link {
    background-color: #ff6b6b;
    border-color: #ff6b6b;
    color: white;
}

.page-item.disabled .page-link {
    background-color: #f8f9fa;
    border-color: #e9ecef;
    color: #adb5bd;
}

/* Responsive */
@media (max-width: 576px) {
    .pagination {
        gap: 5px;
    }
    
    .page-link {
        padding: 8px 12px;
        font-size: 0.9rem;
    }
}

