
/* tablets (768px - 1024px) */
@media (max-width: 1024px) {
    .container {
        padding: 0 15px;
        max-width: 100%;
    }
    
    /* Cabeza */
    .header-content {
        gap: 1rem;
        flex-wrap: wrap;
    }
    
    .logo-text {
        font-size: 1.1rem;
    }
    
    .search-bar {
        max-width: 400px;
        order: 3;
        flex: 1 1 100%;
        margin-top: 0.5rem;
    }
    
    /* boton de regresar */
    .back-to-catalog {
        padding: 0.6rem 1.2rem;
        font-size: 0.9rem;
    }
    
    /* tablet layout */
    .main {
        padding: 1.5rem 0;
    }
    
    /* productos */
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 1.25rem;
    }
    
    .product-card:hover {
        transform: translateY(-3px);
    }
    
    /* ficha t. tablet */
    .product-detail {
        grid-template-columns: 1fr 1fr;
        gap: 2rem;
    }
    
    .product-main-img {
        height: 350px;
    }
    
    .thumbnail {
        width: 70px;
        height: 70px;
    }
    
    .product-info {
        padding: 1.5rem;
    }
    
    .product-title {
        font-size: 1.75rem;
    }
    
    .specs-grid {
        grid-template-columns: 1fr;
    }
    
    /* paginacion */
    .pagination {
        gap: 0.5rem;
    }
    
    .page-numbers {
        gap: 0.25rem;
    }
    
    .page-number {
        padding: 0.4rem 0.6rem;
        font-size: 0.85rem;
    }
}

/* Tablet (768px - 900px) */
@media (max-width: 900px) and (min-width: 768px) {
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        gap: 1rem;
    }
    
    .product-image {
        height: 180px;
    }
    
    .product-info {
        padding: 1rem;
    }
    
    .product-name {
        font-size: 1rem;
    }
    
    /* cabeza contacto */
    .header {
        padding: 0.75rem 0;
    }
    
    .categories-nav {
        top: 60px;
        padding: 0.75rem 0;
    }
    
    .categories-list {
        gap: 0.25rem;
    }
    
    .category-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.85rem;
    }
    
    /* F.T tablet*/
    .product-detail {
        gap: 1.5rem;
    }
    
    .product-main-img {
        height: 300px;
    }
    
    .thumbnail {
        width: 60px;
        height: 60px;
    }
}

/* Orientacion H */
@media (max-width: 1024px) and (orientation: landscape) {
    .header {
        position: relative;
    }
    
    .categories-nav {
        position: relative;
        top: 0;
    }
    
    .main {
        min-height: auto;
        padding: 1rem 0;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 1rem;
    }
    
    /* F.T Landscape */
    .product-detail {
        grid-template-columns: 1fr 1fr;
        gap: 1.5rem;
    }
    
    .product-main-img {
        height: 250px;
    }
}

/* ajustes especioficos para ipad */
@media (width: 1024px) and (height: 1366px) {
    /* iPad vertical */
    .container {
        max-width: 900px;
    }
    
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    /* F.T ipad V */
    .product-detail {
        grid-template-columns: 1fr 1fr;
        gap: 2.5rem;
    }
    
    .product-main-img {
        height: 400px;
    }
}

@media (width: 1366px) and (height: 1024px) {
    /* iPad Pro horizontal */
    .products-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    /*  F.T ipad H */
    .product-detail {
        grid-template-columns: 1fr 1fr;
        gap: 3rem;
    }
    
    .product-main-img {
        height: 350px;
    }
}

/* Tranciones */
@media (prefers-reduced-motion: no-preference) {
    .container,
    .products-grid,
    .header-content,
    .product-detail {
        transition: all 0.3s ease;
    }
}

/* Mejoras de accesibilidad */
@media (max-width: 1024px) and (pointer: coarse) {
    .category-btn,
    .pagination-btn,
    .page-number,
    .view-btn,
    .back-to-catalog {
        min-height: 44px;
        min-width: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .search-input {
        font-size: 16px; /* Previene zoom en iOS */
    }
    
    .product-card {
        cursor: default;
    }
    
    /* Mejoras tactiles para la FT */
    .thumbnail {
        min-width: 60px;
        min-height: 60px;
    }
    
    .btn-secondary {
        min-height: 44px;
    }
}

/* Ajustes de tipografia */
@media (max-width: 1024px) and (min-width: 768px) {
    body {
        font-size: 15px;
    }
    
    .section-title {
        font-size: 1.75rem;
    }
    
    .product-title {
        font-size: 1.1rem;
    }
    
    /* FT tipografia */
    .product-detail .product-title {
        font-size: 1.5rem;
    }
    
    .specs-title {
        font-size: 1.1rem;
    }
}

/* Optimizacion Perfomance */
@media (max-width: 1024px) {
    .product-card:hover {
        transform: none;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }
    
    /* Reducir efectos para mejor performance */
    .search-suggestions {
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    }
    
    /* FT preformance */
    .product-gallery {
        position: static;
    }
}

/* Productos relacionados en tablet */
@media (max-width: 1024px) and (min-width: 768px) {
    .related-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 1rem;
    }
    
    .related-product-img {
        width: 100px;
        height: 100px;
    }
}

/* BREADCRUMB */
@media (max-width: 1024px) {
    .breadcrumb {
        padding: 0.75rem 0;
    }
    
    .breadcrumb-list {
        font-size: 0.85rem;
    }
}

/* Acciones de producto */
@media (max-width: 1024px) and (min-width: 768px) {
    .product-actions {
        flex-direction: row;
        gap: 0.75rem;
    }
    
    .product-actions .btn-secondary {
        flex: 1;
        justify-content: center;
    }
}

/* impresion */
@media (max-width: 1024px) {
    @media print {
        .header,
        .categories-nav,
        .footer,
        .breadcrumb,
        .product-actions,
        .related-products {
            display: none;
        }
        
        .main {
            margin: 0;
            padding: 0;
        }
        
        .products-grid {
            grid-template-columns: repeat(2, 1fr);
            gap: 0.5rem;
        }
        
        .product-card {
            box-shadow: none;
            border: 1px solid #ddd;
            break-inside: avoid;
        }
        
        /* Impresion FT*/
        .product-detail {
            display: block;
        }
        
        .product-main-img {
            height: 300px;
        }
        
        .image-thumbnails {
            display: none;
        }
    }
}

/* tablet (alta densidad) */
@media (max-width: 1024px) and (min-width: 768px) and (max-height: 600px) {
    .header {
        padding: 0.5rem 0;
    }
    
    .categories-nav {
        padding: 0.5rem 0;
        top: 50px;
    }
    
    .main {
        padding: 1rem 0;
        min-height: calc(100vh - 150px);
    }
    
    .product-image {
        height: 150px;
    }
    
    /* FT compacta */
    .product-detail {
        gap: 1rem;
    }
    
    .product-main-img {
        height: 250px;
    }
    
    .product-info {
        padding: 1rem;
    }
}