/* =========================================================
   NEW BALANCE STORE — STYLESHEET (FINAL & FIXED)
   ========================================================= */

/* ============ 1. VARIABLES & RESET ============ */
:root {
  --hitam: #2b2b2b;
  --abu: #6b6b6b;
  --abu-muda: #f9f8f6;
  --merah: #c8102e;
  --merah-dark: #a00d25;
  --putih: #ffffff;
  --border: #eaeaea;
  --success: #2e9e5b;
  --warning: #e8850a;
  --font-heading: "Playfair Display", serif;
  --font-body: "Poppins", sans-serif;
  --sp-section: 100px 40px;
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.08);
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-pill: 50px;
  --t-fast: 0.2s ease;
  --t-med: 0.4s ease;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 100px;
  overflow-x: hidden;
}

body {
  font-family: var(--font-body);
  color: var(--hitam);
  background-color: var(--putih);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}
button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}
a {
  text-decoration: none;
  color: inherit;
}
ul {
  list-style: none;
}

/* ============ 2. TYPOGRAPHY ============ */
h1,
h2,
h3,
.section-title {
  font-family: var(--font-heading);
  font-weight: 600;
}
h1 {
  font-size: clamp(32px, 5vw, 56px);
  line-height: 1.1;
}
h2 {
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.2;
}
h3 {
  font-size: clamp(16px, 2vw, 18px);
}

/* ============ 3. UTILITY ============ */
.container {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 24px;
}
.section-header {
  text-align: center;
  margin-bottom: 48px;
}
.subtitle {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--merah);
  font-weight: 600;
  margin-bottom: 8px;
  display: block;
}
.section-title {
  color: var(--hitam);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 32px;
  background: var(--hitam);
  color: var(--putih);
  border-radius: var(--radius-pill);
  font-weight: 500;
  font-size: 14px;
  transition: all var(--t-fast);
}
.btn:hover {
  background: var(--merah);
  transform: translateY(-2px);
}
.btn-hero {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: var(--putih);
}
.btn-hero:hover {
  background: var(--putih);
  color: var(--hitam);
}

/* ============ 4. NAVBAR FLOATING ============ */
.navbar {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 48px);
  max-width: 1320px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: var(--radius-pill);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
  z-index: 1000;
}

.navbar-container {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 12px 32px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 700;
  color: var(--hitam);
  flex-shrink: 0;
}
.navbar-menu {
  margin: 0 auto;
}
.nav-content {
  display: flex;
  align-items: center;
  gap: 32px;
}
.nav-content a {
  color: var(--hitam);
  font-weight: 500;
  font-size: 14px;
  position: relative;
  transition: color var(--t-fast);
}
.nav-content a:hover,
.nav-content a.active {
  color: var(--merah);
}
.nav-content a.active::after {
  content: "";
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 6px;
  height: 6px;
  background: var(--merah);
  border-radius: 50%;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}
.search-form {
  display: flex;
  gap: 8px;
}
.search-input {
  width: 140px;
  padding: 10px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  font-family: var(--font-body);
  font-size: 13px;
  background: var(--abu-muda);
  outline: none;
  transition: all var(--t-fast);
}
.search-input:focus {
  border-color: var(--hitam);
  background: var(--putih);
}
.search-button {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--hitam);
  color: var(--putih);
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-wrapper {
  display: flex;
  align-items: center;
}
.nav-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--hitam);
  font-size: 20px;
  transition: color var(--t-fast);
}
.nav-icon:hover {
  color: var(--merah);
}
.user-menu {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  font-weight: 500;
  background: var(--abu-muda);
  padding: 6px 16px;
  border-radius: var(--radius-pill);
}

.cart-wrap {
  flex-shrink: 0;
}
.cart-icon {
  position: relative;
  display: inline-flex;
  color: var(--hitam);
  font-size: 22px;
}
.cart-count {
  position: absolute;
  top: -4px;
  right: -10px;
  min-width: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--merah);
  color: var(--putih);
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
}

.hamburger,
.search-toggle {
  display: none;
}
.drawer-header,
.drawer-footer {
  display: none;
}

/* ============ 5. HERO CAROUSEL ============ */
.hero-section {
  position: relative;
  height: 100vh;
  min-height: 600px;
  overflow: hidden;
  background: var(--hitam);
}
.hero-carousel {
  width: 100%;
  height: 100%;
}
.carousel-track {
  display: flex;
  width: 300%;
  height: 100%;
  transition: transform 0.8s cubic-bezier(0.25, 1, 0.5, 1);
}
.carousel-slide {
  width: 33.333%;
  height: 100%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-start;
}
.slide-bg {
  position: absolute;
  inset: 6% 4% 6% auto;
  width: 58%;
  height: 88%;
  object-fit: contain;
  object-position: center right;
  z-index: 1;
}
.slide-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    rgba(0, 0, 0, 0.76) 0%,
    rgba(0, 0, 0, 0.5) 52%,
    rgba(0, 0, 0, 0.14) 100%
  );
  z-index: 2;
}
.slide-content {
  position: relative;
  z-index: 3;
  text-align: left;
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  padding: 100px 40px 0;
  color: var(--putih);
}
.slide-content > * {
  max-width: 560px;
}
.slide-content p {
  font-size: 18px;
  margin-bottom: 40px;
  font-weight: 300;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}
.carousel-dots {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 12px;
  z-index: 4;
}
.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  transition: all var(--t-fast);
}
.dot.active {
  background: var(--putih);
  transform: scale(1.4);
}

/* ============ 6. PRODUCT CARDS ============ */
.catalog-products {
  padding: var(--sp-section);
}
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 32px 24px;
}

.product-card {
  display: flex;
  flex-direction: column;
  transition: transform var(--t-fast);
}
.product-card:hover {
  transform: translateY(-8px);
}
.product-image {
  background: var(--putih);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 24px;
  position: relative;
  box-shadow: var(--shadow-sm);
  margin-bottom: 16px;
  overflow: hidden;
}
.product-image img {
  height: 160px;
  object-fit: contain;
  transition: transform var(--t-med);
  mix-blend-mode: multiply;
}
.product-card:hover .product-image img {
  transform: scale(1.08) rotate(-3deg);
}

.product-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: var(--merah);
  color: var(--putih);
  font-size: 10px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  text-transform: uppercase;
  z-index: 10;
}

.product-info {
  display: flex;
  flex-direction: column;
  flex: 1;
  justify-content: space-between;
}
.info-top h3 {
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 600;
  color: var(--hitam);
  margin-bottom: 4px;
}
.info-top p {
  font-size: 13px;
  color: var(--abu);
}
.info-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
}
.price {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 700;
  color: var(--hitam);
}
.btn-add {
  width: 36px;
  height: 36px;
  background: var(--abu-muda);
  color: var(--hitam);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: all var(--t-fast);
}
.btn-add:hover {
  background: var(--hitam);
  color: var(--putih);
  transform: scale(1.1);
}

/* ============ 7. CATEGORY & FOOTER ============ */
.category-section {
  padding: var(--sp-section);
  background: var(--hitam);
}
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 24px;
}
.category-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  text-align: center;
  padding: 32px 24px;
  cursor: pointer;
  transition: all var(--t-med);
}
.category-card:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-8px);
}
.category-card img {
  height: 100px;
  object-fit: contain;
  margin: 0 auto 16px;
}
.category-card h3 {
  color: var(--putih);
  margin-bottom: 4px;
}
.category-card p {
  font-size: 12px;
  color: #a0a0a0;
}

.footer {
  background: var(--hitam);
  color: var(--putih);
  padding: 80px 40px 24px;
}
.footer-container {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  max-width: 1200px;
  margin: 0 auto;
}
.footer-brand h3 {
  font-family: var(--font-heading);
  font-size: 28px;
  margin-bottom: 16px;
}
.footer-brand p {
  color: #a0a0a0;
  font-size: 14px;
}
.footer-links h4,
.footer-contact h4,
.footer-social h4 {
  font-size: 16px;
  margin-bottom: 16px;
}
.footer-links li {
  margin-bottom: 12px;
}
.footer-links a,
.footer-contact p,
.footer-social a {
  color: #a0a0a0;
  font-size: 14px;
  transition: color var(--t-fast);
}
.footer-links a:hover,
.footer-social a:hover {
  color: var(--merah);
}
.footer-contact p {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
}
.footer-contact i {
  color: var(--merah);
}
.social-icons {
  display: flex;
  gap: 16px;
}
.footer-bottom {
  grid-column: 1 / -1;
  text-align: center;
  border-top: 1px solid #444;
  margin-top: 32px;
  padding-top: 24px;
  font-size: 13px;
  color: #888;
}

/* ============ 8. MODAL & CART DRAWER ============ */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
  backdrop-filter: blur(8px);
}
.modal-overlay.active {
  display: flex;
}
.modal-box {
  background: var(--putih);
  padding: 32px;
  border-radius: var(--radius-md);
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
}
.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  font-size: 28px;
  color: var(--abu);
}

.cart-drawer-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  backdrop-filter: blur(4px);
}
.cart-drawer-overlay.active {
  display: block;
}
.cart-drawer {
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  right: 0;
  width: 400px;
  max-width: 100%;
  height: 100%;
  background: var(--putih);
  z-index: 1001;
  transform: translateX(110%);
  transition: transform var(--t-med);
}
.cart-drawer.active {
  transform: translateX(0);
}
.cart-drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid var(--border);
}
.cart-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}
.cart-item {
  display: flex;
  gap: 16px;
  padding-bottom: 16px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
  align-items: center;
}
.cart-item-info {
  flex: 1;
}
.cart-item-info p:first-child {
  font-weight: 600;
  font-size: 14px;
}
.cart-item-info p:last-child {
  font-size: 13px;
  color: var(--merah);
  font-weight: 600;
}
.cart-item-qty button {
  width: 26px;
  height: 26px;
  border: 1px solid var(--border);
  border-radius: 50%;
}
.cart-drawer-footer {
  padding: 20px;
  border-top: 1px solid var(--border);
  background: var(--abu-muda);
}
.cart-drawer-footer p {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 700;
  text-align: right;
  margin-bottom: 16px;
}
.cart-drawer-footer .btn {
  width: 100%;
}

/* ============ 9. TOAST ============ */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.toast {
  background: var(--hitam);
  color: var(--putih);
  padding: 12px 20px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  border-left: 4px solid var(--success);
  animation: toastIn var(--t-med);
}
@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}
.toast.hide {
  animation: toastOut var(--t-med) forwards;
}
@keyframes toastOut {
  to {
    opacity: 0;
    transform: translateX(100%);
  }
}

/* =========================================================
   MEDIA QUERIES (TABLET & MOBILE) — FIX TOTAL
   ========================================================= */

/* Sembunyikan elemen khusus mobile di Desktop */
.drawer-header,
.drawer-footer,
.menu-overlay {
  display: none;
}

@media (max-width: 1180px) {
  /* 1. NAVBAR MOBILE (Matikan transform & blur) */
  .navbar {
    width: calc(100% - 20px);
    top: 10px;
    left: 10px;
    transform: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    background: #ffffff;
    border: 1px solid var(--border);
  }

  .navbar-container {
    padding: 10px 16px;
    gap: 8px;
  }

  .search-form,
  .auth-wrapper {
    display: none !important;
  }
  .nav-actions {
    margin-left: auto;
    gap: 8px;
  }

  .search-toggle,
  .hamburger {
    display: inline-flex;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--abu-muda);
    color: var(--hitam);
    font-size: 16px;
    align-items: center;
    justify-content: center;
  }

  /* 2. SIDE DRAWER (Menu Kanan) */
  .navbar-menu {
    position: fixed;
    top: 0;
    right: 0;
    width: 280px;
    height: 100vh;
    background: #ffffff !important;
    z-index: 1005;
    transform: translateX(100%); /* Sembunyi di kanan */
    transition: transform 0.3s ease;
    padding: 24px;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    visibility: hidden;
  }

  .navbar-menu.active {
    transform: translateX(0);
    visibility: visible;
  }

  .drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 16px;
  }
  .drawer-header h3 {
    font-size: 24px;
    color: var(--hitam);
    font-family: var(--font-heading);
  }
  .close-drawer {
    font-size: 28px;
    color: var(--hitam);
    background: none;
    border: none;
  }

  .nav-content {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }
  .nav-content li {
    border-bottom: 1px solid var(--border);
  }
  .nav-content a {
    padding: 16px 0;
    font-size: 15px;
    display: block;
    color: var(--hitam);
  }
  .nav-content a.active::after {
    display: none;
  }

  .drawer-footer {
    display: block;
    margin-top: auto;
    padding-top: 24px;
  }
  .btn-login-drawer {
    display: flex;
    justify-content: center;
    gap: 8px;
    background: var(--merah);
    color: #ffffff !important;
    padding: 14px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    text-decoration: none;
  }

  /* 3. OVERLAY HITAM */
  .menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1004; /* Di bawah menu (1005) */
    opacity: 0;
    transition: opacity 0.3s;
  }
  .menu-overlay.active {
    display: block;
    opacity: 1;
  }

  /* 4. SEARCH OVERLAY */
  .mobile-search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #ffffff;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    transform: translateY(100%);
    transition: transform 0.3s ease;
  }
  .mobile-search-overlay.active {
    transform: translateY(0);
  }

  .search-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border-bottom: 1px solid var(--border);
    background: #ffffff;
  }
  .btn-close-search {
    background: none;
    border: none;
    font-size: 20px;
    color: var(--hitam);
    width: 40px;
    height: 40px;
  }
  .mobile-search-input {
    flex: 1;
    padding: 12px 16px;
    border: none;
    background: var(--abu-muda);
    border-radius: var(--radius-pill);
    font-family: inherit;
    font-size: 14px;
    outline: none;
  }

  .search-content {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    background: #ffffff;
  }
  .search-content h3 {
    font-family: var(--font-body);
    font-size: 16px;
    margin-bottom: 16px;
    color: var(--hitam);
    font-weight: 600;
  }
  .search-cat-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  .search-cat-card {
    background: var(--abu-muda);
    padding: 16px;
    border-radius: var(--radius-md);
    cursor: pointer;
  }
  .search-cat-card h3 {
    font-family: var(--font-heading);
    font-size: 18px;
    margin-bottom: 4px;
  }
  .search-cat-card p {
    font-size: 12px;
    color: var(--abu);
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .hero-section {
    height: 78vh;
    min-height: 560px;
    max-height: 760px;
  }

  .slide-bg {
    inset: 8% auto 8% 59%;
    width: 38%;
    height: 84%;
  }

  .slide-content {
    width: 54%;
    margin: 0;
    padding: 88px 16px 0 32px;
  }

  .slide-content h1 {
    font-size: clamp(32px, 4vw, 44px);
  }

  .slide-content p {
    font-size: 16px;
    margin-bottom: 28px;
  }

  .catalog-products,
  .category-section {
    padding: 64px 24px;
  }

  .section-header {
    margin-bottom: 36px;
  }

  .product-grid,
  #top-products .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    max-width: 760px !important;
    gap: 24px;
  }

  .product-image {
    padding: 24px 16px;
  }

  .product-image img {
    height: 140px;
  }

  .category-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
  }

  .category-card {
    padding: 24px 16px;
  }

  .footer {
    padding: 56px 24px 24px;
  }

  .footer-container {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 32px;
  }
}

@media (max-width: 768px) {
  .hero-section {
    height: 60vh;
    min-height: 400px;
  }
  .carousel-slide {
    align-items: flex-end;
    justify-content: center;
  }
  .slide-overlay {
    background: linear-gradient(
      180deg,
      rgba(0, 0, 0, 0.35) 0%,
      rgba(0, 0, 0, 0.72) 100%
    );
  }
  .slide-content {
    text-align: center;
    padding: 0 24px 88px;
  }
  .slide-bg {
    inset: 0 0 auto;
    width: 100%;
    height: 48%;
    object-position: center;
  }
  .slide-content h1 {
    font-size: 32px;
    line-height: 1.2;
  }
  .slide-content p {
    font-size: 14px;
  }

  .catalog-products,
  .category-section,
  .footer {
    padding: 40px 16px;
  }

  .product-grid,
  #top-products .product-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px;
  }
  .product-image {
    padding: 16px 8px;
  }
  .product-image img {
    height: 100px;
  }
  .product-info {
    padding: 8px 0;
  }
  .info-top h3 {
    font-size: 14px;
  }
  .price {
    font-size: 15px;
  }
  .btn-add {
    width: 30px;
    height: 30px;
    font-size: 12px;
  }

  .category-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  .footer-container {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .footer-links {
    display: none;
  }
}
