/* 
* La Tienda de Don Goyo - Accessibility Styles
* Styles for improving accessibility
*/

/* Skip Link */
.skip-link {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--primary-color);
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1001;
    transform: translateY(100px);
    transition: transform 0.3s ease, background-color 0.3s ease;
    text-decoration: none;
    font-size: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    opacity: 0.8;
}

.skip-link::before {
    content: '\f077'; /* Font Awesome arrow up icon */
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    font-size: 20px;
}

.skip-link:hover {
    background-color: var(--accent-color);
    opacity: 1;
}

.skip-link:focus {
    transform: translateY(0);
    outline: none;
    background-color: var(--accent-color);
    opacity: 1;
}

/* Focus styles - enhanced for better visibility */
a:focus,
button:focus,
input:focus,
select:focus,
textarea:focus,
[tabindex]:focus {
    outline: 3px solid var(--accent-color);
    outline-offset: 3px;
    box-shadow: 0 0 0 3px rgba(255, 152, 0, 0.3);
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 2px;
}

/* Different focus styles for different elements */
a:focus {
    border-radius: 2px;
}

button:focus,
.btn-primary:focus,
.btn-secondary:focus {
    outline-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(139, 90, 43, 0.4);
}

input:focus,
select:focus,
textarea:focus {
    outline-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.3);
}

/* Keyboard focus indicator */
.keyboard-focus-indicator {
    position: fixed;
    z-index: 9999;
    pointer-events: none;
    border-radius: 3px;
    transition: all 0.2s ease;
    box-shadow: 0 0 0 3px var(--accent-color), 0 0 0 6px rgba(255, 255, 255, 0.5);
    display: none;
}

/* Improved contrast for text */
.text-light {
    color: #444; /* Darker for better contrast */
}

/* High contrast mode support */
@media (prefers-contrast: more) {
    :root {
        --primary-color: #704010;
        --secondary-color: #2e8031;
        --accent-color: #d97b00;
        --dark-color: #000000;
        --light-color: #ffffff;
    }
    
    body {
        color: #000;
        background-color: #fff;
    }
    
    a {
        color: #0000EE;
        text-decoration: underline;
    }
    
    a:visited {
        color: #551A8B;
    }
    
    a:hover, a:focus {
        color: #000;
        background-color: #ff0;
        outline: 2px solid #000;
    }
    
    .btn-primary,
    .btn-secondary {
        border: 2px solid #000;
        color: #fff;
        background-color: #000;
        text-decoration: none;
    }
    
    .btn-primary:hover,
    .btn-secondary:hover,
    .btn-primary:focus,
    .btn-secondary:focus {
        background-color: #fff;
        color: #000;
        text-decoration: underline;
    }
    
    /* Increase contrast for all text */
    h1, h2, h3, h4, h5, h6, p, li, td, th, blockquote, figcaption {
        color: #000;
    }
    
    /* Add borders to elements that might be hard to distinguish */
    img, iframe, video {
        border: 1px solid #000;
    }
    
    /* Increase border contrast */
    input, select, textarea {
        border: 2px solid #000;
    }
}

/* Improved form field accessibility */
input[type="checkbox"],
input[type="radio"] {
    width: 18px;
    height: 18px;
}

/* Increased tap target sizes for mobile */
@media (max-width: 768px) {
    button, 
    .btn-primary,
    .btn-secondary,
    a.btn-primary,
    a.btn-secondary,
    input[type="submit"],
    input[type="button"],
    input[type="checkbox"],
    input[type="radio"],
    select,
    .nav-link,
    .menu-item a {
        min-height: 44px;
        min-width: 44px;
        padding: 12px;
        margin: 4px;
        line-height: 1;
    }
    
    .social-icon {
        min-width: 44px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Increase spacing between interactive elements */
    nav ul li {
        margin: 0 8px;
    }
    
    /* Ensure form fields are large enough */
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    input[type="password"],
    textarea,
    select {
        font-size: 16px; /* Prevents iOS zoom on focus */
        padding: 12px;
        margin-bottom: 16px;
    }
}

/* Reduced motion for animations */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.001s !important;
        transition-duration: 0.001s !important;
        scroll-behavior: auto !important;
    }
    
    .parallax-hero,
    .parallax-section {
        background-attachment: scroll !important;
    }
}

/* Screen reader only text */
.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;
}

/* ARIA attributes styling */
[aria-current="page"] {
    font-weight: bold;
    text-decoration: underline;
}

[aria-disabled="true"] {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Focus visible polyfill */
.js-focus-visible :focus:not(.focus-visible) {
    outline: none;
}

.js-focus-visible .focus-visible {
    outline: 3px solid var(--accent-color);
    outline-offset: 3px;
}
