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

:root {
  --bg: #ffffff;
  --surface: #f5f5f7;
  --surface2: #ebebed;
  --surface3: #e1e1e6;
  --border: #d8d8df;
  --accent: #ff8d00;
  --accent-dim: #e67f00;
  --cta: #00308d;
  --cta-dim: #002670;
  --text: #1c1c1e;
  --muted: #6e6e73;
  --nav-h: 72px;
  --radius: 8px;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Onest', sans-serif;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

/* ─── HEADER ─── */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-h);
  background: rgba(255, 255, 255, .8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 32px;
  gap: 32px;
  z-index: 1000;
}

.logo {
  display: flex;
  align-items: center;
  height: 42px;
  transition: transform .2s, opacity .2s;
}

.logo:hover {
  opacity: .8;
  transform: scale(1.02);
}

.logo img {
  height: 100%;
  width: auto;
  display: block;
}

/* ─── TRIGGER ─── */
.mega-trigger {
  display: flex;
  align-items: center;
  gap: 10px;
  height: var(--nav-h);
  padding: 0 24px;
  background: var(--accent);
  color: #fff;
  font-family: 'Unbounded', sans-serif;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: .02em;
  cursor: pointer;
  border: none;
  white-space: nowrap;
  transition: background .2s, transform .1s;
  user-select: none;
  flex-shrink: 0;
  text-decoration: none;
}

.mega-trigger:hover,
.mega-trigger.is-active {
  background: var(--accent-dim);
}

.mega-trigger:active {
  transform: scale(.98);
}

.trigger-icon {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 16px;
  flex-shrink: 0;
}

.trigger-icon span {
  display: block;
  height: 1.5px;
  background: #fff;
  transition: transform .3s, opacity .3s;
  transform-origin: center;
}

.mega-trigger.is-active .trigger-icon span:nth-child(1) {
  transform: translateY(5.5px) rotate(45deg);
}

.mega-trigger.is-active .trigger-icon span:nth-child(2) {
  opacity: 0;
}

.mega-trigger.is-active .trigger-icon span:nth-child(3) {
  transform: translateY(-5.5px) rotate(-45deg);
}

.nav-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav-link {
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
  transition: color .2s;
  position: relative;
}

.nav-link:hover {
  color: var(--text);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transition: transform .2s;
}

.nav-link:hover::after {
  transform: scaleX(1);
}

.cart-btn,
.cart-header-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color .2s, color .2s, background .2s;
  position: relative;
}

.cart-header-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(255, 141, 0, .05);
}

.cart-count {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(0);
  transition: all .3s;
}

.cart-count.has-items {
  opacity: 1;
  transform: scale(1);
}

@media (max-width: 768px) {
  .site-header {
    padding: 0 16px;
    gap: 12px;
    justify-content: space-between;
  }

  .logo {
    height: 32px;
  }

  .mega-trigger {
    position: relative;
    width: 44px;
    height: 44px;
    padding: 0;
    justify-content: center;
    border-radius: var(--radius);
    background: var(--accent);
    color: #fff;
  }

  .mega-trigger .trigger-icon span {
    background: #fff;
  }

  .mega-trigger.is-active {
    background: var(--accent-dim);
  }

  .trigger-label {
    display: none;
  }

  .nav-right {
    gap: 12px;
  }

  .cart-header-btn {
    padding: 8px 12px;
    font-size: 11px;
  }

  .nav-right .nav-link {
    display: none;
  }
}

/* ─── BREADCRUMBS ─── */
.breadcrumbs {
  margin-top: var(--nav-h);
  padding: 16px 32px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.breadcrumbs a {
  color: var(--muted);
  text-decoration: none;
  transition: color .2s;
}

.breadcrumbs a:hover {
  color: var(--accent);
}

.breadcrumbs .sep {
  opacity: .4;
}

.breadcrumbs .current {
  color: var(--text);
  font-weight: 500;
}

/* ─── MEGA DROPDOWN ─── */
.mega-dropdown {
  position: fixed;
  top: var(--nav-h);
  left: 0;
  right: 0;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  z-index: 999;
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
  transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1), transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.mega-dropdown.is-open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: all;
}

@media (min-width: 769px) {
  .mega-dropdown {
    height: auto !important;
    padding-top: 20px;
  }

  .mega-wrap {
    display: grid;
    grid-template-columns: 280px 1fr;
    max-width: 1440px;
    margin: 0 auto;
    width: 100%;
    position: relative;
  }

  .mega-wrap::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 280px;
    background: var(--surface);
    border-right: 1px solid var(--border);
    z-index: 1;
  }

  .mega-sidebar {
    display: contents;
  }

  .mega-item {
    display: contents;
  }

  .mega-tab {
    grid-column: 1;
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 24px;
    font-size: 13px;
    font-weight: 500;
    color: var(--muted);
    cursor: pointer;
    transition: color .15s, background .15s, border-left-color .15s;
    border-left: 2px solid transparent;
    user-select: none;
  }

  .mega-tab:hover {
    color: var(--text);
    background: var(--surface2);
  }

  .mega-item.is-active .mega-tab {
    color: var(--accent);
    background: var(--surface2);
    border-left-color: var(--accent);
  }

  .mega-tab .arr {
    display: none;
  }

  .mega-item-content {
    grid-column: 2;
    grid-row: 1 / span 100;
    display: none;
    padding: 32px 40px;
    background: var(--surface);
    min-height: 0;
  }

  .mega-item.is-active .mega-item-content {
    display: block;
    animation: fadeIn .2s ease-out;
  }
}

@media (max-width: 768px) {
  .mega-dropdown {
    top: var(--nav-h);
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(100vh - var(--nav-h));
    overflow-y: auto;
    background: var(--surface);
  }

  .mega-wrap {
    display: flex;
    flex-direction: column;
  }

  .mega-sidebar {
    width: 100%;
  }

  .mega-item {
    display: block;
    background: #fff;
    border-bottom: 1px solid var(--border);
  }

  .mega-tab {
    padding: 16px 20px;
    font-size: 14px;
    color: var(--text);
    background: #fff;
    border-left: none;
    transition: background .2s;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .mega-item.is-active .mega-tab {
    background: var(--surface);
    color: var(--accent);
  }

  .mega-tab .arr {
    display: block;
    font-size: 8px;
    opacity: 0.4;
    transition: transform .3s ease;
  }

  .mega-item.is-active .mega-tab .arr {
    transform: rotate(180deg);
    opacity: 1;
    color: var(--accent);
  }

  .mega-item-content {
    display: grid !important;
    position: static !important;
    width: 100% !important;
    padding: 0 !important;
    grid-template-rows: 0fr;
    transition: grid-template-rows .3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    background: #fff;
  }

  .mega-item.is-active .mega-item-content {
    grid-template-rows: 1fr;
    border-top: 1px solid var(--border);
  }

  .mega-item-inner {
    min-height: 0;
    padding: 0;
  }

  .mega-item-inner-wrap {
    padding: 12px 20px 24px;
  }

  .mega-col-title {
    display: none !important;
  }
}

/* ─── INTERNAL ELEMENTS ─── */
.mega-col-title {
  font-family: 'Unbounded', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .08em;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.panel-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 10px;
  border-radius: var(--radius);
  font-size: 14px;
  color: var(--text);
  text-decoration: none;
  transition: background .15s, color .15s, transform .1s;
}

.panel-link:hover {
  background: var(--surface2);
  color: var(--accent);
  transform: translateX(2px);
}

@media (max-width: 768px) {
  .panel-link {
    border-bottom: 1px solid var(--surface2);
    border-radius: 0;
    padding: 14px 4px;
  }

  .panel-link:last-child {
    border-bottom: none;
  }
}

.mega-item-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.mega-links-col {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mega-cta-col {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
}

@media (max-width: 480px) {
  .mega-item-grid {
    grid-template-columns: 1fr;
  }
}

.mega-2-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  row-gap: 4px;
  column-gap: 16px;
}

@media (max-width: 768px) {
  .mega-2-col {
    grid-template-columns: 1fr;
  }
}

.mega-materials-grid {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.mega-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mega-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--surface2);
  color: var(--text);
  padding: 8px 16px;
  border-radius: 40px;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: all .2s ease;
  border: 1px solid transparent;
}

.mega-pill:hover {
  background: transparent;
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
}

@media (max-width: 768px) {
  .mega-chips {
    gap: 12px;
    margin-top: 10px;
  }

  .mega-pill {
    flex: 1 1 auto;
    justify-content: center;
  }
}

.mega-pill--outline {
  background: transparent;
  border: 1px solid var(--border);
}

.mega-pill--dashed {
  border: 1px dashed var(--border);
  background: transparent;
}

.mega-pill--surface {
  background: var(--surface2);
}

.mega-item-footer {
  margin-top: 1.5rem;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.mega-cta {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 12px;
  background: var(--accent);
  color: #fff;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .05em;
  font-size: 12px;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: transform .15s, opacity .15s;
}

.mega-cta:hover {
  transform: translateY(-2px);
  opacity: 0.9;
}

/* ─── MOBILE EXTRAS ─── */
.mob-sidebar-extra {
  display: flex;
  flex-direction: column;
  border-top: none;
  margin-top: 0;
}

@media (min-width: 769px) {
  .mob-sidebar-extra {
    display: none;
  }
}

.mob-extra-link {
  display: flex;
  align-items: center;
  padding: 18px 20px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
  background: #fff;
  transition: color .15s, background .15s;
}

.mob-extra-link:hover,
.mob-extra-link.active {
  color: var(--accent);
  background: rgba(255, 141, 0, .04);
}

.mob-extra-cart {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px 20px 16px;
  padding: 14px 20px;
  background: var(--cta);
  color: #fff;
  font-family: 'Unbounded', sans-serif;
  font-size: 11px;
  font-weight: 500;
  text-decoration: none;
  border-radius: var(--radius);
}

.mob-extra-cart .cart-count {
  position: static;
  width: auto;
  height: auto;
  padding: 2px 7px;
  border-radius: 10px;
  transform: none;
  opacity: 0;
  font-size: 11px;
  margin-left: auto;
  transition: opacity .2s;
}

.mob-extra-cart .cart-count.has-items {
  opacity: 1;
}

/* ─── OVERLAY ─── */
.mega-overlay {
  position: fixed;
  top: var(--nav-h);
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, .3);
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s;
  z-index: 998;
}

.mega-overlay.is-open {
  opacity: 1;
  pointer-events: all;
}

/* ─── MINI CART DRAWER ─── */
.cart-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .55);
  z-index: 1100;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s;
}

.cart-drawer-overlay.is-open {
  opacity: 1;
  pointer-events: all;
}

.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(420px, 90vw);
  background: var(--surface);
  border-left: 1px solid var(--border);
  z-index: 1101;
  transform: translateX(100%);
  transition: transform .3s ease;
  display: flex;
  flex-direction: column;
}

.cart-drawer.is-open {
  transform: translateX(0);
}

.cart-drawer-head {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cart-drawer-head h3 {
  font-family: 'Unbounded', sans-serif;
  font-size: 14px;
  font-weight: 600;
}

.cart-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 16px;
  cursor: pointer;
  transition: border-color .2s;
}

.cart-close:hover {
  border-color: var(--accent);
}

.cart-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 24px;
}

.cart-empty {
  text-align: center;
  padding: 40px 0;
  color: var(--muted);
  font-size: 13px;
}

.cart-item {
  display: flex;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  animation: fadeIn .2s ease;
}

.cart-item-icon {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  background: var(--surface2);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

.cart-item-info {
  flex: 1;
}

.cart-item-name {
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 4px;
}

.cart-item-detail {
  font-size: 11px;
  color: var(--muted);
}

.cart-item-remove {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 11px;
  cursor: pointer;
  transition: color .2s;
  margin-top: 4px;
}

.cart-item-remove:hover {
  color: #ff4d4d;
}

.cart-drawer-footer {
  padding: 20px 24px;
  border-top: 1px solid var(--border);
}

.cart-summary {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 12px;
}

.cart-summary strong {
  color: var(--text);
}

.cart-checkout-btn,
.btn-primary {
  width: 100%;
  padding: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--cta);
  color: #fff;
  font-family: 'Unbounded', sans-serif;
  font-size: 12px;
  font-weight: 500;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background .2s;
  text-decoration: none;
}

.cart-checkout-btn:hover,
.btn-primary:hover {
  background: var(--cta-dim);
}

.cart-checkout-btn:disabled {
  opacity: .4;
  cursor: not-allowed;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateX(6px)
  }

  to {
    opacity: 1;
    transform: translateX(0)
  }
}