/* IKONG — responsive hardening + WCAG AA accessibility.
   Loaded LAST (after ikong.css + woocommerce.css) so these additive overrides
   win without editing those files. Mobile / tablet / odd widths + a11y. */

/* ---------- Overflow safety: never scroll sideways ---------- */
/* Use `clip`, not `hidden`: `hidden` makes an element a scroll container, which
   breaks `position: sticky` on the header (it scrolled away instead of pinning).
   `clip` hides horizontal overflow identically WITHOUT creating that container.
   BOTH <html> and <body> must use clip — style.css sets `body{overflow-x:hidden}`
   which alone was enough to keep the sticky nav from pinning. */
html, body { overflow-x: clip; }
/* Solid dark canvas behind the body's `background-attachment: fixed` gradient.
   The body sets only a fixed gradient image with NO background-color, so any
   area the fixed layer doesn't paint (short pages like the cart, below the fold)
   fell back to the browser's white canvas — a white block bled in beside the
   cart totals. A root background-color guarantees the fallback is near-black. */
html { background-color: var(--ikong-bg, #05070C); }
img, svg, video, iframe { max-width: 100%; }
/* NOTE: do NOT force `img { height: auto }` globally — it overrides components
   that set an explicit logo/icon height (it had blown the press logos up to
   full width). Keep height control with the components. */

/* ---------- Trusted-by / press logos: small + uniform ---------- */
.ikong-press__logos { align-items: center; }
.ikong-press__logos img { height: 28px !important; width: auto; max-width: 170px; object-fit: contain; }

/* ---------- Brand logo (image lockup) ---------- */
/* WooCommerce core ships `.woocommerce img, .woocommerce-page img { height:auto }`
   — specificity (0,1,1), which BEATS `.ikong-logo__img` (0,1,0) on every shop /
   cart / my-account page and blows the header+footer logo up to its intrinsic
   859x407. We win it back with !important (overriding a third-party rule). */
.ikong-logo__img { display: block; height: 50px !important; width: auto !important; max-width: 200px; }
.ikong-footer__brand .ikong-logo__img { height: 58px !important; margin-bottom: 4px; }
@media (max-width: 560px) {
  .ikong-logo__img { height: 40px !important; }
  .ikong-footer__brand .ikong-logo__img { height: 50px !important; }
}

/* ---------- Keyboard focus visibility (WCAG 2.4.7) ---------- */
a:focus-visible,
button:focus-visible,
[tabindex]:focus-visible,
.ikong-iconbtn:focus-visible,
.ikong-mega__item:focus-visible,
.ikong-catnav__chip:focus-visible,
.ikong-card__cta:focus-visible,
.woocommerce a.button:focus-visible,
.woocommerce button.button:focus-visible {
  outline: 2px solid var(--ikong-cyan, #56B5FF);
  outline-offset: 2px;
  border-radius: 6px;
}
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid var(--ikong-cyan, #56B5FF);
  outline-offset: 1px;
}
/* Card lifts shouldn't hide a focused link inside them. */
.ikong-card:focus-within,
.woocommerce ul.products li.product:focus-within { outline: 2px solid var(--ikong-cyan, #56B5FF); outline-offset: 3px; border-radius: var(--ikong-radius-card); }

/* ---------- Touch: larger tap targets + scrollable drawer ---------- */
@media (hover: none) and (pointer: coarse) {
  .ikong-iconbtn { width: 46px; height: 46px; }
}
@media (max-width: 1024px) {
  .ikong-nav { overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
  .ikong-catnav { top: 0; } /* header isn't sticky-offset inside the drawer flow */
}

/* ---------- Cart table → stacked cards on phones ---------- */
@media (max-width: 768px) {
  .woocommerce table.cart thead { display: none; }
  .woocommerce table.cart,
  .woocommerce table.cart tbody,
  .woocommerce table.cart tr,
  .woocommerce table.cart td { display: block; width: 100% !important; }
  .woocommerce table.cart tr {
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 14px;
    margin: 0 0 14px;
    padding: 8px 14px;
    background: linear-gradient(180deg, #0B1322, #070A12);
  }
  .woocommerce table.cart td {
    border: 0 !important;
    display: flex; align-items: center; justify-content: space-between; gap: 14px;
    text-align: right; padding: 10px 0;
  }
  .woocommerce table.cart td::before {
    content: attr(data-title);
    color: var(--ikong-text-muted); font-size: 12px;
    text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600;
  }
  .woocommerce table.cart td.product-thumbnail { justify-content: center; }
  .woocommerce table.cart td.product-thumbnail::before { display: none; }
  .woocommerce table.cart td.actions { flex-direction: column; gap: 10px; }
  .woocommerce table.cart td.actions .coupon { display: flex; gap: 8px; width: 100%; }
  .woocommerce .cart-collaterals .cart_totals { max-width: 100%; }
}

/* ---------- Single product: full-width buy row on small screens ---------- */
@media (max-width: 560px) {
  .single-product form.cart { width: 100%; gap: 12px; }
  .single-product form.cart .single_add_to_cart_button { width: 100%; justify-content: center; }
  .single-product .quantity { width: 100%; }
  .single-product .quantity input.qty { width: 100%; }
  .ikong-cta-band .btn { width: 100%; justify-content: center; }
}

/* ---------- Verification block: ID upload wraps cleanly ---------- */
@media (max-width: 480px) {
  .ikong-idupload { flex-direction: column; align-items: flex-start; gap: 8px; }
  .ikong-idupload input[type="file"] { width: 100%; }
}

/* ---------- Mega-menu never exceeds the viewport on mid widths ---------- */
@media (min-width: 1025px) and (max-width: 1180px) {
  .ikong-mega { width: min(560px, 70vw); }
  .ikong-mega__grid { grid-template-columns: 1fr; }
}

/* ---------- Honor reduced-motion (WCAG 2.3.3) ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .ikong-card:hover,
  .ikong-cat-card:hover,
  .woocommerce ul.products li.product:hover,
  .ikong-cat-card:hover,
  .btn:hover { transform: none; }
}

/* ---------- Tiny phones (<=360px): tighten spacing, prevent clipping ---------- */
@media (max-width: 360px) {
  .container, .ikong-header__inner, .ikong-hero__inner { padding-inline: 16px; }
  .ikong-logo__name { font-size: 24px; }
  .ikong-hero__title { font-size: clamp(44px, 16vw, 64px); }
}

/* ---------- Press logos + shop toolbar tuned for phones/tablets ---------- */
@media (max-width: 768px) {
  .ikong-press__logos { justify-content: center; gap: 22px 30px; }
  .ikong-press__logos img { height: 22px !important; max-width: 120px; }
  /* Result count + sorting shouldn't crowd on a narrow shop/category toolbar. */
  .woocommerce-result-count { display: block; float: none; margin: 0 0 12px; }
  .woocommerce-ordering { float: none; margin: 0 0 18px; width: 100%; }
  .woocommerce-ordering select, .ikong-wc .woocommerce-ordering select { width: 100%; }
}

/* ---------- WooCommerce notice icons: kill the broken glyph box ---------- */
/* The theme replaces WooCommerce's stylesheet, so the "WooCommerce" icon font
   never loads — but core still renders an absolutely-positioned ::before icon on
   every notice, which falls back to a tofu box overlapping the text. Our notices
   are styled with a coloured top border instead, so suppress the icon entirely. */
.woocommerce-message::before,
.woocommerce-info::before,
.woocommerce-error::before,
.woocommerce-noreviews::before,
.woocommerce-no-products-found .woocommerce-info::before,
.woocommerce ul.cart_list li::before,
.woocommerce .woocommerce-message::before,
.woocommerce .woocommerce-info::before,
.woocommerce .woocommerce-error::before { content: none !important; display: none !important; }
/* Reclaim the left gutter core reserved for that icon. */
.woocommerce-message,
.woocommerce-info,
.woocommerce-error,
.woocommerce-noreviews { padding-left: 20px !important; }

/* ---------- Header: pin nav to the very top + reclaim hero space ---------- */
/* The near-black utility strip (Lab Tested · 99% Purity · …) above the nav reads
   as dead "top padding" over the dark hero. Slim it, shrink the nav, and keep
   the hero's negative-margin pull-up in sync so the figure shows higher up.
   (Sticky itself is fixed by the overflow-x: clip change at the top of this file.) */
:root { --ikong-nav-height: 76px; }
.ikong-utility__inner { height: 28px; }
.ikong-hero {
  margin-top: calc(-1 * var(--ikong-nav-height) - 28px);
  padding-top: calc(var(--ikong-nav-height) + 28px);
}

/* ---------- Hide the top utility strip on mobile + tablet ----------
   Lab Tested / 99% Purity / Fast & Discreet Shipping is desktop-only chrome.
   Hide it ≤1024px and drop the hero's matching 28px offset so the top stays flush. */
@media (max-width: 1024px) {
  .ikong-utility { display: none; }
  .ikong-hero {
    margin-top: calc(-1 * var(--ikong-nav-height));
    padding-top: var(--ikong-nav-height);
  }
}

/* ---------- Mobile nav drawer: full-width overlay below a pinned header ----------
   The base drawer was min(82vw,360px) anchored right, so the hero bled through on
   the left and (worse) the drawer (z-index 200) covered the header's close button
   (z-index 100) — you could only close by tapping a link. Fix: drawer fills the
   full width BELOW the header, and the header floats above it so the logo + X stay
   visible and tappable. */
@media (max-width: 1024px) {
  .ikong-header { z-index: 300; } /* keep logo + close (X) above the open drawer */
  .ikong-nav {
    inset: var(--ikong-nav-height) 0 0 0;   /* below header, full width */
    width: auto; max-width: none;
    border-left: 0;
    padding: 20px 22px 48px;
    overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
    background: #05070C;
  }
  /* Roomier, easier-to-tap items now that there's full width to work with. */
  .ikong-nav ul { gap: 2px; }
  .ikong-nav > ul > li > a { font-size: 18px; padding: 14px 0; }
  .ikong-nav .ikong-mega,
  .ikong-nav .has-mega .ikong-mega {
    position: static; opacity: 1; visibility: visible; transform: none;
    width: auto; max-width: none; box-shadow: none; background: transparent;
    border: 0; padding: 4px 0 10px; margin: 0;
  }
  .ikong-nav .ikong-mega__grid { grid-template-columns: 1fr; gap: 2px; }
  .ikong-nav .ikong-mega__item { padding: 12px 10px; border-radius: 12px; }
  .ikong-nav .ikong-mega__item:active { background: rgba(255,255,255,0.05); }
}
@media (max-width: 560px) {
  /* On phones the drawer is a true full-screen panel. */
  .ikong-nav > ul > li > a { font-size: 17px; }
}
