/**
 * Accessibility Enhancements - Mat Zona Tecnológica
 * 
 * Mejoras de accesibilidad para cumplir WCAG 2.1 AA
 * Objetivo: Subir score de 89/91 a +95
 */

/* ============================================================================
   1. SKIP LINK MEJORADO
   ============================================================================ */
.skip-link {
    position: absolute;
    top: -100%;
    left: 50%;
    transform: translateX(-50%);
    background: #13ADED;
    color: #fff;
    padding: 12px 24px;
    z-index: 10000;
    text-decoration: none;
    font-weight: 600;
    border-radius: 0 0 8px 8px;
    transition: top 0.3s;
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    min-height: 44px;
    min-width: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.skip-link:focus {
    top: 0;
    outline: 3px solid #FFD700;
    outline-offset: 2px;
    border-radius: 0 0 8px 8px;
}

/* ============================================================================
   2. FOCUS VISIBLE - Indicadores de foco claros
   ============================================================================ */
*:focus-visible {
    outline: 3px solid #13ADED;
    outline-offset: 2px;
    border-radius: 4px;
}

/* Links */
a:focus-visible {
    outline: 3px solid #13ADED;
    outline-offset: 2px;
    border-radius: 4px;
    box-shadow: 0 0 0 6px rgba(19, 173, 237, 0.2);
}

/* Botones */
button:focus-visible,
.btn:focus-visible,
.button:focus-visible {
    outline: 3px solid #13ADED;
    outline-offset: 2px;
    border-radius: 4px;
    box-shadow: 0 0 0 6px rgba(19, 173, 237, 0.3);
}

/* Inputs y selects */
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: 3px solid #13ADED;
    outline-offset: 0;
    border-color: #13ADED;
    box-shadow: 0 0 0 3px rgba(19, 173, 237, 0.2);
}

/* Links del menú */
.main-navigation a:focus-visible {
    outline: 3px solid #13ADED;
    outline-offset: 2px;
    background: rgba(19, 173, 237, 0.1);
}

/* ============================================================================
   3. CONTRASTE DE COLORES
   ============================================================================ */

/* Botones principales - Asegurar contraste 4.5:1 mínimo */
.btn-primary,
.btn-secondary,
.header-reserva-btn {
    min-height: 44px;
    min-width: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

/* Hover states con suficiente contraste */
.btn-primary:hover,
.btn-secondary:hover,
.header-reserva-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Textos secundarios con buen contraste */
.product-short-desc,
.entry-summary,
.sf-description {
    color: #475569; /* Contraste 4.6:1 sobre blanco */
}

/* ============================================================================
   4. TOUCH TARGETS - Mínimo 44x44px
   ============================================================================ */
@media (max-width: 768px) {
    /* Botones de menú móvil */
    .main-navigation a,
    .main-navigation button {
        min-height: 44px;
        padding: 14px 16px;
    }
    
    /* Iconos de acción */
    .header-actions button,
    .header-actions a {
        min-width: 44px;
        min-height: 44px;
        padding: 10px;
    }
    
    /* Botones de producto */
    .btn-add-cart,
    .btn-buy-now {
        min-height: 44px;
        padding: 14px 20px;
    }
    
    /* Links de navegación */
    .sf-links a,
    .sf-contact-list a {
        min-height: 44px;
        padding: 12px 0;
    }
}

/* ============================================================================
   5. REDUCED MOTION
   ============================================================================ */
@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;
    }
    
    .hero-3d-shape,
    .orb {
        animation: none !important;
    }
}

/* ============================================================================
   6. ALTO CONTRASTE
   ============================================================================ */
@media (prefers-contrast: high) {
    .btn-primary,
    .btn-secondary {
        border: 2px solid currentColor;
    }
    
    a {
        text-decoration: underline;
    }
    
    .skip-link {
        border: 2px solid #fff;
    }
}

/* ============================================================================
   7. FORMULARIOS ACCESIBLES
   ============================================================================ */
.form-row label {
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 8px;
    display: block;
}

.required {
    color: #dc2626;
    margin-left: 4px;
    font-weight: 700;
}

/* Mensajes de error accesibles */
.woocommerce-invalid fieldset {
    border-color: #dc2626;
}

.woocommerce-invalid fieldset *:focus {
    border-color: #dc2626;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.2);
}

.woocommerce-error,
.woocommerce-message {
    padding: 16px;
    border-radius: 8px;
    font-weight: 500;
}

/* ============================================================================
   8. IMÁGENES DECORATIVAS
   ============================================================================ */
img[alt=""],
img[aria-hidden="true"] {
    pointer-events: none;
}

/* ============================================================================
   9. MENÚ MÓVIL - Focus Trap
   ============================================================================ */
.main-navigation.active {
    tab-index: -1;
}

.main-navigation.active:focus-within {
    outline: 3px solid #13ADED;
    outline-offset: -3px;
}

/* ============================================================================
   10. BREADCRUMBS ACCESIBLES
   ============================================================================ */
.woocommerce-breadcrumb {
    font-size: 14px;
    color: #64748b;
    margin-bottom: 20px;
}

.woocommerce-breadcrumb a {
    color: #13ADED;
    text-decoration: underline;
}

.woocommerce-breadcrumb a:hover {
    color: #0B5CAF;
}

.woocommerce-breadcrumb .breadcrumb-separator {
    margin: 0 8px;
    color: #94a3b8;
}

/* ============================================================================
   11. PRODUCT SCHEMA VISUAL
   ============================================================================ */
.product-schema-wrapper {
    position: relative;
}

.product-schema-wrapper [itemprop="name"] {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
}

.product-schema-wrapper [itemprop="price"] {
    font-size: 18px;
    font-weight: 700;
    color: #13ADED;
}

/* ============================================================================
   12. ACCESSIBILITY UTILITIES
   ============================================================================ */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.sr-only-focusable:focus {
    position: static;
    width: auto;
    height: auto;
    padding: inherit;
    margin: inherit;
    overflow: visible;
    clip: auto;
    white-space: normal;
}

/* ============================================================================
   13. MODALES ACCESIBLES
   ============================================================================ */
.modal[role="dialog"]:focus {
    outline: 3px solid #13ADED;
    outline-offset: 2px;
}

/* ============================================================================
   14. TABLAS ACCESIBLES
   ============================================================================ */
table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

th {
    font-weight: 600;
    color: #1e293b;
    background: #f8fafc;
}

/* ============================================================================
   15. RESPONSIVE ACCESIBILITY
   ============================================================================ */
@media (max-width: 480px) {
    .skip-link {
        font-size: 14px;
        padding: 10px 20px;
    }
    
    button, .button, .btn {
        font-size: 16px; /* Prevenir zoom en iOS */
    }
}
