/* ===== RESET & GLOBAL ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
}

body {
  font-family: 'Inter', sans-serif;
  color: #0f172a;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;

  /* ===== BACKGROUND BERKARAKTER ===== */
  background-color: #eef2f7;
  background-image:
    radial-gradient(circle at 100% 0%, rgba(245, 158, 11, 0.10) 0%, transparent 45%),
    radial-gradient(circle at 0% 100%, rgba(37, 99, 235, 0.08) 0%, transparent 45%),
    radial-gradient(rgba(15, 23, 42, 0.045) 1px, transparent 1px);
  background-size: auto, auto, 22px 22px;
  background-attachment: fixed;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 16px 60px;
  flex: 1;
  width: 100%;
}

/* ===== HEADER ===== */
.header {
  background: #1e2530;
  width: 100%;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.header__top {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 14px 28px;
  max-width: 1400px;
  margin: 0 auto;
}

.logo {
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  text-decoration: none;
  color: #ffffff;
  white-space: nowrap;
}

.logo span {
  color: #f59e0b;
}

/* --- Search Bar --- */
.search-bar {
  flex: 1;
  display: flex;
  align-items: center;
  background: #ffffff;
  border-radius: 999px;
  overflow: hidden;
  max-width: 780px;
  height: 42px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.search-bar input {
  flex: 1;
  border: none;
  outline: none;
  padding: 0 20px;
  font-size: 0.9rem;
  font-family: inherit;
  color: #334155;
  background: transparent;
  min-width: 0;
}

.search-bar input::placeholder {
  color: #94a3b8;
}

.search-bar button {
  width: 62px;
  height: 100%;
  border: none;
  background: #f59e0b;
  color: #ffffff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  flex-shrink: 0;
}

.search-bar button:hover {
  background: #d97706;
}

/* --- Header Actions --- */
.header__actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  color: #cbd5e1;
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

/* --- Navigation --- */
.nav {
  display: flex;
  gap: 32px;
  padding: 0 28px 16px;
  max-width: 1400px;
  margin: 0 auto;
  flex-wrap: wrap;
}

.nav a {
  color: #e2e8f0;
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.2s;
}

.nav a:hover {
  color: #f59e0b;
}

/* ===== PRODUCTS SECTION (panel putih glass) ===== */
.products-section {
  text-align: left;
  position: relative;
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 28px;
  padding: 32px 28px 40px;
  box-shadow:
    0 20px 50px rgba(15, 23, 42, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.products-title {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 8px;
  color: #0f172a;
}

.products-subtitle {
  font-size: 1rem;
  color: #64748b;
  margin-bottom: 32px;
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 22px;
}

/* --- Product Card --- */
.product-card {
  background: #ffffff;
  border: 1px solid #eef2f7;
  border-radius: 20px;
  padding: 16px 16px 20px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.03);
  transition: transform 0.25s, box-shadow 0.25s;
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.08);
}

/* ============================================================
   UKURAN GAMBAR DISERAGAMKAN — THUMBNAIL SELALU PERSEGI
   ============================================================ */
.product-thumb {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #f1f5f9;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  margin-bottom: 16px;
  overflow: hidden;
}

.thumb-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
  transition: transform 0.35s ease;
}

.product-card:hover .thumb-img {
  transform: scale(1.06);
}

/* ===== NAMA PRODUK ===== */
.product-name {
  font-size: 1rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.35;
  margin-bottom: 8px;
  letter-spacing: -0.2px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.7em;
}

/* ===== RATING ===== */
.product-rating {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: #475569;
  margin-bottom: 18px;
}

.product-rating .stars {
  color: #f59e0b;
  letter-spacing: 1px;
  font-size: 0.9rem;
}

.product-rating .count {
  color: #64748b;
}

/* ===== TOMBOL VIEW PRODUCT ===== */
.btn-view {
  margin-top: auto;
  display: block;
  width: 100%;
  text-align: center;
  background: #2563eb;
  color: #ffffff;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 12px 16px;
  border-radius: 10px;
  text-decoration: none;
  transition: background 0.2s, transform 0.15s;
  min-height: 44px;
  line-height: 1.4;
}

.btn-view:hover {
  background: #1d4ed8;
}

.btn-view:active {
  transform: scale(0.98);
}

/* ===== FOOTER ===== */
.footer {
  position: relative;
  background: #1e2530;
  color: #ffffff;
  text-align: center;
  padding: 40px 24px 44px;
}

.footer__logo {
  display: inline-block;
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  text-decoration: none;
  color: #ffffff;
  margin-bottom: 12px;
}

.footer__logo span {
  color: #f59e0b;
}

.footer__copy {
  font-size: 0.9rem;
  color: #94a3b8;
  font-weight: 400;
}

/* --- Floating Toolbar --- */
.float-toolbar {
  position: absolute;
  right: 24px;
  bottom: 24px;
  display: grid;
  grid-template-columns: repeat(2, 42px);
  grid-template-rows: repeat(2, 42px);
  gap: 4px;
  background: #2a3340;
  padding: 6px;
  border-radius: 10px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}

.tool-btn {
  width: 42px;
  height: 42px;
  border: none;
  background: #353f4d;
  color: #cbd5e1;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s, transform 0.15s;
}

.tool-btn:hover {
  background: #f59e0b;
  color: #ffffff;
  transform: translateY(-1px);
}

.tool-btn:active {
  transform: translateY(0);
}

/* ===== RESPONSIVE ===== */

/* Tablet */
@media (max-width: 900px) {
  .products-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 18px;
  }
}

/* Mobile */
@media (max-width: 768px) {
  .header__top {
    flex-wrap: wrap;
    padding: 12px 16px;
    gap: 12px;
  }

  .search-bar {
    order: 3;
    width: 100%;
    max-width: 100%;
    margin-top: 8px;
    height: 40px;
  }

  .nav {
    padding: 0 16px 14px;
    gap: 20px;
    overflow-x: auto;
    flex-wrap: nowrap;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .nav::-webkit-scrollbar { display: none; }

  .nav a {
    white-space: nowrap;
  }

  .container {
    padding: 24px 12px 40px;
  }

  .products-section {
    padding: 20px 14px 28px;
    border-radius: 20px;
  }

  .products-title {
    font-size: 1.5rem;
  }

  .products-subtitle {
    font-size: 0.9rem;
    margin-bottom: 22px;
  }

  .products-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .product-card {
    padding: 12px 12px 16px;
    border-radius: 16px;
  }

  .product-thumb {
    border-radius: 12px;
    padding: 10px;
    margin-bottom: 12px;
  }

  .product-name {
    font-size: 0.88rem;
    margin-bottom: 6px;
  }

  .product-rating {
    font-size: 0.75rem;
    margin-bottom: 12px;
    gap: 4px;
  }

  .product-rating .stars {
    font-size: 0.8rem;
    letter-spacing: 0;
  }

  .btn-view {
    padding: 10px 12px;
    font-size: 0.82rem;
    min-height: 42px;
  }

  .float-toolbar {
    right: 12px;
    bottom: 12px;
    grid-template-columns: repeat(2, 38px);
    grid-template-rows: repeat(2, 38px);
  }

  .tool-btn {
    width: 38px;
    height: 38px;
  }

  .footer {
    padding: 32px 16px 80px;
  }
}

/* HP kecil */
@media (max-width: 380px) {
  .products-grid {
    grid-template-columns: 1fr;
  }

  .products-title {
    font-size: 1.3rem;
  }
}

/* iOS safe-area */
@supports (padding: max(0px)) {
  .footer {
    padding-bottom: max(40px, env(safe-area-inset-bottom));
  }
}