:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --secondary: #f59e0b;
  --secondary-dark: #d97706;
  --dark: #1e293b;
  --light: #f8fafc;
  --gray: #64748b;
  --success: #10b981;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Poppins', sans-serif;
  background: linear-gradient(135deg, #a8e6cf, #dce6f5);
  background-attachment: fixed;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  min-height: 100vh;
  color: var(--dark);
  line-height: 1.6;
  overflow-x: hidden;
  padding: 0;
}

body > *:not(footer) {
  flex-shrink: 0;
}

/* Header */
header {
  width: 100%;
  padding: 1rem 5%;
  background-color: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--dark);
  display: flex;
  align-items: center;
  gap: 0;
  line-height: 1;
}

.logo img {
  height: 65px !important;
  width: auto !important;
  max-height: none !important;
  max-width: none !important;
  vertical-align: middle;
}

.logo span {
  color: var(--secondary);
}

.nav-links {
  display: flex;
  gap: 1.5rem;
}

.nav-links a {
  color: var(--dark);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s ease;
  position: relative;
}

.nav-links a:hover {
  color: var(--secondary);
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--secondary);
  transition: width 0.3s ease;
}

.nav-links a:hover::after {
  width: 100%;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.user-email {
  background: rgba(255, 255, 255, 0.6);
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.9rem;
  backdrop-filter: blur(5px);
  color: var(--dark);
}

.user-info-container {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.6);
  padding: 0.5rem 1rem;
  border-radius: 20px;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  cursor: pointer;
  user-select: none;
  transition: all 0.2s ease;
}

.user-info-container:hover {
  background: rgba(255, 255, 255, 0.8);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

#user-info {
  display: flex;
  align-items: center;
  gap: 7px;
  font-weight: 500;
  font-size: 0.84rem;
  color: var(--dark);
}

#user-info i {
  color: var(--gray);
  font-size: 0.85rem;
}

/* Main Content */
.main-content {
  width: 100%;
  max-width: 1200px;
  padding: 2rem 1rem;
  margin-top: 0.5rem;
}

h1 {
  text-align: center;
  color: #0984e3;
  font-size: 1.8rem;
  margin-bottom: 1rem;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.1);
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  align-items: center;
  margin-bottom: 1.5rem;
  padding: 0 0.5rem;
}

.search-box {
  flex: 1;
  min-width: 200px;
  max-width: 300px;
}

.search-box input {
  width: 100%;
  padding: 0.8rem;
  border: 2px solid #0984e3;
  border-radius: 12px;
  font-size: 1rem;
  outline: none;
}

.sort-box {
  flex: 1;
  min-width: 200px;
  max-width: 250px;
}

.sort-box select {
  width: 100%;
  padding: 0.8rem;
  border: 2px solid #0984e3;
  border-radius: 12px;
  font-size: 1rem;
  background: white;
}

.game-box select {
  width: 100%;
  padding: 0.8rem;
  border: 2px solid #0984e3;
  border-radius: 12px;
  font-size: 1rem;
  background: white;
}

.custom-select {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0.8rem;
  border: 2px solid #0984e3;
  border-radius: 12px;
  background: white;
  cursor: pointer;
  font-size: 1rem;
  color: var(--dark);
  min-height: 48px;
  box-sizing: border-box;
}

.custom-select:focus {
  outline: 2px solid var(--primary);
}

/* ============================================
   DESKTOP DROPDOWN (>768px) — seperti aslinya
   ============================================ */
.dropdown-menu {
  max-height: 260px;
  overflow-y: auto;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 2px solid #0984e3;
  border-radius: 12px;
  z-index: 200;
  margin-top: 4px;
  list-style: none;
  padding: 0;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.dropdown-item {
  display: flex;
  align-items: center;
  padding: 10px 14px;
  cursor: pointer;
  gap: 10px;
  font-size: 0.95rem;
  color: var(--dark);
  border-bottom: 1px solid #f1f5f9;
  transition: background 0.15s;
}

.dropdown-item:hover {
  background-color: #f0f7ff;
}

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

.game-icon {
  width: 44px;
  height: 44px;
  object-fit: contain;
  border-radius: 8px;
  background: #f8fafc;
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  align-items: center;
  margin: 1.5rem 0;
}

.pagination button {
  padding: 0.6rem 1rem;
  background: #0984e3;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
}

.pagination button:disabled {
  background: #ccc;
  cursor: not-allowed;
}

.pagination span {
  font-weight: 600;
  color: #2d3436;
}

/* Item Container */
.item-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
  padding: 0.5rem;
}

.item {
  width: 100%;
  max-width: 200px;
  min-height: auto;
  background: white;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  padding: 0.75rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  cursor: pointer;
  overflow: hidden;
  position: relative;
}

.item:hover {
  transform: translateY(-4px) scale(1.03);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  border-color: #0984e3;
}

.item img {
  width: 100%;
  height: 120px;
  object-fit: contain;
  object-position: center;
  border-radius: 8px;
  margin-bottom: 0.5rem;
  border: 1px solid #ddd;
  background: #f9f9f9;
  padding: 0;
}

.item h3 {
  font-size: 0.9rem;
  margin: 0.25rem 0 0.25rem;
  color: #2d3436;
  font-weight: 600;
  line-height: 1.3;
  word-wrap: break-word;
  max-height: 2.6rem;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
}

.item h3:hover {
  text-decoration: none;
}

.price {
  display: none;
  font-weight: 700;
  color: #27ae60;
  font-size: 0.9rem;
  text-align: center;
  background: #e8f5e9;
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
  margin-top: 0.25rem;
  margin-bottom: 0;
}

.sold-count {
  font-size: 0.7rem;
  color: rgba(51, 51, 51, 0.6);
  font-style: italic;
  margin-top: 0.25rem;
  margin-bottom: 0;
}

.desc-btn {
  background: #6c5ce7;
  color: white;
  border: none;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.9rem;
  cursor: pointer;
  width: 100%;
  margin: 0.3rem 0 0.8rem;
}

.desc-btn:hover {
  background: #5f4fc9;
}

.buy-input {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: auto;
  padding-top: 0.8rem;
  border-top: 2px solid #f1f2f6;
}

.input-group {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

.input-group input {
  flex: 1 1 150px;
  min-width: 150px;
  padding: 0.6rem;
  border: 2px solid #0984e3;
  border-radius: 10px;
  font-size: 0.95rem;
  outline: none;
}

.input-group button {
  flex-shrink: 0;
  padding: 0.6rem 0.8rem;
  font-size: 0.9rem;
  background-color: #0984e3;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
}

.input-group button:hover {
  background-color: #067bc2;
}

.spinner {
  border: 4px solid #f3f3f3;
  border-top: 4px solid #3b82f6;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  animation: spin 1s linear infinite;
  margin: 0.5rem auto;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.result-info {
  font-size: 0.85rem;
  text-align: left;
  margin: 0.3rem 0 0.5rem 0;
  line-height: 1.4;
}

.qty-control {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.qty-btn {
  width: 36px;
  height: 36px;
  background: #0984e3;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1.2rem;
  cursor: pointer;
}

.qty-btn:hover {
  background: #067bc2;
}

.qty-input {
  width: 60px;
  text-align: center;
  font-size: 1.1rem;
  padding: 0.4rem;
  border: 2px solid #0984e3;
  border-radius: 6px;
  outline: none;
}

.total-price {
  text-align: center;
  font-weight: 700;
  color: #e74c3c;
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.buy-input button.buy-now {
  padding: 0.6rem 1rem;
  background: linear-gradient(to bottom, #27ae60, #219653);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.3s;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 4px 8px rgba(39, 174, 96, 0.2);
  margin-top: 0.5rem;
}

.buy-input button.buy-now:hover:not(:disabled) {
  background: linear-gradient(to bottom, #219653, #1e8a4c);
  transform: translateY(-2px);
}

.buy-input button.buy-now:disabled {
  background: #b2bec3;
  color: #666;
  cursor: not-allowed;
  transform: none;
}

/* Popup Description */
#popup-description {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: white;
  border: 2px solid #0984e3;
  border-radius: 16px;
  padding: 1.5rem;
  z-index: 1000;
  width: 90%;
  max-width: 500px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

#popup-description h3 {
  margin-top: 0;
  color: #0984e3;
  text-align: center;
  font-size: 1.3rem;
}

#popup-description button {
  display: block;
  margin: 1rem auto 0;
  padding: 8px 16px;
  background: #00b894;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
}

/* Tutorial Popup */
#tutorial-popup {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

#tutorial-popup .tutorial-modal-content {
  background: white;
  border-radius: 16px;
  padding: 1.5rem;
  width: 90%;
  max-width: 600px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  position: relative;
}

.tutorial-close {
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 2rem;
  color: #aaa;
  cursor: pointer;
}

.tutorial-close:hover {
  color: #000;
}

/* Popup Top Up */
.popup-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  justify-content: center;
  align-items: center;
  z-index: 1000;
  backdrop-filter: blur(4px);
  animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.popup-content {
  background: white;
  color: var(--dark);
  border-radius: 16px;
  padding: 20px;
  width: 90%;
  max-width: 360px;
  text-align: center;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
  border: 2px solid var(--success);
  transform: scale(0.95);
  opacity: 0;
  animation: popIn 0.3s ease forwards;
}

@keyframes popIn {
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.popup-content h3 {
  margin-top: 0;
  color: var(--primary);
  font-size: 1.4rem;
  font-weight: 600;
}

.payment-methods {
  margin: 12px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.method-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 2px solid #ddd;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 14px;
}

.method-option:hover {
  background-color: #f8fafc;
  transform: scale(1.02);
  transition: all 0.2s ease;
}

/* Social Section */
.social-section {
  margin: 2rem 0 0.8rem 0;
  text-align: center;
}

.social-title {
  font-size: 1.2rem;
  margin-bottom: 1.5rem;
  color: var(--dark);
}

.social-icons {
  display: flex;
  gap: 0.8rem;
  justify-content: center;
  flex-wrap: wrap;
  align-items: center;
}

.social-icons a {
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.7);
  color: var(--dark);
  font-size: 1.2rem;
  transition: all 0.3s ease;
  backdrop-filter: blur(5px);
  border: 1px solid rgba(255, 255, 255, 0.5);
}

.social-icons a:hover {
  background: var(--secondary);
  color: white;
  transform: translateY(-5px);
  box-shadow: 0 5px 15px rgba(245, 158, 11, 0.3);
}

/* Footer */
footer {
  margin-top: auto;
  width: 100%;
  background-color: rgba(255, 255, 255, 0.8);
  padding: 2rem 5%;
  text-align: center;
  backdrop-filter: blur(10px);
  color: var(--dark);
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
}

.footer-logo {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--dark);
}

.footer-logo span {
  color: var(--secondary);
}

.footer-links {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  justify-content: center;
}

.footer-links a {
  color: var(--gray);
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer-links a:hover {
  color: var(--secondary);
}

.footer-copyright {
  text-align: center;
  font-size: 13px;
  color: #aaa;
  margin-top: 10px;
}

.footer-copyright p {
  margin: 2px 0;
  line-height: 1.2;
}

.copyright {
  color: var(--gray);
  font-size: 0.9rem;
  margin-top: 1rem;
}

.loading-more {
  text-align: center;
  padding: 1rem;
  color: var(--gray);
  font-size: 0.9rem;
}

.loading-spinner {
  display: inline-block;
  width: 30px;
  height: 30px;
  border: 3px solid #f3f3f3;
  border-top: 3px solid #0984e3;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 1rem auto;
}

.btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.2);
}

.btn-topup {
  background: linear-gradient(to bottom, #10b981, #059669);
  color: white;
  border-radius: 30px;
  padding: 8px 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 10px rgba(16, 185, 129, 0.3);
}

.btn-topup:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(16, 185, 129, 0.4);
  background: linear-gradient(to bottom, #059669, #047857);
}

.btn-logout {
  background: linear-gradient(to bottom, #e74c3c, #c0392b);
  color: white;
  border-radius: 30px;
  padding: 8px 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 10px rgba(231, 76, 60, 0.3);
}

/* ============================================
   BOTTOM SHEET — hanya aktif di mobile ≤768px
   Di desktop: tersembunyi sepenuhnya, dropdown
   biasa yang dipakai (ada di dalam .game-box)
   ============================================ */

/* Desktop (>768px): sembunyikan semua elemen bottom sheet */
#game-bottom-sheet,
#game-bs-overlay {
  display: none !important;
}

/* Mobile (≤768px): aktifkan bottom sheet */
@media (max-width: 768px) {

  /* Overlay */
  #game-bs-overlay {
    display: block !important;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    z-index: 50000;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease;
  }

  #game-bs-overlay.bs-overlay-visible {
    opacity: 1;
    pointer-events: all;
  }

  /* Sheet panel */
  #game-bottom-sheet {
    display: flex !important;
    flex-direction: column;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    max-height: 80vh;
    min-height: 120px;
    z-index: 50001;
    background: #ffffff;
    border-radius: 24px 24px 0 0;
    box-shadow: 0 -8px 40px rgba(0,0,0,0.18), 0 -1px 0 rgba(0,0,0,0.04);
    /* Tersembunyi di bawah layar */
    transform: translateY(110%);
    visibility: hidden;
    transition: transform 0.4s cubic-bezier(0.32, 0.72, 0, 1),
                visibility 0s linear 0.4s;
    overflow: visible;
  }

  #game-bottom-sheet.bs-open {
    transform: translateY(0);
    visibility: visible;
    transition: transform 0.4s cubic-bezier(0.32, 0.72, 0, 1),
                visibility 0s linear 0s;
  }

  /* Drag handle */
  .bs-handle-wrap {
    flex-shrink: 0;
    padding: 12px 0 8px;
    display: flex;
    justify-content: center;
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
  }

  .bs-handle-wrap:active { cursor: grabbing; }

  .bs-handle {
    width: 40px;
    height: 4px;
    background: #cbd5e1;
    border-radius: 99px;
  }

  /* Header sheet */
  .bs-header {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px 12px;
    border-bottom: 1.5px solid #f1f5f9;
  }

  .bs-title {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    color: #0f172a;
    letter-spacing: -0.01em;
  }

  .bs-close-btn {
    width: 30px;
    height: 30px;
    border: none;
    background: #f1f5f9;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #64748b;
    font-size: 0.78rem;
    flex-shrink: 0;
    transition: background 0.15s, color 0.15s, transform 0.2s;
  }

  .bs-close-btn:hover {
    background: #e2e8f0;
    color: #0f172a;
    transform: rotate(90deg);
  }

  /* Scrollable list — hanya area ini yang scroll */
  #game-dropdown {
    list-style: none;
    margin: 0;
    padding: 6px 0 0;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    flex: 1 1 auto;
    min-height: 0; /* wajib ada agar flex child bisa shrink */
    padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  }

  /* Item di dalam bottom sheet */
  #game-dropdown .dropdown-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 13px 20px;
    cursor: pointer;
    font-family: 'Poppins', sans-serif;
    font-size: 0.95rem;
    font-weight: 500;
    color: #1e293b;
    border-bottom: 1px solid #f8fafc;
    transition: background 0.12s ease;
    position: relative;
    touch-action: pan-y;
  }

  #game-dropdown .dropdown-item:last-child { border-bottom: none; }
  #game-dropdown .dropdown-item:hover  { background: #f0f7ff; }
  #game-dropdown .dropdown-item:active { background: #dbeafe; }

  /* Item aktif */
  #game-dropdown .dropdown-item.bs-selected {
    background: #eff6ff;
    color: #2563eb;
    font-weight: 600;
  }

  #game-dropdown .dropdown-item.bs-selected::after {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    right: 20px;
    color: #2563eb;
    font-size: 0.8rem;
  }

  /* Icon game di dalam sheet */
  #game-dropdown .game-icon {
    width: 46px;
    height: 46px;
    object-fit: contain;
    border-radius: 10px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 3px;
    flex-shrink: 0;
  }

  /* Chevron trigger rotate saat sheet terbuka */
  #game-select-trigger .bs-chevron {
    transform: rotate(0deg);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }

  #game-select-trigger.bs-trigger-active .bs-chevron {
    transform: rotate(180deg);
  }

  /* Kunci scroll body saat sheet terbuka */
  body.bs-lock {
    overflow: hidden;
    position: fixed;
    width: 100%;
  }
}

/* ============================================
   MEDIA QUERIES — layout umum
   ============================================ */
@media (max-width: 768px) {
  header {
    flex-direction: column;
    gap: 0.3rem;
    padding: 1rem;
  }

  .nav-links {
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
  }
}

@media (max-width: 600px) {
  header {
    flex-direction: column;
    gap: 0.1rem;
    padding: 0.6rem 1rem;
  }

  header img {
    height: 38px !important;
  }

  .logo {
    font-size: 1.1rem;
  }

  .logo img {
    height: 50px !important;
  }

  .nav-links {
    flex-wrap: wrap;
    gap: 0.6rem;
    font-size: 0.85rem;
    justify-content: center;
  }

  .user-email {
    padding: 0.3rem 0.8rem;
    font-size: 0.8rem;
  }

  .controls {
    flex-direction: column;
    align-items: stretch;
  }

  .game-box,
  .search-box {
    max-width: 100% !important;
    width: 100% !important;
  }

  .social-section {
    margin: 1.5rem 0 0.8rem 0;
    text-align: center;
  }

  .social-title {
    font-size: 1rem;
    margin-bottom: 1rem;
  }

  .social-icons a {
    width: 40px;
    height: 40px;
    font-size: 1rem;
  }

  .social-icons {
    gap: 0.6rem;
  }

  .item-container {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.6rem;
    padding: 0.5rem;
  }

  .item {
    max-width: none;
    padding: 0.6rem;
  }

  .item img {
    height: 100px;
    object-fit: contain;
    padding: 0.3rem;
  }

  .item h3 {
    font-size: 0.85rem;
    max-height: 2.2rem;
    -webkit-line-clamp: 2;
    line-clamp: 2;
  }

  .price {
    font-size: 0.85rem;
    padding: 0.25rem 0.5rem;
  }

  .sold-count {
    font-size: 0.7rem;
  }

  .popup-content {
    padding: 16px;
    max-width: 95vw;
    font-size: 13px;
  }

  .method-option {
    padding: 10px;
    font-size: 13px;
  }

  .header-buttons {
    flex-direction: column;
    align-items: center;
    gap: 12px;
  }

  .mobile-action-row {
    display: flex;
    gap: 10px;
    width: 100%;
    justify-content: center;
  }
}

@media (min-width: 601px) {
  .header-buttons {
    flex-direction: row;
  }
}

@media (max-width: 600px) {
  footer {
    padding: 1rem 0.8rem;
    margin-top: 1rem;
  }

  .footer-content {
    gap: 0.3rem;
  }

  .footer-logo {
    font-size: 1.3rem;
    margin-bottom: 0.1rem;
  }

  .footer-links {
    gap: 0.8rem;
    font-size: 0.85rem;
    margin: 0.3rem 0;
  }

  .footer-copyright {
    margin-top: 0.3rem;
  }

  .copyright {
    font-size: 0.8rem;
    margin-top: 0.2rem;
  }
}

/* Turnstile */
#turnstile-container {
  margin: 15px 0;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 65px;
}

#ts-widget {
  transform-origin: center;
}

@media (max-width: 600px) {
  #turnstile-container {
    transform: scale(0.85);
    margin: 10px 0;
  }

  #tosPopup iframe {
    height: 250px !important;
  }
}

#tosPopup > div        { box-sizing: border-box; }
#tosPopup iframe       { display: block; flex-shrink: 0; }
#tosPopup label        { flex-shrink: 0; }
#tosPopup #turnstile-container { flex-shrink: 0; margin: 8px 0; min-height: auto; }
#tosPopup #btnAcceptTos        { flex-shrink: 0; margin-top: 0; }

/* Lang Switcher */
#lang-switcher {
  position: fixed;
  top: 8px;
  right: 10px;
  z-index: 9999;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

#lang-pill         { padding: 3px 6px !important; gap: 1px !important; }
#lang-btn-id,
#lang-btn-en       { font-size: 1.1rem !important; padding: 1px 3px !important; }
#lang-indicator    { width: 26px !important; }
#lang-label        { font-size: 0.55rem !important; }

@media (min-width: 601px) {
  #lang-switcher {
    position: fixed;
    top: 10px;
    right: 14px;
  }
}

/* ============================================
   BOTTOM SHEET — Search Toko Seller (mobile)
   ============================================ */
.bs-store-search-wrap {
  flex-shrink: 0;
  padding: 10px 16px 6px;
  border-bottom: 1px solid #f1f5f9;
}

.bs-store-search-inner {
  position: relative;
  display: flex;
  align-items: center;
}

.bs-store-search-ico {
  position: absolute;
  left: 10px;
  font-size: 0.8rem;
  color: #94a3b8;
  pointer-events: none;
}

.bs-store-search-input {
  width: 100%;
  padding: 8px 32px 8px 30px;
  font-size: 0.875rem;
  font-family: 'Poppins', sans-serif;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  background: #f8fafc;
  color: #1e293b;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.15s;
}

.bs-store-search-input:focus {
  border-color: #2563eb;
  background: #fff;
}

.bs-store-search-clear {
  position: absolute;
  right: 8px;
  background: none;
  border: none;
  cursor: pointer;
  color: #94a3b8;
  font-size: 0.75rem;
  padding: 4px;
  display: flex;
  align-items: center;
}
.bs-store-search-go {
  position: absolute;
  right: 8px;
  background: #2563eb;
  border: none;
  border-radius: 7px;
  cursor: pointer;
  color: #fff;
  font-size: 0.78rem;
  padding: 5px 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.bs-store-search-go:hover {
  background: #1d4ed8;
}

/* ============================================
   PC: Cari Toko Seller — sebelah kiri controls
   ============================================ */
.store-search-box {
  flex: 1;
  min-width: 180px;
  max-width: 220px;
  display: none; /* hidden di mobile, tampil di PC */
}

.store-search-inner {
  position: relative;
  display: flex;
  align-items: center;
}

.store-search-ico {
  position: absolute;
  left: 12px;
  font-size: 0.85rem;
  color: #64748b;
  pointer-events: none;
  z-index: 1;
}

.store-search-input {
  width: 100%;
  padding: 0.8rem 2.5rem 0.8rem 2.2rem;
  border: 2px solid #0984e3;
  border-radius: 12px;
  font-size: 0.95rem;
  font-family: 'Poppins', sans-serif;
  background: white;
  color: var(--dark);
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.store-search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(9, 132, 227, 0.1);
}

.store-search-input::placeholder {
  color: #94a3b8;
}

.store-search-clear {
  position: absolute;
  right: 40px;
  background: none;
  border: none;
  cursor: pointer;
  color: #94a3b8;
  font-size: 0.75rem;
  padding: 4px;
  display: flex;
  align-items: center;
  transition: color 0.15s;
}

.store-search-clear:hover {
  color: #64748b;
}

.store-search-go {
  position: absolute;
  right: 8px;
  background: #0984e3;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  color: #fff;
  font-size: 0.78rem;
  padding: 5px 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
  height: 28px;
}

.store-search-go:hover {
  background: #067bc2;
}

/* Tampilkan hanya di PC (>768px) */
@media (min-width: 769px) {
  .store-search-box {
    display: block;
  }
  /* Pastikan search item juga terlihat di PC */
  .search-box {
    display: block !important;
  }
}

/* Mobile: sembunyikan PC store search (sudah ada di bottom sheet) */
@media (max-width: 768px) {
  .store-search-box {
    display: none !important;
  }
}
