/* ════════════════════════════════════════════════════════════
   TECNO-VALLE - Custom Styles
   Versión 2.0 - Con modales de productos y zoom
   ════════════════════════════════════════════════════════════ */

/* ────────────────────────────────────────────────────────────
   1. FUENTES Y BASE
   ──────────────────────────────────────────────────────────── */

.font-inter {
    font-family: 'Inter', sans-serif;
}

body {
    font-family: 'Inter', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ────────────────────────────────────────────────────────────
   2. ANIMACIONES
   ──────────────────────────────────────────────────────────── */

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Clases de animación */
.animate-fade-in {
    animation: fadeIn 0.6s ease-out;
}

.animate-fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

.animation-delay-200 {
    animation-delay: 0.2s;
}

.animation-delay-400 {
    animation-delay: 0.4s;
}

/* ────────────────────────────────────────────────────────────
   3. UTILIDADES DE TEXTO
   ──────────────────────────────────────────────────────────── */

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ────────────────────────────────────────────────────────────
   4. RESPONSIVE CONTAINER
   ──────────────────────────────────────────────────────────── */

@media (max-width: 640px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

/* ────────────────────────────────────────────────────────────
   5. ACCESIBILIDAD (FOCUS STATES)
   ──────────────────────────────────────────────────────────── */

a:focus, button:focus, input:focus, textarea:focus, select:focus {
    outline: 2px solid #facc15;
    outline-offset: 2px;
}

/* ────────────────────────────────────────────────────────────
   6. PRINT STYLES
   ──────────────────────────────────────────────────────────── */

@media print {
    nav, footer, .whatsapp-float {
        display: none !important;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
    
    a {
        text-decoration: underline;
    }
}

/* ────────────────────────────────────────────────────────────
   7. PRODUCTOS - TARJETAS
   ──────────────────────────────────────────────────────────── */

.product-card {
    cursor: pointer;
    transition: all 0.3s ease;
}

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

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

.product-image {
    transition: transform 0.5s ease;
}

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

/* Icono de zoom en hover */
.product-image-container .fa-search-plus {
    transition: all 0.3s ease;
}

.product-image-container:hover .fa-search-plus {
    transform: scale(1.2);
}

/* Botón de comprar - evitar que active el modal */
.comprar-btn {
    pointer-events: auto;
    z-index: 10;
    position: relative;
}

/* ────────────────────────────────────────────────────────────
   8. MODAL DE DETALLE DE PRODUCTO
   ──────────────────────────────────────────────────────────── */

#product-modal {
    animation: fadeIn 0.3s ease-out;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

#product-modal .bg-white {
    animation: slideUp 0.3s ease-out;
}

#product-modal .max-h-\[90vh\] {
    max-height: 90vh;
}

/* Scroll personalizado para modal */
#product-modal ::-webkit-scrollbar {
    width: 8px;
}

#product-modal ::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

#product-modal ::-webkit-scrollbar-thumb {
    background: #1e3a8a;
    border-radius: 4px;
}

#product-modal ::-webkit-scrollbar-thumb:hover {
    background: #0f172a;
}

/* Contenido del modal */
#modal-product-image {
    transition: transform 0.3s ease;
}

#modal-product-image:hover {
    transform: scale(1.05);
    cursor: zoom-in;
}

/* ────────────────────────────────────────────────────────────
   9. MODAL DE ZOOM DE IMAGEN
   ──────────────────────────────────────────────────────────── */

#image-zoom-modal {
    animation: fadeIn 0.2s ease-out;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

#image-zoom-modal img {
    animation: zoomIn 0.3s ease-out;
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
}

#image-zoom-modal .max-w-4xl {
    max-width: 1400px;
}

/* Botón de cerrar modal */
#image-zoom-modal button,
#product-modal button {
    transition: all 0.3s ease;
    z-index: 10;
}

#image-zoom-modal button:hover,
#product-modal button:hover {
    transform: scale(1.2);
    opacity: 1;
}

/* ────────────────────────────────────────────────────────────
   10. NAVEGACIÓN Y HEADER
   ──────────────────────────────────────────────────────────── */

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: #facc15;
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

/* Menú móvil */
#mobile-menu {
    transition: all 0.3s ease;
}

/* ────────────────────────────────────────────────────────────
   11. BOTÓN FLOTANTE WHATSAPP
   ──────────────────────────────────────────────────────────── */

.whatsapp-float {
    transition: all 0.3s ease;
}

.whatsapp-float:hover {
    transform: scale(1.1);
}

.whatsapp-float .fa-whatsapp {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

/* Tooltip del botón WhatsApp */
.whatsapp-float + span {
    transition: all 0.3s ease;
}

/* ────────────────────────────────────────────────────────────
   12. TARJETAS DE SERVICIOS
   ──────────────────────────────────────────────────────────── */

.group:hover .group-hover\:scale-110 {
    transform: scale(1.1);
}

.group:hover .group-hover\:from-brand-yellow {
    background-image: linear-gradient(to bottom right, #facc15, #fbbf24);
}

/* ────────────────────────────────────────────────────────────
   13. FORMULARIOS
   ──────────────────────────────────────────────────────────── */

input:focus, textarea:focus, select:focus {
    border-color: #1e3a8a;
    box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.1);
}

/* Validación de formularios */
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;
}

/* ────────────────────────────────────────────────────────────
   14. TABLAS (ADMIN)
   ──────────────────────────────────────────────────────────── */

table {
    border-collapse: collapse;
}

table th,
table td {
    vertical-align: middle;
}

table tr:hover {
    background-color: #f9fafb;
}

/* ────────────────────────────────────────────────────────────
   15. BADGES Y ETIQUETAS
   ──────────────────────────────────────────────────────────── */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 9999px;
    transition: all 0.3s ease;
}

.badge-yellow {
    background-color: #facc15;
    color: #1e3a8a;
}

.badge-blue {
    background-color: #1e3a8a;
    color: #ffffff;
}

.badge-green {
    background-color: #10b981;
    color: #ffffff;
}

/* ────────────────────────────────────────────────────────────
   16. LOADING SPINNER
   ──────────────────────────────────────────────────────────── */

.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #1e3a8a;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ────────────────────────────────────────────────────────────
   17. UTILIDADES GENERALES
   ──────────────────────────────────────────────────────────── */

.text-shadow {
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.shadow-glow {
    box-shadow: 0 0 20px rgba(250, 204, 21, 0.3);
}

.gradient-text {
    background: linear-gradient(90deg, #ffffff 0%, #facc15 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ────────────────────────────────────────────────────────────
   18. MEDIA QUERIES ADICIONALES
   ──────────────────────────────────────────────────────────── */

/* Tablets */
@media (min-width: 768px) and (max-width: 1024px) {
    .product-card {
        max-width: 100%;
    }
}

/* Móviles pequeños */
@media (max-width: 475px) {
    .product-card {
        margin-bottom: 1rem;
    }
    
    #product-modal .p-6 {
        padding: 1rem;
    }
    
    #modal-product-price {
        font-size: 1.5rem;
    }
}

/* Pantallas muy grandes */
@media (min-width: 1536px) {
    .container {
        max-width: 1400px;
    }
}

/* ────────────────────────────────────────────────────────────
   19. REDUCCIÓN DE MOVIMIENTO (ACCESIBILIDAD)
   ──────────────────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ────────────────────────────────────────────────────────────
   20. MODO OSCURO (PREPARACIÓN FUTURA)
   ──────────────────────────────────────────────────────────── */

@media (prefers-color-scheme: dark) {
    /* Aquí puedes agregar estilos para modo oscuro en el futuro */
    /* Ejemplo:
    body {
        background-color: #0f172a;
        color: #f8fafc;
    }
    */
}

/* ════════════════════════════════════════════════════════════
   FIN DE ESTILOS PERSONALIZADOS
   ════════════════════════════════════════════════════════════ */