/* ============================================================
   TargetWeb — header.css
   Three-row: Topbar → Mid header → Nav bar
   ============================================================ */

/* ── Shared container ─────────────────────────────────────── */
.tw-wrap {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 32px;
}

/* ── Announcement bar ─────────────────────────────────────── */
#tw-announcement-bar {
  background: var(--announcement-bg, #e63030);
  color: var(--announcement-color, #fff);
  text-align: center;
  padding: 9px 20px;
  font-size: 13px;
  font-weight: 500;
}
#tw-announcement-bar a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ── Site header wrapper ──────────────────────────────────── */
.tw-site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  transition: box-shadow 0.3s ease;
}
.tw-site-header.is-scrolled {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

/* ══════════════════════════════════════════════════════════
   ROW 1 — TOPBAR
   ══════════════════════════════════════════════════════════ */
.tw-topbar {
  background: var(--topbar-bg, #ffffff);
  border-bottom: 1px solid rgba(0, 0, 0, 0.07);
}
.tw-topbar__inner {
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.tw-topbar__left,
.tw-topbar__right {
  display: flex;
  align-items: center;
  gap: 20px;
}
.tw-topbar__item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--topbar-text, #444);
  text-decoration: none;
  font-size: 12px;
  white-space: nowrap;
  transition: color 0.2s;
}
.tw-topbar__item svg {
  opacity: 0.5;
  flex-shrink: 0;
}
.tw-topbar__item:hover {
  color: var(--color-primary, #e63030);
}
.tw-topbar__phone {
  font-weight: 600;
}
.tw-topbar__socials {
  display: flex;
  align-items: center;
  gap: 10px;
  border-left: 1px solid rgba(0, 0, 0, 0.1);
  padding-left: 16px;
}
.tw-topbar__social {
  color: var(--topbar-text, #444);
  opacity: 0.45;
  display: flex;
  align-items: center;
  text-decoration: none;
  transition:
    color 0.2s,
    opacity 0.2s;
}
.tw-topbar__social:hover {
  color: var(--color-primary, #e63030);
  opacity: 1;
}

/* ══════════════════════════════════════════════════════════
   ROW 2 — MID HEADER
   ══════════════════════════════════════════════════════════ */
.tw-midheader {
  background: var(--header-bg, #ffffff);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}
.tw-midheader__inner {
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

/* Logo */
.tw-logo a {
  display: flex;
  align-items: center;
  text-decoration: none;
}
.tw-logo-img {
  height: var(--logo-height, 56px);
  width: auto;
  display: block;
  transition: opacity 0.2s;
}
.tw-logo a:hover .tw-logo-img {
  opacity: 0.85;
}
.tw-logo-text {
  font-size: 22px;
  font-weight: 800;
  color: var(--color-dark, #2a2a2a);
  letter-spacing: -0.02em;
}

/* ── Action icons — all same size ─────────────────────────── */
.tw-header-actions {
  display: flex;
  align-items: center;
  gap: 2px;
}

.tw-icon-btn {
  position: relative;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: var(--header-icon, #1a1a1a);
  cursor: pointer;
  text-decoration: none;
  transition:
    background 0.18s,
    color 0.18s,
    transform 0.15s;
  flex-shrink: 0;
}
.tw-icon-btn svg {
  width: 19px;
  height: 19px;
  display: block;
  flex-shrink: 0;
}
.tw-icon-btn:hover {
  background: rgba(0, 0, 0, 0.05);
  color: var(--color-primary, #e63030);
  transform: translateY(-1px);
}
.tw-icon-btn:active {
  transform: translateY(0);
}

/* Cart badge */
.tw-cart-badge {
  position: absolute;
  top: 5px;
  right: 5px;
  background: var(--color-primary, #e63030);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  min-width: 15px;
  height: 15px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
  line-height: 1;
  pointer-events: none;
  border: 2px solid var(--header-bg, #fff);
}

/* Hamburger — hidden on desktop, shown on mobile via media query */
.tw-hamburger {
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  display: none;
  padding: 8px;
  width: 42px;
  height: 42px;
}
.tw-bar {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--header-icon, #1a1a1a);
  border-radius: 2px;
  transition:
    transform 0.25s ease,
    opacity 0.2s ease;
  transform-origin: center;
}
.tw-hamburger[aria-expanded="true"] .tw-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.tw-hamburger[aria-expanded="true"] .tw-bar:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.tw-hamburger[aria-expanded="true"] .tw-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ── Search bar ───────────────────────────────────────────── */
.tw-search-bar {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  border-top: 1px solid transparent;
  transition:
    max-height 0.32s ease,
    opacity 0.28s ease,
    border-color 0.25s;
  background: var(--header-bg, #ffffff);
}
.tw-search-bar.is-open {
  max-height: 72px;
  opacity: 1;
  border-top-color: rgba(0, 0, 0, 0.07);
}
.tw-search-bar .tw-wrap {
  padding-top: 12px;
  padding-bottom: 12px;
}
.tw-search-form {
  display: flex;
  align-items: center;
  gap: 0;
  border: 1.5px solid rgba(0, 0, 0, 0.14);
  border-radius: 6px;
  overflow: hidden;
  max-width: 560px;
  transition: border-color 0.2s;
}
.tw-search-form:focus-within {
  border-color: var(--color-primary, #e63030);
}
.tw-search-input {
  flex: 1;
  height: 42px;
  border: none;
  outline: none;
  padding: 0 16px;
  font-size: 14px;

  background: transparent;
  color: #1a1a1a;
}
.tw-search-input::placeholder {
  color: #aaa;
}
.tw-search-submit {
  width: 48px;
  height: 42px;
  background: var(--color-primary, #e63030);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex-shrink: 0;
  transition: opacity 0.18s;
}
.tw-search-submit:hover {
  opacity: 0.88;
}

/* ══════════════════════════════════════════════════════════
   ROW 3 — NAV BAR
   spacing above added via padding-top on midheader border
   ══════════════════════════════════════════════════════════ */
.tw-navbar {
  background: var(--nav-bg, #2a2a2a);
}
.tw-navbar__inner {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Menu */
.tw-nav-menu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
}
.tw-nav-menu > li {
  position: relative;
}
.tw-nav-menu > li > a {
  display: block;
  padding: 16px 20px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--nav-text, #ffffff);
  text-decoration: none;
  white-space: nowrap;

  position: relative;
  transition: color 0.2s;
}

/* Animated underline slide from left */
.tw-nav-menu > li > a::after {
  content: "";
  position: absolute;
  bottom: 10px;
  left: 20px;
  right: 20px;
  height: 2px;
  background: var(--color-primary, #e63030);
  border-radius: 2px;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.26s cubic-bezier(0.4, 0, 0.2, 1);
}
.tw-nav-menu > li > a:hover::after,
.tw-nav-menu > li.current-menu-item > a::after,
.tw-nav-menu > li.current-menu-ancestor > a::after {
  transform: scaleX(1);
}
.tw-nav-menu > li > a:hover,
.tw-nav-menu > li.current-menu-item > a,
.tw-nav-menu > li.current-menu-ancestor > a {
  color: var(--nav-hover, #e63030);
}

/* Dropdown */
.tw-nav-menu .sub-menu {
  list-style: none;
  margin: 0;
  padding: 8px 0;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 230px;
  background: #ffffff;
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.09);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.13);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition:
    opacity 0.22s ease,
    transform 0.22s ease,
    visibility 0.22s;
  z-index: 100;
}
.tw-nav-menu > li:hover > .sub-menu,
.tw-nav-menu > li:focus-within > .sub-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.tw-nav-menu .sub-menu li {
  position: relative;
}
.tw-nav-menu .sub-menu li a {
  display: block;
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 400;
  color: #2a2a2a;
  text-decoration: none;
  letter-spacing: 0;
  text-transform: none;
  transition:
    background 0.14s,
    color 0.14s,
    padding-left 0.14s;
  border-left: 3px solid transparent;
}
.tw-nav-menu .sub-menu li a:hover {
  background: rgba(0, 0, 0, 0.03);
  color: var(--color-primary, #e63030);
  padding-left: 24px;
  border-left-color: var(--color-primary, #e63030);
}

/* ══════════════════════════════════════════════════════════
   MOBILE DRAWER
   ══════════════════════════════════════════════════════════ */
.tw-mobile-nav {
  position: fixed;
  inset: 0 0 0 auto;
  width: 300px;
  max-width: 88vw;
  background: var(--nav-bg, #2a2a2a);
  color: #fff;
  z-index: 1200;
  transform: translateX(100%);
  transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.tw-mobile-nav.is-open {
  transform: translateX(0);
}
.tw-mobile-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}
.tw-mobile-logo img,
.tw-mobile-head .tw-logo-img {
  height: 36px;
  width: auto;
  filter: brightness(0) invert(1);
}
.tw-mobile-logo-text {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
}
.tw-mobile-close {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.08);
  border: none;
  border-radius: 6px;
  color: #fff;
  cursor: pointer;
  transition: background 0.15s;
  flex-shrink: 0;
}
.tw-mobile-close:hover {
  background: rgba(255, 255, 255, 0.16);
}
.tw-mobile-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* Mobile menu items */
.tw-mobile-menu {
  list-style: none;
  margin: 0;
  padding: 8px 0;
}
.tw-mobile-menu > li > a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #fff;
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  transition:
    color 0.15s,
    background 0.15s;
}
.tw-mobile-menu > li > a:hover,
.tw-mobile-menu > li.current-menu-item > a {
  color: var(--color-primary, #e63030);
  background: rgba(255, 255, 255, 0.03);
}
.tw-mobile-menu .sub-menu {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 0;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.18);
  transition: max-height 0.3s ease;
}
.tw-mobile-menu .menu-item-has-children.is-open > .sub-menu {
  max-height: 400px;
}
.tw-mobile-menu .sub-menu li a {
  display: block;
  padding: 11px 20px 11px 32px;
  font-size: 13px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.6);
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  transition: color 0.14s;
}
.tw-mobile-menu .sub-menu li a:hover {
  color: #fff;
}

/* Mobile contact section */
.tw-mobile-contact {
  padding: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.tw-mobile-contact__item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.55);
  text-decoration: none;
  transition: color 0.15s;
}
.tw-mobile-contact__item svg {
  flex-shrink: 0;
  opacity: 0.7;
}
.tw-mobile-contact__item:hover {
  color: #fff;
}

/* Overlay */
.tw-nav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 1100;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.3s,
    visibility 0.3s;
}
.tw-nav-overlay.is-visible {
  opacity: 1;
  visibility: visible;
}

/* ══════════════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════════════ */

/* ── Tablet (1024px and below) ───────────────────────────── */
@media (max-width: 1024px) {
  /* Hide desktop nav bar */
  .tw-navbar {
    display: none;
  }

  /* Show hamburger */
  .tw-hamburger {
    display: flex;
  }

  /* Make sure mobile nav is properly set up */
  .tw-mobile-nav {
    display: flex;
  }
}

/* ── Small tablet (768px and below) ──────────────────────── */
@media (max-width: 768px) {
  .tw-wrap {
    padding: 0 18px;
  }
  .tw-midheader__inner {
    height: 68px;
  }
  .tw-logo-img {
    height: var(--logo-height-mobile, 40px);
  }
  /* Hide hours on topbar — not enough space */
  .tw-topbar__item.tw-topbar__hours {
    display: none;
  }
  .tw-topbar__socials {
    display: none;
  }
}

/* ── Mobile (480px and below) ────────────────────────────── */
@media (max-width: 480px) {
  .tw-wrap {
    padding: 0 14px;
  }
  .tw-topbar {
    display: none;
  }
  .tw-midheader__inner {
    height: 60px;
  }
  .tw-logo-img {
    height: var(--logo-height-mobile, 40px);
  }
  .tw-icon-btn {
    width: 38px;
    height: 38px;
  }
  .tw-icon-btn svg {
    width: 17px;
    height: 17px;
  }
}

/* ── Mobile nav drawer ────────────────────────────────────── */
/* Use transform instead of display:none so JS transition works */
.tw-mobile-menu {
  display: block;
  width: 100%;
}
.tw-mobile-menu > li {
  display: block;
  width: 100%;
}
.tw-mobile-menu > li > a {
  display: flex;
  width: 100%;
}
