/*--------------------------------------------------------------------- 
   LaVitrina64 - Estilos Responsivos Mejorados
   Mejoras de responsividad para todas las páginas
   Basado en mejores prácticas de "Descarga Hostinger"
---------------------------------------------------------------------*/

/* ==============================
   RESET Y MEJORAS GENERALES
   ============================== */

/* Prevenir scroll horizontal */
html, body {
    overflow-x: hidden !important;
    max-width: 100vw !important;
}

/* Asegurar que todas las imágenes sean responsivas */
img {
    max-width: 100% !important;
    height: auto !important;
    display: block;
}

/* Contenedores responsivos */
.container, .container-fluid {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

/* ==============================
   MEJORAS GENERALES PARA MÓVILES
   ============================== */

/* Mejoras generales para móviles */
@media (max-width: 768px) {
    /* Contenedores - Basado en "Descarga Hostinger" */
    .container-fluid {
        padding-left: 18px !important;
        padding-right: 18px !important;
    }
    
    .container {
        padding-left: 18px !important;
        padding-right: 18px !important;
    }
    
    /* Asegurar que no haya overflow */
    * {
        max-width: 100%;
        box-sizing: border-box;
    }
    
    /* Títulos */
    h1, .h1 {
        font-size: 28px !important;
    }
    
    h2, .h2 {
        font-size: 24px !important;
    }
    
    h3, .h3 {
        font-size: 20px !important;
    }
    
    /* Botones - Tamaño táctil mínimo (44px) */
    .btn,
    button,
    a.btn {
        min-height: 44px !important;
        min-width: 44px !important;
        padding: 12px 20px !important;
        font-size: 16px !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
    
    .btn-lg {
        padding: 14px 28px !important;
        font-size: 18px !important;
        min-height: 48px !important;
    }
    
    .btn-sm {
        padding: 10px 16px !important;
        font-size: 14px !important;
        min-height: 40px !important;
    }
    
    /* Cards de productos */
    .product-card-premium,
    .product-col {
        margin-bottom: 20px;
    }
    
    /* Imágenes */
    img {
        max-width: 100%;
        height: auto;
    }
    
    /* Formularios - Mejoras para móviles */
    .form-control,
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    input[type="number"],
    input[type="password"],
    select,
    textarea {
        font-size: 16px !important; /* Evita zoom en iOS */
        min-height: 44px !important; /* Tamaño táctil mínimo */
        padding: 12px 16px !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
    
    /* Espaciado */
    .section-padding {
        padding: 30px 0 !important;
    }
    
    /* Carrusel */
    .carousel-item img {
        width: 100%;
        height: auto;
    }
    
    /* Grid de productos */
    .row {
        margin-left: -10px;
        margin-right: -10px;
    }
    
    .row > [class*="col-"] {
        padding-left: 10px;
        padding-right: 10px;
        margin-bottom: 20px;
    }
    
    /* Asegurar que las columnas no se desborden */
    [class*="col-"] {
        width: 100% !important;
        max-width: 100% !important;
        flex: 0 0 100% !important;
    }
    
    /* Excepción: mantener columnas específicas cuando sea necesario */
    .row .col-md-6,
    .row .col-sm-6 {
        flex: 0 0 100% !important;
        max-width: 100% !important;
    }
}

/* Tablets */
@media (min-width: 769px) and (max-width: 991px) {
    .container {
        max-width: 100%;
        padding-left: 20px;
        padding-right: 20px;
    }
    
    .product-card-premium {
        margin-bottom: 25px;
    }
}

/* Móviles pequeños */
@media (max-width: 576px) {
    /* Títulos más pequeños - Basado en "Descarga Hostinger" */
    h1, .h1 {
        font-size: clamp(1.5rem, 5vw, 2rem) !important;
        line-height: 1.2 !important;
    }
    
    h2, .h2 {
        font-size: clamp(1.25rem, 4vw, 1.75rem) !important;
        line-height: 1.3 !important;
    }
    
    h3, .h3 {
        font-size: clamp(1.1rem, 3.5vw, 1.5rem) !important;
    }
    
    /* Padding reducido pero consistente */
    .container-fluid {
        padding-left: 15px !important;
        padding-right: 15px !important;
    }
    
    .container {
        padding-left: 15px !important;
        padding-right: 15px !important;
    }
    
    /* Botones full width en móviles */
    .btn-group-vertical .btn,
    .btn-mobile-full {
        width: 100%;
        margin-bottom: 10px;
    }
    
    /* Cards más compactas */
    .card, .admin-card {
        padding: 15px !important;
        margin-bottom: 15px !important;
    }
    
    /* Texto más pequeño pero legible */
    p, .text, body {
        font-size: 15px !important;
        line-height: 1.6 !important;
    }
    
    /* Imágenes de productos - Responsivas */
    .product-image,
    .product-card-premium img,
    .product-col img {
        width: 100% !important;
        height: auto !important;
        max-height: 300px !important;
        object-fit: contain !important;
    }
    
    /* Asegurar centrado vertical en imágenes del catálogo */
    .product-card-image-wrapper img {
        object-position: 50% 50% !important;
        object-fit: cover !important;
    }
    
    /* Formularios */
    .form-group {
        margin-bottom: 15px;
    }
    
    /* Tablas responsivas */
    .table-responsive {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* Móviles muy pequeños */
@media (max-width: 400px) {
    h1, .h1 {
        font-size: clamp(1.25rem, 6vw, 1.75rem) !important;
    }
    
    h2, .h2 {
        font-size: clamp(1.1rem, 5vw, 1.5rem) !important;
    }
    
    .container {
        padding-left: 12px !important;
        padding-right: 12px !important;
    }
    
    .container-fluid {
        padding-left: 12px !important;
        padding-right: 12px !important;
    }
    
    .btn {
        padding: 10px 16px !important;
        font-size: 14px !important;
        min-height: 44px !important;
    }
    
    .card, .admin-card {
        padding: 12px !important;
    }
    
    /* Asegurar que todo sea legible */
    body, p, .text {
        font-size: 14px !important;
    }
}

/* Mejoras para páginas específicas */

/* Página de producto - Mejoras móviles */
@media (max-width: 768px) {
    #product-detail .row {
        flex-direction: column !important;
        margin: 0 !important;
    }
    
    #product-detail .col-md-6 {
        width: 100% !important;
        max-width: 100% !important;
        flex: 0 0 100% !important;
        margin-bottom: 30px !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
    
    #product-images {
        margin-bottom: 20px !important;
    }
    
    #main-image {
        width: 100% !important;
        height: auto !important;
        max-height: 400px !important;
        object-fit: contain !important;
    }
    
    .thumb-image {
        margin-bottom: 10px;
        cursor: pointer;
        transition: opacity 0.3s;
    }
    
    .thumb-image:hover {
        opacity: 0.7;
    }
    
    #product-info {
        padding: 0 15px;
    }
    
    #product-title {
        font-size: clamp(1.5rem, 5vw, 2rem) !important;
        margin-bottom: 15px !important;
    }
    
    #product-price {
        font-size: clamp(1.5rem, 4vw, 2rem) !important;
        margin: 20px 0 !important;
    }
}

/* ==============================
   CATÁLOGO - MEJORAS MÓVILES
   ============================== */

/* Catálogo - Mejoras móviles */
@media (max-width: 768px) {
    /* Sidebar de filtros - Ocultar o hacer colapsable */
    #filters-sidebar {
        margin-bottom: 20px !important;
        width: 100% !important;
        max-width: 100% !important;
    }
    
    #filters-sidebar .col-md-3 {
        width: 100% !important;
        max-width: 100% !important;
        flex: 0 0 100% !important;
    }
    
    /* Contenedor de filtros */
    #filters-sidebar > div {
        padding: 15px !important;
    }
    
    #filters-sidebar h3 {
        font-size: clamp(18px, 4vw, 20px) !important;
        margin-bottom: 15px !important;
    }
    
    /* Grid de productos - Una columna en móviles */
    #products-grid .col-md-3,
    #products-grid .col-sm-6,
    #products-grid .col-md-4 {
        width: 100% !important;
        max-width: 100% !important;
        flex: 0 0 100% !important;
        margin-bottom: 20px !important;
        padding-left: 10px !important;
        padding-right: 10px !important;
    }
    
    /* Campo de búsqueda */
    #search-input {
        width: 100% !important;
        padding: 14px 16px !important;
        font-size: 16px !important; /* Evita zoom en iOS */
        min-height: 48px !important;
        box-sizing: border-box !important;
        border-radius: 8px !important;
    }
    
    /* Selects de filtros */
    #filters-sidebar select,
    #sort-order {
        width: 100% !important;
        min-height: 48px !important;
        font-size: 16px !important; /* Evita zoom en iOS */
        padding: 12px 16px !important;
        margin-bottom: 15px !important;
        border-radius: 8px !important;
    }
    
    #filters-sidebar label {
        font-size: 14px !important;
        margin-bottom: 8px !important;
        display: block !important;
    }
    
    /* Botón de ordenar */
    #sort-order {
        width: 100% !important;
        min-width: auto !important;
    }
    
    /* Product cards en catálogo */
    .product-card-catalog {
        margin-bottom: 20px !important;
    }
    
    .product-card-image-wrapper {
        height: 220px !important;
    }
    
    .product-card-content {
        padding: 15px !important;
    }
    
    .product-card-title {
        font-size: clamp(14px, 3vw, 16px) !important;
        min-height: 44px !important;
    }
    
    .product-card-meta,
    .product-card-variant {
        font-size: clamp(12px, 2.5vw, 13px) !important;
    }
    
    .product-card-price {
        font-size: clamp(18px, 4vw, 22px) !important;
    }
    
    .product-card-badge {
        font-size: 10px !important;
        padding: 4px 8px !important;
    }
}

/* Catálogo - Móviles pequeños */
@media (max-width: 576px) {
    #filters-sidebar > div {
        padding: 12px !important;
    }
    
    .product-card-image-wrapper {
        height: 200px !important;
    }
    
    .product-card-content {
        padding: 12px !important;
    }
    
    .product-card-title {
        font-size: 14px !important;
        min-height: 40px !important;
    }
    
    .product-card-price {
        font-size: 18px !important;
    }
    
    #search-input {
        padding: 12px 14px !important;
        font-size: 16px !important;
    }
}

/* Catálogo - Móviles muy pequeños */
@media (max-width: 400px) {
    .product-card-image-wrapper {
        height: 180px !important;
    }
    
    .product-card-content {
        padding: 10px !important;
    }
    
    .product-card-title {
        font-size: 13px !important;
        min-height: 38px !important;
    }
    
    .product-card-price {
        font-size: 16px !important;
    }
}

/* Drops */
@media (max-width: 768px) {
    .drop-section {
        margin-bottom: 30px !important;
    }
    
    .drop-section h2 {
        font-size: 20px !important;
    }
    
    .drop-section .col-md-4 {
        margin-bottom: 20px;
    }
}

/* Gallery */
@media (max-width: 768px) {
    .carousel-item img {
        height: 250px;
        object-fit: cover;
    }
}

/* Index - Carrusel */
@media (max-width: 768px) {
    .banner_section .carousel-item .row {
        flex-direction: column-reverse;
    }
    
    .banner_section .col-xl-6 {
        margin-bottom: 20px;
    }
    
    .sport_text {
        font-size: 28px !important;
    }
    
    .lorem_text {
        font-size: 14px !important;
    }
    
    .hero-buttons-wrapper {
        flex-direction: column;
        gap: 10px;
    }
    
    .hero-buttons-wrapper .btn {
        width: 100%;
    }
}

/* Index - Productos destacados */
@media (max-width: 768px) {
    .our_section_2 .row {
        margin-left: -5px;
        margin-right: -5px;
    }
    
    .our_section_2 .col-md-3 {
        padding-left: 5px;
        padding-right: 5px;
        margin-bottom: 15px;
    }
}

/* Contact */
@media (max-width: 768px) {
    .contact_section .row {
        flex-direction: column;
    }
    
    .contact_section .col-md-6 {
        width: 100%;
        margin-bottom: 20px;
    }
}

/* About - Mejoras para móviles */
@media (max-width: 768px) {
    .about_section {
        padding: 30px 0 !important;
    }
    
    .about_text {
        font-size: clamp(20px, 5vw, 28px) !important;
        padding: 0 15px !important;
    }
    
    /* Asegurar que el texto de about siempre sea visible */
    .about_middle {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        width: 100% !important;
        margin: 0 auto !important;
        padding: 0 15px !important;
    }
    
    .about_lorem,
    p.about_lorem {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        font-size: clamp(14px, 3vw, 16px) !important;
        line-height: 1.6 !important;
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
        max-width: 100% !important;
        padding: 0 15px !important;
        margin: 0 auto 20px !important;
        text-align: center !important;
    }
}

/* About - Móviles pequeños */
@media (max-width: 576px) {
    .about_text {
        font-size: clamp(18px, 4.5vw, 24px) !important;
    }
    
    .about_lorem,
    p.about_lorem {
        font-size: clamp(13px, 2.8vw, 15px) !important;
        padding: 0 10px !important;
    }
}

/* About - Móviles muy pequeños */
@media (max-width: 400px) {
    .about_text {
        font-size: clamp(16px, 4vw, 20px) !important;
    }
    
    .about_lorem,
    p.about_lorem {
        font-size: clamp(12px, 2.5vw, 14px) !important;
        padding: 0 8px !important;
    }
}

/* Footer - Responsive */
@media (max-width: 768px) {
    .footer_section {
        padding: 40px 0 20px;
    }
    
    .footer_section .col-sm-4 {
        flex: 0 0 100%;
        max-width: 100%;
        margin-bottom: 30px;
        text-align: left;
    }
    
    .important_text {
        text-align: left;
    }
    
    .important_text::after {
        left: 0;
        transform: none;
    }
    
    .footer_menu {
        text-align: left;
    }
    
    .footer_menu ul {
        display: block;
        text-align: left;
    }
    
    .footer_lorem_text {
        text-align: left;
    }
    
    /* Logo del footer alineado a la izquierda en móviles */
    .footer-logo {
        margin: 0;
        text-align: left;
    }
    
    .footer_section .input-group {
        max-width: 100%;
        margin: 0 auto 15px;
    }
}

@media (max-width: 576px) {
    .footer_section {
        padding: 30px 0 15px;
    }
    
    .footer_section .col-sm-4 {
        margin-bottom: 25px;
    }
    
    .important_text {
        font-size: 18px;
        margin-bottom: 15px;
    }
    
    .footer_menu li {
        font-size: 13px;
        margin-bottom: 10px;
    }
    
    .footer_lorem_text {
        font-size: 13px;
    }
}

/* Utilidades responsivas */
.hide-mobile {
    display: block;
}

.show-mobile {
    display: none;
}

@media (max-width: 768px) {
    .hide-mobile {
        display: none !important;
    }
    
    .show-mobile {
        display: block !important;
    }
}

/* Mejoras de accesibilidad en móviles - Basado en "Descarga Hostinger" */
@media (max-width: 768px) {
    /* Botones más grandes para tocar - Estándar iOS/Android */
    button, .btn, a.btn, input[type="submit"], input[type="button"] {
        min-height: 44px !important;
        min-width: 44px !important;
        padding: 12px 20px !important;
        font-size: 16px !important;
    }
    
    /* Links más grandes - Solo si son interactivos principales */
    a.btn, a.button, .nav-links {
        min-height: 44px !important;
        display: inline-flex !important;
        align-items: center !important;
        padding: 8px 12px !important;
    }
    
    /* Inputs más grandes - Evita zoom en iOS */
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    input[type="number"],
    input[type="password"],
    input[type="search"],
    select,
    textarea {
        min-height: 44px !important;
        font-size: 16px !important; /* Evita zoom automático en iOS */
        padding: 12px 16px !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
    
    /* Asegurar que los elementos interactivos sean táctiles */
    .cart-link,
    .openbtn,
    .search_icon {
        min-width: 44px !important;
        min-height: 44px !important;
    }
}

/* ==============================
   MEJORAS ADICIONALES
   ============================== */

/* Prevenir desbordamiento horizontal */
@media (max-width: 768px) {
    * {
        max-width: 100%;
    }
    
    table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        width: 100%;
    }
    
    /* Asegurar que los iframes sean responsivos */
    iframe,
    embed,
    object,
    video {
        max-width: 100% !important;
        height: auto !important;
    }
}

/* ==============================
   CHECKOUT Y CARRITO - MÓVILES
   ============================== */

/* Checkout - Mejoras móviles */
@media (max-width: 768px) {
    .checkout-container {
        padding: 20px 15px !important;
    }
    
    .checkout-form {
        padding: 20px 15px !important;
        margin-bottom: 20px !important;
    }
    
    .checkout-summary {
        position: static !important;
        margin-top: 20px !important;
        padding: 20px 15px !important;
    }
    
    .checkout-item {
        flex-direction: column !important;
        align-items: flex-start !important;
        padding: 15px 0 !important;
    }
    
    .checkout-item img {
        width: 80px !important;
        height: 80px !important;
        margin-right: 0 !important;
        margin-bottom: 10px !important;
    }
    
    .checkout-item-info {
        width: 100% !important;
    }
    
    .checkout-item-price {
        margin-top: 10px !important;
        font-size: 18px !important;
    }
    
    .form-row {
        flex-direction: column !important;
        gap: 0 !important;
    }
    
    .form-row .form-group {
        margin-bottom: 15px !important;
    }
    
    .btn-checkout {
        min-height: 50px !important;
        font-size: 16px !important;
        padding: 15px 20px !important;
    }
}

/* Carrito - Mejoras móviles */
@media (max-width: 768px) {
    #cart-content .col-md-8,
    #cart-content .col-md-4 {
        width: 100% !important;
        max-width: 100% !important;
        flex: 0 0 100% !important;
        margin-bottom: 20px !important;
    }
    
    #cart-content .col-md-4 > div {
        position: static !important;
        margin-top: 0 !important;
    }
    
    .cart-item {
        flex-direction: column !important;
        align-items: flex-start !important;
        padding: 15px 0 !important;
    }
    
    .cart-item img {
        width: 100% !important;
        max-width: 200px !important;
        height: auto !important;
        margin-bottom: 15px !important;
    }
    
    #subtotal,
    #total {
        font-size: 18px !important;
    }
    
    #total {
        font-size: 22px !important;
    }
}

/* ==============================
   PRODUCTO - MEJORAS ADICIONALES
   ============================== */

@media (max-width: 576px) {
    #product-detail .row {
        margin: 0 !important;
    }
    
    #product-images .row {
        margin: 0 !important;
    }
    
    #product-images .col-4 {
        padding: 5px !important;
    }
    
    .thumb-image {
        width: 100% !important;
        height: auto !important;
        min-height: 80px !important;
        object-fit: cover !important;
    }
    
    #product-info > div {
        padding: 15px !important;
        margin-bottom: 15px !important;
    }
    
    #product-actions button {
        width: 100% !important;
        margin-bottom: 10px !important;
        min-height: 50px !important;
        font-size: 16px !important;
    }
}

/* ==============================
   TABLAS RESPONSIVAS
   ============================== */

@media (max-width: 768px) {
    table {
        font-size: 14px !important;
    }
    
    table th,
    table td {
        padding: 8px 4px !important;
        font-size: 13px !important;
    }
    
    /* Ocultar columnas menos importantes en móviles */
    .table-responsive table th:nth-child(n+4),
    .table-responsive table td:nth-child(n+4) {
        display: none;
    }
}

/* ==============================
   FORMULARIOS MEJORADOS
   ============================== */

@media (max-width: 768px) {
    .form-group label {
        font-size: 14px !important;
        margin-bottom: 6px !important;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        font-size: 16px !important; /* Evita zoom en iOS */
        padding: 14px 16px !important;
        min-height: 48px !important;
        border-radius: 8px !important;
    }
    
    .error-message {
        font-size: 13px !important;
        margin-top: 4px !important;
    }
}

/* ==============================
   MEJORAS PARA TABLETS
   ============================== */

@media (min-width: 769px) and (max-width: 991px) {
    .container {
        max-width: 100% !important;
        padding-left: 20px !important;
        padding-right: 20px !important;
    }
    
    .product-card-premium,
    .product-col {
        margin-bottom: 25px;
    }
    
    /* Mantener 2 columnas en tablets */
    .row .col-md-6 {
        flex: 0 0 50% !important;
        max-width: 50% !important;
    }
    
    /* Checkout en tablets */
    .checkout-container {
        padding: 30px 20px !important;
    }
    
    .checkout-summary {
        position: sticky !important;
        top: 20px !important;
    }
}

