/* ============================================================
   Mobile navigation drawer
   See DESIGN-RULES.md §8
   ============================================================ */

/* Backdrop */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 11, .45);
  z-index: var(--z-backdrop);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--dur-slow) var(--ease),
              visibility 0s linear var(--dur-slow);
}

.drawer-backdrop.is-open {
  opacity: 1;
  visibility: visible;
  transition: opacity var(--dur-slow) var(--ease),
              visibility 0s linear 0s;
}

/* Drawer */
.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(420px, 92vw);
  background: var(--white);
  z-index: var(--z-drawer);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform var(--dur-slow) var(--ease);
  box-shadow: -24px 0 48px -24px rgba(10,10,11,.24);
}

.drawer.is-open { transform: translateX(0); }

.drawer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  height: 64px;
  flex-shrink: 0;
}

.drawer__logo {
  display: inline-flex;
  align-items: center;
}

.drawer__logo img {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.drawer__close {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-2);
  color: var(--ink);
  transition: background var(--dur-fast) var(--ease);
}

.drawer__close:hover { background: var(--paper); }
.drawer__close svg { width: 20px; height: 20px; }

/* Body — scrollable */
.drawer__body {
  flex: 1;
  overflow-y: auto;
  padding: var(--sp-3) 0;
  -webkit-overflow-scrolling: touch;
}

.drawer__nav {
  display: flex;
  flex-direction: column;
}

.drawer__item { display: flex; flex-direction: column; }

.drawer__row {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 14px 20px;
  font-size: var(--fs-16);
  font-weight: 500;
  color: var(--ink);
  border-bottom: 1px solid var(--line-soft);
  transition: background var(--dur-fast) var(--ease);
  text-align: left;
  gap: var(--sp-3);
}

.drawer__row:hover,
.drawer__row:active { background: var(--paper); }

.drawer__row-label { flex: 1; }

.drawer__toggle {
  width: 32px;
  height: 32px;
  border-radius: var(--r-2);
  background: var(--paper);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  flex-shrink: 0;
  margin-right: -6px;
  transition: background var(--dur-fast) var(--ease),
              color var(--dur-fast) var(--ease);
}

.drawer__toggle svg {
  width: 14px; height: 14px;
  transition: transform var(--dur) var(--ease);
}

.drawer__item.is-open .drawer__toggle {
  background: var(--ink);
  color: var(--white);
}

.drawer__item.is-open .drawer__toggle svg {
  transform: rotate(45deg); /* + becomes × */
}

/* Sub-list (accordion) */
.drawer__sub {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows var(--dur-slow) var(--ease);
  background: var(--paper-2);
}

.drawer__item.is-open .drawer__sub {
  grid-template-rows: 1fr;
}

.drawer__sub-inner {
  overflow: hidden;
  min-height: 0;
}

.drawer__sub-group {
  padding: 8px 0 12px;
  border-bottom: 1px solid var(--line-soft);
}

.drawer__sub-group:last-child { border-bottom: 0; }

.drawer__sub-heading {
  padding: 12px 20px 6px;
  font-size: var(--fs-11);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: var(--tracking-eyebrow);
  color: var(--text-muted);
}

.drawer__sub-link {
  display: flex;
  align-items: center;
  padding: 10px 20px 10px 32px;
  font-size: var(--fs-14);
  color: var(--ink);
  transition: background var(--dur-fast) var(--ease),
              color var(--dur-fast) var(--ease);
}

.drawer__sub-link:hover { background: var(--white); color: var(--red); }

/* Current page indicator — auto-applied by main.js */
.drawer__sub-link[aria-current="page"] {
  color: var(--red);
  font-weight: 600;
  background: var(--white);
  position: relative;
}

.drawer__sub-link[aria-current="page"]::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 60%;
  background: var(--red);
  border-radius: 2px;
}

.drawer__sub-link--view-all {
  color: var(--red);
  font-weight: 600;
  font-size: var(--fs-13);
}

.drawer__sub-link--view-all::after {
  content: "→";
  margin-left: 6px;
  display: inline-block;
  transition: transform var(--dur) var(--ease);
}

.drawer__sub-link--view-all:hover::after { transform: translateX(3px); }

/* Footer pinned */
.drawer__foot {
  flex-shrink: 0;
  padding: var(--sp-4) var(--sp-5) var(--sp-5);
  border-top: 1px solid var(--border);
  background: var(--paper-2);
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.drawer__contact {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  font-size: var(--fs-13);
  color: var(--text-muted);
}

.drawer__contact a {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  color: var(--text-muted);
}

.drawer__contact a svg {
  width: 14px; height: 14px;
  color: var(--smoke);
}

.drawer__contact a:hover { color: var(--ink); }

.drawer__foot-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  margin-top: var(--sp-2);
}

.drawer__foot .btn { flex: 1; justify-content: center; }

.drawer__lang {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  overflow: hidden;
  height: 40px;
  flex-shrink: 0;
}

.drawer__lang button {
  padding: 0 12px;
  height: 100%;
  font-size: var(--fs-13);
  font-weight: 600;
  color: var(--text-muted);
  transition: background var(--dur-fast) var(--ease),
              color var(--dur-fast) var(--ease);
}

.drawer__lang button.is-active {
  background: var(--ink);
  color: var(--white);
}
