/* ==========================================
   Mejoras de Accesibilidad Web
   Contraste, Enlaces y Elementos Interactivos
   ========================================== */

/* Enlaces con mejor contraste y distinción visual más allá del color */
a {
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
    transition: all 0.3s ease;
}

a:hover, a:focus {
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

/* Enlaces en navegación principal - distinción más allá del color */
.site-navigation a {
    font-weight: 500;
    border-bottom: 2px solid transparent;
    text-decoration: none;
    transition: border-bottom 0.3s ease;
}

.site-navigation a:hover,
.site-navigation a:focus {
    border-bottom: 2px solid currentColor;
    outline: none;
}

.site-navigation .active a {
    border-bottom: 2px solid currentColor;
    font-weight: 700;
}

/* Mejorar contraste de botones - ratio mínimo 4.5:1 */
.btn-primary {
    background-color: #0056b3 !important;
    border-color: #004085 !important;
    font-weight: 600;
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: #004085 !important;
    border-color: #003366 !important;
    box-shadow: 0 0 0 3px rgba(0, 86, 179, 0.3) !important;
}

/* Enlaces de categorías de productos con mejor contraste */
.product-category {
    font-weight: 700;
    text-decoration: none;
    border: 3px solid transparent;
    display: inline-block;
    padding: 0.5rem 1rem;
    transition: all 0.3s ease;
    position: relative;
}

.product-category::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: currentColor;
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.product-category:hover::after,
.product-category:focus::after {
    transform: scaleX(1);
}

.product-category:hover,
.product-category:focus {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

/* Mejorar foco visible en todos los elementos interactivos */
*:focus {
    outline: 2px solid #0056b3;
    outline-offset: 2px;
}

button:focus,
a:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 3px solid #0056b3;
    outline-offset: 2px;
}

/* Mejorar contraste en formularios */
.form-control {
    border: 2px solid #495057;
}

.form-control:focus {
    border-color: #004085;
    box-shadow: 0 0 0 3px rgba(0, 86, 179, 0.25);
    outline: none;
}

/* Botones de cookies con mejor contraste y distinción */
.btn-cookies {
    font-weight: 600;
    border: 2px solid #333;
    transition: all 0.3s ease;
    text-decoration: underline;
    text-decoration-thickness: 1px;
}

.btn-cookies:hover,
.btn-cookies:focus {
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    outline: 2px solid #0056b3;
    outline-offset: 2px;
    text-decoration-thickness: 2px;
}

/* Mejorar visibilidad de checkboxes y radios */
.custom-control-input:focus ~ .custom-control-label::before {
    border-color: #004085;
    box-shadow: 0 0 0 3px rgba(0, 86, 179, 0.25);
}

.custom-control-label::before {
    border: 2px solid #495057;
}

/* Footer links con mejor contraste */
footer a {
    color: #0056b3;
    font-weight: 500;
    text-decoration: underline;
}

footer a:hover,
footer a:focus {
    color: #003366;
    text-decoration-thickness: 2px;
}

/* Mejorar contraste de texto en general */
body {
    color: #212529;
}

.text-muted {
    color: #495057 !important;
}

/* Indicadores de carrusel con mejor contraste */
.carousel-indicators li {
    background-color: #666;
    border: 2px solid #333;
}

.carousel-indicators .active {
    background-color: #0056b3;
    border: 2px solid #004085;
}

/* Controles de carrusel con mejor visibilidad */
.carousel-control-prev-icon,
.carousel-control-next-icon {
    filter: drop-shadow(0 0 3px #000);
}

/* Mejorar contraste de badges */
.badge {
    font-weight: 700;
    padding: 0.5em 0.75em;
    border: 1px solid rgba(0, 0, 0, 0.3);
}

/* Skip link para navegación por teclado */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: #0056b3;
    color: white;
    padding: 8px;
    text-decoration: none;
    font-weight: bold;
    z-index: 10000;
}

.skip-link:focus {
    top: 0;
    outline: 3px solid #fff;
    outline-offset: 2px;
}

/* Mejorar contraste de tablas */
table {
    border: 2px solid #495057;
}

th {
    background-color: #343a40;
    color: #fff;
    font-weight: 700;
    border: 1px solid #495057;
}

td {
    border: 1px solid #dee2e6;
}

/* Estados hover y focus consistentes */
a:hover,
button:hover,
.btn:hover {
    text-decoration-thickness: 2px;
    transform: translateY(-1px);
    transition: all 0.2s ease;
}

/* Mejorar contraste de iconos */
.fa, .fas, .far, .fal, .fab {
    color: inherit;
    text-shadow: 0 0 1px rgba(0, 0, 0, 0.3);
}

/* Asegurar que el contraste del logo sea bueno */
.site-logo a {
    font-weight: 700;
    text-decoration: none;
    border-bottom: 3px solid transparent;
}

.site-logo a:hover,
.site-logo a:focus {
    border-bottom: 3px solid currentColor;
}
/* ==========================================
   CORRECCIÓN DE CONTRASTE - Elementos problemáticos
   ========================================== */

/* .text-primary con mejor contraste (WCAG AA 4.5:1 mínimo) */
.text-primary,
a.text-primary {
    color: #004085 !important; /* Azul oscuro con contraste 7:1 sobre blanco */
}

.text-primary:hover,
a.text-primary:hover,
.text-primary:focus,
a.text-primary:focus {
    color: #002752 !important; /* Azul más oscuro para hover */
    text-decoration: underline;
    text-decoration-thickness: 2px;
}

/* Navbar con mejor contraste de texto */
.site-navbar.bg-white {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.site-navbar a {
    color: #212529 !important; /* Texto negro con alto contraste 16:1 */
    font-weight: 500;
}

.site-navbar a:hover,
.site-navbar a:focus {
    color: #000 !important;
}

/* Títulos y spans con .text-primary - mejor contraste */
span.text-primary.h6,
span.text-primary,
h6.text-primary,
.h6.text-primary {
    color: #003d7a !important; /* Azul oscuro AA compliant (contraste 8:1) */
    font-weight: 700;
}

/* Enlaces genéricos con mejor contraste */
a:not(.btn):not(.carousel-control-prev):not(.carousel-control-next) {
    color: #0056b3; /* Color con ratio 4.5:1 mínimo */
}

a:not(.btn):hover,
a:not(.btn):focus {
    color: #003d7a; /* Más oscuro en hover (contraste 8:1) */
}

/* Carousel items - asegurar que tengan contenido accesible */
.carousel-item {
    min-height: 200px;
    position: relative;
}

.carousel-item:empty::after {
    content: attr(aria-label);
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* Mejorar contraste de elementos con baja visibilidad */
.text-uppercase {
    font-weight: 700;
    letter-spacing: 0.05em;
}

/* Asegurar contraste en fondos blancos */
.bg-white a,
.bg-white .text-primary {
    color: #003d7a !important;
}