/*
 * Benitobag Accessibility Enhancements
 * WCAG 2.1 AA Compliance CSS
 * 
 * This file contains all accessibility improvements while maintaining
 * the luxury brand aesthetic of Benitobag.
 */

/* ===========================================
   1. SKIP NAVIGATION
   =========================================== */

.skip-navigation {
  position: relative;
  z-index: 10000;
}

.skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  background: #c9ab81;
  color: #0b1315;
  padding: 12px 20px;
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
  font-family: "Open Sans Condensed", sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border-radius: 0 0 8px 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
  z-index: 10001;
  transition: top 0.3s ease, box-shadow 0.3s ease;
  border: 2px solid #0b1315;
}

.skip-link:focus {
  top: 0;
  outline: none;
  box-shadow: 
    0 6px 16px rgba(0,0,0,0.6),
    0 0 0 4px #0b1315,
    0 0 0 6px #c9ab81;
}

.skip-link:hover {
  background: #e2ab5d;
  color: #0b1315;
}

/* ===========================================
   2. FOCUS INDICATORS
   =========================================== */

/* Global Focus Reset */
*:focus {
  outline: none;
}

/* Primary Focus Style for Interactive Elements */
.focus-primary,
button:focus,
input:focus,
select:focus,
textarea:focus,
[tabindex]:focus,
[role="button"]:focus {
  /* outline: 1px solid #c9ab81; */
  /* outline-offset: 2px; */
  box-shadow: 0 0 0 1px #0b1315, 0 0 0 px #c9ab81;
 /*  border-radius: 2px; */
  transition: all 0.2s ease-in-out;
}

/* Enhanced Focus for Critical Elements */
.focus-critical,
.btn_benito_close:focus,
.btn_benito_close2:focus,
.modal-close:focus {
  outline: 1px solid #c9ab81 !important;
  /* outline-offset: 3px; */
  box-shadow: 
    0 0 0 1px #0b1315,
    0 0 0 6px #c9ab81,
    0 0 12px rgba(244, 208, 63, 0.4) !important;
}

/* Link Focus States */
a:focus {
  /* outline: 1px solid #c9ab81; */
 /*  outline-offset: 2px; */
 /*  background-color: rgba(244, 208, 63, 0.15); */
  border-radius: 3px;
 /*  text-decoration: underline; */
  text-decoration-color: #c9ab81;
 /*  text-underline-offset: 3px; */
}

/* Navigation Link Focus */
.nav_side_box a:focus,
.nav_sub_side_box a:focus {
 /*  background-color: rgba(244, 208, 63, 0.2);
  padding-left: 15px;
  margin-left: -10px;
  margin-right: -10px;*/
  border-radius: 4px; 
}

/* Button Focus States */
.benito_btn_outline:focus {
  outline: 1px solid #c9ab81 !important;
 /*  outline-offset: 2px; */
  box-shadow: 
    6px 6px 10px rgba(0, 0, 0, 0.7),
    0 0 0 1px #0b1315,
    0 0 0 4px #c9ab81 !important;
  background-color: rgba(244, 208, 63, 0.1);
}

/* Search Input Focus */
.search_input:focus {
  border-color: #c9ab81 !important;
  box-shadow: 
    0 0 0 1px #0b1315,
    0 0 0 3px #c9ab81,
    0 0 8px rgba(244, 208, 63, 0.3) !important;
  background-color: #243039;
}

/* Search Button Focus */
.search_btn:focus {
  outline: 1px solid #c9ab81 !important;
  outline-offset: 2px;
  background-color: rgba(244, 208, 63, 0.2);
  border-radius: 4px;
}

/* ===========================================
   3. ENHANCED COLOR CONTRAST
   =========================================== */

/* Enhanced Text Colors for Better Contrast */
.text-enhanced {
  color: #ffffff; /* 15.8:1 contrast ratio */
}

.text-brand-enhanced {
  color: #c9ab81; /* 8.1:1 contrast ratio */
}

.text-muted-enhanced {
  color: #d1d5db; /* 6.2:1 contrast ratio */
}

/* Error States */
.text-error {
  color: #ff6b6b; /* 5.2:1 contrast ratio */
}

.border-error {
  border-color: #ff6b6b !important;
}

.bg-error {
  background-color: rgba(255, 107, 107, 0.1);
}

/* Success States */
.text-success {
  color: #51cf66; /* 5.8:1 contrast ratio */
}

.border-success {
  border-color: #51cf66 !important;
}

.bg-success {
  background-color: rgba(81, 207, 102, 0.1);
}

/* Warning States */
.text-warning {
  color: #ffd43b; /* 7.1:1 contrast ratio */
}

.border-warning {
  border-color: #ffd43b !important;
}

.bg-warning {
  background-color: rgba(255, 212, 59, 0.1);
}

/* ===========================================
   4. TOUCH TARGET OPTIMIZATION
   =========================================== */

/* Mobile Touch Targets (44px minimum) */
@media screen and (max-width: 850px) {
  
  /* Navigation Items */
  .nav_side_box > li > a,
  .nav_sub_side_box > li > a {
    min-height: 48px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    margin: 2px 0;
    touch-action: manipulation;
  }
  
  /* Buttons */
  .benito_btn_outline,
  .btn_benito_close,
  .btn_benito_close2 {
    /* min-height: 48px; */
    min-width: 80px;
    width: 33%;
    padding: 4px 20px;
    touch-action: manipulation;
  }
  
  /* Search Elements */
  .search_input {
    min-height: 48px;
    font-size: 16px; /* Prevents zoom on iOS */
    padding: 12px 50px 12px 15px;
  }
  
  .search_btn {
    min-height: 48px;
    min-width: 48px;
    padding: 12px;
  }
  
  /* Social Media Icons */
  .side_social_face,
  .side_social_insta {
    width: 48px;
    height: 48px;
    padding: 4px;
  }
  
  /* Modal Close Buttons */
  .modal_header .close {
    min-height: 48px;
    min-width: 48px;
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  /* Back to Top Button */
  .back_to_top {
    width: 64px;
    height: 64px;
    right: 20px;
    bottom: 20px;
  }
}

/* Touch Spacing */
.touch-spacing {
  margin: 8px 4px;
}

.touch-spacing-large {
  margin: 12px 8px;
}

/* ===========================================
   5. FORM ACCESSIBILITY ENHANCEMENTS
   =========================================== */

/* Form Container */
.form-accessible {
  max-width: 600px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

/* Form Groups */
.form-group {
  margin-bottom: 1.5rem;
  position: relative;
}

/* Labels */
.form-label {
  display: block;
  font-size: 1.125rem;
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 0.5rem;
  font-family: "Open Sans Condensed", sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* Required Field Indicators */
.form-label.required::after {
  content: " *";
  color: #ff6b6b;
  font-weight: bold;
  font-size: 1.2em;
}

/* Input Styling */
.form-input {
  width: 100%;
  min-height: 48px;
  padding: 12px 16px;
  font-size: 16px; /* Prevents zoom on mobile */
  line-height: 1.4;
  color: #ffffff;
  background-color: #1a2830;
  border: 2px solid #c9ab81;
  border-radius: 4px;
  font-family: "Josefin Sans", sans-serif;
  transition: all 0.3s ease;
  box-sizing: border-box;
}

.form-input::placeholder {
  color: #9ca3af;
  font-style: italic;
}

/* Input Focus States */
.form-input:focus {
  border-color: #c9ab81 !important;
  outline: none;
  box-shadow: 
    0 0 0 1px #0b1315,
    0 0 0 3px #c9ab81,
    inset 0 1px 3px rgba(0,0,0,0.1);
  background-color: #243039;
}

/* Error States */
.form-input.error {
  border-color: #ff6b6b !important;
  background-color: rgba(255, 107, 107, 0.1);
  box-shadow: 0 0 0 2px rgba(255, 107, 107, 0.2);
}

/* Success States */
.form-input.success {
  border-color: #51cf66 !important;
  background-color: rgba(81, 207, 102, 0.1);
  box-shadow: 0 0 0 2px rgba(81, 207, 102, 0.2);
}

/* Textarea Specific */
textarea.form-input {
  min-height: 120px;
  resize: vertical;
}

/* Error Messages */
.error-message {
  display: flex;
  align-items: flex-start;
  color: #ff6b6b;
  font-size: 0.95rem;
  margin-top: 0.5rem;
  font-weight: 500;
}

.error-message::before {
  content: "⚠️";
  margin-right: 0.5rem;
  font-size: 1rem;
  flex-shrink: 0;
  margin-top: 1px;
}

/* Success Messages */
.success-message {
  display: flex;
  align-items: flex-start;
  color: #51cf66;
  font-size: 0.95rem;
  margin-top: 0.5rem;
  font-weight: 500;
}

.success-message::before {
  content: "✓";
  margin-right: 0.5rem;
  font-size: 1.1rem;
  flex-shrink: 0;
  margin-top: 1px;
}

/* Help Text */
.form-help {
  font-size: 0.9rem;
  color: #d1d5db;
  margin-top: 0.25rem;
  line-height: 1.4;
}

/* ===========================================
   6. BREADCRUMB NAVIGATION
   =========================================== */

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  padding: 1rem 0;
  margin-bottom: 1rem;
  font-size: 0.95rem;
  font-family: "Open Sans Condensed", sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.breadcrumb-item {
  display: flex;
  align-items: center;
  color: #d1d5db;
}

.breadcrumb-item + .breadcrumb-item::before {
  content: "›";
  padding: 0 0.75rem;
  color: #c9ab81;
  font-size: 1.2em;
}

.breadcrumb-item a {
  color: #ffffff;
  text-decoration: none;
  transition: all 0.3s ease;
  padding: 4px 8px;
  border-radius: 3px;
}

.breadcrumb-item a:hover {
  color: #c9ab81;
  background-color: rgba(244, 208, 63, 0.1);
  text-decoration: underline;
  text-decoration-color: #c9ab81;
}

.breadcrumb-item a:focus {
  outline: 2px solid #c9ab81;
  outline-offset: 2px;
  background-color: rgba(244, 208, 63, 0.2);
}

.breadcrumb-item.active {
  color: #c9ab81;
  font-weight: 600;
}

/* ===========================================
   7. CURRENT PAGE INDICATORS
   =========================================== */

/* Navigation Current Page */
.nav-item.current,
.nav-item[aria-current="page"] {
  position: relative;
  color: #c9ab81 !important;
  font-weight: 600;
  background-color: rgba(244, 208, 63, 0.1);
  border-radius: 4px;
  margin: 2px 0;
}

.nav-item.current::before,
.nav-item[aria-current="page"]::before {
  content: "";
  position: absolute;
  left: -5px;
  top: 50%;
  width: 4px;
  height: 60%;
  background-color: #c9ab81;
  transform: translateY(-50%);
  border-radius: 0 2px 2px 0;
}

/* ===========================================
   8. SCREEN READER SUPPORT
   =========================================== */

/* 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;
}

/* Show on focus for screen readers */
.sr-only:focus {
  position: static;
  width: auto;
  height: auto;
  padding: 0.5rem 1rem;
  margin: 0.5rem;
  overflow: visible;
  clip: auto;
  white-space: normal;
  background-color: #c9ab81;
  color: #0b1315;
  border: 2px solid #0b1315;
  border-radius: 4px;
  font-weight: 600;
  text-align: center;
  z-index: 9999;
}

/* ===========================================
   9. LOADING AND STATE INDICATORS
   =========================================== */

/* Loading State for Buttons */
.btn-loading {
  position: relative;
  color: transparent !important;
  pointer-events: none;
}

.btn-loading::after {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  top: 50%;
  left: 50%;
  margin-left: -10px;
  margin-top: -10px;
  border: 2px solid;
  border-radius: 50%;
  border-color: transparent;
  border-top-color: currentColor;
  animation: btn-loading-spin 1s linear infinite;
}

.benito_btn_outline.btn-loading::after {
  border-top-color: #c9ab81;
}

@keyframes btn-loading-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* ===========================================
   10. MODAL ACCESSIBILITY ENHANCEMENTS
   =========================================== */

/* Modal Focus Management */
.modal[aria-hidden="false"] {
  display: block !important;
}

.modal[aria-hidden="true"] {
  display: none !important;
}

/* Modal Close Button Enhancement */
.modal-close-enhanced {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: 2px solid #c9ab81;
  color: #c9ab81;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 1;
}

.modal-close-enhanced:hover {
  background-color: #c9ab81;
  color: #0b1315;
  border-color: #c9ab81;
}

.modal-close-enhanced:focus {
  outline: 3px solid #c9ab81;
  outline-offset: 2px;
  background-color: rgba(244, 208, 63, 0.1);
  border-color: #c9ab81;
  color: #c9ab81;
}

/* ===========================================
   11. MOTION PREFERENCES
   =========================================== */

/* Reduced Motion Support */
@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;
  }
  
  /* Disable slider animations */
  .slider li {
    animation: none !important;
  }
  
  /* Disable hover animations */
  .benito_btn_outline:before,
  .benito_btn_outline:after,
  .side_hover:before,
  .side_hover:after {
    transition: none !important;
  }
}

/* ===========================================
   12. HIGH CONTRAST MODE SUPPORT
   =========================================== */

@media (prefers-contrast: high) {
  
  /* Increase border widths */
  .form-input,
  .benito_btn_outline,
  .modal_content {
    border-width: 3px;
  }
  
  /* Enhance focus indicators */
  *:focus {
    outline-width: 4px !important;
    outline-offset: 3px !important;
  }
  
  /* Increase text contrast */
  body,
  .text-enhanced {
    color: #ffffff;
  }
  
  .text-brand-enhanced,
  .modal_title,
  h1, h2, h3 {
    color: #ffff00; /* Maximum contrast yellow */
  }
}

/* ===========================================
   13. PRINT ACCESSIBILITY
   =========================================== */

@media print {
  
  /* Hide interactive elements in print */
  .skip-navigation,
  .search_container,
  .back_to_top,
  .side_social,
  .benito_btn_outline {
    display: none !important;
  }
  
  /* Ensure readable text in print */
  body,
  * {
    color: #000000 !important;
    background: #ffffff !important;
  }
  
  /* Show URLs for links */
  a:after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
    color: #666666;
  }
  
  /* Ensure proper spacing */
  .modal_content,
  .content {
    border: 1px solid #000000 !important;
    box-shadow: none !important;
  }
}

/* ===========================================
   14. UTILITY CLASSES
   =========================================== */

/* Focus Management */
.focus-trap-start,
.focus-trap-end {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* Accessible Hide/Show */
.a11y-hidden {
  position: absolute !important;
  clip: rect(1px, 1px, 1px, 1px);
  padding: 0 !important;
  border: 0 !important;
  height: 1px !important;
  width: 1px !important;
  overflow: hidden;
}

.a11y-visible {
  position: static !important;
  clip: auto;
  padding: inherit !important;
  border: inherit !important;
  height: auto !important;
  width: auto !important;
  overflow: visible;
}

/* Skip to main content target */
#main-content:target {
  outline: 3px solid #c9ab81;
  outline-offset: 4px;
}

/* Live Region for Dynamic Content */
.live-region {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.live-region.show {
  position: static;
  left: auto;
  width: auto;
  height: auto;
  overflow: visible;
  padding: 1rem;
  background-color: #0f1d22;
  border: 2px solid #c9ab81;
  border-radius: 4px;
  margin: 1rem 0;
}

/* ===========================================
   15. RESPONSIVE ACCESSIBILITY ENHANCEMENTS
   =========================================== */

/* Large Screens - Enhanced Spacing */
@media screen and (min-width: 1200px) {
  .nav_side_box > li > a {
    padding: 8px 0;
    margin: 3px 0;
  }
  
  .form-group {
    margin-bottom: 2rem;
  }
  
  .breadcrumb {
    padding: 1.5rem 0;
  }
}

/* Small Screens - Optimized Touch */
@media screen and (max-width: 480px) {
  .skip-link {
    left: 8px;
    right: 8px;
    width: auto;
    text-align: center;
  }
  
  .form-accessible {
    padding: 1rem 0.5rem;
  }
  
  .modal_content {
    margin: 0.5rem;
    max-height: 95vh;
  }
  
  .breadcrumb {
    font-size: 0.85rem;
    padding: 0.5rem 0;
  }
  
  .breadcrumb-item + .breadcrumb-item::before {
    padding: 0 0.5rem;
  }
}

/* ===========================================
   END OF ACCESSIBILITY ENHANCEMENTS
   =========================================== */