/* Accessibility Styles */

/* Focus styles for keyboard navigation */
*:focus {
    outline: 2px solid var(--primary-red);
    outline-offset: 2px;
}

/* Skip to main content link (for screen readers) */
.skip-to-main {
    position: absolute;
    top: -40px;
    left: 6px;
    background: var(--primary-red);
    color: var(--white);
    padding: 8px;
    text-decoration: none;
    border-radius: 4px;
    z-index: 9999;
    transition: top 0.3s ease;
}

.skip-to-main:focus {
    top: 6px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --primary-red: #cc0000;
        --dark-red: #990000;
        --text-dark: #000000;
        --text-gray: #333333;
        --border-gray: #666666;
    }
}

/* Reduced motion for users who prefer it */
@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;
    }
}

/* Enhanced focus for interactive elements */
button:focus,
a:focus,
input:focus,
textarea:focus,
select:focus {
    outline: 2px solid var(--primary-red);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(197, 48, 48, 0.1);
}

/* Remove outline for mouse users, keep for keyboard users */
button:focus:not(:focus-visible),
a:focus:not(:focus-visible) {
    outline: none;
    box-shadow: none;
}

/* Ensure sufficient color contrast for links */
a {
    color: var(--primary-red);
    text-decoration: underline;
}

a:hover,
a:focus {
    color: var(--dark-red);
    text-decoration: underline;
}

/* Make sure interactive elements are large enough */
button,
a,
input,
textarea,
select {
    min-height: 44px;
    min-width: 44px;
}

/* Style for screen reader only content */
.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;
}

/* Make sure form labels are properly associated */
label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
}

/* Error states for form validation */
input:invalid,
textarea:invalid,
select:invalid {
    border-color: #dc3545;
    box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.1);
}

.error-message {
    color: #dc3545;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: block;
}

/* Success states */
input:valid,
textarea:valid,
select:valid {
    border-color: #28a745;
}

/* Improve table accessibility */
table {
    border-collapse: collapse;
    width: 100%;
}

th {
    text-align: left;
    background-color: var(--light-gray);
    font-weight: 600;
}

th,
td {
    padding: 0.75rem;
    border: 1px solid var(--border-gray);
}

/* Ensure adequate spacing for touch targets */
.nav-menu a,
.cta-button,
.whatsapp-float {
    padding: 0.75rem 1rem;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Print styles for accessibility */
@media print {
    .whatsapp-float,
    .menu-toggle,
    .top-bar {
        display: none !important;
    }
    
    a::after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
        color: #666;
    }
    
    .card {
        break-inside: avoid;
        page-break-inside: avoid;
    }
}