/* ================================================================
   CAS & SONS PROTECTIVE GROUP — HEADER STYLES (header.css)
   Requires Google Fonts in <head>:
   <link href="https://fonts.googleapis.com/css2?family=Rajdhani:wght@500;600;700&family=Inter:wght@400;500&display=swap" rel="stylesheet">
================================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body { overflow-x: hidden; }

:root {
  --clr-blue:   #244383;
  --clr-blue2:  #1a3268;
  --clr-white:  #ffffff;
  --clr-text:   #1c2a4a;
  --clr-muted:  #5a6a8a;
  --clr-border: rgba(36, 67, 131, 0.15);
  --nav-h:      114px;
  --font-head:  'Rajdhani', sans-serif;
  --font-body:  'Inter', sans-serif;
  --ease:       cubic-bezier(0.4, 0, 0.2, 1);
  --radius:     6px;
  --max-w:      1380px;
}

/* ── TOP UTILITY BAR ─────────────────────────────────────────── */
.cas-topbar {
  background: var(--clr-blue);
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  font-family: var(--font-body);
  font-size: 12px;
  color: rgba(255, 255, 255, 0.8);
  letter-spacing: 0.04em;
}
.cas-topbar__inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.cas-topbar a { color: rgba(255, 255, 255, 0.8); text-decoration: none; }
.cas-topbar a:hover { color: var(--clr-white); }
.cas-topbar__right { display: flex; gap: 20px; align-items: center; }
.cas-topbar__cta {
  background: var(--clr-white);
  color: var(--clr-blue) !important;
  font-weight: 600;
  padding: 4px 14px;
  border-radius: var(--radius);
  transition: background 0.2s var(--ease);
}
.cas-topbar__cta:hover { background: #e8edf8; }

/* ── MAIN NAV ────────────────────────────────────────────────── */
.cas-nav {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--clr-white);
  border-bottom: 2px solid var(--clr-blue);
  box-shadow: 0 2px 20px rgba(36, 67, 131, 0.12);
}
.cas-nav__inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
  min-height: var(--nav-h);
  display: flex;
  align-items: stretch;
  gap: 8px;
}

/* ── LOGO ────────────────────────────────────────────────────── */
.cas-nav__logo { flex-shrink: 0; display: flex; align-items: center; align-self: center; }
.cas-nav__logo img { height: 104px; width: auto; display: block; }

/* ── DESKTOP MENU ────────────────────────────────────────────── */
.cas-menu {
  display: flex;
  align-items: center;
  list-style: none;
  gap: 0;
  margin-left: auto;
  flex-shrink: 1;
  min-width: 0;
  overflow: visible;
  flex-wrap: wrap;
  align-content: center;
}
.cas-menu__item { position: relative; }
.cas-menu__link {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 10px;
  font-family: var(--font-head);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--clr-text);
  text-decoration: none;
  border-radius: var(--radius);
  white-space: nowrap;
  transition: color 0.2s var(--ease), background 0.2s var(--ease);
}
.cas-menu__link:hover,
.cas-menu__item:hover > .cas-menu__link,
.cas-menu__link.active,
.cas-menu__item.active > .cas-menu__link {
  color: var(--clr-blue);
  background: rgba(36, 67, 131, 0.07);
}
.cas-menu__link.active {
  border-bottom: 2px solid var(--clr-blue);
  font-weight: 700;
}
.cas-menu__link svg {
  width: 12px; height: 12px;
  stroke: currentColor; fill: none; stroke-width: 2.5;
  flex-shrink: 0;
  transition: transform 0.25s var(--ease);
}
.cas-menu__item:hover > .cas-menu__link svg { transform: rotate(180deg); }

/* ── DROPDOWN ────────────────────────────────────────────────── */
.cas-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 200px;
  list-style: none;
  padding: 16px 0 6px;
  background: var(--clr-white);
  border: 1px solid var(--clr-border);
  border-top: 2px solid var(--clr-blue);
  border-radius: 0 0 var(--radius) var(--radius);
  box-shadow: 0 10px 30px rgba(36, 67, 131, 0.15);
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity 0.22s var(--ease), transform 0.22s var(--ease);
}
.cas-menu__item::after {
  content: '';
  position: absolute;
  bottom: -12px;
  left: 0;
  right: 0;
  height: 12px;
}
.cas-menu__item:hover > .cas-dropdown,
.cas-menu__item:focus-within > .cas-dropdown {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
.cas-dropdown li a {
  display: block;
  padding: 10px 20px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  color: var(--clr-muted);
  text-decoration: none;
  border-left: 2px solid transparent;
  transition: color 0.18s, border-color 0.18s, background 0.18s, padding-left 0.18s;
}
.cas-dropdown li a:hover {
  color: var(--clr-blue);
  border-left-color: var(--clr-blue);
  background: rgba(36, 67, 131, 0.05);
  padding-left: 26px;
}

/* ── NAV RIGHT ICONS ─────────────────────────────────────────── */
.cas-nav__actions {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
  margin-left: 8px;
}
.cas-nav__icon-btn {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  width: 40px; height: 40px;
  border-radius: var(--radius);
  color: var(--clr-text);
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
}
.cas-nav__icon-btn:hover { background: rgba(36, 67, 131, 0.08); color: var(--clr-blue); }
.cas-nav__icon-btn svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.8; }
.cas-cart-badge {
  position: absolute;
  top: 4px; right: 4px;
  background: var(--clr-blue);
  color: var(--clr-white);
  font-size: 10px; font-weight: 700;
  min-width: 16px; height: 16px;
  border-radius: 999px;
  display: flex; align-items: center; justify-content: center;
  line-height: 1;
}

/* ── HAMBURGER ───────────────────────────────────────────────── */
.cas-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px; height: 40px;
  background: none; border: none; cursor: pointer;
  padding: 8px; border-radius: var(--radius);
  transition: background 0.2s;
}
.cas-hamburger:hover { background: rgba(36, 67, 131, 0.08); }
.cas-hamburger span {
  display: block; width: 100%; height: 2px;
  background: var(--clr-text); border-radius: 2px;
  transition: transform 0.3s var(--ease), opacity 0.3s;
}
.cas-hamburger.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.cas-hamburger.is-open span:nth-child(2) { opacity: 0; }
.cas-hamburger.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── MOBILE DRAWER ───────────────────────────────────────────── */
.cas-mobile-nav {
  display: none;
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: min(340px, 88vw);
  background: var(--clr-white);
  border-left: 2px solid var(--clr-blue);
  z-index: 1100;
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform 0.35s var(--ease);
  padding-bottom: 40px;
}
.cas-mobile-nav.is-open { transform: translateX(0); }
.cas-mobile-nav__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid rgba(36, 67, 131, 0.12);
  background: #f5f7fc;
}
.cas-mobile-nav__head img { height: 40px; }
.cas-mobile-close {
  background: none; border: none; cursor: pointer;
  color: var(--clr-muted); padding: 6px;
  border-radius: var(--radius);
  display: flex; align-items: center;
}
.cas-mobile-close:hover { color: var(--clr-blue); }
.cas-mobile-close svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 2; }
.cas-mobile-menu { list-style: none; padding: 10px 0; }
.cas-mobile-menu__item { border-bottom: 1px solid rgba(36, 67, 131, 0.07); }
.cas-mobile-menu__link {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 22px;
  font-family: var(--font-head);
  font-size: 16px; font-weight: 600;
  letter-spacing: 0.05em; text-transform: uppercase;
  color: var(--clr-text); text-decoration: none;
  transition: color 0.18s, background 0.18s;
}
.cas-mobile-menu__link:hover { color: var(--clr-blue); background: rgba(36, 67, 131, 0.05); }
.cas-mobile-menu__toggle {
  background: none; border: none; cursor: pointer;
  color: var(--clr-muted); display: flex; padding: 4px;
}
.cas-mobile-menu__toggle svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2.5; transition: transform 0.25s; }
.cas-mobile-menu__item.is-open .cas-mobile-menu__toggle svg { transform: rotate(180deg); }
.cas-mobile-sub {
  list-style: none;
  max-height: 0; overflow: hidden;
  background: #f5f7fc;
  transition: max-height 0.3s var(--ease);
}
.cas-mobile-menu__item.is-open .cas-mobile-sub { max-height: 600px; }
.cas-mobile-sub li a {
  display: block;
  padding: 10px 22px 10px 36px;
  font-family: var(--font-body);
  font-size: 13px; color: var(--clr-muted);
  text-decoration: none;
  border-left: 2px solid transparent;
  transition: color 0.18s, border-color 0.18s;
}
.cas-mobile-sub li a:hover { color: var(--clr-blue); border-left-color: var(--clr-blue); }
.cas-mobile-actions { display: flex; gap: 12px; padding: 20px 22px 0; }
.cas-mobile-actions a {
  flex: 1; text-align: center; padding: 11px;
  border-radius: var(--radius);
  font-family: var(--font-head);
  font-size: 14px; font-weight: 600;
  letter-spacing: 0.05em; text-decoration: none;
  transition: background 0.2s, color 0.2s;
}
.cas-mobile-actions__login { border: 1px solid rgba(36, 67, 131, 0.3); color: var(--clr-blue); }
.cas-mobile-actions__login:hover { background: rgba(36, 67, 131, 0.06); }
.cas-mobile-actions__cart { background: var(--clr-blue); color: var(--clr-white); }
.cas-mobile-actions__cart:hover { background: var(--clr-blue2); }

/* ── OVERLAY ─────────────────────────────────────────────────── */
.cas-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(36, 67, 131, 0.25);
  z-index: 1050;
  backdrop-filter: blur(2px);
  opacity: 0;
  transition: opacity 0.3s;
}
.cas-overlay.is-active { opacity: 1; }

/* ── RESPONSIVE ──────────────────────────────────────────────── */
@media (max-width: 1200px) {
  .cas-menu__link { padding: 8px 8px; font-size: 13px; letter-spacing: 0.02em; }
}
@media (max-width: 1024px) {
  .cas-menu__link { padding: 8px 6px; font-size: 12.5px; }
}
@media (max-width: 900px) {
  .cas-menu { display: none; }
  .cas-mobile-nav { display: block; }
  .cas-overlay { display: block; }
  .cas-topbar__left { display: none; }
  .cas-nav__inner { align-items: center; min-height: 70px; }
  .cas-nav__actions {
    flex-direction: row;
    gap: 2px;
    padding: 0;
    margin-left: auto;
  }
  .cas-hamburger {
    display: flex;
    margin-left: 4px;
  }
}
@media (max-width: 480px) {
  .cas-nav__inner { padding: 0 16px; }
  .cas-nav__logo img { height: 60px; }
}
