/* =================================================================
 * TECH CARE — mobile.css  (v7 — avatar fix, grid overflow fix)
 * ================================================================= */

*, *::before, *::after { box-sizing: border-box; }
html  { overflow-x: hidden; }
body  { overflow-x: hidden; max-width: 100vw; }
img   { max-width: 100%; height: auto; }

/* Hamburger: fully removed */
.hamburger-btn { display: none !important; }

/* ── FLUID CONTAINER ── */
.container {
  width: min(92%, 1200px);
  padding: 0 clamp(10px, 3vw, 24px);
  margin: 0 auto;
}

/* =================================================================
 * ── FLUID TYPOGRAPHY & SPACING via clamp()
 * ================================================================= */
.section-title    { font-size: clamp(1.2rem, 3.5vw, 2rem) !important; }
.section-subtitle { font-size: clamp(0.78rem, 1.8vw, 0.95rem) !important; }
.home-content h1  { font-size: clamp(1.4rem, 5.5vw, 3rem) !important; line-height: 1.15; }
.home-content p   { font-size: clamp(0.82rem, 2vw, 1rem) !important; }
.logo             { font-size: clamp(1rem, 2.5vw, 1.5rem) !important; }

.btn {
  font-size: clamp(0.72rem, 1.5vw, 0.85rem) !important;
  padding: clamp(10px, 1.5vw, 14px) clamp(18px, 3vw, 32px) !important;
}

.home-section      { padding: clamp(90px, 14vw, 200px) 0; }
.produk-section    { padding: clamp(50px, 8vw, 100px) 0; }
.testimoni-section { padding: clamp(45px, 7vw, 90px) 0; }
.about-section     { padding: clamp(45px, 7vw, 100px) 0; }
.kontak-section    { padding: clamp(45px, 7vw, 100px) 0; }

.navbar    { padding: clamp(0.65rem, 1.4vw, 1.2rem) 0; }
.cart-icon { width: clamp(38px, 4vw, 50px) !important; height: clamp(38px, 4vw, 50px) !important; }
.navbar .btn {
  padding: clamp(7px, 1vw, 10px) clamp(10px, 1.5vw, 18px) !important;
  font-size: clamp(0.72rem, 1.3vw, 0.85rem) !important;
}

/* Product cards */
.produk-card h3         { font-size: clamp(0.72rem, 1.5vw, 1rem) !important; }
.produk-card .deskripsi { font-size: clamp(0.65rem, 1.2vw, 0.82rem) !important; }
.produk-card .harga     { font-size: clamp(0.78rem, 1.6vw, 1rem) !important; }
.produk-card .harga-asli{ font-size: clamp(0.6rem, 1.1vw, 0.82rem) !important; }
.produk-card .badge     { font-size: clamp(0.6rem, 1.1vw, 0.8rem) !important; padding: clamp(3px, 0.4vw, 6px) clamp(6px, 0.8vw, 12px) !important; }
.tambah-keranjang, .btn-disabled {
  font-size: clamp(0.68rem, 1.3vw, 0.85rem) !important;
  padding: clamp(8px, 1.2vw, 14px) clamp(10px, 1.5vw, 16px) !important;
}
.produk-image { height: clamp(130px, 20vw, 260px) !important; }
.card-deck  { width: clamp(70px, 11vw, 140px) !important; height: clamp(82px, 13vw, 165px) !important; }
.deck-card  {
  width:  clamp(60px, 9.5vw, 120px) !important;
  height: clamp(72px, 11.5vw, 145px) !important;
  margin-left: clamp(-30px, -4.75vw, -60px) !important;
  margin-top:  clamp(-36px, -5.75vw, -72px) !important;
}

/* Testimoni */
.testimoni-card   { padding: clamp(0.9rem, 2vw, 1.8rem) !important; }
.testimoni-card p { font-size: clamp(0.72rem, 1.5vw, 0.95rem) !important; }
.testimoni-author img { width: clamp(38px, 4vw, 50px) !important; height: clamp(38px, 4vw, 50px) !important; }
.testimoni-author h4  { font-size: clamp(0.8rem, 1.4vw, 1rem) !important; }
.testimoni-author p   { font-size: clamp(0.72rem, 1.2vw, 0.85rem) !important; }

/* ── USER AVATAR in testimoni card (icon circle) ─────────────
 * Scope fix: the .user-avatar in dashboard has font-size:4rem
 * which bleeds into testimoni. Override it here specifically.  */
.testimoni-author .user-avatar {
  width: 46px !important;
  height: 46px !important;
  min-width: 46px !important;
  border-radius: 50% !important;
  font-size: 1.3rem !important;  /* icon size inside circle */
  margin-left: 0 !important;
  opacity: 1 !important;
  flex-shrink: 0 !important;
}

/* Features */
.feature   { padding: clamp(1rem, 2.5vw, 2rem) clamp(0.8rem, 2vw, 1rem) !important; }
.feature i { font-size: clamp(1.6rem, 3.5vw, 2.5rem) !important; }
.feature h4{ font-size: clamp(0.85rem, 1.8vw, 1.2rem) !important; }
.feature p { font-size: clamp(0.75rem, 1.4vw, 1rem) !important; }

.kontak-form { padding: clamp(1.1rem, 3vw, 2rem) !important; }

footer.footer, footer { padding: clamp(28px, 5vw, 60px) clamp(12px, 4vw, 80px) !important; }
.footer-links h4, .footer-contact h4 { font-size: clamp(0.85rem, 1.6vw, 1rem) !important; }
.footer-links a  { font-size: clamp(0.76rem, 1.4vw, 0.92rem) !important; }
.footer-bottom p { font-size: clamp(0.7rem, 1.2vw, 0.85rem) !important; }

/* Dashboard — scoped to mobile only so desktop sizing is never overridden */
@media (max-width: 768px) {
  .welcome-content h1 { font-size: clamp(1.2rem, 3.5vw, 2rem) !important; }
  .stat-number { font-size: clamp(0.95rem, 2.5vw, 1.5rem) !important; }
  .stat-label  { font-size: clamp(0.65rem, 1.2vw, 0.82rem) !important; }
  .stat-icon   { width: clamp(36px, 4.5vw, 55px) !important; height: clamp(36px, 4.5vw, 55px) !important; font-size: clamp(1rem, 2vw, 1.5rem) !important; }
  .dashboard-card h3 { font-size: clamp(0.9rem, 2vw, 1.1rem) !important; }
  .action-card h4    { font-size: clamp(0.82rem, 1.8vw, 1rem) !important; }
  .action-card p     { font-size: clamp(0.75rem, 1.4vw, 0.88rem) !important; }
  .action-icon { width: clamp(38px, 4.5vw, 55px) !important; height: clamp(38px, 4.5vw, 55px) !important; font-size: clamp(1.05rem, 2vw, 1.5rem) !important; }
}

.checkout-form-section, .checkout-summary-card,
.review-card, .payment-card,
.od-card, .profile-edit-card { padding: clamp(1rem, 3vw, 2rem) !important; }
.form-header h2 { font-size: clamp(1.1rem, 2.5vw, 1.4rem) !important; }
.od-page-title  { font-size: clamp(18px, 3.5vw, 28px) !important; }
.auth-right h3  { font-size: clamp(1.5rem, 4vw, 2.1rem) !important; }
.page-header h1 { font-size: clamp(1.3rem, 3.5vw, 2rem) !important; }
.page-header p  { font-size: clamp(0.8rem, 1.5vw, 1rem) !important; }

/* =================================================================
 * ── LOGO SIDEBAR ────────────────────────────────────────────────
 * ================================================================= */
.nav-drawer-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.45); z-index: 1199;
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s ease;
}
.nav-drawer-overlay.is-open { opacity: 1; pointer-events: auto; }

.logo-sidebar {
  display: none;
  position: fixed; top: 0; left: 0;
  width: 240px; height: 100vh;
  background: #fff; z-index: 1200;
  box-shadow: 4px 0 30px rgba(0,0,0,0.15);
  flex-direction: column;
  transform: translateX(-100%);
  transition: transform 0.32s cubic-bezier(0.4,0,0.2,1);
  overflow-y: auto;
}
.logo-sidebar.is-open { transform: translateX(0); }

.logo-sidebar-header {
  display: flex; align-items: center;
  justify-content: space-between;
  padding: 20px 18px 16px;
  background: linear-gradient(135deg, #3a86ff 0%, #8338ec 100%);
  flex-shrink: 0;
}
.logo-sidebar-brand {
  font-size: 1.05rem; font-weight: 800; color: #fff;
  letter-spacing: 0.5px; display: flex; align-items: center; gap: 7px;
}
.logo-sidebar-close {
  background: rgba(255,255,255,0.18); border: none; color: #fff;
  width: 30px; height: 30px; border-radius: 8px; cursor: pointer;
  font-size: 0.9rem; display: flex; align-items: center; justify-content: center;
  transition: background 0.2s; flex-shrink: 0;
}
.logo-sidebar-close:hover { background: rgba(255,255,255,0.3); }

.logo-sidebar-nav { display: flex; flex-direction: column; padding: 12px 0; flex: 1; }

.logo-sidebar-item {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 20px; text-decoration: none;
  color: #374151; font-size: 0.92rem; font-weight: 600;
  border-bottom: 1px solid #f3f4f6;
  transition: background 0.18s, color 0.18s, padding-left 0.18s;
}
.logo-sidebar-item:last-child { border-bottom: none; }
.logo-sidebar-item:hover { background: #f0f4ff; color: #3a86ff; padding-left: 26px; }
.logo-sidebar-item.active { background: #eff6ff; color: #3a86ff; border-left: 3px solid #3a86ff; }

.logo-sidebar-icon {
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, #3a86ff 0%, #8338ec 100%);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 0.9rem; flex-shrink: 0;
  box-shadow: 0 3px 10px rgba(58,134,255,0.25);
  transition: transform 0.2s;
}
.logo-sidebar-item:hover .logo-sidebar-icon,
.logo-sidebar-item.active .logo-sidebar-icon { transform: scale(1.08); }
.logo-sidebar-label { flex: 1; }
.logo-sidebar-arrow { font-size: 0.72rem; color: #9ca3af; transition: color 0.18s, transform 0.18s; }
.logo-sidebar-item:hover .logo-sidebar-arrow,
.logo-sidebar-item.active .logo-sidebar-arrow { color: #3a86ff; transform: translateX(3px); }

/* =================================================================
 * ── STRUCTURAL BREAKPOINTS
 * ================================================================= */

/* ── TABLET ≤ 1024px ── */
@media (max-width: 1024px) {
  .produk-grid { grid-template-columns: repeat(3, 1fr) !important; gap: clamp(0.6rem, 2vw, 1.25rem); }
  .features-container { grid-template-columns: repeat(2, 1fr); gap: clamp(12px, 2vw, 20px); }
  .checkout-wrapper { grid-template-columns: 1fr !important; }
  .checkout-summary-card { position: relative !important; top: auto !important; }
  .review-wrapper { grid-template-columns: 1fr !important; }
  .payment-card { position: relative !important; top: auto !important; }
  .od-cards-grid { grid-template-columns: repeat(2, 1fr) !important; }
  .testimoni-grid,
  .testimoni-container { grid-template-columns: repeat(2, 1fr) !important; gap: 20px !important; }
}

/* ── MOBILE ≤ 768px ── */
@media (max-width: 768px) {

  .nav-drawer-overlay { display: block; }
  .logo-sidebar { display: flex; }
  .nav-menu { display: none !important; }
  .nav-username { display: none !important; }

  .logo { cursor: pointer; user-select: none; -webkit-tap-highlight-color: transparent; }

  .home-content { max-width: 100%; text-align: center; }
  .home-content .logo { display: none !important; }

  /* Testimoni: 1 col on mobile */
  .testimoni-grid,
  .testimoni-container { grid-template-columns: 1fr !important; gap: 16px !important; }

  /* Testimoni author stays horizontal */
  .testimoni-author { flex-direction: row !important; align-items: center !important; gap: 12px !important; }

  /* Product grid: 2 col */
  .produk-grid { grid-template-columns: repeat(2, 1fr) !important; }
  .produk-card { min-height: unset !important; }

  /* Category pills scroll */
  .category-pills-container {
    flex-wrap: nowrap !important; overflow-x: auto; overflow-y: visible;
    justify-content: flex-start !important; padding: 4px 2px;
    gap: clamp(6px, 1.5vw, 10px); -webkit-overflow-scrolling: touch; scrollbar-width: none;
  }
  .category-pills-container::-webkit-scrollbar { display: none; }
  .category-pill { flex-shrink: 0; white-space: nowrap; }

  .img-pick-swatches {
    flex-wrap: nowrap !important; overflow-x: auto;
    -webkit-overflow-scrolling: touch; scrollbar-width: none;
  }
  .img-pick-swatches::-webkit-scrollbar { display: none; }

  .features-container { grid-template-columns: repeat(2, 1fr); }

  /* Footer: centered single col */
  .footer-container {
    grid-template-columns: 1fr !important; text-align: center;
    gap: clamp(20px, 4vw, 32px); padding: 0 clamp(12px, 3vw, 24px);
  }
  .footer-brand, .footer-links, .footer-contact { text-align: center; }
  .footer-links h4::after, .footer-contact h4::after { left: 50%; transform: translateX(-50%); }
  .footer-links a::before { display: none; }
  .footer-links a:hover { padding-left: 0; }

  /* Cart sidebar */
  .cart-sidebar { width: 100vw !important; right: -100vw !important; }
  .cart-sidebar.active { right: 0 !important; }
  .notification-dropdown { width: min(340px, calc(100vw - 20px)) !important; right: -10px !important; }

  /* Cart page */
  .cart-container { grid-template-columns: 1fr !important; }
  .cart-right { position: static !important; }

  /* Checkout */
  .form-row-2col { grid-template-columns: 1fr !important; }
  .checkout-wrapper { grid-template-columns: 1fr !important; }

  /* Order review */
  .info-row { grid-template-columns: 1fr !important; }
  .progress-tracker { flex-wrap: wrap; gap: 10px; }
  .progress-line { width: clamp(24px, 5vw, 40px); }
  .od-action-buttons { flex-direction: column; align-items: center; }
  .od-btn-outline, .od-btn-primary { width: 100%; max-width: 300px; justify-content: center; }
  .od-cards-grid { grid-template-columns: 1fr !important; }

  .od-products-row { grid-template-columns: 1fr !important; gap: 6px; padding: 12px; background: #f9fafb; border-radius: 8px; margin-bottom: 10px; border: 1px solid #e5e7eb; }
  .od-products-row.header { display: none; }
  .od-col-price::before  { content: 'Harga: ';  color: #6b7280; font-size: 12px; }
  .od-col-qty::before    { content: 'Jumlah: '; color: #6b7280; font-size: 12px; }
  .od-col-total::before  { content: 'Total: ';  color: #6b7280; font-size: 12px; }

  /* Dashboard */
  .welcome-banner { flex-direction: column !important; text-align: center; }
  .welcome-graphic { margin-left: 0 !important; margin-top: 1rem; }
  .welcome-banner::before { display: none !important; }
  .stats-grid { grid-template-columns: repeat(3, 1fr) !important; }
  .dashboard-grid { grid-template-columns: 1fr !important; }
  .info-grid { grid-template-columns: 1fr !important; }
  .action-grid { grid-template-columns: repeat(2, 1fr) !important; }
  .action-buttons { flex-direction: column; }
  .btn-outline-edit, .btn-primary-shop { width: 100%; justify-content: center; }
  .welcome-card { flex-direction: column !important; text-align: center; padding: 2rem !important; }
  .welcome-card .user-avatar { margin-left: 0 !important; margin-top: 1rem; }
  .welcome-card::before { display: none !important; }

  /* Edit profile */
  .form-grid { grid-template-columns: 1fr !important; }
  .form-actions { flex-direction: column; gap: 10px; }
  .form-actions .btn-save, .form-actions .btn-cancel { width: 100%; justify-content: center; }
  .security-link { flex-wrap: wrap; }

  /* Auth — logo stays as link, NO sidebar trigger on auth page */
  .auth-left { display: none !important; }
  .auth-right { padding: clamp(1.6rem, 4vw, 2.5rem) clamp(1.2rem, 4vw, 2rem) !important; }
  .auth-wrap { border-radius: 16px; margin-top: clamp(60px, 9vw, 80px); }
  .form-row { grid-template-columns: 1fr !important; }

  section, .produk-card, .testimoni-card, .feature, .kontak-form,
  .dashboard-card, .stat-card, .order-card { max-width: 100%; overflow: hidden; }
}

/* ── PHONE ≤ 480px ── */
@media (max-width: 480px) {
  .container { width: 100%; padding: 0 11px; }

  .produk-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 0.7rem !important; }
  .produk-card { border-radius: 10px !important; min-height: unset !important; }
  .produk-image { height: clamp(120px, 28vw, 180px) !important; }

  /* iOS zoom prevention */
  .form-group input, .form-group textarea, .form-group select,
  .kontak-form input, .kontak-form textarea, .kontak-form select,
  .input-wrap input { font-size: 16px !important; }

  .category-pill { padding: clamp(5px, 1.2vw, 8px) clamp(9px, 2vw, 14px); }
  .sort-controls label { display: none; }

  /* Testimoni: 1 col on phone, bigger and readable */
  .testimoni-grid,
  .testimoni-container { grid-template-columns: 1fr !important; gap: 14px !important; }
  .testimoni-card { padding: 1.2rem !important; }
  .testimoni-author { flex-direction: row !important; align-items: center !important; gap: 12px !important; }
  .testimoni-author .user-avatar {
    width: 40px !important; height: 40px !important;
    min-width: 40px !important; font-size: 1.1rem !important;
  }
  .testimoni-author img { width: 40px !important; height: 40px !important; }

  /* Features: 2 col */
  .features-container { grid-template-columns: repeat(2, 1fr) !important; }

  /* Cart */
  .item-footer { flex-direction: column !important; align-items: flex-start !important; gap: 12px !important; }
  .qty-elegant-ctrl { width: 100% !important; justify-content: space-between !important; }
  .qty-input { flex: 1 !important; text-align: center !important; }

  .notification-dropdown { width: calc(100vw - 14px) !important; right: -7px !important; }

  /* Dashboard stats: 3 col stays compact */
  .stats-grid { grid-template-columns: repeat(3, 1fr) !important; gap: 8px !important; }
  .stat-card { padding: 1rem 0.7rem !important; }
}

/* ── MINIMUM ≤ 320px ── */
@media (max-width: 320px) {
  .produk-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 0.4rem !important; }
  .features-container { grid-template-columns: repeat(2, 1fr) !important; }
  .testimoni-grid, .testimoni-container { grid-template-columns: 1fr !important; }
  .stats-grid { grid-template-columns: repeat(3, 1fr) !important; }
  .footer-container { padding: 0 6px !important; }
}