/**
 * DEV-036: Photochromic Glasses UK responsive Header & Navigation.
 */

.pcuk-desktop-header { display: none; }

@media (min-width: 768px) {
  .ct-header { display: none !important; }
  .pcuk-desktop-header { display: flex; align-items: center; gap: 30px; min-height: 76px; padding: 0 clamp(24px, 4vw, 64px); border-bottom: 1px solid #e2e8f0; background: #fff; color: #111827; position: relative; z-index: 1000; }
  .pcuk-desktop-header__brand { color: #111827; text-decoration: none; font-size: 1.1rem; font-weight: 750; letter-spacing: -.02em; white-space: nowrap; }
  .pcuk-desktop-header__nav { display: flex; align-items: center; gap: clamp(14px, 2vw, 28px); flex: 1; }
  .pcuk-desktop-header__nav > a, .pcuk-nav-dropdown__toggle, .pcuk-desktop-header__actions a, .pcuk-search-button { border: 0; background: none; color: #334155; font: inherit; font-size: .92rem; font-weight: 600; text-decoration: none; white-space: nowrap; cursor: pointer; padding: 10px 0; }
  .pcuk-desktop-header__nav > a:hover, .pcuk-nav-dropdown__toggle:hover, .pcuk-desktop-header__actions a:hover, .pcuk-search-button:hover { color: #2563eb; }
  .pcuk-nav-dropdown { position: relative; }
  .pcuk-nav-dropdown__arrow { display: inline-block; width: 12px; height: 12px; margin-left: 4px; vertical-align: -1px; stroke: #64748b; flex-shrink: 0; transition: transform 0.2s ease; }
  .pcuk-nav-dropdown__toggle[aria-expanded="true"] .pcuk-nav-dropdown__arrow { transform: rotate(180deg); }
  .pcuk-nav-dropdown__menu { position: absolute; top: calc(100% + 8px); left: -16px; min-width: 235px; padding: 8px; border: 1px solid #dbe3ec; border-radius: 12px; background: #fff; box-shadow: 0 16px 40px rgba(15,23,42,.14); }
  .pcuk-nav-dropdown__menu a { display: block; padding: 10px 12px; border-radius: 8px; color: #1e293b; text-decoration: none; font-size: .9rem; line-height: 1.25; }
  .pcuk-nav-dropdown__menu a:hover, .pcuk-nav-dropdown__menu a:focus-visible { background: #eff6ff; color: #1d4ed8; outline: none; }
  .pcuk-desktop-header__actions { display: flex; align-items: center; gap: 18px; margin-left: auto; }
  .pcuk-desktop-header__actions a:last-of-type { color: #111827; }
  .pcuk-desktop-header__actions [data-pcuk-desktop-cart-count] { display: inline-flex; min-width: 18px; justify-content: center; color: #2563eb; }
}

/* ==========================================================================
   Desktop / Mobile Visibility Isolation
   ========================================================================== */
@media (min-width: 768px) {
  .pcuk-mobile-header,
  .pcuk-mobile-drawer {
    display: none !important;
  }
}

@media (max-width: 767.98px) {
  .ct-header [data-device="mobile"],
  #offcanvas {
    display: none !important;
  }

  body.pcuk-mobile-menu-open {
    position: fixed;
    left: 0;
    right: 0;
    width: 100%;
    overflow: hidden;
  }

  /* ==========================================================================
     Mobile Header
     ========================================================================== */
  .pcuk-mobile-header {
    display: block !important;
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    z-index: 990;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid #dfe5ea;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
  }

  .pcuk-mobile-header__bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 58px;
    padding: 0 16px;
    max-width: 100%;
  }

  .pcuk-mobile-header__menu {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    margin-left: -8px;
    padding: 0;
    background: transparent;
    border: none;
    cursor: pointer;
    color: #111827;
  }

  .pcuk-mobile-header__menu svg {
    width: 24px;
    height: 24px;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    fill: none;
  }

  .pcuk-mobile-header__brand {
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 1.05rem;
    font-weight: 700;
    color: #111827;
    text-decoration: none;
    letter-spacing: -0.015em;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .pcuk-mobile-header__actions {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-right: -8px;
  }

  .pcuk-mobile-header__action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    position: relative;
    color: #111827;
    text-decoration: none;
  }

  .pcuk-mobile-header__action svg {
    width: 22px;
    height: 22px;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
  }

  .pcuk-mobile-header__cart-count {
    position: absolute;
    top: 6px;
    right: 4px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: 999px;
    background: #2563eb;
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
    box-sizing: border-box;
  }

  .pcuk-mobile-header__cart-count.is-empty {
    display: none;
  }

  /* ==========================================================================
     Offcanvas Drawer Menu
     ========================================================================== */
  .pcuk-mobile-drawer {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    pointer-events: none;
  }

  .pcuk-mobile-drawer.is-open {
    pointer-events: auto;
  }

  .pcuk-mobile-drawer__scrim {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    border: none;
    opacity: 0;
    transition: opacity 0.25s ease;
    cursor: pointer;
    width: 100%;
    height: 100%;
  }

  .pcuk-mobile-drawer.is-open .pcuk-mobile-drawer__scrim {
    opacity: 1;
  }

  .pcuk-mobile-drawer__panel {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(380px, 86vw);
    background: #f8fafc;
    border-right: 1px solid #dfe5ea;
    box-shadow: 24px 0 60px rgba(15, 23, 42, 0.16);
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    box-sizing: border-box;
  }

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

  /* Head */
  .pcuk-mobile-drawer__head {
    padding: 22px 20px 18px;
    background: #ffffff;
    border-bottom: 1px solid #dfe5ea;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
  }

  .pcuk-mobile-drawer__brand {
    display: flex;
    align-items: center;
    gap: 14px;
  }

  .pcuk-mobile-drawer__brand-mark {
    display: inline-flex;
    flex: 0 0 auto;
    width: 56px;
    height: 56px;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    background: linear-gradient(135deg, #111827 0%, #2563eb 100%);
    color: #ffffff;
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.25);
  }

  .pcuk-mobile-drawer__brand-copy {
    display: flex;
    flex-direction: column;
    gap: 2px;
  }

  .pcuk-mobile-drawer__eyebrow {
    margin: 0;
    color: #2563eb;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  .pcuk-mobile-drawer__brand-copy strong {
    font-size: 1.05rem;
    font-weight: 700;
    color: #111827;
    line-height: 1.2;
  }

  .pcuk-mobile-drawer__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 1px solid #dfe5ea;
    border-radius: 999px;
    background: #ffffff;
    color: #111827;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
  }

  .pcuk-mobile-drawer__close:active {
    background: #f1f5f9;
  }

  .pcuk-mobile-drawer__close svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    fill: none;
  }

  /* Nav Cards */
  .pcuk-mobile-drawer__nav {
    margin: 20px 18px 0;
  }

  .pcuk-mobile-drawer__nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .pcuk-mobile-drawer__nav a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 18px;
    border: 1px solid #dfe5ea;
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.04);
    color: #111827;
    font-size: 1.02rem;
    font-weight: 650;
    text-decoration: none;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
  }

  .pcuk-mobile-drawer__nav a:active {
    transform: scale(0.985);
    background: #f8fafc;
  }

  .pcuk-mobile-drawer__group > button { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 15px 18px; border: 1px solid #dfe5ea; border-radius: 16px; background: #fff; color: #111827; font: inherit; font-size: 1.02rem; font-weight: 650; text-align: left; cursor: pointer; }
  .pcuk-mobile-drawer__group > button svg { width: 18px; height: 18px; stroke: #64748b; stroke-width: 2; fill: none; }
  .pcuk-mobile-drawer__group [data-pcuk-mobile-submenu] { margin: 6px 0 0 14px; padding-left: 10px; border-left: 2px solid #dbeafe; }
  .pcuk-mobile-drawer__group [data-pcuk-mobile-submenu] a { display: block; padding: 9px 10px; color: #334155; font-size: .9rem; text-decoration: none; }

  .pcuk-mobile-drawer__nav a svg {
    width: 18px;
    height: 18px;
    stroke: #64748b;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
  }

  /* Quick Links */
  .pcuk-mobile-drawer__quick-links {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin: 18px 18px 0;
  }

  .pcuk-mobile-drawer__quick-links a {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 13px 14px;
    border: 1px solid #dfe5ea;
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.03);
    text-decoration: none;
    transition: background 0.15s ease;
  }

  .pcuk-mobile-drawer__quick-links a:active {
    background: #f1f5f9;
  }

  .pcuk-mobile-drawer__quick-links strong {
    font-size: 0.94rem;
    font-weight: 700;
    color: #111827;
    line-height: 1.2;
  }

  .pcuk-mobile-drawer__quick-links span {
    font-size: 0.76rem;
    color: #64748b;
    line-height: 1.2;
  }

  /* Footer & Currency */
  .pcuk-mobile-drawer__footer {
    margin-top: auto;
    padding: 22px 18px;
    border-top: 1px solid #dfe5ea;
    background: #ffffff;
  }

  .pcuk-mobile-drawer__currency .pcuk-mobile-drawer__eyebrow {
    margin-bottom: 8px;
  }

  .pcuk-currency-skeleton {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border: 1px solid #dfe5ea;
    border-radius: 12px;
    background: #f8fafc;
    color: #111827;
    font-size: 0.94rem;
    font-weight: 600;
  }

  .pcuk-currency-skeleton__flag {
    font-size: 1.15rem;
    line-height: 1;
  }

  .pcuk-currency-skeleton__label {
    flex: 1;
    color: #111827;
  }

  .pcuk-currency-skeleton__icon {
    width: 16px;
    height: 16px;
    stroke: #64748b;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
  }
}
