/* ========================================
   Tienda - TODO DE TODITO
   ======================================== */

/* Hero de la Tienda */
.tienda-hero {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: var(--white);
    padding: 140px 0 60px;
    text-align: center;
}

.tienda-hero h1 {
    font-size: 48px;
    margin-bottom: 15px;
    font-weight: 800;
}

.tienda-hero h1 .highlight {
    color: var(--accent-color);
}

.tienda-hero p {
    font-size: 20px;
    opacity: 0.95;
}

/* Filtros Section */
.filtros-section {
    padding: 40px 0;
    background: var(--white);
    border-bottom: 1px solid #e0e0e0;
}

.tienda-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 40px;
    align-items: start;
}

/* Barra Lateral de Filtros */
.filtros-sidebar {
    background: var(--white);
    border-radius: var(--border-radius-lg);
    padding: 25px;
    box-shadow: var(--shadow);
    position: sticky;
    top: 100px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
}

.filtros-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--primary-color);
}

.filtros-header h2 {
    font-size: 18px;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.filtros-header h2 i {
    color: var(--primary-color);
}

.btn-limpiar-filtros {
    background: none;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    padding: 8px 12px;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-limpiar-filtros:hover {
    background: var(--primary-color);
    color: var(--white);
}

.filtro-categoria h3,
.filtro-precio h3,
.filtro-orden h3 {
    font-size: 14px;
    color: var(--text-color);
    margin-bottom: 12px;
    font-weight: 600;
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
}

.filtro-categoria h3:first-child,
.filtro-precio h3:first-child,
.filtro-orden h3:first-child {
    padding-top: 0;
    border-top: none;
}

.categoria-opciones {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.categoria-check {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 6px;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.categoria-check:hover {
    background: var(--background-color);
}

.categoria-check input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.categoria-check span {
    font-size: 13px;
    color: var(--text-color);
}

.filtro-precio input[type="range"] {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: var(--background-color);
    outline: none;
    -webkit-appearance: none;
}

.filtro-precio input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 102, 204, 0.3);
}

.precio-valores {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 13px;
    color: var(--text-light);
    font-weight: 600;
}

#precioMaximo {
    color: var(--primary-color);
    font-weight: 700;
}

.filtro-orden select {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #e0e0e0;
    border-radius: var(--border-radius);
    font-size: 13px;
    font-family: 'Poppins', sans-serif;
    cursor: pointer;
    transition: var(--transition);
}

.filtro-orden select:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Contenido Principal */
.tienda-main {
    min-width: 0;
}

.productos-section {
    padding: 60px 0;
    background: var(--background-color);
}

.tienda-main .productos-section {
    padding: 0;
    background: transparent;
}

.productos-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    gap: 20px;
}

#productosCount {
    color: var(--text-light);
    font-size: 14px;
    font-weight: 600;
}

.vista-opciones {
    display: flex;
    gap: 10px;
    margin-left: auto;
}

.vista-btn {
    width: 40px;
    height: 40px;
    border: 2px solid #e0e0e0;
    background: var(--white);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
}

.vista-btn:hover,
.vista-btn.active {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: rgba(0, 102, 204, 0.05);
}

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

.productos-grid.lista {
    grid-template-columns: 1fr;
}

.productos-grid.lista .product-card {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 30px;
}

.productos-grid.lista .product-image {
    height: 250px;
}

.productos-grid.lista .product-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Product Card */
.product-card {
    background: var(--white);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.product-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

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

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

.product-image-container {
    overflow: hidden;
    position: relative;
}

.product-info {
    padding: 20px;
}

.product-category {
    font-size: 0.8rem;
    color: var(--primary-color);
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.product-category i {
    font-size: 0.7rem;
}

.product-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 10px;
}

.product-variation {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 10px;
}

.product-description {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 15px;
    line-height: 1.4;
}

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

.product-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.product-stock {
    font-size: 0.8rem;
    color: #28a745;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 5px;
}

.add-to-cart {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: var(--white);
    border: none;
    border-radius: var(--border-radius);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.add-to-cart:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 20px rgba(0, 102, 204, 0.4);
}

/* Responsive */
@media (max-width: 992px) {
    .tienda-layout {
        grid-template-columns: 1fr;
    }

    .filtros-sidebar {
        position: relative;
        top: 0;
        max-height: none;
        overflow: visible;
    }
}

@media (max-width: 768px) {
    .tienda-layout {
        gap: 20px;
    }

    .filtros-sidebar {
        padding: 20px;
    }

    .hero-tienda h1 {
        font-size: 32px;
    }

    .hero-tienda p {
        font-size: 16px;
    }

    .productos-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    .productos-grid.lista .product-card {
        grid-template-columns: 1fr;
    }

    .productos-grid.lista .product-image {
        height: 200px;
    }
}

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

/* ========================================
   Tienda Enhanced Mobile Responsive
   ======================================== */

/* Tablet Landscape and Below */
@media (max-width: 1024px) {
    .tienda-layout {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .filtros-sidebar {
        border-right: none;
        border-bottom: 1px solid #e0e0e0;
    }

    .productos-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }

    .vista-opciones {
        align-self: flex-end;
    }
}

/* Tablet Portrait and Below */
@media (max-width: 768px) {
    /* Filtros Sidebar Mobile */
    .filtros-sidebar {
        padding: 15px;
        margin-bottom: 20px;
    }

    .filtros-header h2 {
        font-size: 18px;
    }

    .filtro-categoria h3,
    .filtro-precio h3,
    .filtro-orden h3 {
        font-size: 15px;
    }

    .categoria-check {
        font-size: 14px;
        padding: 8px 0;
    }

    .categoria-check input {
        width: 18px;
        height: 18px;
    }

    #precioRange {
        height: 6px;
    }

    #ordenSelect {
        font-size: 14px;
        padding: 10px;
    }

    /* Productos Header Mobile */
    .productos-header {
        padding: 15px;
    }

    #productosCount {
        font-size: 14px;
    }

    .vista-opciones {
        gap: 8px;
    }

    .vista-btn {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }

    /* Product Grid Mobile */
    .productos-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        padding: 0 10px;
    }

    .product-card {
        padding: 10px;
        font-size: 13px;
    }

    .product-image {
        height: 150px;
    }

    .product-category {
        font-size: 11px;
    }

    .product-name {
        font-size: 13px;
        margin: 8px 0;
    }

    .product-variation {
        font-size: 12px;
    }

    .product-description {
        font-size: 11px;
        display: none;
    }

    .product-footer {
        flex-direction: column;
        gap: 5px;
        align-items: flex-start;
    }

    .product-price {
        font-size: 15px;
    }

    .product-stock {
        font-size: 11px;
    }

    .add-to-cart {
        font-size: 12px;
        padding: 8px 12px;
        min-height: 40px;
    }

    /* Lista View Mobile */
    .productos-grid.lista .product-card {
        grid-template-columns: 1fr;
        padding: 12px;
    }

    .productos-grid.lista .product-image {
        height: 180px;
        margin-bottom: 10px;
    }

    .productos-grid.lista .product-info {
        padding: 0;
    }
}

/* Mobile Small (Phones) */
@media (max-width: 480px) {
    /* Hero Mobile Small */
    .tienda-hero {
        padding: 60px 0 30px;
        min-height: 200px;
    }

    .tienda-hero h1 {
        font-size: 24px;
    }

    .tienda-hero p {
        font-size: 13px;
    }

    /* Filtros Mobile Small */
    .filtros-sidebar {
        padding: 12px;
    }

    .filtros-header {
        margin-bottom: 15px;
    }

    .filtros-header h2 {
        font-size: 16px;
    }

    .btn-limpiar-filtros {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }

    .filtro-categoria h3,
    .filtro-precio h3,
    .filtro-orden h3 {
        font-size: 14px;
    }

    .categoria-opciones {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .categoria-check {
        font-size: 12px;
        padding: 6px 8px;
    }

    .precio-valores {
        font-size: 12px;
    }

    #ordenSelect {
        font-size: 13px;
        padding: 8px;
    }

    /* Productos Mobile Small */
    .productos-grid {
        gap: 8px;
        padding: 0 8px;
    }

    .product-card {
        padding: 8px;
    }

    .product-image {
        height: 140px;
    }

    .product-name {
        font-size: 12px;
    }

    .product-price {
        font-size: 14px;
    }

    .add-to-cart {
        font-size: 11px;
        padding: 6px 10px;
    }

    /* Productos Header Mobile Small */
    .productos-header {
        padding: 12px 15px;
    }

    #productosCount {
        font-size: 13px;
    }

    .vista-btn {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }
}

/* Landscape orientation for phones */
@media (max-width: 768px) and (orientation: landscape) {
    .tienda-hero {
        min-height: 160px;
    }

    .filtros-sidebar {
        display: flex;
        flex-wrap: wrap;
        gap: 15px;
    }

    .filtro-categoria,
    .filtro-precio,
    .filtro-orden {
        flex: 1;
        min-width: 150px;
    }

    .productos-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    .categoria-check {
        min-height: 40px;
        display: flex;
        align-items: center;
    }

    .vista-btn {
        min-width: 44px;
        min-height: 44px;
    }

    .btn-limpiar-filtros {
        min-width: 44px;
        min-height: 44px;
    }

    .add-to-cart {
        min-height: 44px;
    }
}
