/* ==========================================================================
   YURI SHOP TOP BAR (Phone, CS Email, Info Pabrikan)
   ========================================================================== */

.yuri-top-bar {
  background-color: var(--color-brand-primary);
  color: var(--color-border);
  font-size: 0.8125rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.5rem 0;
}

.top-bar-flex {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.top-bar-contact {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.top-bar-contact a {
  color: var(--color-border);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-weight: 500;
}

.top-bar-contact a:hover {
  color: var(--color-text-inverse);
  text-decoration: underline;
}

.top-bar-right {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.top-bar-right a,
.top-bar-right .top-bar-btn {
  color: var(--color-border-hover);
  text-decoration: none;
  background: none;
  border: none;
  font-family: inherit;
  font-size: 0.8125rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.375rem;
}

.top-bar-right a:hover,
.top-bar-right .top-bar-btn:hover {
  color: var(--color-text-inverse);
}

.top-bar-divider {
  color: rgba(255, 255, 255, 0.25);
  font-size: 0.75rem;
  user-select: none;
}

/* Pencarian gaya marketplace di header utama, lebar penuh satu baris */
.header-search-row {
  padding: 0 0 1rem;
}

.header-search-form {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 50px;
  padding: 0 0.4rem 0 1.1rem;
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.header-search-form:focus-within {
  border-color: var(--color-action);
  box-shadow: 0 0 0 3px rgba(0, 122, 120, 0.18);
}

.header-search-input {
  flex: 1 1 auto;
  min-width: 0;
  background: none;
  border: none;
  color: var(--color-brand-primary);
  font-size: 1rem;
  font-family: inherit;
  padding: 0.6rem 0.5rem 0.6rem 0;
  outline: none;
}

.header-search-input:focus-visible {
  outline: none;
}

.header-search-input::placeholder {
  color: var(--color-text-light);
}

.header-search-input::-webkit-search-cancel-button,
.header-search-input::-webkit-search-decoration {
  -webkit-appearance: none;
  appearance: none;
}

.header-search-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  height: 44px;
  padding: 0 1.5rem;
  background-color: var(--color-action);
  color: var(--color-text-inverse);
  border: none;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.header-search-btn:hover {
  background-color: var(--color-action-hover);
}

.header-search-form .search-clear-btn {
  position: static;
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  padding: 0;
  margin-right: 0.25rem;
  display: none;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--color-text-light);
  border-radius: var(--radius-pill);
  cursor: pointer;
}

.header-search-form .search-clear-btn:hover {
  color: var(--color-brand-primary);
  background-color: var(--color-surface-subtle);
}

@media (max-width: 639px) {
  .header-search-row {
    padding: 0 0 0.75rem;
  }

  .header-search-form {
    min-height: 46px;
  }

  .header-search-btn {
    width: 46px;
    padding: 0;
  }

  .header-search-btn span {
    display: none;
  }
}

/* ==========================================================================
   MAIN HEADER (Yuri Official Logo, Horizontal Nav, Mega Menu, Keranjang Pill)
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background-color: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.04);
}

.header-main-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
  gap: 1.5rem;
  position: relative;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
}

.yuri-logo-img {
  height: 48px;
  width: auto;
  max-height: 52px;
  object-fit: contain;
  display: block;
}

/* Navigasi Horizontal Yuri Shop */
.main-nav-wapper {
  display: flex;
  align-items: center;
}

.main-nav-menu {
  display: none;
  align-items: center;
  gap: 0.4rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

@media (min-width: 960px) {
  .main-nav-menu {
    display: flex;
  }
}

.nav-divider {
  color: var(--color-border-hover);
  font-size: 0.8125rem;
  font-weight: 300;
  user-select: none;
  display: inline-flex;
  align-items: center;
  padding: 0 0.15rem;
}

.main-nav-link {
  height: 44px; /* Minimum tap target R-03 */
  padding: 0 0.5rem;
  background: none;
  border: none;
  color: #374151;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  transition: color 0.15s ease;
  white-space: nowrap;
}

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

.main-nav-link.active {
  color: var(--color-action);
  font-weight: 700;
}

/* Mega Menu Dropdown Panel (Persis Screenshot) */
.has-megamenu {
  position: static;
}

.megamenu-panel {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  width: 100%;
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-top: 1px solid var(--color-surface-subtle);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  padding: 2.25rem 2.5rem 2.75rem 2.5rem;
  z-index: 100;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
}

.megamenu-panel::before {
  content: "";
  position: absolute;
  top: -8px;
  left: 0;
  right: 0;
  height: 8px;
}

.has-megamenu:hover .megamenu-panel,
.has-megamenu:focus-within .megamenu-panel,
.megamenu-panel.is-open {
  display: block;
}

.megamenu-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 3rem;
  width: 100%;
}

.megamenu-col {
  display: flex;
  flex-direction: column;
}

.megamenu-col-title {
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--color-text-main);
  margin: 0 0 1.25rem 0;
  padding: 0;
  border: none;
}

.megamenu-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
}

.megamenu-list li {
  border-bottom: 1px solid var(--color-surface-subtle);
}

.megamenu-list a {
  display: block;
  padding: 0.625rem 0;
  color: var(--color-text-muted);
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 400;
  line-height: 1.4;
  transition: color 0.15s ease, padding-left 0.15s ease;
}

.megamenu-list a:hover {
  color: var(--color-action);
  padding-left: 4px;
}

/* Header Action & Tombol Keranjang Pill Style (Persis Screenshot) */
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.cart-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  background-color: var(--color-bg-main);
  color: #374151;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 0 1.125rem;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  height: 44px; /* Tap target R-03 */
  text-decoration: none;
}

.cart-pill-btn:hover {
  background-color: var(--color-surface-subtle);
  border-color: var(--color-border-hover);
  color: var(--color-text-main);
}

.cart-pill-btn svg {
  color: var(--color-text-muted);
  flex-shrink: 0;
}

.cart-text {
  font-weight: 700;
  font-size: 0.875rem;
  color: #374151;
  text-transform: uppercase;
}

.cart-badge-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  background-color: var(--color-action);
  color: var(--color-text-inverse);
  font-size: 0.6875rem;
  font-weight: 800;
  border-radius: var(--radius-sm);
  line-height: 1;
}

@media (max-width: 480px) {
  .cart-text {
    display: none;
  }
  .cart-pill-btn {
    padding: 0 0.75rem;
  }
  .yuri-logo-img {
    height: 38px;
  }
}

/* Kompatibilitas Legacy Cart Button */
.cart-toggle-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  height: 44px;
  padding: 0 1.125rem;
  background-color: var(--color-action);
  color: var(--color-text-inverse);
  border: none;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
}

.cart-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: var(--color-surface);
  color: var(--color-action);
  font-size: 0.75rem;
  font-weight: 800;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: var(--radius-pill);
}

/* =========================================================================
   BOTTOM NAVIGATION MOBILE
   ========================================================================= */

.bottom-nav {
  display: none;
}

.bottom-nav-btn {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  min-height: 56px;
  padding: 0.4rem 0.25rem;
  background: none;
  border: none;
  font-family: inherit;
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--color-text-muted);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.bottom-nav-btn svg {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

.bottom-nav-btn.active {
  color: var(--color-action);
}

.bottom-nav-cart-wrap {
  position: relative;
  display: inline-flex;
}

.bottom-nav-badge {
  position: absolute;
  top: -6px;
  right: -10px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  display: none;
  align-items: center;
  justify-content: center;
  background-color: var(--color-promo);
  color: var(--color-text-inverse);
  font-size: 0.625rem;
  font-weight: 800;
  border-radius: var(--radius-pill);
  line-height: 1;
}

@media (max-width: 959px) {
  .bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 40;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    background-color: var(--color-surface);
    border-top: 1px solid var(--color-border);
    box-shadow: 0 -1px 3px rgba(15, 23, 42, 0.06);
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }

  /* Beri ruang bawah supaya konten terakhir tidak tertutup bottom nav */
  body {
    padding-bottom: calc(58px + env(safe-area-inset-bottom, 0px));
  }

  /* Naikkan toast agar tidak tertutup bottom nav */
  .toast-container {
    bottom: calc(70px + env(safe-area-inset-bottom, 0px));
  }
}

/* Container Multi-View Switcher */
.app-view {
  display: none;
}

.app-view.active {
  display: block;
}

