/**
* 2010-2026 ADPixNet | WebMastering
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop or ThirtyBees to newer
* versions in the future. If you wish to customize PrestaShop or ThirtyBees for your
* needs please refer to https://www.prestashop.com or https://www.thirtybees.com for more information.
*
*
* @Module		SGK Access WCAG
* @Description	WCAG 2.1 / RGAA 4.1 accessibility widget — Levels A, AA and AAA.
* @Version		1.2.0
* @Copyright	ADPixNet | WebMasterring <https://adpixnet.com/>
* @Addons		PrestaShop - ThirtyBees Developments <https://addons.adpixnet.com/>
* @support		Support Requests <https://admin.adpixnet.com/forms/ticket?styled=1&with_logo=1>
* @license		Valid for 1 website (or project) for each purchase of license International Registered 
*				Trademark & Property of ADPixNet. More information on <https://addons.adpixnet.com/content/1-politique-de-license>
*/

/* ============================================================
   CUSTOM PROPERTIES
   ============================================================ */
:root {
  --sgk-pri:    #1565c0;
  --sgk-sec:    #e3f2fd;
  --sgk-aux:    #f5f5f5;
  --sgk-txt:    #1a1a1a;
  --sgk-white:  #ffffff;
  --sgk-radius: 12px;
  --sgk-shadow: 0 4px 24px rgba(0,0,0,.18);
  --sgk-dur:    .18s;
  --sgk-z:      9000;
}

/* ============================================================
   SKIP LINK (WCAG 2.4.1 — Level A)
   ============================================================ */
.sgk-skip-link {
  position: absolute;
  top: -120px;
  left: 16px;
  z-index: calc(var(--sgk-z) + 200);
  background: var(--sgk-pri);
  color: #fff;
  padding: 10px 20px;
  border-radius: 0 0 8px 8px;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  transition: top var(--sgk-dur) ease;
  white-space: nowrap;
}
.sgk-skip-link:focus {
  top: 0;
  outline: 3px solid #fff;
  outline-offset: 3px;
}

/* ============================================================
   HIGH CONTRAST MODE (WCAG 1.4.3 AA / 1.4.6 AAA)
   ============================================================ */
html.sgk-hc,
html.sgk-hc body {
  background: #000 !important;
  color: #fff !important;
}
html.sgk-hc *:not(#sgk-widget):not(#sgk-widget *) {
  background-color: #000 !important;
  color: #fff !important;
  border-color: #fff !important;
}
html.sgk-hc a:not(#sgk-widget a) {
  color: #ffeb3b !important;
  text-decoration: underline !important;
}
html.sgk-hc img:not(#sgk-widget *) {
  filter: brightness(.85) contrast(1.15);
}

/* ============================================================
   CUSTOM CURSORS (WCAG 1.4.11)
   ============================================================ */
body.sgk-cur-w,
body.sgk-cur-w * { cursor: var(--sgk-cur, auto) !important; }
body.sgk-cur-b,
body.sgk-cur-b * { cursor: var(--sgk-cur, auto) !important; }

body.sgk-cur-w a, body.sgk-cur-w button,
body.sgk-cur-w input, body.sgk-cur-w select,
body.sgk-cur-w [role=button], body.sgk-cur-w label[for],
body.sgk-cur-b a, body.sgk-cur-b button,
body.sgk-cur-b input, body.sgk-cur-b select,
body.sgk-cur-b [role=button], body.sgk-cur-b label[for] {
  cursor: var(--sgk-cur-ptr, pointer) !important;
}

/* ============================================================
   WIDGET CONTAINER
   ============================================================ */
#sgk-widget {
  position: fixed;
  z-index: var(--sgk-z);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  /* default: bottom-right */
  right: 20px;
  bottom: 20px;
}

#sgk-widget.sgk-left  { left: 20px; right: auto; align-items: flex-start; }
#sgk-widget.sgk-right { right: 20px; left: auto; align-items: flex-end; }

#sgk-widget.sgk-bottom { bottom: 20px; top: auto; }
#sgk-widget.sgk-top    { top: 20px; bottom: auto; flex-direction: column-reverse; }
#sgk-widget.sgk-center {
  top: 50%;
  bottom: auto;
  transform: translateY(-50%);
}

/* ============================================================
   TOGGLE BUTTON
   ============================================================ */
#sgk-toggle {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: none;
  background: var(--sgk-white);
  cursor: pointer;
  box-shadow: var(--sgk-shadow);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--sgk-dur), box-shadow var(--sgk-dur), background var(--sgk-dur);
  padding: 0;
  flex-shrink: 0;
  position: relative;
}
#sgk-toggle::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid transparent;
  transition: border-color var(--sgk-dur);
}
#sgk-toggle:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 28px rgba(0,0,0,.22);
}
#sgk-toggle:focus-visible {
  outline: none;
}
#sgk-toggle:focus-visible::after {
  border-color: var(--sgk-pri);
}
#sgk-toggle[aria-expanded="true"] {
  background: var(--sgk-pri);
}
#sgk-toggle[aria-expanded="true"] svg path {
  fill: #fff;
}

/* ============================================================
   PANEL
   ============================================================ */
#sgk-panel {
  background: var(--sgk-white);
  border-radius: var(--sgk-radius);
  box-shadow: var(--sgk-shadow);
  width: 256px;
  overflow: hidden;
  /* Positioned relative to button */
  position: absolute;
}

/* Position panel relative to button */
#sgk-widget.sgk-bottom #sgk-panel { bottom: 62px; }
#sgk-widget.sgk-top    #sgk-panel { top: 62px; }
#sgk-widget.sgk-center #sgk-panel { bottom: 62px; }

#sgk-widget.sgk-right #sgk-panel { right: 0; left: auto; }
#sgk-widget.sgk-left  #sgk-panel { left: 0; right: auto; }

/* Panel inner scroll */
.sgk-panel-inner {
  max-height: min(480px, 80vh);
  overflow-y: auto;
  overflow-x: hidden;
  padding: 8px 0 4px;
  scrollbar-width: thin;
  scrollbar-color: var(--sgk-pri) #eee;
}
.sgk-panel-inner::-webkit-scrollbar { width: 4px; }
.sgk-panel-inner::-webkit-scrollbar-thumb { background: var(--sgk-pri); border-radius: 2px; }

/* Panel header */
.sgk-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px 6px;
  border-bottom: 1px solid #eee;
}
.sgk-panel-head-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--sgk-pri);
  text-transform: uppercase;
  letter-spacing: .05em;
}
.sgk-panel-head-close {
  background: none;
  border: none;
  cursor: pointer;
  color: #888;
  font-size: 18px;
  line-height: 1;
  padding: 2px 4px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  transition: color var(--sgk-dur), background var(--sgk-dur);
}
.sgk-panel-head-close:hover { color: #333; background: #f0f0f0; }
.sgk-panel-head-close:focus-visible { outline: 2px solid var(--sgk-pri); outline-offset: 2px; }

/* ============================================================
   SECTIONS
   ============================================================ */
.sgk-section {
  padding: 2px 8px;
}
.sgk-divider {
  height: 1px;
  background: #eee;
  margin: 4px 8px;
}

/* Section toggle button */
.sgk-sec-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  background: var(--sgk-aux);
  color: var(--sgk-txt);
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  transition: background var(--sgk-dur), border-color var(--sgk-dur), color var(--sgk-dur);
  line-height: 1.3;
  box-sizing: border-box;
}
.sgk-sec-btn:hover {
  background: var(--sgk-sec);
  border-color: var(--sgk-pri);
  color: var(--sgk-pri);
}
.sgk-sec-btn:focus-visible {
  outline: 2px solid var(--sgk-pri);
  outline-offset: 2px;
}
.sgk-sec-btn.sgk-active {
  background: var(--sgk-pri);
  color: #fff;
  border-color: var(--sgk-pri);
}
.sgk-sec-btn.sgk-active:hover { opacity: .92; }

.sgk-sec-btn.sgk-open {
  background: var(--sgk-sec);
  color: var(--sgk-pri);
  border-color: var(--sgk-pri);
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

/* Chevron icon */
.sgk-chevron {
  margin-left: auto;
  flex-shrink: 0;
  transition: transform var(--sgk-dur);
  color: #aaa;
}
.sgk-sec-btn.sgk-open .sgk-chevron { transform: rotate(180deg); }
.sgk-sec-btn.sgk-active .sgk-chevron { color: rgba(255,255,255,.7); }

/* Icon */
.sgk-icon {
  width: 20px;
  text-align: center;
  font-size: 14px;
  flex-shrink: 0;
}

/* Section body (accordion) */
.sgk-sec-body {
  background: #fafafa;
  border: 1px solid #e0e0e0;
  border-top: none;
  border-radius: 0 0 8px 8px;
  padding: 10px 12px 8px;
  margin-bottom: 2px;
}

/* ============================================================
   FORM CONTROLS
   ============================================================ */
.sgk-lbl {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: #666;
  margin: 6px 0 3px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.sgk-select {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid #ddd;
  border-radius: 6px;
  background: #fff;
  color: var(--sgk-txt);
  font-size: 12px;
  cursor: pointer;
  box-sizing: border-box;
}
.sgk-select:focus { outline: 2px solid var(--sgk-pri); border-color: var(--sgk-pri); }

/* Range slider */
.sgk-range {
  -webkit-appearance: none;
  width: 100%;
  height: 4px;
  border-radius: 2px;
  background: #ddd;
  cursor: pointer;
  margin: 4px 0 8px;
  box-sizing: border-box;
  display: block;
}
.sgk-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--sgk-pri);
  cursor: grab;
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,.25);
}
.sgk-range::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--sgk-pri);
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,.25);
  cursor: grab;
}
.sgk-range:focus-visible { outline: none; }
.sgk-range:focus-visible::-webkit-slider-thumb {
  box-shadow: 0 0 0 3px var(--sgk-sec), 0 1px 4px rgba(0,0,0,.25);
}

.sgk-range-hue {
  height: 7px;
  border-radius: 4px;
  background: linear-gradient(to right,#f00,#ff0,#0f0,#0ff,#00f,#f0f,#f00);
}
.sgk-range-speed {
  background: linear-gradient(to right, #b0c4e8, var(--sgk-pri));
}

/* Toggle switch */
.sgk-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 12px;
  color: var(--sgk-txt);
}
.sgk-switch {
  position: relative;
  flex-shrink: 0;
  width: 40px;
  height: 22px;
}
.sgk-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}
.sgk-switch-track {
  position: absolute;
  inset: 0;
  background: #ccc;
  border-radius: 22px;
  cursor: pointer;
  transition: background var(--sgk-dur);
}
.sgk-switch-track::before {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  top: 3px;
  left: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform var(--sgk-dur);
  box-shadow: 0 1px 3px rgba(0,0,0,.25);
}
.sgk-switch input:checked + .sgk-switch-track { background: var(--sgk-pri); }
.sgk-switch input:checked + .sgk-switch-track::before { transform: translateX(18px); }
.sgk-switch input:focus-visible + .sgk-switch-track {
  outline: 2px solid var(--sgk-pri);
  outline-offset: 2px;
}

/* Font controls */
.sgk-font-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}
.sgk-font-row .sgk-range { flex: 1; margin: 0; min-width: 0; }
.sgk-btn-sm {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--sgk-sec);
  color: var(--sgk-pri);
  border: 1px solid var(--sgk-pri);
  border-radius: 6px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  transition: background var(--sgk-dur);
}
.sgk-btn-sm:hover { background: var(--sgk-pri); color: #fff; }
.sgk-btn-sm:focus-visible { outline: 2px solid var(--sgk-pri); outline-offset: 2px; }

/* Output badge */
.sgk-output {
  text-align: center;
  font-size: 11px;
  color: #555;
  background: #f0f0f0;
  border-radius: 4px;
  padding: 3px 6px;
  margin-top: 4px;
}

/* Cursor pair buttons */
.sgk-pair {
  display: flex;
  gap: 6px;
  margin-bottom: 4px;
}
.sgk-pair-btn {
  flex: 1;
  padding: 7px 4px;
  border: 1px solid #ddd;
  border-radius: 6px;
  background: var(--sgk-aux);
  color: var(--sgk-txt);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: background var(--sgk-dur), border-color var(--sgk-dur), color var(--sgk-dur);
}
.sgk-pair-btn:hover { background: var(--sgk-sec); border-color: var(--sgk-pri); color: var(--sgk-pri); }
.sgk-pair-btn.sgk-active { background: var(--sgk-pri); color: #fff; border-color: var(--sgk-pri); }
.sgk-pair-btn:focus-visible { outline: 2px solid var(--sgk-pri); outline-offset: 2px; }

/* Reset button */
.sgk-reset-btn {
  width: 100%;
  padding: 6px;
  background: transparent;
  color: #999;
  border: 1px dashed #ddd;
  border-radius: 6px;
  font-size: 11px;
  cursor: pointer;
  text-align: center;
  margin-top: 4px;
  transition: all var(--sgk-dur);
}
.sgk-reset-btn:hover { background: #fff0f0; color: #c62828; border-color: #ef9a9a; }
.sgk-reset-btn:focus-visible { outline: 2px solid var(--sgk-pri); outline-offset: 2px; }

/* Global reset */
.sgk-global-reset {
  width: 100%;
  padding: 9px;
  background: #fff3e0;
  color: #e65100;
  border: 1px solid #ffcc80;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  transition: background var(--sgk-dur);
}
.sgk-global-reset:hover { background: #ffe0b2; border-color: #ff9800; }
.sgk-global-reset:focus-visible { outline: 2px solid var(--sgk-pri); outline-offset: 2px; }

/* ============================================================
   HIGH CONTRAST — WIDGET OVERRIDES
   ============================================================ */
html.sgk-hc #sgk-panel {
  background: #111 !important;
  border: 2px solid #fff !important;
}
html.sgk-hc .sgk-sec-btn {
  background: #222 !important;
  color: #fff !important;
  border-color: #555 !important;
}
html.sgk-hc .sgk-sec-btn:hover,
html.sgk-hc .sgk-sec-btn.sgk-open {
  background: #333 !important;
  border-color: #fff !important;
}
html.sgk-hc .sgk-sec-btn.sgk-active {
  background: #1565c0 !important;
  border-color: #90caf9 !important;
}
html.sgk-hc .sgk-sec-body {
  background: #1a1a1a !important;
  border-color: #444 !important;
}
html.sgk-hc .sgk-panel-head { border-color: #444 !important; }
html.sgk-hc .sgk-panel-head-title { color: #90caf9 !important; }
html.sgk-hc .sgk-output { background: #333 !important; color: #fff !important; }
html.sgk-hc #sgk-toggle {
  background: #222 !important;
  border: 2px solid #fff !important;
}

/* ============================================================
   RESPONSIVE — TABLET
   ============================================================ */
@media (max-width: 768px) {
  #sgk-widget.sgk-left  { left: 12px; }
  #sgk-widget.sgk-right { right: 12px; }
  #sgk-widget.sgk-bottom { bottom: 12px; }
  #sgk-widget.sgk-top    { top: 12px; }

  #sgk-toggle { width: 50px; height: 50px; }
  #sgk-toggle svg { width: 24px; height: 24px; }

  #sgk-panel {
    width: calc(100vw - 24px);
    max-width: 300px;
  }
  #sgk-widget.sgk-bottom #sgk-panel { bottom: 58px; }
  #sgk-widget.sgk-top    #sgk-panel { top: 58px; }
  #sgk-widget.sgk-center #sgk-panel { bottom: 58px; }
}

/* ============================================================
   RESPONSIVE — MOBILE
   ============================================================ */
@media (max-width: 480px) {
  #sgk-widget.sgk-left,
  #sgk-widget.sgk-right {
    left: 8px;
    right: 8px;
  }
  #sgk-widget.sgk-right { align-items: flex-end; }
  #sgk-widget.sgk-left  { align-items: flex-start; }

  #sgk-panel {
    width: calc(100vw - 16px);
    max-width: none;
  }
  #sgk-widget.sgk-right #sgk-panel { right: 0; left: auto; }
  #sgk-widget.sgk-left  #sgk-panel { left: 0; right: auto; }
}

/* ============================================================
   REDUCED MOTION (WCAG 2.3.3 AAA)
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  :root { --sgk-dur: 0s; }
  #sgk-toggle { transition: none; }
  .sgk-sec-btn,
  .sgk-switch-track,
  .sgk-switch-track::before { transition: none; }
}
