/* ==============================================
   OPTIMIZACIONES MÓVILES ADICIONALES
   Daniel Magzul Website
   ============================================== */

/* Asegurar que el navbar móvil sea visible y fijo - BLANCO CON LETRAS NEGRAS */
@media screen and (max-width: 768px) {
    /* Forzar visibilidad del navbar en móvil */
    header#navbar {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        z-index: 9999 !important;
        background-color: rgba(255, 255, 255, 0.98) !important;
        backdrop-filter: blur(10px) !important;
        -webkit-backdrop-filter: blur(10px) !important;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
    }
    
    /* Forzar texto y SVGs negro en navbar */
    header#navbar a,
    header#navbar svg,
    header#navbar button {
        color: #111827 !important;
    }
    
    header#navbar svg {
        stroke: #111827 !important;
    }
    
    /* Asegurar que el contenido no quede oculto bajo el navbar */
    main {
        padding-top: 60px;
    }
    
    /* Menú móvil con mejor contraste */
    #mobile-menu {
        background-color: #ffffff !important;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    }
    
    #mobile-menu a {
        color: #111827 !important;
        font-weight: 500;
    }
    
    #mobile-menu a:hover,
    #mobile-menu a:active {
        background-color: #f3f4f6 !important;
        color: #000000 !important;
    }
    
    /* Optimización de imágenes responsive */
    img {
        max-width: 100% !important;
        height: auto !important;
        display: block;
    }
    
    /* Imágenes de álbumes en cards */
    .bg-gray-100 img[alt*="Portada"],
    .bg-gray-100 img[alt*="álbum"] {
        width: 180px !important;
        height: 180px !important;
        min-width: 180px !important;
        object-fit: cover !important;
        border-radius: 0.5rem;
    }
    
    /* Imagen hero ajustada */
    section.h-screen img {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
        object-position: center center !important;
    }
    
    /* Mejora de legibilidad en móvil */
    h1, h2, h3, h4, h5, h6 {
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    /* Botones más grandes para touch */
    button,
    .btn,
    a.bg-black,
    a.border-2 {
        min-height: 48px !important;
        padding: 0.875rem 1.5rem !important;
        font-size: 1rem !important;
    }
    
    /* Cards con mejor espaciado */
    .bg-white.shadow-md,
    .bg-gray-100.shadow-xl {
        padding: 1.25rem !important;
        margin-bottom: 1.5rem !important;
    }
    
    /* Formularios optimizados */
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    textarea,
    select {
        font-size: 16px !important; /* Evita zoom automático en iOS */
        padding: 0.875rem !important;
        width: 100% !important;
    }
    
    /* Videos responsive */
    iframe {
        max-width: 100% !important;
        height: auto !important;
    }
    
    /* Grid layouts en una columna */
    .grid {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
    }
    
    /* Espaciado optimizado para secciones */
    section {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
    
    /* Hero section ajustado */
    section.h-screen {
        min-height: 100vh !important;
        height: auto !important;
    }
    
    /* Carrito drawer optimizado para móvil - 90% de ancho */
    #cart-drawer {
        width: 90% !important;
        max-width: 400px !important;
        z-index: 9998 !important;
        box-shadow: -4px 0 20px rgba(0, 0, 0, 0.3) !important;
        border-radius: 12px 0 0 12px !important;
    }
    
    /* Overlay del carrito - completamente visible y clickeable */
    #cart-overlay {
        z-index: 9997 !important;
        display: block !important;
        pointer-events: auto !important;
        cursor: pointer !important;
    }
    
    #cart-overlay.hidden {
        display: none !important;
        pointer-events: none !important;
    }
    
    /* Asegurar que el navbar esté encima del carrito */
    header#navbar {
        z-index: 9999 !important;
    }
    
    /* Mejorar scroll del carrito en móvil */
    #cart-drawer #cart-items {
        overflow-y: auto !important;
        overflow-x: hidden !important;
        -webkit-overflow-scrolling: touch !important;
        max-height: calc(100vh - 200px) !important;
    }
}

/* Optimización para móviles pequeños (iPhone SE, etc.) */
@media screen and (max-width: 375px) {
    header#navbar .font-bold {
        font-size: 1.5rem !important;
    }
    
    .bg-gray-100 img[alt*="Portada"],
    .bg-gray-100 img[alt*="álbum"] {
        width: 160px !important;
        height: 160px !important;
        min-width: 160px !important;
    }
    
    h2.text-4xl,
    h2.text-5xl {
        font-size: 1.5rem !important;
    }
}

/* Modo landscape en móviles */
@media screen and (max-height: 500px) and (orientation: landscape) {
    header#navbar {
        padding-top: 0.5rem !important;
        padding-bottom: 0.5rem !important;
    }
    
    section.h-screen {
        height: auto !important;
        min-height: 100vh !important;
        padding-top: 4rem !important;
    }
}

/* Tablets en modo portrait */
@media screen and (min-width: 769px) and (max-width: 1024px) {
    .bg-gray-100 img[alt*="Portada"],
    .bg-gray-100 img[alt*="álbum"] {
        width: 220px !important;
        height: 220px !important;
    }
}

/* Prevenir problemas de overflow */
* {
    box-sizing: border-box;
}

html, body {
    overflow-x: hidden;
    width: 100%;
}

/* ==============================================
   MEJORAS UX/UI GLOBALES
   ============================================== */

/* Smooth scrolling para mejor experiencia */
html {
    scroll-behavior: smooth;
}

/* Feedback visual en todos los elementos interactivos */
button,
a,
input[type="submit"],
.cursor-pointer {
    transition: all 0.3s ease;
    cursor: pointer;
}

button:active,
a:active,
input[type="submit"]:active {
    transform: scale(0.98);
}

/* Mejorar legibilidad de textos */
body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* Focus visible para accesibilidad */
button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: 2px solid #111827;
    outline-offset: 2px;
}

/* Mejorar contraste de placeholders */
::placeholder {
    color: #9ca3af;
    opacity: 1;
}

/* Animaciones suaves para transiciones de página */
.page-content {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Loading states para botones */
button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

/* Mejorar cards y contenedores */
.bg-white,
.bg-gray-100 {
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.bg-white:hover,
.bg-gray-100:hover {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

/* Espaciado consistente */
section {
    scroll-margin-top: 80px; /* Compensar navbar fijo */
}

/* Mejorar inputs y formularios */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
textarea,
select {
    transition: all 0.3s ease;
    border: 2px solid #e5e7eb;
}

input:focus,
textarea:focus,
select:focus {
    border-color: #111827;
    box-shadow: 0 0 0 3px rgba(17, 24, 39, 0.1);
}

/* Estados de validación */
input:invalid:not(:placeholder-shown),
textarea:invalid:not(:placeholder-shown) {
    border-color: #ef4444;
}

input:valid:not(:placeholder-shown),
textarea:valid:not(:placeholder-shown) {
    border-color: #10b981;
}

/* Mejorar botones de acción */
button[type="submit"],
.buy-button,
.buy-album-button {
    position: relative;
    overflow: hidden;
}

button[type="submit"]::before,
.buy-button::before,
.buy-album-button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

button[type="submit"]:active::before,
.buy-button:active::before,
.buy-album-button:active::before {
    width: 300px;
    height: 300px;
}

/* ==============================================
   FORZAR MENÚ BLANCO CON LETRAS NEGRAS EN TODAS LAS PLATAFORMAS
   ============================================== */

/* Estilos globales para PC y todas las resoluciones */
header#navbar {
    background-color: rgba(255, 255, 255, 0.98) !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
}

header#navbar a,
header#navbar button,
header#navbar .font-bold {
    color: #111827 !important;
}

header#navbar svg {
    stroke: #111827 !important;
    color: #111827 !important;
}

header#navbar a:hover {
    color: #4b5563 !important;
}

/* Asegurar que el menú móvil desplegable también sea blanco */
#mobile-menu {
    background-color: #ffffff !important;
}

#mobile-menu a {
    color: #111827 !important;
}
