/* ================================================
   assets/css/responsive.css — Semua media query (mobile-first) - VERSI PERBAIKAN
   ================================================ */

/* ----------------------------------------------
   BASE MOBILE STYLES (0 - 479px)
   Semua pengaturan untuk layar kecil diutamakan di sini
   ---------------------------------------------- */

/* Navigation mobile: disembunyikan secara default, muncul saat toggle */
.nav {
  display: none;
}

.nav.nav--active {
  display: block;
  position: absolute;
  top: 80px; /* Tinggi header */
  left: 0;
  width: 100%;
  background-color: var(--color-bg);
  padding: var(--space-4);
  box-shadow: var(--box-shadow-md);
  z-index: var(--z-dropdown);
}

.nav__list {
  flex-direction: column;
  gap: var(--space-4);
}

.nav__link {
  display: block;
  padding: var(--space-2) 0;
}

/* ================================================
   Header responsiveness — Logo dan teks logo
   ================================================ */

/* Mobile first: ukuran kecil untuk layar < 480px */
.header__container {
  height: 60px;
  transition: height var(--transition-fast);
}

.header__logo-image {
  height: 32px;
  width: auto;
  transition: height var(--transition-fast);
}

.header__logo-text {
  font-size: 1.25rem; /* 20px */
  transition: font-size var(--transition-fast);
}

/* Header menu toggle tampil di mobile */
.header__menu-toggle {
  display: block;
}

/* Semua grid sistem diubah menjadi 1 kolom secara default */
.grid--cols-2,
.grid--cols-3,
.grid--cols-4 {
  grid-template-columns: 1fr;
}

/* Section-specific grids */
.featured__grid,
.features__grid,
.testimonials__grid,
.gallery__grid {
  grid-template-columns: 1fr;
}

/* About section */
.about__container {
  grid-template-columns: 1fr;
  gap: var(--space-6);
}

/* Hero section */
.hero__container {
  grid-template-columns: 1fr;
  text-align: center;
}

.hero__cta {
  justify-content: center;
}

/* ================================================
   Newsletter form responsiveness
   ================================================ */

.newsletter__form {
  flex-direction: column;
  width: 100%;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

.newsletter__input {
  width: 100%;
  margin-bottom: var(--space-2);
}

.newsletter__btn {
  width: 100%;
}

/* Footer */
.footer__container {
  grid-template-columns: 1fr;
  gap: var(--space-6);
}

/* ----------------------------------------------
   Small devices (landscape phones, 480px and up)
   ---------------------------------------------- */
@media screen and (min-width: 480px) {
  :root {
    --container-padding: var(--space-5);
  }

  h1,
  .h1 {
    font-size: calc(var(--font-size-3xl) * 1.1);
  }

  h2,
  .h2 {
    font-size: calc(var(--font-size-2xl) * 1.1);
  }

  .hero__title {
    font-size: calc(var(--font-size-3xl) * 1.1);
  }

  .header__container {
    height: 64px;
  }
  .header__logo-image {
    height: 36px;
  }
  .header__logo-text {
    font-size: 1.5rem; /* 24px */
  }

  .cart-drawer {
    max-width: 100%;
  }
}

/* ----------------------------------------------
   Medium devices (tablets, 768px and up)
   ---------------------------------------------- */
@media screen and (min-width: 768px) {
  :root {
    --container-padding: var(--space-6);
  }

  /* Navigasi desktop tampil normal */
  .nav {
    display: block !important;
    position: static;
    background-color: transparent;
    box-shadow: none;
    padding: 0;
  }

  .nav__list {
    flex-direction: row;
    gap: var(--space-6);
  }

  .header__container {
    height: 80px;
  }
  .header__logo-image {
    height: 48px;
  }
  .header__logo-text {
    font-size: var(--font-size-xl); /* 2rem = 32px */
  }

  .header__menu-toggle {
    display: none; /* Sembunyikan tombol menu */
  }

  /* Kembalikan grid ke 2 kolom */
  .grid--cols-2 {
    grid-template-columns: repeat(2, 1fr);
  }

  .grid--cols-3 {
    grid-template-columns: repeat(2, 1fr); /* Sementara 2 kolom */
  }

  .grid--cols-4 {
    grid-template-columns: repeat(2, 1fr); /* Sementara 2 kolom */
  }

  .featured__grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .features__grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .testimonials__grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .gallery__grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* About dan Hero kembali ke 2 kolom dengan teks kiri */
  .about__container {
    grid-template-columns: 1fr 1fr;
    text-align: left;
  }

  .hero__container {
    grid-template-columns: 1fr 1fr;
    text-align: left;
  }

  .hero__cta {
    justify-content: flex-start;
  }

    .newsletter__form {
    flex-direction: row;
  }

  .newsletter__input {
    width: auto; /* atau flex: 1 */
    flex: 1;
    margin-bottom: 0;
  }

  .newsletter__btn {
    width: auto;
  }

  /* Footer 2 kolom */
  .footer__container {
    grid-template-columns: 1fr 1fr;
  }
}

/* ----------------------------------------------
   Large devices (desktops, 1024px and up)
   ---------------------------------------------- */
@media screen and (min-width: 1024px) {
  :root {
    --container-padding: var(--space-8);
  }

  h1,
  .h1 {
    font-size: var(--font-size-3xl);
  }

  h2,
  .h2 {
    font-size: var(--font-size-2xl);
  }

  /* Kembalikan grid ke jumlah kolom penuh */
  .grid--cols-3 {
    grid-template-columns: repeat(3, 1fr);
  }

  .grid--cols-4 {
    grid-template-columns: repeat(4, 1fr);
  }

  .featured__grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .features__grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .gallery__grid {
    grid-template-columns: repeat(4, 1fr);
  }

  /* Footer 4 kolom (sesuai desain) */
  .footer__container {
    grid-template-columns: 2fr 1fr 1fr 1.5fr;
  }
}

/* ----------------------------------------------
   Extra large devices (large desktops, 1280px and up)
   ---------------------------------------------- */
@media screen and (min-width: 1280px) {
  :root {
    --container-padding: var(--space-10);
  }

  h1,
  .h1 {
    font-size: calc(var(--font-size-3xl) * 1.2);
  }

  .hero__title {
    font-size: calc(var(--font-size-3xl) * 1.2);
  }
}

/* ----------------------------------------------
   prefers-reduced-motion
   ---------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }

  [data-animate] {
    opacity: 1 !important;
  }

  .animate,
  .spinner {
    animation: none !important;
  }
}