/* ==========================================================================
   FlagsExpo redesign V1 (Figma) — Header + Footer
   Loaded AFTER Css/default.css — only styles new v2-* classes plus light
   overrides on top of the existing mega-menu markup (nav ul li.mainMenuItem
   etc.), which is left in place and still driven by RotatorMaster.master.cs.
   ========================================================================== */

@font-face {
  font-family: 'Inter';
  src: url('../fonts/Inter-Variable.ttf') format('truetype-variations'), url('../fonts/Inter-Variable.ttf') format('truetype');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Literata';
  src: url('../fonts/Literata-Variable.ttf') format('truetype-variations'), url('../fonts/Literata-Variable.ttf') format('truetype');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* Global safety net: clip any element that still bleeds past the viewport
   edge instead of letting the whole page grow a horizontal scrollbar. This
   doesn't fix the underlying oversized element (that's still a bug worth
   finding), but it stops the page-wide side-scroll it causes. */
html, body { max-width: 100%; overflow-x: hidden; }

:root {
  --v2-navy: #00205b;
  --v2-navy-dark: #001845;
  --v2-red: #c8102e;
  --v2-red-dark: #bf0d3e;
  --v2-text: #1f1f1f;
  --v2-text-muted: #989ca1;
  --v2-border: #f3f3f3;
  --v2-font: 'Inter', Arial, Helvetica, sans-serif;
  --v2-font-display: 'Literata', Georgia, serif;
}

.v2-topbar, .v2-mainbar, .v2-nav-wrapper, .v2-footer,
.v2-topbar *, .v2-mainbar *, .v2-nav-wrapper *, .v2-footer * {
  box-sizing: border-box;
  font-family: var(--v2-font);
}

/* ---------- Top bar ---------- */
.v2-topbar { background: var(--v2-navy); width: 100%; }
.v2-topbar-inner {
  max-width: 1440px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 80px;
}
.v2-topbar-badges { display: flex; gap: 32px; align-items: center; flex-wrap: wrap; }
.v2-badge { display: inline-flex; align-items: center; gap: 8px; color: #fff; font-size: 13px; font-weight: 600; white-space: nowrap; }
.v2-badge img { width: 16px; height: 16px; }
.v2-topbar-links { display: flex; gap: 32px; align-items: center; }
.v2-topbar-links a { color: #fff; font-size: 13px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.v2-topbar-links a:hover { text-decoration: underline; }
.v2-topbar-callus {
  display: none; align-items: center; gap: 6px;
  color: #fff; font-size: 13px; font-weight: 700; text-decoration: none; white-space: nowrap;
}
.v2-topbar-callus img { width: 14px; height: 14px; }

/* ---------- Main bar ---------- */
.v2-mainbar {
  background: #fff; border-bottom: 1px solid var(--v2-border);
  max-width: 1440px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 80px; gap: 24px;
}
.v2-mainbar-left { display: flex; align-items: center; gap: 24px; flex: 1 1 0; min-width: 0; }
.v2-logo { display: block; flex-shrink: 0; }
.v2-logo img { display: block; height: 40px; width: auto; }
.v2-logo .v2-logo-icon { display: none; }

.v2-search { flex: 1 1 0; min-width: 0; display: flex; align-items: stretch; background: #f5f6f8; }
.v2-search-input { flex: 1 1 0; min-width: 0; border: none; background: transparent; padding: 12px 0 12px 24px; font-size: 14px; color: var(--v2-text); outline: none; }
.v2-search-input::placeholder { color: var(--v2-text-muted); }
.v2-search-btn { background: var(--v2-red); width: 40px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; border: none; cursor: pointer; }
.v2-search-btn img { width: 20px; height: 20px; }

/* ---------- Search autocomplete (jQuery UI widget, restyled to match v2) ---------- */
.ui-autocomplete {
  box-sizing: border-box;
  font-family: var(--v2-font);
  background: #fff;
  border: 1px solid var(--v2-border);
  box-shadow: 0 12px 24px rgba(0,0,0,0.12);
  margin: 8px 0 0 0;
  padding: 6px 0;
  list-style: none;
  max-height: 340px;
  overflow-y: auto;
  overflow-x: hidden;
}
.ui-autocomplete li { list-style: none; padding: 0; margin: 0; }
.ui-autocomplete li:nth-child(even) .ui-autocomplete-a-image { background: #f9f9fa; }
.ui-autocomplete .ui-autocomplete-a-image {
  display: flex; align-items: center; gap: 16px;
  padding: 14px 16px;
  text-decoration: none;
  background: #fff;
  cursor: pointer;
}
.ui-autocomplete .ui-autocomplete-a-image img {
  width: 48px; height: 32px; object-fit: cover; flex-shrink: 0;
  border: 1px solid var(--v2-border); float: none; margin: 0;
}
.ui-autocomplete .ui-autocomplete-a-image span {
  float: none; width: auto; font: inherit; font-size: 14px; color: var(--v2-text); line-height: 1.3;
}
.ui-autocomplete .ui-autocomplete-a-image:hover,
.ui-autocomplete .ui-autocomplete-a-image:active,
.ui-autocomplete .ui-autocomplete-a-image:visited { color: var(--v2-text); }
.ui-autocomplete .ui-state-focus .ui-autocomplete-a-image,
.ui-autocomplete .ui-autocomplete-a-image:hover { background: #f5f6f8; }
.ui-autocomplete .ui-state-focus .ui-autocomplete-a-image span,
.ui-autocomplete .ui-autocomplete-a-image:hover span { color: var(--v2-red); }

.v2-mainbar-right { display: flex; align-items: center; gap: 20px; flex-shrink: 0; }
.v2-iconlink { display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--v2-text); text-decoration: none; font-size: 13px; font-weight: 500; position: relative; }
.v2-iconlink img { width: 22px; height: 22px; }
.v2-iconlink:hover { color: var(--v2-red); }
.v2-cart { position: relative; }
.v2-cart-badge {
  position: absolute; top: -6px; right: -10px;
  background: var(--v2-red); color: #fff; font-size: 10px; font-weight: 700;
  min-width: 16px; height: 16px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center; padding: 0 3px;
}
.v2-cart-badge:empty::before { content: '0'; }

.v2-divider img { display: block; height: 32px; width: 1px; }

.v2-callus { display: flex; flex-direction: column; gap: 4px; }
.v2-callus-label { font-size: 11px; color: var(--v2-text-muted); text-transform: uppercase; letter-spacing: 0.4px; }
.v2-callus-number { font-size: 16px; font-weight: 700; color: var(--v2-text); text-decoration: none; }

/* ---------- Nav / mega-menu (desktop default) ---------- */
.v2-nav-wrapper { background: #fff; border-bottom: 1px solid rgba(0,0,0,0.06); }
.v2-nav { max-width: 1440px; margin: 0 auto; padding: 0 80px; float: none; }
.v2-nav-list { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; flex-wrap: wrap; }

/* light reskin over the existing mega-menu classes (structure/behavior unchanged) */
.v2-nav-list li.mainMenuItem { float: none; display: flex; align-items: center; }
.v2-nav-list li.mainMenuItem > a {
  padding: 22px 8px 22px 26px; color: var(--v2-text) !important; font-size: 14px; font-weight: 500; display: block;
}
.v2-nav-list li.mainMenuItem:hover,
.v2-nav-list li.mainMenuItem.active {
  background: transparent;
}
.v2-nav-list li.mainMenuItem:hover > a,
.v2-nav-list li.mainMenuItem.active > a {
  color: var(--v2-red) !important;
}
.v2-nav-list li.mainMenuItem .v2-nav-arrow {
  display: inline-block; width: 10px; height: 10px; margin-right: 26px; flex-shrink: 0;
  background: url('../img/icon-chevron-down.svg') no-repeat center / contain;
  transition: transform 0.15s ease;
  cursor: pointer;
}
.v2-nav-list li.mainMenuItem:hover .v2-nav-arrow,
.v2-nav-list li.mainMenuItem.is-open .v2-nav-arrow {
  transform: rotate(180deg);
}
.v2-nav-list li ul li table td.right .catTitle {
  color: var(--v2-navy);
}
.v2-nav-list li ul li table td.right .catSubcats a {
  color: var(--v2-text);
  background-image: none;
  padding-left: 0;
}
.v2-nav-list li ul li table td.right .catSubcats a:hover {
  color: var(--v2-red) !important;
}

/* Hamburger toggle button — hidden on desktop, shown on mobile/tablet */
.v2-nav-toggle { display: none; cursor: pointer; align-items: center; gap: 8px; padding: 14px 20px; }
.v2-nav-toggle p { margin: 0; font-size: 14px; font-weight: 600; line-height: 1; color: var(--v2-text); }
.v2-hamburger {
  display: flex; flex-direction: column; justify-content: space-between;
  width: 20px; height: 14px; flex-shrink: 0;
}
.v2-hamburger span { display: block; width: 100%; height: 2px; background: var(--v2-text); }


/* ---------- Footer ---------- */
.v2-footer { background: var(--v2-navy-dark); color: #fff; padding-top: 32px; }
.v2-footer-top {
  max-width: 1440px; margin: 0 auto; padding: 48px 64px;
  display: flex; align-items: flex-start; justify-content: space-between; gap: 100px; flex-wrap: nowrap;
}
.v2-footer-brand { display: flex; flex-direction: column; gap: 32px; width: 200px; flex-shrink: 0; }
.v2-footer-logo { width: 144px; height: 74px; display: block; }
.v2-footer-contact { display: flex; flex-direction: column; gap: 14px; }
.v2-footer-contact-row { display: flex; align-items: center; gap: 8px; }
.v2-footer-contact-row img { width: 20px; height: 20px; }
.v2-footer-contact-row a { color: #fff; text-decoration: none; font-size: 15px; }
.v2-footer-social { display: flex; gap: 12px; align-items: center; }
.v2-footer-social img { width: 32px; height: 32px; }
.v2-footer-annin { height: 40px; width: auto; background: #fff; padding: 2px 4px; margin-right: 8px; }

.v2-footer-cols { display: flex; gap: 24px; flex-wrap: nowrap; flex: 1 1 auto; justify-content: space-between; min-width: 0; }
.v2-footer-col { display: flex; flex-direction: column; min-width: 0; flex: 1 1 0; }
.v2-footer-col-toggle {
  margin: 0 0 12px 0; font-size: 17px; font-weight: 700; color: #fff;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  cursor: default;
}
.v2-footer-col-chevron { display: none; width: 16px; height: 16px; flex-shrink: 0; transition: transform 0.2s ease; }
.v2-footer-col-links-inner { display: flex; flex-direction: column; gap: 14px; }
.v2-footer-col a { color: rgba(255,255,255,0.7); text-decoration: none; font-size: 13px; }
.v2-footer-col a:hover { color: #fff; text-decoration: underline; }

.v2-footer-payments {
  max-width: 1440px; margin: 0 auto; padding: 0 64px 32px 64px;
  display: flex; gap: 13px; align-items: center; justify-content: flex-end; flex-wrap: wrap;
}
.v2-payment-icon { height: 26px; width: 41.6px; display: inline-block; }
.v2-payment-icon-layered { position: relative; width: 41.6px; height: 26px; display: inline-block; }
.v2-payment-layer { position: absolute; inset: 0; height: 100%; width: 100%; }

.v2-footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.15);
  max-width: 1440px; margin: 0 auto; padding: 24px 64px 32px 64px;
  display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap;
}
.v2-footer-bottom p { margin: 0; font-size: 14px; color: rgba(255,255,255,0.7); }
.v2-footer-bottom-links { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.v2-footer-bottom-links a { color: rgba(255,255,255,0.7); text-decoration: none; font-size: 14px; }
.v2-footer-bottom-links a:hover { color: #fff; }
.v2-footer-bottom-links #siteseal { display: inline-flex; }
.v2-footer-bottom-links #siteseal img { height: 34px; width: auto; }

/* ==========================================================================
   Responsive
   Breakpoints: >=1024px desktop (default above), 641-1023px tablet, <=640px phone
   ========================================================================== */

/* ---------- Tablet (<=1023px) ---------- */
@media (max-width: 1023px) {
  .v2-topbar-inner { padding-left: 20px; padding-right: 20px; }
  .v2-topbar-badges { display: none; }
  .v2-topbar-links { gap: 20px; }
  .v2-topbar-callus { display: flex; }

  .v2-mainbar { padding: 12px 20px; flex-wrap: nowrap; gap: 12px; }
  .v2-mainbar-left { order: 1; flex: 1 1 auto; gap: 12px; }
  .v2-mainbar-right { order: 2; gap: 14px; }
  .v2-logo img { height: 32px; }
  .v2-logo .v2-logo-full { display: none; }
  .v2-logo .v2-logo-icon { display: block; }

  .v2-callus { display: none; }
  .v2-divider { display: none; }

  .v2-nav { padding: 0 20px; max-width: none; }
  .v2-footer-top { padding: 32px 20px; gap: 32px; flex-direction: column; }
  .v2-footer-payments, .v2-footer-bottom { padding-left: 20px; padding-right: 20px; }
  .v2-footer-cols { gap: 0; flex-direction: column; width: 100%; }
  .v2-footer-brand { width: 100%; }

  /* Footer link columns become collapsible accordions */
  .v2-footer-col { border-top: 1px solid rgba(255,255,255,0.15); }
  .v2-footer-cols .v2-footer-col:last-child { border-bottom: 1px solid rgba(255,255,255,0.15); }
  .v2-footer-col-toggle { cursor: pointer; margin: 0; padding: 18px 0; }
  .v2-footer-col-chevron { display: block; }
  .v2-footer-col-links {
    display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.25s ease;
  }
  .v2-footer-col-links-inner { overflow: hidden; }
  .v2-footer-col.is-open .v2-footer-col-links { grid-template-rows: 1fr; padding-bottom: 18px; }
  .v2-footer-col.is-open .v2-footer-col-chevron { transform: rotate(180deg); }

  /* Mobile-style off-canvas nav (mega-menu row becomes a toggleable vertical list) */
  .v2-nav-toggle { display: flex; }
  .v2-nav-wrapper .v2-nav {
    display: none;
    border-top: 1px solid var(--v2-border);
  }
  .v2-nav-wrapper.v2-nav-open .v2-nav { display: block; }
  .v2-nav-list { flex-direction: column; align-items: stretch; }
  .v2-nav-list li.mainMenuItem { width: 100%; flex-wrap: wrap; border-bottom: 1px solid var(--v2-border); }
  .v2-nav-list li.mainMenuItem > a { padding: 14px 4px; flex: 1 1 auto; }
  .v2-nav-list li.mainMenuItem .v2-nav-arrow { margin-right: 4px; }
}

/* ---------- Phone (<=640px) ---------- */
@media (max-width: 640px) {
  .v2-topbar-inner { flex-wrap: wrap; row-gap: 6px; }
  .v2-topbar-links { gap: 10px; }
  .v2-topbar-links a { font-size: 11px; }
  .v2-topbar-callus { font-size: 12px; }

  .v2-mainbar { gap: 10px; }
  .v2-mainbar-left { gap: 10px; }
  .v2-mainbar-right { gap: 10px; }
  .v2-iconlink-label { display: none; }
  .v2-iconlink img { width: 20px; height: 20px; }

  .v2-search-input { padding-left: 14px; font-size: 13px; }

  .v2-footer-cols { gap: 0; }
  .v2-footer-bottom { flex-direction: column; align-items: flex-start; gap: 12px; }
  .v2-footer-payments { justify-content: flex-start; }
}
