/* =========================================================
   CROWNSY HEADER
   RALPH LAUREN INSPIRED
========================================================= */

:root {
  --crownsy-black: #080808;
  --crownsy-dark: #101010;
  --crownsy-white: #ffffff;
  --crownsy-offwhite: #f8f7f4;
  --crownsy-gray: #777777;
  --crownsy-border: #dededb;
}

/* =========================================================
   HEADER BASE
========================================================= */

.crownsy-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 9999;
  color: var(--crownsy-white);

  transition:
    color 0.35s ease,
    background-color 0.35s ease,
    box-shadow 0.35s ease,
    transform 0.55s cubic-bezier(0.4, 0, 0.2, 1);
}

#crownsyHeader {
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

#crownsyHeader.topbar-hidden {
  transform: translateY(calc(var(--crownsy-topbar-height) * -1));
}

/* Mobile menu tidak ikut bergeser saat topbar disembunyikan */

#crownsyHeader.topbar-hidden:has(.crownsy-mobile-menu.active) {
  transform: none;
}

/* =========================================================
   HEADER WHEN SCROLLED
========================================================= */

.crownsy-header.is-scrolled {
  color: var(--crownsy-black);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.08);
}

/* =========================================================
   TOP BAR
========================================================= */

.crownsy-topbar {
  height: 34px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);

  transition:
    transform 0.35s ease,
    background-color 0.35s ease,
    border-color 0.35s ease;
}

.crownsy-topbar.is-hidden {
  transform: translateY(-100%);
}

.crownsy-header.is-scrolled .crownsy-topbar {
  background: var(--crownsy-black);
  color: var(--crownsy-white);
  border-color: var(--crownsy-black);
}

.crownsy-topbar-inner {
  max-width: 1440px;
  width: calc(100% - 80px);
  height: 100%;
  margin: 0 auto;

  display: flex;
  align-items: center;
  justify-content: space-between;

  font-family: Arial, sans-serif;
  font-size: 9px;
  letter-spacing: 0.14em;
}

.topbar-left,
.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-right a {
  color: inherit;
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.topbar-right a:hover {
  opacity: 0.55;
}

.topbar-divider {
  width: 1px;
  height: 9px;
  background: currentColor;
  opacity: 0.35;
}

/* =========================================================
   MAIN NAV
========================================================= */

.crownsy-nav {
  height: 84px;

  transition:
    background-color 0.35s ease,
    border-color 0.35s ease;
}

.crownsy-nav-inner {
  max-width: 1440px;
  width: calc(100% - 80px);
  height: 100%;
  margin: 0 auto;

  display: flex;
  align-items: center;
}

/* =========================================================
   LOGO
========================================================= */

.crownsy-logo {
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex-shrink: 0;
  width: 245px;

  color: inherit;
  text-decoration: none;
}

.logo-main {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 27px;
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0.28em;
}

.logo-sub {
  margin-top: 8px;

  font-family: Arial, sans-serif;
  font-size: 7px;
  font-weight: 500;
  letter-spacing: 0.34em;
}

/* =========================================================
   DESKTOP NAV
========================================================= */

.crownsy-desktop-nav {
  display: flex;
  align-items: center;
  height: 100%;
  gap: 30px;
}

.nav-item {
  position: static;
  height: 100%;

  display: flex;
  align-items: center;
}

.nav-link {
  position: relative;

  display: flex;
  align-items: center;
  height: 100%;

  color: inherit;
  text-decoration: none;

  font-family: Arial, sans-serif;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.16em;
  white-space: nowrap;

  transition: opacity 0.2s ease;
}

.nav-link:hover {
  opacity: 0.55;
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 25px;
  height: 1px;

  background: currentColor;
  transform: scaleX(0);
  transform-origin: center;

  transition: transform 0.3s ease;
}

.nav-item:hover > .nav-link::after {
  transform: scaleX(1);
}

/* =========================================================
   HEADER ACTIONS
========================================================= */

.crownsy-actions {
  margin-left: auto;

  display: flex;
  align-items: center;
  gap: 23px;
}

.header-action {
  display: flex;
  align-items: center;
  justify-content: center;

  width: auto;
  height: auto;
  padding: 0;
  margin: 0;

  border: none;
  background: none;
  box-shadow: none;
  border-radius: 0;

  color: inherit;
  text-decoration: none;
  cursor: pointer;
}

.header-action svg {
  width: 20px;
  height: 20px;

  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.header-action:hover {
  background: none;
  box-shadow: none;
}

/* =========================================================
   MEGA MENU
========================================================= */

.mega-menu {
  position: absolute;
  top: 118px;
  left: 0;

  width: 100%;

  background: var(--crownsy-white);
  color: var(--crownsy-black);

  border-top: 1px solid var(--crownsy-border);
  box-shadow: 0 18px 35px rgba(0, 0, 0, 0.08);

  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-8px);

  transition:
    opacity 0.25s ease,
    transform 0.3s ease,
    visibility 0.3s ease;
}

/* Header transparan */

.crownsy-header:not(.is-scrolled) .mega-menu {
  top: 118px;
}

/* Mega menu terbuka saat hover atau aktif */

.nav-item.has-mega:hover .mega-menu,
.nav-item.has-mega.is-open .mega-menu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

/* =========================================================
   MEGA INNER
========================================================= */

.mega-inner {
  width: calc(100% - 80px);
  max-width: 1440px;
  margin: 0 auto;

  display: grid;
  grid-template-columns: 255px minmax(0, 1fr);

  min-height: 390px;
  height: auto;
}

/* =========================================================
   MEGA SIDEBAR
========================================================= */

.mega-sidebar {
  padding: 40px 40px 45px 0;
  border-right: 1px solid var(--crownsy-border);
}

.mega-eyebrow {
  margin-bottom: 15px;

  font-family: Arial, sans-serif;
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.2em;

  color: var(--crownsy-black);
}

.mega-sidebar h3 {
  margin: 0 0 28px;

  font-family: Georgia, "Times New Roman", serif;
  font-size: 20px;
  font-weight: 400;
}

.mega-sidebar-link {
  position: relative;

  display: block;
  width: fit-content;
  margin-bottom: 17px;

  color: #5e5e5e;
  text-decoration: none;

  font-family: Georgia, "Times New Roman", serif;
  font-size: 16px;
  line-height: 1.2;

  transition:
    color 0.2s ease,
    transform 0.2s ease;
}

.mega-sidebar-link:hover {
  color: var(--crownsy-black);
  transform: translateX(4px);
}

.mega-sidebar-link.active {
  color: var(--crownsy-black);
}

.mega-sidebar-link.active::after {
  content: "";
  display: block;

  width: 100%;
  height: 1px;
  margin-top: 5px;

  background: currentColor;
}

/* =========================================================
   MEGA CONTENT
========================================================= */

.mega-content {
  padding: 34px 0 45px 55px;
  min-width: 0;
}

.mega-heading {
  display: flex;
  align-items: center;
  margin-bottom: 19px;
}

.mega-heading::after {
  content: "";
  height: 1px;
  flex: 1;
  margin-left: 18px;
  background: #222;
}

.mega-heading span {
  font-family: Arial, sans-serif;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.18em;
}

/* =========================================================
   MEGA GRID
========================================================= */

.mega-grid {
  display: grid;
  gap: 12px;
}

.mega-grid-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.mega-grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

/* Produk maksimal 3 kartu per baris */

.nav-item.has-mega .mega-grid-4 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

/* =========================================================
   MEGA CARD
========================================================= */

.mega-card {
  display: block;
  color: var(--crownsy-black);
  text-decoration: none;
  overflow: hidden;
}

.mega-card-image {
  position: relative;

  width: 100%;
  aspect-ratio: 1 / 1.18;
  overflow: hidden;

  background: #ecebe8;
}

.mega-card-image::after {
  content: "";
  position: absolute;
  inset: 0;

  background: rgba(0, 0, 0, 0.05);
  opacity: 0;

  transition: opacity 0.35s ease;
}

.mega-card img {
  display: block;

  width: 100%;
  height: 100%;

  object-fit: cover;

  transition: transform 0.5s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.mega-card:hover img {
  transform: scale(1.045);
}

.mega-card:hover .mega-card-image::after {
  opacity: 1;
}

.mega-card-content {
  padding-top: 11px;
}

.mega-card-label {
  display: block;
  margin-bottom: 5px;

  font-family: Arial, sans-serif;
  font-size: 7px;
  font-weight: 600;
  letter-spacing: 0.18em;

  color: #777;
}

.mega-card strong {
  display: block;

  font-family: Georgia, "Times New Roman", serif;
  font-size: 15px;
  font-weight: 400;
}

/* =========================================================
   MOBILE MENU BUTTON
========================================================= */

.crownsy-mobile-toggle {
  display: none;

  margin-left: auto;

  width: 42px;
  height: 42px;
  padding: 0;

  border: 0;
  background: transparent;

  color: inherit;
  cursor: pointer;

  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
}

.crownsy-mobile-toggle span {
  display: block;

  width: 21px;
  height: 1px;

  background: currentColor;

  transition:
    transform 0.3s ease,
    opacity 0.3s ease;
}

.crownsy-mobile-toggle.active span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.crownsy-mobile-toggle.active span:nth-child(2) {
  opacity: 0;
}

.crownsy-mobile-toggle.active span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

/* =========================================================
   MOBILE MENU
========================================================= */

.crownsy-mobile-menu {
  position: fixed;
  top: 0;
  left: 0;

  width: 100%;
  height: 100vh;

  background: var(--crownsy-white);
  color: var(--crownsy-black);

  z-index: 10000;

  opacity: 0;
  visibility: hidden;
  transform: translateX(100%);

  transition:
    transform 0.45s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.3s ease,
    visibility 0.45s ease;

  overflow: hidden;
}

.crownsy-mobile-menu.active {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
}

.mobile-menu-inner {
  height: 100%;

  display: flex;
  flex-direction: column;
}

.mobile-menu-top {
  height: 88px;
  padding: 0 25px;

  display: flex;
  align-items: center;
  justify-content: space-between;

  border-bottom: 1px solid var(--crownsy-border);
}

.mobile-menu-top > span {
  font-family: Arial, sans-serif;
  font-size: 9px;
  letter-spacing: 0.2em;
}

.mobile-close {
  width: 42px;
  height: 42px;

  border: 0;
  background: transparent;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  cursor: pointer;
}

.mobile-close span {
  position: absolute;

  width: 22px;
  height: 1px;

  background: #000;
}

.mobile-close span:first-child {
  transform: rotate(45deg);
}

.mobile-close span:last-child {
  transform: rotate(-45deg);
}

/* =========================================================
   MOBILE NAVIGATION
========================================================= */

.mobile-navigation {
  position: relative;

  flex: 1;
  overflow-y: auto;

  padding: 15px 25px 40px;
}

.mobile-main-link,
.mobile-menu-trigger {
  width: 100%;
  min-height: 64px;

  display: flex;
  align-items: center;
  justify-content: space-between;

  color: #080808;
  text-decoration: none;

  border-bottom: 1px solid var(--crownsy-border);

  font-family: Arial, sans-serif;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.16em;

  background: transparent;
}

.mobile-menu-trigger {
  border-top: 0;
  border-left: 0;
  border-right: 0;
  cursor: pointer;
}

.mobile-plus {
  font-family: Arial, sans-serif;
  font-size: 20px;
  font-weight: 300;

  transition: transform 0.3s ease;
}

.mobile-menu-item.active .mobile-plus {
  transform: rotate(45deg);
}

/* =========================================================
   MOBILE SUBMENU
========================================================= */

.mobile-submenu {
  position: absolute;
  inset: 0;

  background: var(--crownsy-white);
  padding: 15px 25px 40px;

  overflow-y: auto;
  transform: translateX(100%);

  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);

  z-index: 5;
}

.mobile-menu-item.active .mobile-submenu {
  transform: translateX(0);
}

.mobile-submenu-header {
  min-height: 64px;

  display: flex;
  align-items: center;
  gap: 17px;

  border-bottom: 1px solid var(--crownsy-border);
}

.mobile-submenu-header span {
  font-family: Arial, sans-serif;
  font-size: 10px;
  letter-spacing: 0.18em;
}

.mobile-back {
  width: 40px;
  height: 40px;
  padding: 0;

  border: 0;
  background: transparent;

  font-size: 23px;
  font-weight: 300;

  cursor: pointer;
}

.mobile-submenu > a {
  display: block;

  padding: 21px 0;

  border-bottom: 1px solid var(--crownsy-border);

  color: #111;
  text-decoration: none;

  font-family: Georgia, "Times New Roman", serif;
  font-size: 19px;
}

/* =========================================================
   MOBILE FOOTER
========================================================= */

.mobile-menu-footer {
  padding: 20px 25px;

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;

  border-top: 1px solid var(--crownsy-border);
}

.mobile-menu-footer span {
  font-family: Arial, sans-serif;
  font-size: 7px;
  letter-spacing: 0.16em;
}

.mobile-menu-footer a {
  color: #000;
  text-decoration: none;

  font-family: Arial, sans-serif;
  font-size: 8px;
  letter-spacing: 0.12em;
}

/* =========================================================
   BODY LOCK — MOBILE MENU
========================================================= */

body.crownsy-menu-open {
  overflow: hidden;
}

/* =========================================================
   MEGA MENU GLOBAL SCROLL
========================================================= */

.nav-item.has-mega .mega-menu {
  max-height: calc(100vh - 118px);

  overflow-y: auto;
  overflow-x: hidden;

  scrollbar-width: thin;
  scrollbar-color: #cfcfcf transparent;
}

.nav-item.has-mega .mega-inner {
  height: auto;
  min-height: 390px;
}

/* Scrollbar Chrome, Edge, Safari */

.nav-item.has-mega .mega-menu::-webkit-scrollbar {
  width: 6px;
}

.nav-item.has-mega .mega-menu::-webkit-scrollbar-track {
  background: transparent;
}

.nav-item.has-mega .mega-menu::-webkit-scrollbar-thumb {
  background: #cfcfcf;
}

.nav-item.has-mega .mega-menu::-webkit-scrollbar-thumb:hover {
  background: #999;
}

/* =========================================================
   TABLET
========================================================= */

@media (max-width: 1100px) {
  .crownsy-topbar-inner,
  .crownsy-nav-inner,
  .mega-inner {
    width: calc(100% - 50px);
  }

  .crownsy-logo {
    width: 210px;
  }

  .crownsy-desktop-nav {
    gap: 20px;
  }

  .nav-link {
    font-size: 9px;
  }

  .mega-inner {
    grid-template-columns: 220px minmax(0, 1fr);
  }

  .mega-content {
    padding-left: 35px;
  }

  .nav-item.has-mega .mega-grid-4 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
  }
}

/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 900px) {
  .crownsy-topbar {
    display: block;
  }

  .crownsy-nav {
    height: 76px;
  }

  .crownsy-nav-inner {
    width: calc(100% - 36px);
  }

  .crownsy-logo {
    width: auto;
  }

  .logo-main {
    font-size: 22px;
    letter-spacing: 0.23em;
  }

  .logo-sub {
    font-size: 6px;
    margin-top: 6px;
  }

  .crownsy-desktop-nav {
    display: none;
  }

  .crownsy-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
  }

  .crownsy-mobile-toggle {
    display: flex;
    margin-left: 8px;
  }

  .mega-menu {
    display: none;
  }
}

/* =========================================================
   SMALL MOBILE
========================================================= */

@media (max-width: 480px) {
  .crownsy-nav {
    height: 70px;
  }

  .crownsy-nav-inner {
    width: calc(100% - 28px);
  }

  .logo-main {
    font-size: 19px;
    letter-spacing: 0.2em;
  }

  .logo-sub {
    font-size: 5px;
    letter-spacing: 0.28em;
  }

  .mobile-menu-top {
    height: 75px;
    padding: 0 20px;
  }

  .mobile-navigation {
    padding-left: 20px;
    padding-right: 20px;
  }

  .mobile-submenu {
    padding-left: 20px;
    padding-right: 20px;
  }

  .mobile-menu-footer {
    padding: 17px 20px;
  }

  .mobile-menu-footer span {
    font-size: 6px;
  }
}

/* =========================================================
   REDUCED MOTION
========================================================= */

@media (prefers-reduced-motion: reduce) {
  .crownsy-header,
  .mega-menu,
  .mega-card img,
  .crownsy-mobile-menu,
  .mobile-submenu {
    transition: none !important;
  }
}
