:root {
  --green: #1b5e20;
  --accent: #2e7d32;
  --muted: #7a7a7a;
  --bg: #fff;
  --surface: #f6f6f6;
  --shadow: rgba(18, 18, 18, 0.06);
  --radius: 10px;
  --font-heading: "Montserrat";
  --font-body: "Open Sans", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: var(--font-body);
  background: var(--bg);
  color: #111;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading), sans-serif;
}

.notification {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background-color: var(--accent);
  color: white;
  padding: 10px 15px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  z-index: 3000;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
}
.notification.show {
  opacity: 1;
  transform: translateY(0);
}

.topbar {
  background: var(--green);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 9999;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 1.2rem;
}

.brand-logo {
  height: 46px;
}

.top-actions {
  display: flex;
  gap: 0;
  align-items: center;
}

/* Base Button Styles (Task 5) */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  border-radius: 999px;
  font-family: var(--font-heading), sans-serif;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  border: none;
  text-decoration: none;
  line-height: 1.2;
  outline: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

.btn-primary {
  background-color: var(--green);
  color: #fff !important;
}

.btn-primary:hover {
  background-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(27, 94, 32, 0.15);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background-color: #ffffff;
  color: var(--green) !important;
  border: 1.5px solid var(--green);
}

.btn-secondary:hover {
  background-color: #f1f7f3;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(27, 94, 32, 0.1);
}

.btn-secondary:active {
  transform: translateY(0);
}

/* A new universal class for header icon containers */
.header-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: none;
  border-radius: 6px;
  background-color: transparent;
  color: #fff;
  cursor: pointer;
  transition: background-color 0.2s ease;
  position: relative;
}

.header-icon:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.header-icon svg {
  width: 22px;
  height: 22px;
}

.header-icon .flag-icon {
  width: 22px;
  height: 22px;
  border-radius: 9999px;
  object-fit: cover;
}

/* Stripping sizing/padding from original .icon-btn to avoid conflicts */
.icon-btn {
  padding: 0;
}

.icon-btn .badge {
  position: absolute;
  top: 4px;
  right: 4px;
  background: #fff;
  color: var(--green);
  font-weight: 700;
  border-radius: 50%;
  padding: 0;
  font-size: 0.75rem;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.main-content {
  margin: 2rem;
}

.layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 2rem;
  margin-top: 1.2rem;
  padding: 0 2rem 2rem; /* jarak kanan–kiri */
  position: relative;
  z-index: 0;
  box-sizing: border-box;
}

.sidebar {
  background: var(--surface);
  padding: 1.25rem;
  border-radius: 10px;
  border: 1px solid rgba(0, 0, 0, 0.04);
  position: sticky;
  top: 90px;
  height: calc(100vh - 120px);
  overflow: auto;
  transition: transform 0.3s ease;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.sidebar-header h4 {
  font-family: var(--font-heading);
  color: var(--green);
  font-size: 0.95rem;
  margin: 0;
}

.collapse-btn {
  background: transparent;
  border: 0;
  font-size: 1.15rem;
  cursor: pointer;
  color: var(--muted);
}

.category-list ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.category-list li {
  margin: 0.6rem 0;
}

.category-list a {
  display: block;
  padding: 0.45rem 0.6rem;
  border-radius: 6px;
  color: #111;
  font-weight: 1000;
  text-decoration: none;
}

.category-list a:hover,
.category-list a.active {
  background: rgba(30, 100, 30, 0.05);
  color: var(--accent);
}

/* Sidebar overlay (mobile) */
.sidebar.mobile-active {
  position: fixed;
  left: 0;
  top: 0;
  width: 250px;
  height: 100vh;
  background: #fff;
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.2);
  transform: translateX(0);
  z-index: 1500;
}

.sidebar.mobile-hidden {
  transform: translateX(-110%);
}

.search-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin: 1.5rem auto;
  max-width: 600px;
  background: var(--surface);
  border: 1.5px solid rgba(0, 0, 0, 0.08);
  border-radius: 50px;
  padding: 0.5rem 1rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  transition: all 0.25s ease;
}

.search-bar:hover {
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

.search-bar input[type="search"] {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: 1rem;
  font-family: var(--font-body);
  color: #222;
  padding: 0.6rem 0.8rem;
}

.search-bar input::placeholder {
  color: #888;
  font-style: italic;
}

.search-bar label {
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.search-bar i {
  width: 22px;
  height: 22px;
  color: var(--green);
  stroke-width: 2.5; /* biar icon-nya sedikit lebih tebal */
  transition: 0.2s ease;
}

.search-bar i:hover {
  color: var(--accent);
  transform: scale(1.1);
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding-right: 1rem;
}

.page-header h1 {
  font-family: var(--font-heading);
  color: var(--green);
  font-size: 1.5rem;
  margin: 0;
  font-weight: 700;
  text-align: left;
}

/* ===== SORT BY (Toggle Button Version) ===== */
.sort-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  padding: 0.5rem 0.8rem;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
  transition: all 0.2s ease;
  white-space: nowrap;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--green);
  cursor: pointer;
}

.sort-toggle-btn:hover {
  border-color: var(--accent);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
  color: var(--accent);
}

.sort-toggle-btn span {
  font-size: 1rem;
  line-height: 1;
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  justify-content: center;
}

.promo-section {
  margin-bottom: 2.5rem;
}

.promo-actions {
  text-align: center;
  margin-top: 1.5rem;
}

.product-card {
  background: #ddd;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.04);
  box-shadow: 0 4px 12px var(--shadow);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  aspect-ratio: 3 / 4;
  display: flex;
  flex-direction: column;
  position: relative;
}

.product-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 24px rgba(18, 18, 18, 0.08);
}

/* ==== Gambar produk ==== */
.product-media {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  border-top-left-radius: 12px;
  border-top-right-radius: 12px;
  align-items: center;
  justify-content: right;
  padding: 0px;
  margin: 0rem;
}

.product-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-top-left-radius: 12px;
  border-top-right-radius: 12px;
  object-position: center;
  display: block;
}

/* ==== Konten di bawah gambar ==== */
.product-body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding: 0.9rem 1rem;
  background: #fff;
  flex-shrink: 0;
  min-height: 70px;
}

.product-title {
  font-weight: 700;
  font-size: 1rem;
  margin: 0 0 0.25rem 0;
  color: #111;
  flex-grow: 1;
  text-align: left;
}

.product-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.price {
  color: var(--accent);
  font-weight: 800;
  font-size: 0.95rem;
  margin-right: 1rem;
}

.product-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background-color: #E53935;
  color: #FFFFFF;
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  z-index: 1;
}

.price-container {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.price-original {
  text-decoration: line-through;
  color: var(--muted);
  font-size: 0.85rem;
  margin-bottom: 0.1rem;
}

.price-discounted {
  color: #2E7D32;
  font-weight: 800;
  font-size: 0.95rem;
}

.product-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

.product-link:hover {
  text-decoration: none;
  color: inherit;
}

.product-link:visited,
.product-link:active {
  color: inherit;
  text-decoration: none;
}

/* ==== Tombol Add to Cart ==== */
.add-cart {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  width: auto;
}

.add-cart i {
  width: 18px;
  height: 18px;
  stroke-width: 2.5;
  color: #2e7d32;
  transition: 0.2s ease;
}

.btn-sm {
  background-color: #f0fdf4;
  border: 1px solid #dcfce7;
  color: var(--green);
  padding: 0.5rem 1rem;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 600;
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.btn-sm:hover {
  background-color: var(--green);
  color: #fff;
  border-color: var(--green);
  transform: translateY(-1px);
}

@media (max-width: 768px) {
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }

  .product-body {
    padding: 0.7rem;
    min-height: 95px; /* lebih kecil di mobile */
  }

  .product-title {
    font-size: 0.9rem;
  }

  .price {
    font-size: 0.85rem;
  }

  .btn-sm {
    font-size: 0.8rem;
    padding: 0.35rem 0.6rem;
  }
}

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.6rem;
  margin-top: 2rem;
  font-family: var(--font-body);
}

.pagination a {
  display: inline-block;
  padding: 0.5rem 1.1rem;
  border-radius: 999px;
  border: 1.8px solid var(--accent);
  color: var(--accent);
  background: #fff;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  letter-spacing: 0.25px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
  transition: all 0.25s ease;
}

.pagination a:hover {
  background: var(--accent);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
}

.pagination a.active {
  background: var(--green);
  color: #fff;
  border-color: var(--green);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
}

.preview {
  background: var(--surface);
  padding: 1.5rem;
  border-radius: var(--radius);
  box-shadow: 0 4px 12px var(--shadow);
  text-align: center;
  margin: 2rem;
}

.preview h2 {
  color: var(--green);
  margin-top: 0;
  margin-bottom: 0.6rem;
}

/* MODERN CONTACT PAGE STYLES */

.contact-page {
  padding-top: 0rem;
}

.contact-page h1 {
  text-align: center;
  margin-bottom: 30px;
  color: var(--primary);
  font-size: 1.8rem;
  font-family: "Montserrat", sans-serif;
}

.contact-page > p {
  text-align: center;
  margin-bottom: 40px;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
  font-size: 1.1rem;
  color: #555;
}

.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  margin: 2rem;
}

.news-section .section-title {
  font-size: 2.2rem;
  margin-bottom: 3rem;
  text-align: center;
}

@media (min-width: 1024px) {
  .news-grid {
    /* Konsisten 3 kolom di desktop */
    grid-template-columns: repeat(3, 1fr);
  }
}

.news-card-link {
  text-decoration: none;
  color: inherit;
  display: block;
  height: 100%;
}

.news-card {
  background: var(--bg);
  border-radius: var(--radius);
  box-shadow: 0 4px 12px var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s, box-shadow 0.3s;
  height: 100%;
}

.news-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.news-card-image-wrapper {
  /* Modern 16:9 aspect ratio */
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 9 / 16 * 100% */
  overflow: hidden;
  background-color: var(--surface);
}

.news-card-image-wrapper img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.news-card-content {
  padding: 1rem 1.2rem; /* padding lebih besar */
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.news-card-content h3 {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  color: var(--green);
  margin: 0 0 0.25rem 0;
  line-height: 1.4;
  /* Batasi judul menjadi 2 baris */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  min-height: 3.08em; /* 1.1em * 1.4 * 2 baris */
  height: 3.08em; /* Tambahkan tinggi eksplisit */
}

.news-card-meta {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.news-card-excerpt {
  font-size: 0.9rem;
  line-height: 1.5;
  color: #444;
  flex-grow: 1;
  /* Batasi deskripsi menjadi 3 baris */
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.site-footer {
  width: 100%;
  background: var(--green);
  color: #fff;
  padding: 2rem 0 1.5rem;
  margin-top: 0rem;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
}

.footer-col h4 {
  margin-top: 0;
  margin-bottom: 0.8rem;
  font-family: var(--font-heading);
}

.footer-col p {
  line-height: 1.6;
  color: #e0e0e0;
}

.footer-col a {
  color: #fff;
  text-decoration: none;
}

.footer-col a:hover {
  text-decoration: underline;
}

.footer-inner .social-icons {
  margin-top: 1rem;
}

.footer-inner .social-icons a {
  display: inline-block;
  margin-right: 0.8rem;
  color: #fff;
  font-size: 1.2rem;
  transition: color 0.2s;
}

.footer-inner .social-icons a:hover {
  color: #c8e6c9;
}

.footer-inner .footer-col img {
  height: 170px;
}

.footer-bottom {
  text-align: center;
  margin-top: 1.5rem;
  font-size: 0.9rem;
  color: #e0e0e0;
}

@media (max-width: 1024px) {
  .layout {
    grid-template-columns: 220px 1fr;
  }
}

@media (max-width: 768px) {
  .layout {
    grid-template-columns: 1fr;
    gap: 1rem;
    padding: 0 1rem 2rem; /* kasih jarak kanan–kiri */
  }

  .products-grid {
    grid-template-columns: repeat(2, 1fr); /* 2 produk per baris */
    gap: 1rem;
  }

  .product-card {
    aspect-ratio: 3 / 4; /* tetap jaga proporsi */
  }

  #menu-toggle {
    display: inline-block;
  }
}

@media (min-width: 769px) {
  #menu-toggle {
    display: none !important;
  }
}

@media (max-width: 768px) {
  body {
    font-size: 0.9rem; /* ukuran dasar font jadi lebih kecil */
  }

  .product-title {
    font-size: 0.9rem; /* judul produk lebih kecil */
  }

  .price {
    font-size: 0.85rem; /* harga lebih kecil dikit */
  }

  .btn-sm {
    font-size: 0.8rem; /* tombol tambah ke keranjang juga kecil */
    padding: 0.35rem 0.6rem;
  }

  .page-header h1 {
    font-size: 1.2rem; /* judul "Produk Unggulan" lebih pas di layar kecil */
  }

  .preview p,
  .footer-col p {
    font-size: 0.85rem;
  }

  .category-list a {
    font-size: 0.9rem;
  }
}

#menu-toggle {
  display: none;
}

@media (max-width: 768px) {
  #menu-toggle {
    display: inline-block;
    color: white;
    font-size: 1.5rem;
  }

  /* Sidebar disembunyikan default */
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 260px;
    background: #fff;
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.15);
    transform: translateX(-110%);
    transition: transform 0.3s ease-in-out;
    z-index: 2000;
  }

  /* Sidebar aktif (ketika hamburger diklik) */
  .sidebar.mobile-active {
    transform: translateX(0);
  }

  /* Nonaktifkan scroll saat sidebar terbuka */
  body.sidebar-open {
    overflow: hidden;
  }
}

.hero-section {
  padding-top: 0.5rem;
}

.hero-slider {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  box-shadow: 0 4px 10px var(--shadow);
  width: 100%;
  aspect-ratio: 4 / 1;
  max-height: 300px;
}

.hero-slider .slide-item {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.8s ease-in-out;
}

.hero-slider .slide-item.active {
  opacity: 1;
  visibility: visible;
}

.hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--radius);
}

/* Hero Content overlay */
.hero-content {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 3rem 10%;
  color: white;
  text-shadow: 0 0 10px rgba(0, 0, 0, 0.7);

  /* Efek overlay gelap agar teks terlihat */
  background: linear-gradient(
    to right,
    rgba(0, 0, 0, 0.6) 30%,
    /* Dibuat lebih gelap */ rgba(0, 0, 0, 0.2) 70%,
    transparent 100%
  );
}

.hero-title {
  font-family: var(--font-heading);
  font-size: 2.8rem;
  margin: 0 0 1rem 0;
}

.hero-subtitle {
  font-size: 1.3rem;
  margin: 0 0 1.5rem 0;
  max-width: 60%;
}

.btn-accent {
  color: #ffffff; /* Ubah warna teks menjadi hitam agar kontras dengan latar belakang kuning */
}

.btn-accent:hover {
  transform: translateY(-2px); /* Efek sedikit terangkat */
}

/* Navigasi Dots */
.slider-dots {
  position: absolute;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 0.5rem;
  z-index: 15;
}

.slider-dots button {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.8);
  cursor: pointer;
  padding: 0;
  transition: background 0.3s, transform 0.3s;
}

.slider-dots button.active {
  background: var(--accent); /* Warna aktif */
  transform: scale(1.2);
}

.slider-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  background: rgba(0, 0, 0, 0.3);
  color: white;
  border: none;
  padding: 0.8rem 0.5rem;
  cursor: pointer;
  font-size: 1.5rem;
  opacity: 0.8;
  transition: opacity 0.3s, background 0.3s;
  height: 100%; /* Agar bisa di klik di seluruh tinggi */
  display: flex;
  align-items: center;
}

.slider-arrow:hover {
  opacity: 1;
  background: rgba(0, 0, 0, 0.5);
}

.slider-arrow.prev {
  left: 0; /* Ubah dari 10px ke 0 untuk menempel di tepi */
  border-radius: 0;
  padding-left: 10px;
}

.slider-arrow.next {
  right: 0; /* Ubah dari 10px ke 0 untuk menempel di tepi */
  border-radius: 0;
  padding-right: 10px;
}

.contact-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 3rem;
  align-items: flex-start;
  margin-top: 2rem;
}

.contact-form {
  background: #fff;
  padding: 2.5rem;
  border-radius: 12px;
  box-shadow: 0 5px 20px rgba(0,0,0,0.07);
}

.contact-form label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: #333;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 0.8rem 1rem;
  border: 1px solid #ccc;
  border-radius: 8px;
  margin-bottom: 1.2rem;
  font-size: 1rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.15);
}

.contact-form .btn-primary {
  width: 100%;
  padding: 1rem;
  font-size: 1.1rem;
  background-color: var(--green);
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.search-button-borderless {
  border: none !important;
  background: none !important;
}

.contact-form .btn-primary:hover {
  background-color: var(--accent);
}

.contact-info {
  background: var(--surface);
  padding: 2.5rem;
  border-radius: 12px;
}

.contact-info h2 {
  margin-top: 0;
  color: var(--green);
}

.contact-info p {
  margin-bottom: 1rem;
  line-height: 1.6;
}

.contact-info a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.contact-info a:hover {
  text-decoration: underline;
}

.contact-info .social-icons {
  margin-top: 1.5rem;
  display: flex;
  gap: 1rem;
}

.contact-info .social-icons a {
  color: var(--green);
  font-size: 1.5rem;
}
.contact-info .social-icons a:hover {
  color: var(--accent);
}

@media (max-width: 992px) {
  .contact-grid {
    grid-template-columns: 1fr;
  }
}

.account-layout {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  margin-top: 2rem;
}

.account-sidebar {
  flex: 0 0 250px; /* Sidebar with fixed width */
  position: sticky;
  top: 90px;
}

.account-main {
  flex: 1; /* Main content takes the rest of the space */
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.main-content .container .page-title {
  margin-left: 0;
  margin-bottom: 1rem;
}


/* --- Sidebar Navigation --- */
.account-nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  overflow: hidden;
  border: 1px solid rgba(0,0,0,0.08);
}

.account-nav a {
  display: flex;
  align-items: center;
  padding: 1rem;
  text-decoration: none;
  color: #333;
  font-weight: 600;
  border-left: 4px solid transparent;
  transition: all 0.2s ease;
}

.account-nav a:hover {
  background-color: var(--surface);
  color: var(--accent);
}

.account-nav a.active {
  border-left-color: var(--green);
  background-color: #f0fff0;
  color: var(--green);
}

.account-nav i {
  margin-right: 0.8rem;
  width: 20px;
  stroke-width: 2.5;
}

/* --- Section Cards --- */
.account-section {
  background-color: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.06);
  border: 1px solid rgba(0,0,0,0.08);
  overflow: hidden;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid #eee;
}

.section-header h2 {
  margin: 0;
  font-size: 1.25rem;
  font-family: var(--font-heading);
  color: var(--green);
}

.section-body {
  padding: 1.5rem;
}

/* --- Form Styling --- */
.form-group {
  margin-bottom: 0rem;
}

.form-group:last-child {
  margin-bottom: 0;
}

.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

/* Unified style for inputs and selects */
.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group select {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  background-color: #fff;
  font-size: 1rem;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(46, 125, 50, 0.15);
}

/* Style for disabled fields to look read-only */
.form-group input:disabled,
.form-group select:disabled {
  background-color: #f7f7f7;
  border-color: #e0e0e0;
  color: #555;
  cursor: not-allowed;
}

/* --- Action Buttons --- */
.form-actions {
  margin-top: 1.5rem;
  text-align: right;
}


/* --- Order History Card --- */
.order-card {
    background-color: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
    margin-bottom: 15px;
}
.order-code {
    font-weight: 700;
    font-size: 1.1em;
    color: var(--green);
}
.order-date {
    font-size: 0.9em;
    color: #777;
}
.order-status, .status-badge {
    font-weight: 600;
    padding: 0.3rem 0.8rem;
    border-radius: 50px;
    font-size: 0.85em;
    text-transform: capitalize;
    color: white;
}
/* Status Colors (Final Merge) */
.status-menunggu-konfirmasi { background-color: #f59e0b; } /* Amber */
.status-diproses { background-color: #3b82f6; } /* Blue */
.status-dalam-pengiriman { background-color: #8b5cf6; } /* Violet */
.status-selesai { background-color: var(--accent); } /* Accent (Green theme) */
.status-ditolak { background-color: #ef4444; } /* Red */
.status-default { background-color: #6b7280; } /* Gray */


.order-body {
    padding: 10px 0;
}

.order-body .item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #f5f5f5;
}
.order-body .item:last-child {
    border-bottom: none;
}
.order-body .item-info {
    flex-grow: 1;
}
.order-body .item-name {
    font-weight: 600;
}
.order-body .item-qty {
    font-size: 0.9em;
    color: #777;
}
.order-body .item-total {
    font-weight: 600;
    color: #333;
}
.order-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}
.order-receipt {
    font-size: 0.9em;
    color: #555;
}
.order-total {
    text-align: right;
}
.order-total strong {
    display: block;
    font-weight: 600;
    font-size: 0.9em;
    color: #777;
}
.order-total span {
    font-weight: 700;
    font-size: 1.2em;
    color: var(--green);
}


/* Responsive adjustments */
@media (max-width: 768px) {
  .account-layout {
    flex-direction: column;
  }

  .account-sidebar {
    width: 100%;
    flex: 0 0 auto;
    position: static;
  }
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.modal-content {
  background: #ffffff;
  padding: 2rem;
  border-radius: 20px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  width: 95%;
  max-width: 500px;
  transform: translateY(20px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-overlay.show {
  opacity: 1;
  visibility: visible;
}

.modal-overlay.show .modal-content {
  transform: translateY(0);
}

.modal-title {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--green);
  font-size: 1.5rem;
  margin-top: 0;
  margin-bottom: 1rem;
  text-align: left;
}

.modal-body {
  font-size: 1rem;
  line-height: 1.6;
  color: #555;
  margin-bottom: 1.5rem;
  text-align: left;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

/* --- Styles for Confirmation Modal --- */
.confirmation-summary {
  margin: 1.25rem 0;
  text-align: left;
  max-height: 250px;
  overflow-y: auto;
  background: #f9fbfa;
  border-radius: 12px;
  padding: 1rem;
  border: 1px solid #eef3f0;
}

.summary-product-item {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.65rem 0;
  font-size: 0.95rem;
  border-bottom: 1px dashed #e0e0e0;
}

.summary-product-item:last-child {
  border-bottom: none;
}

.summary-product-name {
  color: #4b5563;
  font-weight: 500;
}

.summary-product-total {
  font-weight: 700;
  color: #111827;
}

.summary-grand-total {
  text-align: right;
  margin-top: 1rem;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--green);
}

/* Language Switcher */
.lang-switcher {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.lang-switcher-desktop {
  margin-left: 0.5rem; /* Jarak dari ikon keranjang */
}

.lang-switcher-mobile {
  display: none; /* Sembunyikan di desktop */
  padding: 1rem 1.25rem;
  border-top: 1px solid rgba(0,0,0,0.08);
}

.lang-btn {
  background: transparent;
  border: none;
  color: inherit; /* Mewarisi warna dari parent (putih di header, hitam di sidebar) */
  cursor: pointer;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.9rem;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.lang-btn.active {
  opacity: 1;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.lang-switcher span {
  opacity: 0.5;
}

/* --- Responsive Controls for Switcher --- */
@media (max-width: 768px) {
  .lang-switcher-desktop {
    display: none;
  }
  .lang-switcher-mobile {
    display: flex;
  }
}

/* --- 3D Discount Ribbon --- */
.discount-ribbon {
  position: absolute;
  width: 160px;
  height: 32px;
  line-height: 32px;
  top: 18px;
  left: -45px;
  z-index: 2;

  transform: rotate(-45deg);
  background: #ef4444; /* A modern, vibrant red */
  color: #fff;

  text-align: center;
  font-family: var(--font-body, "Open Sans", sans-serif);
  font-weight: 700;
  font-size: 14px;

  box-shadow: 0 4px 6px rgba(0,0,0,0.15), 0 1px 3px rgba(0,0,0,0.2); /* 3D Floating shadow */

  /* Subtle highlight for a more plastic/realistic look */
  border: 1px solid rgba(0,0,0,0.1);
  border-top-color: rgba(255,255,255,0.2);
  border-bottom-color: rgba(0,0,0,0.3);
}

.discount-ribbon span {
  display: inline-block;
  font-weight: bold;
  color: white;
}

/* Creating the "folded" look */
.discount-ribbon::before,
.discount-ribbon::after {
  content: '';
  position: absolute;
  border-style: solid;
  border-color: transparent;
  z-index: -1; /* Place them behind the main ribbon */
}

/* The darker fold at the top-left edge */
.discount-ribbon::before {
  top: 0;
  left: 0;
  border-width: 0 45px 32px 0; /* Creates the top-left fold shape */
  border-right-color: #b91c1c; /* Darker red for shadow */
}

/* The darker fold at the bottom-right edge */
.discount-ribbon::after {
  bottom: 0;
  right: 0;
  border-width: 32px 45px 0 0; /* Creates the bottom-right fold shape */
  border-top-color: #b91c1c; /* Darker red for shadow */
}

/* Sprint 3 product flow refinements */
.product-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  gap: 1rem;
  align-items: end;
  padding: 2rem 0 0;
}

.product-toolbar .search-bar {
  width: 100%;
  max-width: none;
  margin: 0;
}

.sort-control {
  display: grid;
  gap: 0.35rem;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 700;
}

.product-count {
  color: var(--muted);
  font-weight: 700;
}

.product-grid-responsive,
.products-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.product-card {
  height: 100%;
  aspect-ratio: auto;
  background: var(--color-background, #fff);
  border: 1px solid var(--color-border, #e5e7eb);
  border-radius: var(--radius-lg, 14px);
  box-shadow: var(--shadow-md, 0 4px 12px rgba(17, 24, 39, 0.08));
}

.product-link {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
}

.product-media {
  aspect-ratio: 1 / 1;
  background: #f6f8f5;
}

.product-media img {
  border-radius: 0;
}

.product-discount-badge {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 2;
  border-radius: 999px;
  background: #dc2626;
  color: #fff;
  padding: 0.3rem 0.65rem;
  font-size: 0.78rem;
  font-weight: 800;
}

.product-body {
  justify-content: flex-start;
  gap: 0.35rem;
  min-height: 132px;
  padding: 1rem;
}

.product-category {
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.product-title {
  display: -webkit-box;
  min-height: 2.7em;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-height: 1.35;
}

.product-meta {
  margin-top: auto;
}

.price-container {
  gap: 0.1rem;
}

.price,
.price-discounted {
  color: var(--accent);
  font-size: 1rem;
}

.product-actions {
  display: flex;
  gap: 0.6rem;
  padding: 0 1rem 1rem;
}

.product-actions .btn-sm {
  flex: 1;
  justify-content: center;
  text-decoration: none;
}

.btn-detail {
  background: #fff;
  border-color: var(--green);
}

.catalog-state {
  grid-column: 1 / -1;
  display: grid;
  justify-items: center;
  gap: 0.75rem;
  padding: 3rem 1.5rem;
  text-align: center;
  background: var(--surface);
  border: 1px dashed var(--color-border, #e5e7eb);
  border-radius: var(--radius-lg, 14px);
}

.catalog-state svg {
  width: 2.5rem;
  height: 2.5rem;
  color: var(--accent);
}

.catalog-state h3,
.catalog-state p {
  margin: 0;
}

@media (max-width: 1023px) {
  .product-grid-responsive,
  .products-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .product-toolbar {
    grid-template-columns: 1fr;
  }

  .product-grid-responsive,
  .products-grid {
    grid-template-columns: 1fr;
  }

  .product-actions {
    flex-direction: column;
  }
}

.news-card-link:focus-visible,
.contact-form button:focus-visible,
.contact-info a:focus-visible {
  outline: 3px solid rgba(46, 125, 50, 0.24);
  outline-offset: 3px;
}

.contact-layout,
.contact-info-container {
  /* Backward-compatible aliases for older contact markup. */
}

/* QA hardening: keep responsive layouts inside the viewport and make keyboard focus visible. */
html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

img,
svg,
video,
canvas {
  max-width: 100%;
}

:where(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

button,
.btn,
.admin-button,
.quantity-btn,
.shipping-option {
  min-height: 44px;
}

.form-status-message {
  margin-top: 0.75rem;
  color: var(--green);
  font-weight: 600;
}
