/* ========================================
   CORRECCIONES PARA MODO LANDSCAPE (HORIZONTAL)
   ======================================== */

/* Detectar modo landscape en dispositivos móviles */
@media screen and (max-width: 896px) and (orientation: landscape) {
    
    /* Ajustar altura del hero para no ocupar tanto espacio */
    .hero {
        padding: 1.5rem 1rem !important;
    }
    
    .hero h1 {
        font-size: 1.5rem !important;
        margin-bottom: 0.25rem !important;
    }
    
    .hero p {
        font-size: 0.9rem !important;
    }
    
    /* Ajustar el contenedor de productos en landscape */
    .products-list {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.75rem !important;
        max-height: calc(100vh - 200px);
        overflow-y: auto;
        padding-right: 0.5rem;
    }
    
    /* Tarjeta de producto en landscape */
    .product-card {
        display: grid !important;
        grid-template-columns: 120px 1fr !important;
        grid-template-rows: 1fr auto !important;
        gap: 0.75rem !important;
        padding: 0.75rem !important;
        align-items: start !important;
        min-height: auto !important;
    }
    
    /* Contenedor de imagen ajustado para landscape */
    .product-image-container {
        width: 120px !important;
        height: 100px !important;
        grid-row: 1 / 3 !important;
        margin-bottom: 0 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
    
    /* Asegurar que las imágenes se vean */
    .product-image {
        display: block !important;
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
    }
    
    /* Emoji para productos sin imagen */
    .product-emoji {
        font-size: 2.5rem !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 100% !important;
        height: 100% !important;
    }
    
    /* Información del producto alineada */
    .product-info {
        grid-column: 2 !important;
        grid-row: 1 !important;
        text-align: left !important;
        margin-bottom: 0.5rem !important;
        padding-right: 0.5rem !important;
    }
    
    .product-name {
        font-size: 0.9rem !important;
        margin-bottom: 0.25rem !important;
    }
    
    .product-description {
        font-size: 0.75rem !important;
        line-height: 1.2 !important;
        margin-bottom: 0.25rem !important;
    }
    
    .product-price {
        font-size: 1.1rem !important;
        margin-top: 0.25rem !important;
        justify-content: flex-start !important;
    }
    
    .product-price::before,
    .product-price::after {
        display: none !important;
    }
    
    /* Acciones del producto completamente visibles */
    .product-actions {
        grid-column: 2 !important;
        grid-row: 2 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: flex-start !important;
        gap: 0.75rem !important;
        margin-top: 0 !important;
        width: 100% !important;
    }
    
    /* Control de cantidad más compacto */
    .quantity-control {
        display: flex !important;
        align-items: center !important;
        height: 32px !important;
    }
    
    .quantity-btn {
        width: 30px !important;
        height: 30px !important;
        font-size: 1rem !important;
    }
    
    .quantity-input {
        width: 35px !important;
        font-size: 0.85rem !important;
    }
    
    /* Botón de añadir completamente visible */
    .add-btn {
        padding: 0.5rem 1.25rem !important;
        font-size: 0.85rem !important;
        white-space: nowrap !important;
        flex-shrink: 0 !important;
        height: 32px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
    
    /* Ajustar sección de ofertas */
    .offers-section {
        margin-bottom: 1.5rem !important;
    }
    
    .section-title {
        font-size: 1.2rem !important;
        margin-bottom: 0.75rem !important;
    }
    
    .offer-card {
        min-width: 250px !important;
        padding: 1rem !important;
    }
    
    /* Tabs de categorías más compactos */
    .category-tabs {
        padding: 0.5rem !important;
        margin-bottom: 1rem !important;
    }
    
    .category-tab {
        padding: 0.5rem 0.75rem !important;
        font-size: 0.8rem !important;
    }
    
    /* Header de categoría */
    .category-header {
        font-size: 1.1rem !important;
        margin: 1rem 0 0.75rem !important;
        padding-bottom: 0.5rem !important;
    }
    
    /* Búsqueda más compacta */
    .search-container {
        padding: 0.6rem 1rem !important;
    }
    
    .search-input {
        font-size: 0.9rem !important;
    }
    
    /* Content section ajustado */
    .content-section {
        padding: 1rem !important;
        margin: 0.75rem auto 1.5rem !important;
    }
    
    /* Main container */
    .main-container {
        padding: 0.75rem !important;
    }
    
    /* Floating cart button position */
    .floating-cart {
        bottom: 10px !important;
        right: 10px !important;
        width: 48px !important;
        height: 48px !important;
        font-size: 1.25rem !important;
    }
    
    /* Header más compacto */
    .header-container {
        padding: 0.75rem !important;
    }
    
    .logo {
        font-size: 1.1rem !important;
    }
    
    .logo-icon {
        font-size: 1.5rem !important;
    }
    
    .cart-button-header {
        padding: 0.6rem 1rem !important;
        font-size: 0.85rem !important;
    }
}

/* Ajustes específicos para tablets en landscape */
@media screen and (min-width: 897px) and (max-width: 1024px) and (orientation: landscape) {
    .products-list {
        grid-template-columns: repeat(3, 1fr) !important;
    }
    
    .product-card {
        display: flex !important;
        flex-direction: column !important;
    }
    
    .product-image-container {
        width: 100% !important;
        height: 140px !important;
    }
}

/* Ajustes adicionales para móviles pequeños en landscape */
@media screen and (max-width: 667px) and (orientation: landscape) and (max-height: 400px) {
    /* Para pantallas muy pequeñas en landscape */
    .products-list {
        grid-template-columns: 1fr !important;
        max-height: calc(100vh - 150px) !important;
    }
    
    .product-card {
        grid-template-columns: 100px 1fr !important;
    }
    
    .product-image-container {
        width: 100px !important;
        height: 80px !important;
    }
    
    .hero {
        display: none !important; /* Ocultar hero en pantallas muy pequeñas landscape */
    }
    
    .offers-section {
        display: none !important; /* Ocultar ofertas para dar más espacio */
    }
}

/* Fix para scrollbar en landscape */
@media screen and (orientation: landscape) {
    .products-list::-webkit-scrollbar {
        width: 4px;
    }
    
    .products-list::-webkit-scrollbar-thumb {
        background: var(--primary);
        border-radius: 10px;
    }
    
    .products-list::-webkit-scrollbar-track {
        background: var(--border);
    }
}

/* Asegurar que las imágenes siempre sean visibles */
@media screen and (orientation: landscape) {
    .product-image-container img {
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    /* Fallback para cuando la imagen no carga */
    .product-image-container:empty::before,
    .product-image[src=""]:before {
        content: "🍽️";
        font-size: 2.5rem;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        height: 100%;
    }
}