/* ==============================================
   Accessibility & Cookie Consent Styles
   ============================================== */

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

/* Skip to content link */
.skip-to-content {
  position: fixed;
  top: -100%;
  right: 20px;
  background: var(--color-burgundy);
  color: #fff;
  padding: 12px 24px;
  border-radius: 0 0 var(--radius) var(--radius);
  font-weight: 600;
  font-size: 1rem;
  z-index: 10000;
  transition: top 0.3s ease;
  text-decoration: none;
}

.skip-to-content:focus {
  top: 0;
  outline: 3px solid var(--color-gold);
  outline-offset: 2px;
  color: #fff;
}

/* Keyboard focus ring — override outline:none in style.css */
*:focus-visible {
  outline: 3px solid var(--color-gold) !important;
  outline-offset: 2px !important;
}

/* ==============================================
   Accessibility Toggle Button
   ============================================== */
.a11y-toggle-btn {
  position: fixed;
  bottom: 20px;
  left: 20px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--color-burgundy);
  border: 2px solid var(--color-gold);
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  z-index: 9990;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s ease, background 0.2s ease;
  line-height: 1;
}

.a11y-toggle-btn:hover {
  transform: scale(1.1);
  background: var(--color-burgundy-dark);
}

/* ==============================================
   Accessibility Panel
   ============================================== */
.a11y-panel {
  position: fixed;
  bottom: 80px;
  left: 20px;
  width: 300px;
  max-height: 80vh;
  overflow-y: auto;
  background: var(--color-white);
  border: 2px solid var(--color-gold);
  border-radius: var(--radius);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  z-index: 9991;
  padding: 20px;
  display: none;
  direction: rtl;
}

.a11y-panel.open {
  display: block;
}

.a11y-panel h3 {
  font-size: 1.1rem;
  margin-bottom: 15px;
  color: var(--color-burgundy);
  text-align: center;
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 10px;
}

.a11y-option {
  margin-bottom: 10px;
}

.a11y-option label {
  font-size: 0.9rem;
  font-weight: 500;
  display: block;
  margin-bottom: 5px;
  color: var(--color-text);
}

.a11y-btn {
  display: block;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-bg);
  font-family: var(--font-main);
  font-size: 0.9rem;
  cursor: pointer;
  text-align: center;
  transition: background 0.2s ease, border-color 0.2s ease;
  color: var(--color-text);
}

.a11y-btn:hover {
  background: var(--color-border);
}

.a11y-btn.active {
  background: var(--color-burgundy);
  color: #fff;
  border-color: var(--color-burgundy);
}

.a11y-font-controls {
  display: flex;
  gap: 8px;
}

.a11y-font-controls .a11y-btn {
  flex: 1;
}

.a11y-reset {
  display: block;
  width: 100%;
  padding: 10px 12px;
  margin-top: 15px;
  border: 1px solid var(--color-burgundy);
  border-radius: var(--radius);
  background: transparent;
  font-family: var(--font-main);
  font-size: 0.9rem;
  cursor: pointer;
  text-align: center;
  color: var(--color-burgundy);
  font-weight: 600;
  transition: background 0.2s ease, color 0.2s ease;
}

.a11y-reset:hover {
  background: var(--color-burgundy);
  color: #fff;
}

/* ==============================================
   Body State Classes (applied by JS)
   ============================================== */

/* Font size adjustments */
html.a11y-font-1 {
  font-size: 18px;
}

html.a11y-font-2 {
  font-size: 20px;
}

html.a11y-font-3 {
  font-size: 22px;
}

/* High contrast */
body.a11y-high-contrast {
  background-color: #000 !important;
  color: #fff !important;
}

body.a11y-high-contrast * {
  border-color: #fff !important;
}

body.a11y-high-contrast a {
  color: #FFD700 !important;
}

body.a11y-high-contrast .site-header,
body.a11y-high-contrast .site-footer,
body.a11y-high-contrast .order-summary,
body.a11y-high-contrast .product-card,
body.a11y-high-contrast .contact-info-box {
  background-color: #1a1a1a !important;
  color: #fff !important;
}

body.a11y-high-contrast .btn {
  border-color: #FFD700 !important;
}

body.a11y-high-contrast .page-header {
  background: #1a1a1a !important;
}

/* Grayscale */
body.a11y-grayscale {
  filter: grayscale(100%);
}

/* Highlight links */
body.a11y-highlight-links a {
  text-decoration: underline !important;
  outline: 1px solid currentColor !important;
  outline-offset: 2px !important;
}

/* Stop animations */
body.a11y-stop-animations,
body.a11y-stop-animations * {
  animation-duration: 0s !important;
  animation-delay: 0s !important;
  transition-duration: 0s !important;
  transition-delay: 0s !important;
  scroll-behavior: auto !important;
}

/* ==============================================
   Cookie Consent Banner
   ============================================== */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #2D2D2D;
  color: #fff;
  padding: 15px 20px;
  z-index: 9995;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
  font-size: 0.9rem;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.3);
  direction: rtl;
}

.cookie-banner p {
  margin: 0;
  flex: 1;
  min-width: 200px;
}

.cookie-banner a {
  color: var(--color-gold);
  text-decoration: underline;
}

.cookie-banner-accept {
  background: var(--color-gold);
  color: #2D2D2D;
  border: none;
  padding: 8px 24px;
  border-radius: var(--radius);
  font-family: var(--font-main);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s ease;
}

.cookie-banner-accept:hover {
  background: var(--color-gold-dark);
}

/* Shift accessibility button up when cookie banner is showing */
body.cookie-banner-visible .a11y-toggle-btn {
  bottom: 80px;
}

/* ==============================================
   Mobile Responsive Adjustments
   ============================================== */
@media (max-width: 768px) {
  .a11y-panel {
    width: calc(100vw - 40px);
    left: 20px;
    right: 20px;
    bottom: 80px;
    max-height: 70vh;
  }

  .cookie-banner {
    flex-direction: column;
    text-align: center;
    gap: 10px;
    padding: 12px 15px;
  }

  .cookie-banner p {
    min-width: auto;
  }

  body.cookie-banner-visible .a11y-toggle-btn {
    bottom: 100px;
  }

  .skip-to-content {
    right: 10px;
    font-size: 0.9rem;
    padding: 10px 18px;
  }
}
