/* ==========================================================================
   STANDALONE BRAND SHELL — AGV (Lamborghini x Audi x VinFast)
   & DAINESE (Ferrari x Audi x VinFast)
   Shared Header, Native <dialog> Swipeable Drawer, Footer & Subpage Skin
   ========================================================================== */

:root {
  scroll-padding-top: 84px;
}

.bsh-tricolore {
  position: fixed;
  inset-block-start: 0;
  inset-inline: 0;
  block-size: 3px;
  z-index: 1200;
  pointer-events: none;
  background: linear-gradient(90deg, #009246 0% 33.33%, #ffffff 33.33% 66.66%, #ce2b37 66.66% 100%);
}

/* Header Base */
.bsh-header {
  --bsh-h-bg: rgba(6, 7, 10, 0.86);
  --bsh-h-bg-solid: rgba(6, 7, 10, 0.96);
  --bsh-h-fg: #f8fafc;
  --bsh-h-muted: #94a3b8;
  --bsh-h-border: rgba(255, 255, 255, 0.1);
  --bsh-accent: #00e563;
  --bsh-accent-fg: #040608;
  position: sticky;
  inset-block-start: 3px;
  z-index: 1100;
  block-size: 76px;
  display: flex;
  align-items: center;
  background: var(--bsh-h-bg);
  color: var(--bsh-h-fg);
  border-block-end: 1px solid var(--bsh-h-border);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  transition: background-color 0.25s ease, box-shadow 0.25s ease;
  font-family: "Be Vietnam Pro", "Plus Jakarta Sans", system-ui, -apple-system, sans-serif;
}

.bsh-header.bsh-theme-dainese {
  --bsh-h-bg: rgba(10, 10, 13, 0.88);
  --bsh-h-bg-solid: rgba(10, 10, 13, 0.97);
  --bsh-accent: #d6001c;
  --bsh-sub-color: #dfbf7c;
  --bsh-accent-fg: #ffffff;
  --bsh-h-border: rgba(255, 255, 255, 0.12);
}

.bsh-header.is-scrolled {
  background: var(--bsh-h-bg-solid);
  box-shadow: 0 18px 42px -22px rgba(0, 0, 0, 0.72);
}

/* Shrinking Header on Scroll (Scroll-Driven Animation with safe @supports gate) */
@media (prefers-reduced-motion: no-preference) {
  @supports ((animation-timeline: scroll()) and (animation-range: 0% 100%)) {
    @keyframes bsh-header-compact {
      to {
        box-shadow: 0 18px 44px -20px rgba(0, 0, 0, 0.78);
        background: var(--bsh-h-bg-solid);
      }
    }
    .bsh-header {
      animation: bsh-header-compact auto linear both;
      animation-timeline: scroll(block root);
      animation-range: 0px 140px;
    }
  }
}

.bsh-inner {
  inline-size: min(1400px, calc(100% - 32px));
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.bsh-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
  min-inline-size: 0;
  flex-shrink: 0;
}

.bsh-crest {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.bsh-theme-agv .bsh-crest {
  inline-size: 46px;
  block-size: 38px;
  background: linear-gradient(135deg, #009246 0%, #00c853 48%, #e50914 100%);
  color: #ffffff;
  font-family: "Chakra Petch", "Be Vietnam Pro", sans-serif;
  font-weight: 900;
  font-size: 16px;
  letter-spacing: 0.08em;
  clip-path: polygon(10px 0, 100% 0, calc(100% - 10px) 100%, 0 100%);
}

.bsh-theme-dainese .bsh-crest {
  inline-size: 40px;
  block-size: 40px;
  background: #d6001c;
  color: #ffffff;
  border-radius: 2px;
  box-shadow: 0 8px 20px -8px rgba(214, 0, 28, 0.75);
}

.bsh-brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
  min-inline-size: 0;
}

.bsh-brand-title {
  font-weight: 900;
  font-size: 15px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #ffffff;
  white-space: nowrap;
}

.bsh-theme-agv .bsh-brand-title {
  font-family: "Chakra Petch", "Be Vietnam Pro", sans-serif;
  font-size: 16.5px;
}

.bsh-brand-sub {
  font-family: "JetBrains Mono", monospace;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--bsh-sub-color, var(--bsh-accent));
  text-transform: uppercase;
  margin-block-start: 3px;
  white-space: nowrap;
}

.bsh-nav {
  display: flex;
  align-items: center;
  gap: 24px;
}

.bsh-nav a {
  position: relative;
  color: rgba(248, 250, 252, 0.78);
  text-decoration: none;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  padding-block: 8px;
  white-space: nowrap;
  transition: color 0.2s ease;
}

.bsh-nav a::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  inset-block-end: 2px;
  block-size: 2px;
  background: var(--bsh-accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.24s cubic-bezier(0.22, 1, 0.36, 1);
}

.bsh-nav a:hover,
.bsh-nav a:focus-visible {
  color: #ffffff;
}

.bsh-nav a:hover::after,
.bsh-nav a:focus-visible::after {
  transform: scaleX(1);
}

.bsh-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.bsh-tel {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 14px;
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  font-weight: 700;
  color: #e2e8f0;
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.16);
  transition: border-color 0.2s ease, color 0.2s ease, background-color 0.2s ease;
  white-space: nowrap;
}

.bsh-tel:hover {
  border-color: var(--bsh-accent);
  color: #ffffff;
  background: rgba(255, 255, 255, 0.05);
}

.bsh-cta-wrap {
  display: inline-flex;
  padding: 2px;
}

.bsh-cta-wrap:focus-within {
  outline: 2px solid var(--bsh-accent);
  outline-offset: 2px;
}

.bsh-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  background: var(--bsh-accent);
  color: var(--bsh-accent-fg);
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 0.18s ease, filter 0.18s ease;
}

.bsh-theme-agv .bsh-cta {
  clip-path: polygon(8px 0, 100% 0, calc(100% - 8px) 100%, 0 100%);
  padding-inline: 22px;
}

.bsh-cta:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.bsh-menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  inline-size: 44px;
  block-size: 44px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #ffffff;
  cursor: pointer;
  touch-action: manipulation;
}

.bsh-menu-btn:focus-visible {
  outline: 2px solid var(--bsh-accent);
  outline-offset: 2px;
}

@media (max-width: 1060px) {
  .bsh-nav {
    display: none;
  }
  .bsh-menu-btn {
    display: inline-flex;
  }
}

@media (max-width: 640px) {
  .bsh-header {
    block-size: 62px;
  }
  .bsh-inner {
    inline-size: calc(100% - 24px);
    gap: 10px;
  }
  .bsh-brand {
    gap: 9px;
    flex: 1 1 auto;
    min-inline-size: 0;
  }
  .bsh-theme-agv .bsh-crest {
    inline-size: 40px;
    block-size: 32px;
    font-size: 13.5px;
  }
  .bsh-theme-dainese .bsh-crest {
    inline-size: 34px;
    block-size: 34px;
  }
  .bsh-brand-title,
  .bsh-theme-agv .bsh-brand-title {
    font-size: 13.5px;
    letter-spacing: 0.08em;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .bsh-tel {
    display: none;
  }
  .bsh-cta {
    padding: 8px 11px;
    font-size: 10.5px;
    letter-spacing: 0.05em;
  }
  .bsh-theme-agv .bsh-cta {
    padding-inline: 14px;
  }
  .bsh-brand-sub {
    display: none;
  }
}

@media (max-width: 520px) {
  .bsh-cta-wrap {
    display: none;
  }
}

/* ==========================================================================
   NATIVE <dialog> SWIPEABLE MOBILE NAVIGATION DRAWER
   Follows modern-web-guidance `navigation-drawer` pattern
   ========================================================================== */
.bsh-drawer {
  --drawer-width: min(21em, 84dvw, calc(100dvw - 24px));
  --drawer-backdrop: 0;
  inset: 0;
  inline-size: auto;
  block-size: auto;
  max-inline-size: none;
  max-block-size: none;
  margin: 0;
  padding: 0;
  background: transparent;
  border: 0;
  overflow: visible;
  font-family: "Be Vietnam Pro", "Plus Jakarta Sans", system-ui, sans-serif;
}

.bsh-drawer::backdrop {
  background: #000000;
  opacity: calc(var(--drawer-backdrop) * 0.68);
}

.bsh-drawer-scroller {
  position: relative;
  display: grid;
  grid-template-columns: var(--drawer-width) 100%;
  overflow-x: scroll;
  overscroll-behavior: none;
  scrollbar-width: none;
  scroll-snap-type: x mandatory;
}

.bsh-drawer-scroller::-webkit-scrollbar {
  display: none;
}

@media (prefers-reduced-motion: no-preference) {
  .bsh-drawer-scroller {
    scroll-behavior: smooth;
  }
}

.bsh-drawer-scroller::after {
  content: "";
  scroll-snap-align: end;
  scroll-initial-target: nearest;
}

.bsh-drawer-sheet {
  display: grid;
  grid-template-rows: auto 1fr auto;
  block-size: 100svh;
  background: #07090d;
  color: #f8fafc;
  border-inline-end: 1px solid rgba(255, 255, 255, 0.12);
  overflow-y: auto;
  scroll-snap-align: start;
  scrollbar-width: none;
  padding: max(20px, env(safe-area-inset-top)) 20px max(24px, env(safe-area-inset-bottom));
}

.bsh-drawer.bsh-theme-dainese .bsh-drawer-sheet {
  background: #0b0a0d;
  border-inline-end-color: rgba(214, 0, 28, 0.35);
}

@supports (animation-timeline: scroll()) {
  .bsh-drawer {
    timeline-scope: --bsh-drawer-fade;
    animation: bsh-fade-drawer-backdrop linear both;
    animation-timeline: --bsh-drawer-fade;
  }
  .bsh-drawer-scroller {
    scroll-timeline: --bsh-drawer-fade x;
  }
  @property --drawer-backdrop {
    syntax: "<number>";
    inherits: true;
    initial-value: 0;
  }
  @keyframes bsh-fade-drawer-backdrop {
    0% { --drawer-backdrop: 1; }
    100% { --drawer-backdrop: 0; }
  }
}

.bsh-drawer-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block-end: 18px;
  border-block-end: 1px solid rgba(255, 255, 255, 0.1);
}

.bsh-drawer-close {
  inline-size: 42px;
  block-size: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #ffffff;
  cursor: pointer;
}

.bsh-drawer-links {
  list-style: none;
  margin: 18px 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.bsh-drawer-links a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 12px;
  color: #f1f5f9;
  text-decoration: none;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-block-end: 1px solid rgba(255, 255, 255, 0.06);
}

.bsh-drawer-links a span {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  color: #64748b;
}

.bsh-drawer-foot {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-block-start: 16px;
  border-block-start: 1px solid rgba(255, 255, 255, 0.1);
}

.bsh-drawer-foot a {
  display: flex;
  align-items: center;
  justify-content: center;
  min-block-size: 46px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
}

.bsh-drawer-foot .is-primary {
  background: #00e563;
  color: #040608;
}

.bsh-drawer.bsh-theme-dainese .bsh-drawer-foot .is-primary {
  background: #d6001c;
  color: #ffffff;
}

.bsh-drawer-foot .is-ghost {
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #ffffff;
}

/* ==========================================================================
   STANDALONE BRAND FOOTER (ZERO PHUOT4P / ZERO CROSS-BRAND LINKS)
   ========================================================================== */
.bsh-footer {
  background: #050608;
  color: #94a3b8;
  border-block-start: 1px solid rgba(255, 255, 255, 0.08);
  padding: 64px 0 max(36px, env(safe-area-inset-bottom));
  font-family: "Be Vietnam Pro", "Plus Jakarta Sans", system-ui, sans-serif;
}

.bsh-footer.bsh-theme-dainese {
  background: #09090b;
  border-block-start-color: rgba(214, 0, 28, 0.35);
}

.bsh-footer-inner {
  inline-size: min(1400px, calc(100% - 32px));
  margin-inline: auto;
}

.bsh-footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) repeat(2, minmax(0, 1fr));
  gap: 36px;
  padding-block-end: 40px;
}

@media (max-width: 860px) {
  .bsh-footer-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }
}

.bsh-footer h2 {
  margin: 0 0 14px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #ffffff;
}

.bsh-footer p {
  margin: 0 0 12px;
  font-size: 13.5px;
  line-height: 1.7;
  color: #94a3b8;
}

.bsh-footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.bsh-footer a {
  color: #cbd5e1;
  text-decoration: none;
  font-size: 13.5px;
  transition: color 0.18s ease;
}

.bsh-footer a:hover {
  color: #ffffff;
}

.bsh-theme-agv.bsh-footer a:hover {
  color: #00e563;
}

.bsh-theme-dainese.bsh-footer a:hover {
  color: #f43f5e;
}

.bsh-footer-bottom {
  padding-block-start: 24px;
  border-block-start: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
  color: #64748b;
}

.bsh-footer-host {
  font-family: "JetBrains Mono", monospace;
  color: #94a3b8;
}

/* ==========================================================================
   SUBPAGE BRAND IMMERSION OVERRIDES (/san-pham, /chi-tiet-san-pham, /lien-he)
   Hides multi-brand pills/ribbons from shared pages on single-brand domains
   ========================================================================== */
html[data-brand-subpage] .brand-quick-pills,
html[data-brand-subpage] [data-brand-bar="multi"],
html[data-brand-subpage] .vf-brand-switcher {
  display: none !important;
}
