/*
 * KWMPress dedicated mobile/tablet header.
 * This file owns only .kwm-mobile-site-header and desktop/mobile visibility.
 * It intentionally does not override .kwm-landing-* desktop action styles.
 */

.kwm-mobile-site-header {
  display: none;
}

@media (max-width: 1024px) {
  .kwm-desktop-site-header {
    display: none;
  }

  .kwm-mobile-site-header {
    --kwm-mobile-header-gold: #d7ad57;
    --kwm-mobile-header-gold-soft: #f2ce7a;
    --kwm-mobile-header-icon: #d8dde6;

    position: sticky;
    top: 0;
    z-index: 999;
    display: block;
    width: 100%;
    isolation: isolate;
    border-bottom: 1px solid rgba(215, 173, 87, 0.16);
    background:
      radial-gradient(circle at 76% 0%, rgba(215, 173, 87, 0.12), transparent 34%),
      linear-gradient(90deg, #11100d 0%, #1b1710 50%, #11100d 100%);
    color: #fff;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.25);
    transition: box-shadow 0.25s ease, background-color 0.25s ease;
  }

  .kwm-mobile-site-header::before {
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent 58%),
      radial-gradient(circle at 50% 120%, rgba(215, 173, 87, 0.08), transparent 48%);
    content: "";
  }

  .kwm-mobile-site-header.is-scrolled {
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.34);
  }

  .admin-bar .kwm-mobile-site-header {
    top: 32px;
  }

  .kwm-mobile-site-header__inner {
    display: grid;
    grid-template-columns: minmax(92px, 1fr) auto minmax(92px, 1fr);
    align-items: center;
    width: min(100%, 1280px);
    min-height: 76px;
    margin-inline: auto;
    padding: 0 14px;
    direction: ltr;
  }

  .kwm-mobile-site-header__group {
    display: flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
    direction: ltr;
  }

  .kwm-mobile-site-header__group--left {
    grid-column: 1;
    justify-self: start;
    justify-content: flex-start;
  }

  .kwm-mobile-site-header__group--right {
    grid-column: 3;
    justify-self: end;
    justify-content: flex-end;
  }

  .kwm-mobile-site-header__brand {
    grid-column: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    max-width: 150px;
    color: #fff;
    text-decoration: none;
  }

  .kwm-mobile-site-header__logo {
    display: block;
    width: clamp(104px, 15vw, 132px);
    max-width: 132px;
    max-height: 50px;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 7px 13px rgba(0, 0, 0, 0.3));
  }

  .kwm-mobile-site-header__brand-text {
    overflow: hidden;
    color: #fff;
    font-size: 16px;
    font-weight: 900;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
    direction: rtl;
  }

  .kwm-mobile-site-header__action {
    position: relative;
    display: inline-grid;
    flex: 0 0 44px;
    place-items: center;
    width: 44px;
    min-width: 44px;
    height: 48px;
    min-height: 48px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 12px;
    outline: 0;
    background: transparent;
    color: var(--kwm-mobile-header-icon);
    line-height: 0;
    text-decoration: none;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    transition: color 0.18s ease, background-color 0.18s ease, transform 0.18s ease;
  }

  .kwm-mobile-site-header__action:hover,
  .kwm-mobile-site-header__action:focus-visible {
    background: rgba(215, 173, 87, 0.08);
    color: var(--kwm-mobile-header-gold-soft);
  }

  .kwm-mobile-site-header__action:focus-visible {
    box-shadow: 0 0 0 2px rgba(242, 206, 122, 0.34) inset;
  }

  .kwm-mobile-site-header__action:active {
    transform: scale(0.96);
  }

  .kwm-mobile-site-header__action .kwm-mobile-site-header__icon,
  .kwm-mobile-site-header__action svg.kwm-mobile-site-header__icon {
    display: block;
    width: 28px;
    height: 28px;
    margin: 0;
    overflow: visible;
    color: currentColor;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
    transform: none;
  }

  /*
   * Mobile cart notification badge.
   * The data-attribute selector is intentional: WooCommerce fragments or a
   * third-party cart refresh must never be able to strip the visual styling
   * just because the original class was replaced.
   */
  .kwm-mobile-site-header__action--cart > .kwm-mobile-site-header__badge,
  .kwm-mobile-site-header__action--cart > [data-kwm-cart-count] {
    position: absolute;
    top: -1px;
    right: -1px;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    min-width: 20px;
    height: 20px;
    min-height: 20px;
    padding: 0 4px;
    border: 2px solid #17140f;
    border-radius: 999px;
    background: linear-gradient(180deg, #fb3f67 0%, #e11d48 72%, #be123c 100%);
    color: #fff;
    font-size: 10px;
    font-weight: 900;
    line-height: 1;
    letter-spacing: -0.02em;
    direction: ltr;
    font-variant-numeric: tabular-nums;
    box-sizing: border-box;
    box-shadow:
      0 4px 11px rgba(225, 29, 72, 0.34),
      0 0 0 1px rgba(255, 255, 255, 0.08) inset;
    pointer-events: none;
  }

  .kwm-mobile-site-header__action--cart > .kwm-mobile-site-header__badge:empty,
  .kwm-mobile-site-header__action--cart > [data-kwm-cart-count]:empty,
  .kwm-mobile-site-header__action--cart > [data-kwm-cart-count].is-empty {
    display: none;
  }
}

@media (max-width: 782px) {
  .admin-bar .kwm-mobile-site-header {
    top: 46px;
  }
}

@media (max-width: 520px) {
  .kwm-mobile-site-header__inner {
    grid-template-columns: minmax(88px, 1fr) auto minmax(88px, 1fr);
    min-height: 72px;
    padding-inline: 10px;
  }

  .kwm-mobile-site-header__group {
    gap: 2px;
  }

  .kwm-mobile-site-header__action {
    flex-basis: 42px;
    width: 42px;
    min-width: 42px;
    height: 46px;
    min-height: 46px;
  }

  .kwm-mobile-site-header__action .kwm-mobile-site-header__icon,
  .kwm-mobile-site-header__action svg.kwm-mobile-site-header__icon {
    width: 27px;
    height: 27px;
  }

  .kwm-mobile-site-header__logo {
    width: 108px;
    max-width: 108px;
    max-height: 44px;
  }
}

@media (max-width: 370px) {
  .kwm-mobile-site-header__inner {
    grid-template-columns: minmax(78px, 1fr) auto minmax(78px, 1fr);
    padding-inline: 7px;
  }

  .kwm-mobile-site-header__group {
    gap: 0;
  }

  .kwm-mobile-site-header__action {
    flex-basis: 38px;
    width: 38px;
    min-width: 38px;
  }

  .kwm-mobile-site-header__action .kwm-mobile-site-header__icon,
  .kwm-mobile-site-header__action svg.kwm-mobile-site-header__icon {
    width: 25px;
    height: 25px;
  }

  .kwm-mobile-site-header__logo {
    width: 98px;
    max-width: 98px;
  }
}

@media (min-width: 1025px) {
  .kwm-desktop-site-header {
    display: block;
  }

  .kwm-mobile-site-header {
    display: none;
  }
}
