/*
Theme Name: Spesifikasi
Theme URI: https://spesifikasi.virenial.com
Author: Virenial
Author URI: https://virenial.com
Description: Theme modern untuk situs spesifikasi dan review smartphone Indonesia. Mirip GSMArena dengan tampilan yang bersih, cepat, dan SEO-friendly.
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: spesifikasi
Tags: technology, mobile, responsive, custom-menu, featured-images, translation-ready
*/

/* ===========================
   CSS VARIABLES
=========================== */
:root {
  --primary: #0057FF;
  --primary-dark: #0040CC;
  --primary-light: #E8F0FF;
  --accent: #FF5722;
  --accent-light: #FFF3EF;
  --dark: #0D1117;
  --dark-2: #161B22;
  --dark-3: #21262D;
  --gray-1: #2D3748;
  --gray-2: #4A5568;
  --gray-3: #718096;
  --gray-4: #A0ADB8;
  --gray-5: #CBD5E0;
  --gray-6: #E2E8F0;
  --gray-7: #F7F9FC;
  --white: #FFFFFF;
  --success: #22C55E;
  --warning: #F59E0B;
  --danger: #EF4444;
  --border: #E2E8F0;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow: 0 4px 16px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --font-heading: 'Plus Jakarta Sans', 'Segoe UI', sans-serif;
  --font-body: 'Inter', 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --transition: all 0.2s ease;
  --max-width: 1280px;
}

/* ===========================
   RESET & BASE
=========================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: var(--font-body);
  color: var(--gray-1);
  background: var(--gray-7);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--primary-dark); }

img { max-width: 100%; height: auto; display: block; }

ul { list-style: none; }

/* ===========================
   TYPOGRAPHY
=========================== */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.3;
  color: var(--dark);
}

h1 { font-size: clamp(1.75rem, 3vw, 2.5rem); }
h2 { font-size: clamp(1.4rem, 2.5vw, 2rem); }
h3 { font-size: clamp(1.1rem, 2vw, 1.4rem); }
h4 { font-size: 1.1rem; }

p { margin-bottom: 1rem; color: var(--gray-2); }

/* ===========================
   LAYOUT
=========================== */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

.site-wrapper {
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 100vh;
}

.content-area {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 28px;
  max-width: var(--max-width);
  margin: 28px auto;
  padding: 0 20px;
}

@media (max-width: 1024px) {
  .content-area { grid-template-columns: 1fr; }
  .sidebar { display: none; }
}

/* ===========================
   HEADER
=========================== */
.site-header {
  background: var(--dark);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 20px rgba(0,0,0,0.3);
  /* Perlu untuk nav absolute di mobile */
  isolation: isolate;
}

.header-top {
  background: var(--dark-2);
  padding: 6px 0;
  border-bottom: 1px solid var(--dark-3);
}

.header-top .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.header-tagline {
  font-size: 0.72rem;
  color: var(--gray-4);
  letter-spacing: 0.03em;
}

.header-quick-links {
  display: flex;
  gap: 16px;
}

.header-quick-links a {
  font-size: 0.72rem;
  color: var(--gray-4);
  transition: var(--transition);
}

.header-quick-links a:hover { color: var(--white); }

.header-main {
  padding: 14px 0;
}

.header-main .container {
  display: flex;
  align-items: center;
  gap: 24px;
}

.site-logo {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.logo-icon {
  width: 38px;
  height: 38px;
  background: var(--primary);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 900;
  color: white;
  font-family: var(--font-heading);
  letter-spacing: -1px;
}

.logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.logo-text .main { font-size: 1.25rem; font-weight: 800; color: white; font-family: var(--font-heading); }
.logo-text .sub { font-size: 0.65rem; color: var(--gray-4); letter-spacing: 0.1em; text-transform: uppercase; }

/* Search Bar */
.header-search {
  flex: 1;
  max-width: 520px;
  position: relative;
}

.header-search form {
  display: flex;
  align-items: center;
  background: var(--dark-3);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  overflow: hidden;
  transition: var(--transition);
}

.header-search form:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0,87,255,0.2);
}

.header-search input {
  flex: 1;
  padding: 10px 16px;
  background: transparent;
  border: none;
  color: var(--white);
  font-size: 0.875rem;
  font-family: var(--font-body);
  outline: none;
}

.header-search input::placeholder { color: var(--gray-4); }

.header-search button {
  padding: 10px 16px;
  background: var(--primary);
  border: none;
  color: white;
  cursor: pointer;
  font-size: 0.875rem;
  transition: var(--transition);
}

.header-search button:hover { background: var(--primary-dark); }

/* Tombol ikon search (mobile only) — disembunyikan di desktop */
.header-search-toggle {
  display: none;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

.btn-compare {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--accent);
  color: white;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  transition: var(--transition);
  white-space: nowrap;
}

.btn-compare:hover { background: #e64a19; color: white; transform: translateY(-1px); }

/* Navigation */
.main-nav {
  background: var(--dark-2);
  border-top: 1px solid var(--dark-3);
}

.main-nav .container {
  display: flex;
  align-items: center;
  gap: 0;
}

.main-nav ul {
  display: flex;
  align-items: center;
  gap: 0;
}

.main-nav ul li a {
  display: block;
  padding: 12px 18px;
  color: var(--gray-5);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  transition: var(--transition);
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}

.main-nav ul li a:hover,
.main-nav ul li.current-menu-item a {
  color: var(--white);
  border-bottom-color: var(--primary);
}

/* ===========================
   SUB-MENU DESKTOP
   (harus ada di sini agar tidak tampil sebelum JS load)
=========================== */
.menu-item-has-children {
  position: relative;
}

/* Default: sembunyikan sub-menu di semua ukuran layar */
.sub-menu {
  display: none !important;  /* !important agar tidak bisa ditimpa JS inject */
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--dark-2);
  border: 1px solid var(--dark-3);
  border-top: 2px solid var(--primary);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  min-width: 200px;
  /* z-index lebih tinggi dari hero, card, dan semua konten halaman */
  z-index: 99999;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  list-style: none;
  margin: 0;
  padding: 4px 0;
}

/* Tampilkan HANYA di desktop — hover atau .open via JS klik */
@media (min-width: 769px) {
  .menu-item-has-children:hover > .sub-menu,
  .menu-item-has-children.open > .sub-menu {
    display: block !important;
  }
}

/* Mobile: sub-menu tampil sebagai block statis di dalam nav */
@media (max-width: 768px) {
  .menu-item-has-children.open > .sub-menu {
    display: block !important;
    position: static !important;
    background: var(--dark-3);
    border: none;
    border-left: 3px solid var(--primary);
    border-radius: 0;
    box-shadow: none;
    min-width: unset;
    z-index: auto;
    padding: 0;
    margin: 0;
  }
  .menu-item-has-children.open > .sub-menu li a {
    padding-left: 32px !important;
    font-size: 0.85rem !important;
  }
}

.sub-menu li a {
  display: block;
  padding: 10px 20px !important;
  font-size: 0.82rem !important;
  color: var(--gray-4) !important;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  white-space: nowrap;
  transition: var(--transition);
}
.sub-menu li:last-child a {
  border-bottom: none;
}
.sub-menu li a:hover,
.sub-menu li a:focus {
  background: rgba(255,255,255,0.05) !important;
  color: white !important;
  padding-left: 24px !important;
}

.nav-badge {
  display: inline-block;
  background: var(--accent);
  color: white;
  font-size: 0.6rem;
  padding: 1px 5px;
  border-radius: 10px;
  margin-left: 4px;
  vertical-align: middle;
  font-weight: 700;
}

/* Mobile Menu Toggle */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: white;
  font-size: 1.4rem;
  cursor: pointer;
  padding: 6px;
  margin: 0; /* reset — posisi diatur oleh grid mobile */
}

@media (max-width: 768px) {
  .menu-toggle { display: block; }
  /* main-nav mobile: dikontrol oleh display:none/block di fix v3 */
  .main-nav ul { flex-direction: column; align-items: flex-start; }
  .main-nav ul li a { padding: 10px 20px; border-bottom: none; width: 100%; }
  /* header-search diatur di blok MOBILE HEADER di bawah — jangan hide di sini */
}

/* ===========================
   BREADCRUMB
=========================== */
.breadcrumb-wrap {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 10px 0;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--gray-3);
}

.breadcrumb a { color: var(--gray-3); }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb .sep { color: var(--gray-5); }
.breadcrumb .current { color: var(--gray-1); font-weight: 500; }

/* ===========================
   HERO / FEATURED SLIDER
=========================== */
.hero-section {
  background: var(--dark);
  padding: 32px 0;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 20px;
  align-items: start;
}

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

.featured-post {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--dark-2);
  aspect-ratio: 16/9;
  cursor: pointer;
}

.featured-post img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.featured-post:hover img { transform: scale(1.03); }

.featured-post-overlay {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, transparent 100%);
  padding: 32px 24px 24px;
}

.featured-post-cat {
  display: inline-block;
  background: var(--primary);
  color: white;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.featured-post-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: white;
  line-height: 1.3;
  margin-bottom: 8px;
}

.featured-post-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.75rem;
  color: rgba(255,255,255,0.6);
}

/* Sidebar Posts in Hero */
.hero-sidebar-posts {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.hero-sidebar-post {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 12px;
  background: var(--dark-2);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid var(--dark-3);
}

.hero-sidebar-post:hover { border-color: var(--primary); transform: translateX(4px); }

.hero-sidebar-post img {
  width: 90px;
  height: 70px;
  object-fit: cover;
}

.hero-sidebar-post-info {
  padding: 10px 12px 10px 0;
}

.hero-sidebar-post-cat {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}

.hero-sidebar-post-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--gray-5);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ===========================
   SECTION HEADERS
=========================== */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--border);
}

.section-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--dark);
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title::before {
  content: '';
  display: block;
  width: 4px;
  height: 20px;
  background: var(--primary);
  border-radius: 2px;
}

.section-link {
  font-size: 0.8rem;
  color: var(--primary);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 4px;
}

.section-link:hover { color: var(--primary-dark); }

/* ===========================
   PHONE CARDS
=========================== */
.phones-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 16px;
}

.phone-card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  transition: var(--transition);
  cursor: pointer;
  position: relative;
}

.phone-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary);
}

.phone-card-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 1;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-new { background: var(--success); color: white; }
.badge-hot { background: var(--accent); color: white; }
.badge-sale { background: var(--warning); color: white; }

.phone-card-img {
  background: var(--gray-7);
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 180px;
}

.phone-card-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.3s ease;
}

.phone-card:hover .phone-card-img img { transform: scale(1.08); }

.phone-card-body {
  padding: 14px;
  border-top: 1px solid var(--border);
}

.phone-card-brand {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 2px;
}

.phone-card-name {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 8px;
  line-height: 1.3;
}

.phone-card-specs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 10px;
}

.spec-tag {
  background: var(--gray-7);
  color: var(--gray-2);
  font-size: 0.68rem;
  padding: 2px 7px;
  border-radius: 4px;
  font-weight: 500;
}

.phone-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.phone-price {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--dark);
}

.phone-price small {
  font-size: 0.65rem;
  font-weight: 400;
  color: var(--gray-3);
  display: block;
  line-height: 1;
}

.btn-detail {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--primary);
  padding: 5px 10px;
  border: 1px solid var(--primary);
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.btn-detail:hover {
  background: var(--primary);
  color: white;
}

/* ===========================
   PHONE DETAIL PAGE
=========================== */
.phone-detail-wrap {
  background: var(--white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  margin-bottom: 24px;
}

.phone-detail-header {
  background: linear-gradient(135deg, var(--dark) 0%, var(--dark-2) 100%);
  padding: 36px;
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 40px;
  align-items: center;
}

@media (max-width: 768px) {
  .phone-detail-header { grid-template-columns: 1fr; text-align: center; padding: 24px; }
}

.phone-detail-img-wrap {
  background: rgba(255,255,255,0.05);
  border-radius: var(--radius-lg);
  padding: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.phone-detail-img-wrap img {
  max-height: 280px;
  object-fit: contain;
}

.phone-detail-info .brand {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 6px;
}

.phone-detail-info h1 {
  color: white;
  margin-bottom: 6px;
}

.phone-detail-info .release-date {
  font-size: 0.8rem;
  color: var(--gray-4);
  margin-bottom: 20px;
}

.phone-quick-specs {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 24px;
}

.quick-spec {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  text-align: center;
}

.quick-spec .label {
  font-size: 0.65rem;
  color: var(--gray-4);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: block;
  margin-bottom: 2px;
}

.quick-spec .value {
  font-size: 0.9rem;
  font-weight: 700;
  color: white;
}

.phone-price-section {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.price-tag {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--white);
  font-family: var(--font-heading);
}

.price-tag .currency {
  font-size: 1rem;
  font-weight: 600;
  vertical-align: super;
}

.btn-cek-harga {
  padding: 10px 20px;
  background: var(--primary);
  color: white;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  transition: var(--transition);
}

.btn-cek-harga:hover { background: var(--primary-dark); color: white; transform: translateY(-1px); }

.btn-compare-add {
  padding: 10px 20px;
  background: transparent;
  color: white;
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.btn-compare-add:hover {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.6);
}

/* Tabs */
.detail-tabs {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  display: flex;
  overflow-x: auto;
  scrollbar-width: none;
}

.detail-tabs::-webkit-scrollbar { display: none; }

.tab-btn {
  padding: 14px 24px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--gray-3);
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
  font-family: var(--font-body);
}

.tab-btn:hover { color: var(--dark); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }

.tab-content { display: none; }
.tab-content.active { display: block; }

/* Specs Table */
.specs-section { padding: 32px; }

.specs-group {
  margin-bottom: 28px;
}

.specs-group-title {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 8px 16px;
  background: var(--primary-light);
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
}

.specs-table {
  width: 100%;
  border-collapse: collapse;
}

.specs-table tr {
  border-bottom: 1px solid var(--border);
}

.specs-table tr:last-child { border-bottom: none; }

.specs-table td {
  padding: 11px 16px;
  font-size: 0.875rem;
  vertical-align: top;
}

.specs-table td:first-child {
  width: 35%;
  color: var(--gray-3);
  font-weight: 500;
}

.specs-table td:last-child {
  color: var(--dark);
  font-weight: 500;
}

.specs-table tr:nth-child(even) td { background: var(--gray-7); }

/* Rating */
.rating-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
}

.stars { color: var(--warning); font-size: 1rem; }
.rating-score { font-size: 1.1rem; font-weight: 700; color: var(--dark); }
.rating-count { font-size: 0.78rem; color: var(--gray-3); }

/* ===========================
   BRAND FILTER BAR
=========================== */
.brand-filter {
  background: var(--white);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 24px;
  border: 1px solid var(--border);
}

.brand-filter-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--gray-3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 14px;
}

.brand-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.brand-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  background: var(--gray-7);
  border: 1px solid var(--border);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--gray-2);
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}

.brand-btn:hover,
.brand-btn.active {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
}

.brand-btn img {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

/* ===========================
   SIDEBAR
=========================== */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.widget {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}

.widget-title {
  padding: 14px 18px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--dark);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: var(--gray-7);
  border-bottom: 2px solid var(--primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.widget-body { padding: 16px; }

/* Widget Phone List */
.widget-phone-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.widget-phone-item {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 10px;
  align-items: center;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.widget-phone-item:last-child { border-bottom: none; padding-bottom: 0; }

.widget-phone-img {
  background: var(--gray-7);
  border-radius: var(--radius-sm);
  padding: 4px;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.widget-phone-img img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.widget-phone-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--dark);
  margin-bottom: 2px;
  line-height: 1.3;
}

.widget-phone-price {
  font-size: 0.78rem;
  color: var(--primary);
  font-weight: 600;
}

/* Widget Ad */
.widget-ad {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  border-radius: var(--radius);
  padding: 24px 20px;
  text-align: center;
  color: white;
}

.widget-ad h4 { color: white; margin-bottom: 8px; font-size: 1rem; }
.widget-ad p { color: rgba(255,255,255,0.8); font-size: 0.82rem; margin-bottom: 16px; }

.btn-white {
  display: inline-block;
  background: white;
  color: var(--primary);
  padding: 8px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 700;
  transition: var(--transition);
}

.btn-white:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.2); }

/* ===========================
   COMPARE TOOL
=========================== */
.compare-wrap {
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  overflow: hidden;
  margin-bottom: 24px;
}

.compare-header {
  background: var(--dark);
  padding: 24px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.compare-header h2 { color: white; font-size: 1.2rem; }
.compare-header p { color: var(--gray-4); font-size: 0.82rem; }

.compare-phones {
  display: grid;
  grid-template-columns: 200px repeat(auto-fill, 1fr);
  overflow-x: auto;
}

.compare-phone-header {
  padding: 24px;
  text-align: center;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.compare-phone-header img {
  height: 140px;
  object-fit: contain;
  margin: 0 auto 12px;
}

.compare-phone-header h4 { font-size: 0.9rem; }
.compare-phone-header .price { font-size: 0.82rem; color: var(--primary); font-weight: 600; }

.compare-row {
  display: contents;
}

.compare-row-label {
  padding: 12px 20px;
  background: var(--gray-7);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--gray-3);
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
}

.compare-row-value {
  padding: 12px 20px;
  font-size: 0.85rem;
  color: var(--dark);
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-weight: 500;
}

.compare-winner { background: var(--primary-light); color: var(--primary); font-weight: 700; }

/* ===========================
   NEWS / ARTICLES
=========================== */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.news-card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  transition: var(--transition);
  cursor: pointer;
}

.news-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.news-card-img {
  height: 180px;
  overflow: hidden;
}

.news-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.news-card:hover .news-card-img img { transform: scale(1.05); }

.news-card-body { padding: 16px; }

.news-card-cat {
  display: inline-block;
  font-size: 0.67rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.cat-review { background: var(--primary-light); color: var(--primary); }
.cat-berita { background: var(--accent-light); color: var(--accent); }
.cat-tips { background: #F0FFF4; color: var(--success); }

.news-card-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--dark);
  line-height: 1.4;
  margin-bottom: 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-card-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.72rem;
  color: var(--gray-3);
}

.news-card-meta .author { font-weight: 500; color: var(--gray-2); }

/* ===========================
   FILTER / FINDER TOOL
=========================== */
.finder-tool {
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  overflow: hidden;
  margin-bottom: 28px;
}

.finder-header {
  background: linear-gradient(135deg, var(--dark) 0%, var(--dark-2) 100%);
  padding: 24px 28px;
}

.finder-header h2 { color: white; font-size: 1.15rem; margin-bottom: 4px; }
.finder-header p { color: var(--gray-4); font-size: 0.82rem; margin: 0; }

.finder-body {
  padding: 24px 28px;
}

.filter-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.filter-group label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--gray-3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

.filter-group select,
.filter-group input {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  color: var(--dark);
  background: var(--white);
  font-family: var(--font-body);
  transition: var(--transition);
  outline: none;
}

.filter-group select:focus,
.filter-group input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0,87,255,0.1);
}

.btn-find {
  padding: 11px 28px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font-body);
}

.btn-find:hover { background: var(--primary-dark); transform: translateY(-1px); }

.btn-reset {
  padding: 11px 20px;
  background: var(--gray-7);
  color: var(--gray-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font-body);
}

.btn-reset:hover { background: var(--border); }

/* ===========================
   PAGINATION
=========================== */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 32px 0;
}

.page-num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--gray-2);
  background: var(--white);
  border: 1px solid var(--border);
  transition: var(--transition);
  cursor: pointer;
}

.page-num:hover,
.page-num.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.page-num.dots {
  background: none;
  border: none;
  cursor: default;
  color: var(--gray-3);
}

/* ===========================
   FOOTER
=========================== */
.site-footer {
  background: var(--dark);
  padding: 48px 0 0;
  margin-top: 48px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--dark-3);
}

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

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

.footer-about .footer-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.footer-about p {
  font-size: 0.82rem;
  color: var(--gray-4);
  line-height: 1.7;
  margin-bottom: 20px;
}

.social-links {
  display: flex;
  gap: 10px;
}

.social-link {
  width: 34px;
  height: 34px;
  background: var(--dark-3);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-4);
  font-size: 0.9rem;
  transition: var(--transition);
  text-decoration: none;
}

.social-link:hover { background: var(--primary); color: white; }

.footer-col h5 {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--white);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 16px;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-links a {
  font-size: 0.82rem;
  color: var(--gray-4);
  transition: var(--transition);
}

.footer-links a:hover { color: var(--white); padding-left: 4px; }

.footer-bottom {
  padding: 20px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.footer-copyright {
  font-size: 0.78rem;
  color: var(--gray-4);
}

.footer-bottom-links {
  display: flex;
  gap: 20px;
}

.footer-bottom-links a {
  font-size: 0.78rem;
  color: var(--gray-4);
  transition: var(--transition);
}

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

/* ===========================
   UTILITIES
=========================== */
.text-center { text-align: center; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }

.card-box {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 24px;
  margin-bottom: 24px;
}

.badge-new-phone {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--success);
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 20px;
}

/* Search Results */
.search-results-count {
  font-size: 0.85rem;
  color: var(--gray-3);
  margin-bottom: 20px;
  padding: 12px 16px;
  background: var(--white);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.search-results-count strong { color: var(--dark); }

/* No Results */
.no-results {
  text-align: center;
  padding: 60px 20px;
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}

.no-results h3 { margin-bottom: 8px; }
.no-results p { color: var(--gray-3); }

/* Scroll to Top */
.scroll-top {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 44px;
  height: 44px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(20px);
  transition: var(--transition);
  z-index: 999;
}

.scroll-top.visible {
  opacity: 1;
  transform: translateY(0);
}

.scroll-top:hover { background: var(--primary-dark); transform: translateY(-2px); }

/* Loading Skeleton */
.skeleton {
  background: linear-gradient(90deg, var(--gray-6) 25%, var(--gray-7) 50%, var(--gray-6) 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
  border-radius: var(--radius-sm);
}

@keyframes skeleton-loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ================================================
   SPESIFIKASI THEME v2.0 — IMPROVEMENTS
   Performance, Accessibility, Mobile, SEO, UX
   ================================================ */

/* ---- ACCESSIBILITY: Skip Link ---- */
.skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.skip-link:focus {
  position: fixed;
  left: 16px;
  top: 16px;
  width: auto;
  height: auto;
  padding: 12px 20px;
  background: var(--primary);
  color: white;
  font-weight: 700;
  border-radius: 8px;
  z-index: 99999;
  text-decoration: none;
  font-size: 0.9rem;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

/* ---- ACCESSIBILITY: Screen Reader Only ---- */
.screen-reader-text {
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
  word-wrap: normal !important;
}
.screen-reader-text:focus {
  background-color: var(--primary);
  clip: auto !important;
  clip-path: none;
  color: white;
  display: block;
  font-size: 0.875rem;
  font-weight: 700;
  height: auto;
  left: 5px;
  line-height: normal;
  padding: 15px 23px 14px;
  text-decoration: none;
  top: 5px;
  width: auto;
  z-index: 100000;
}

/* ---- ACCESSIBILITY: Focus Visible (keyboard users) ---- */
:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Remove default outline only when using mouse */
:focus:not(:focus-visible) {
  outline: none;
}

/* Ensure interactive elements have minimum touch target 44×44px */
.btn-cek-harga,
.btn-compare-add,
.tab-btn,
.brand-btn,
.menu-toggle,
.scroll-top,
.btn-compare,
button,
[role="button"] {
  min-height: 44px;
  min-width: 44px;
}

/* ---- TABS: Mobile Horizontal Scroll ---- */
.detail-tabs {
  display: flex;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none; /* Firefox */
  gap: 0;
  border-bottom: 2px solid var(--border);
  margin-bottom: 24px;
}
.detail-tabs::-webkit-scrollbar { display: none; }

.tab-btn {
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
  min-height: 44px;
}
.tab-btn:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: -3px;
}

/* ---- BRAND FILTER: Mobile Scroll (hanya di layar kecil) ---- */
@media (max-width: 768px) {
  .brand-list {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 4px;
  }
  .brand-list::-webkit-scrollbar { display: none; }
  .brand-btn {
    white-space: nowrap;
    flex-shrink: 0;
  }
}

/* sub-menu mobile: lihat FIX v3 di bagian bawah */

/* ---- ACCESSIBILITY: Social Links min size ---- */
.social-link {
  min-width: 36px;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ---- PERFORMANCE: Image placeholders (prevent layout shift) ---- */
.phone-card-img,
.widget-phone-img,
.news-card-img {
  background-color: var(--gray-7);
}
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ---- SEO / UX: Breadcrumb improvements ---- */
.breadcrumb-wrap {
  background: var(--gray-7);
  border-bottom: 1px solid var(--border);
}
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  padding: 10px 0;
  font-size: 0.8rem;
}
.breadcrumb a {
  color: var(--gray-3);
  text-decoration: none;
}
.breadcrumb a:hover { color: var(--primary); text-decoration: underline; }
.breadcrumb .sep { color: var(--gray-4); }
.breadcrumb .current { color: var(--dark); font-weight: 500; }

/* ---- HELPFUL: Empty state improvements ---- */
.no-results {
  text-align: center;
  padding: 60px 20px;
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}
.no-results .no-results-icon {
  font-size: 3rem;
  color: var(--gray-5);
  margin-bottom: 16px;
  display: block;
}

/* ---- BEST PRACTICES: Print styles ---- */
@media print {
  .site-header,
  .site-footer,
  .sidebar,
  .scroll-top,
  .btn-compare,
  .menu-toggle,
  .detail-tabs,
  .tab-btn { display: none !important; }
  .content-area { grid-template-columns: 1fr; }
  .phone-detail-header { flex-direction: row; }
  a[href]:after { content: " (" attr(href) ")"; font-size: 0.7rem; color: #666; }
}

/* ---- Loading state for images ---- */
img.lazy {
  opacity: 0;
  transition: opacity 0.3s ease;
}
img.lazy.loaded,
img:not(.lazy) {
  opacity: 1;
}

/* ---- Badge nav (HOT) ---- */
.nav-badge {
  display: inline-block;
  background: #ef4444;
  color: white;
  font-size: 0.6rem;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 4px;
  vertical-align: middle;
  margin-left: 3px;
  letter-spacing: 0.05em;
}

/* ---- Highlight search terms ---- */
.search-highlight {
  background: #fef9c3;
  border-radius: 2px;
  padding: 0 2px;
  font-weight: 600;
}

/* ---- Smooth tab transitions ---- */
.tab-content {
  animation: fadeIn 0.2s ease;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* overflow-x & box-sizing: lihat FIX v3 di bagian bawah */

/* ============================================================
   MOBILE FRIENDLY — COMPREHENSIVE FIXES
   ============================================================ */

/* --- Content area: sidebar di desktop, full width di tablet/mobile --- */
@media (max-width: 1024px) {
  .content-area {
    grid-template-columns: 1fr;
    padding: 0 16px;
    margin: 16px auto;
    gap: 20px;
  }
  .sidebar { display: none; }
}

/* --- Homepage hero grid --- */
@media (max-width: 900px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }
  .hero-sidebar-posts { display: none; }
}

/* --- Header mobile: lihat FIX v3 di bagian bawah --- */

/* --- Brand filter, phone grid, detail, specs, footer: lihat FIX v3 di bagian bawah --- */

/* --- Pagination mobile --- */
@media (max-width: 480px) {
  .pagination { gap: 4px; }
  .pagination a,
  .pagination span {
    padding: 8px 12px;
    font-size: 0.8rem;
    min-height: 40px;
  }
}

/* ============================================================
   FIX MOBILE TERPOTONG — COMPREHENSIVE OVERFLOW FIX v3
   ============================================================ */

/*
 * PRINSIP:
 * - overflow-x: hidden di body TIDAK CUKUP — hanya sembunyikan scrollbar
 *   tapi elemen tetap meluber & konten terpotong
 * - Solusi benar: clip overflow di html, pastikan SETIAP elemen
 *   flex/grid punya min-width: 0, dan tidak ada elemen yg force lebar > 100vw
 */

/* --- A. ROOT CLIP (bukan sekedar hidden) --- */
html {
  overflow-x: clip; /* lebih kuat dari hidden, tidak create stacking context */
  max-width: 100vw;
}
body {
  overflow-x: clip;
  max-width: 100vw;
  width: 100%;
}

/* --- B. BOX SIZING UNIVERSAL (pastikan padding tidak tambah lebar) --- */
*, *::before, *::after {
  box-sizing: border-box;
}

/* --- C. MEDIA TIDAK BOLEH MELEBIHI CONTAINER --- */
img, video, iframe, embed, object, svg {
  max-width: 100%;
  height: auto;
}

/* ============================================================
   MOBILE HEADER — Hamburger Kiri · Logo Tengah · Search Kanan
   ============================================================ */
@media (max-width: 768px) {

  /* Pastikan header tidak melebihi layar */
  .site-header {
    width: 100%;
    max-width: 100vw;
    overflow: visible;
  }

  /* Header top: sembunyikan di mobile */
  .header-top { display: none; }

  /* Wrapper header-main: position relative untuk logo absolute */
  .header-main {
    position: relative;
  }

  /* Container: 3-kolom grid — kiri | tengah | kanan, tinggi 56px tetap */
  .header-main .container {
    display: grid;
    grid-template-columns: 44px 1fr 44px;
    align-items: center;
    gap: 0;
    padding: 0 12px;
    height: 56px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  /* ── 1. HAMBURGER — kolom kiri ── */
  .menu-toggle {
    grid-column: 1;
    justify-self: start;
    width: 44px;
    height: 44px;
    margin: 0;
    display: flex !important;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex: none;
    order: unset;
  }

  /* ── 2. LOGO — kolom tengah, benar-benar di tengah ── */
  .site-logo {
    grid-column: 2;
    justify-self: center;
    position: static;
    left: unset;
    transform: none;
    order: unset;
    flex: none;
    max-width: calc(100vw - 120px); /* tidak bentrok dengan kiri & kanan */
    overflow: hidden;
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
  }

  .logo-text .main {
    font-size: 0.95rem;
    font-weight: 800;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 140px;
  }
  .logo-text .sub { display: none; }

  /* ── 3. SEARCH ICON — kolom kanan ── */
  /* Sembunyikan tombol compare & header-actions */
  .header-actions { display: none !important; }
  .btn-compare { display: none !important; }

  /* .header-search: slot kanan, selalu 44×44, tidak berubah saat open */
  .header-search {
    grid-column: 3;
    justify-self: end;
    position: static !important; /* override gaya lain */
    width: 44px !important;
    height: 44px !important;
    flex: none;
    display: flex !important;
    align-items: center;
    justify-content: center;
    order: unset;
  }

  /* Sembunyikan form bawaan, tampilkan ikon toggle saja */
  .header-search form { display: none; }

  /* Tombol ikon search */
  .header-search-toggle {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: none;
    border: none;
    color: #fff;
    font-size: 1.15rem;
    cursor: pointer;
    border-radius: 50%;
    transition: background 0.18s;
    flex-shrink: 0;
  }
  .header-search-toggle:hover,
  .header-search-toggle:focus {
    background: rgba(255,255,255,0.1);
    outline: none;
  }

  /* Search bar expanded: panel drop di bawah header, tidak ganggu layout */
  .header-search.search-open {
    /* Ukuran slot tetap 44×44, panel search muncul via form fixed */
    width: 44px !important;
    height: 44px !important;
  }
  .header-search.search-open form {
    display: flex !important;
    position: fixed;
    top: 56px;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 9998;
    background: var(--dark-2);
    padding: 10px 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.35);
    box-sizing: border-box;
    animation: searchSlideDown 0.18s ease;
  }
  @keyframes searchSlideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
  }
  .header-search.search-open input[type="search"] {
    width: 100%;
    min-width: 0;
    font-size: 16px; /* cegah iOS zoom */
    min-height: 44px;
  }

  /* Nav menu: full width, tidak overflow */
  .main-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    max-width: 100vw;
    background: var(--dark);
    z-index: 9999;
    box-sizing: border-box;
    border-top: 2px solid var(--primary);
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  }
  .main-nav.active {
    display: block;
    overflow-y: auto;
    overflow-x: hidden;
    max-height: 80vh;
  }
  .main-nav .container {
    padding: 0;
    max-width: 100%;
  }
  .nav-menu {
    flex-direction: column !important;
    align-items: stretch !important;
    width: 100%;
    max-width: 100%;
  }
  .nav-menu li {
    border-bottom: 1px solid var(--dark-3);
    width: 100%;
  }
  .nav-menu li a {
    padding: 14px 20px !important;
    font-size: 0.95rem !important;
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    border-bottom: none !important;
    width: 100%;
    box-sizing: border-box;
  }

  /* Sub-menu mobile: sudah dihandle di bagian sub-menu CSS di atas */
}

/* ============================================================
   FIX 2: CONTAINER & LAYOUT — tidak boleh melebihi viewport
   ============================================================ */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin-left: auto;
  margin-right: auto;
  box-sizing: border-box;
}

@media (max-width: 480px) {
  .container {
    padding-left: 12px;
    padding-right: 12px;
  }
}

/* Grid item: min-width: 0 agar flex/grid item bisa mengecil */
.main-content,
.sidebar,
.phone-card,
.news-card,
.widget-card,
.hero-grid > *,
.phones-grid > *,
.news-grid > *,
.content-area > * {
  min-width: 0;
}

/* ============================================================
   FIX 3: HERO SECTION — gambar tidak push layout
   ============================================================ */
.hero-section {
  width: 100%;
  max-width: 100vw;
  overflow: hidden;
}

@media (max-width: 900px) {
  .hero-grid {
    grid-template-columns: 1fr;
    width: 100%;
  }
  .hero-sidebar-posts { display: none; }
}

.featured-post {
  width: 100%;
  max-width: 100%;
}
.featured-post img {
  width: 100%;
  max-width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ============================================================
   FIX 4: PHONE GRID & CARDS
   ============================================================ */
.phones-grid {
  width: 100%;
  box-sizing: border-box;
}

/* Tablet: 3 kolom */
@media (max-width: 900px) {
  .phones-grid {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 12px;
  }
}

/* Mobile: 2 kolom */
@media (max-width: 600px) {
  .phones-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px;
  }
  .phone-card-name { font-size: 0.78rem; }
  .phone-card-img  { height: 120px; }
  .phone-card-body { padding: 10px; }
  .spec-tag        { font-size: 0.65rem; padding: 2px 5px; }
}

/* Pastikan card tidak overflow */
.phone-card {
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

/* ============================================================
   FIX 5: SPECS TABLE — scroll internal, tidak push halaman
   ============================================================ */
.specs-section {
  width: 100%;
  overflow: hidden;
}

@media (max-width: 768px) {
  /* Bungkus tabel dalam scroll container */
  .specs-group {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
  }
  .specs-table {
    width: 100%;
    min-width: 0;
    table-layout: auto;
  }
  .specs-table td {
    white-space: normal;
    word-break: break-word;
    overflow-wrap: break-word;
    max-width: 0; /* trick: paksa kolom tidak expand */
  }
  .specs-table td:first-child {
    width: 38%;
    min-width: 90px;
  }
  .specs-table td:last-child {
    width: 62%;
  }
}

/* ============================================================
   FIX 6: COMPARE TABLE — scroll horizontal, jangan push halaman
   ============================================================ */
@media (max-width: 768px) {
  /* Wrapper luar: clip overflow */
  .compare-wrap {
    overflow: hidden;
    width: 100%;
  }
  /* Inner: bisa scroll */
  .compare-phones,
  #compare-phones-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
  }
  /* Konten compare: boleh lebih lebar dari layar, tapi parent yg scroll */
  .compare-phones > *,
  #compare-phones-container > * {
    min-width: 140px;
  }

  /* Compare table di page-bandingkan */
  #compare-result-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
  }
  #compare-table {
    min-width: 480px;
    width: 100%;
  }
  #compare-table th,
  #compare-table td {
    min-width: 110px;
    font-size: 0.78rem;
    padding: 8px 10px;
    word-break: break-word;
  }
}

/* ============================================================
   FIX 7: BRAND FILTER — scroll horizontal tanpa push halaman
   ============================================================ */
@media (max-width: 768px) {
  .brand-filter {
    width: 100%;
    overflow: hidden;
    padding: 14px;
    box-sizing: border-box;
  }
  .brand-list {
    display: flex;
    flex-wrap: nowrap !important;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 4px;
    /* Pastikan tidak meluber ke luar container */
    max-width: 100%;
    width: 100%;
  }
  .brand-list::-webkit-scrollbar { display: none; }
  .brand-btn {
    white-space: nowrap;
    flex-shrink: 0;
    min-height: 36px;
    min-width: unset; /* override min-width: 44px dari touch target rule */
  }
}

/* ============================================================
   FIX 8: DETAIL TABS — scroll horizontal
   ============================================================ */
@media (max-width: 768px) {
  .detail-tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap !important;
    scrollbar-width: none;
    width: 100%;
    max-width: 100%;
  }
  .detail-tabs::-webkit-scrollbar { display: none; }
  .tab-btn {
    white-space: nowrap;
    flex-shrink: 0;
    min-width: unset;
    font-size: 0.78rem;
    padding: 10px 14px;
    min-height: 44px;
  }
}

/* ============================================================
   FIX 9: PHONE DETAIL PAGE
   ============================================================ */
@media (max-width: 768px) {
  .phone-detail-wrap {
    border-radius: 0;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
  }
  .phone-detail-header {
    grid-template-columns: 1fr !important;
    text-align: center;
    padding: 16px;
    gap: 16px;
    width: 100%;
  }
  .phone-detail-img-wrap {
    width: 100%;
    max-width: 200px;
    margin: 0 auto;
  }
  .phone-detail-img-wrap img {
    max-width: 100%;
    height: auto;
  }
  .phone-quick-specs {
    grid-template-columns: repeat(2, 1fr);
    width: 100%;
  }
  .phone-price-section {
    flex-wrap: wrap;
    gap: 10px;
    width: 100%;
  }
  .btn-cek-harga,
  .btn-compare-add {
    width: 100%;
    justify-content: center;
    text-align: center;
    min-height: 44px;
    box-sizing: border-box;
  }
}

/* ============================================================
   FIX 10: SEARCH SUGGESTIONS — tidak meluber dari header
   ============================================================ */
.search-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  max-width: 100%;
  box-sizing: border-box;
  z-index: 2000;
}

/* ============================================================
   FIX 11: FOOTER
   ============================================================ */
@media (max-width: 768px) {
  .site-footer {
    width: 100%;
    max-width: 100vw;
    overflow: hidden;
  }
  .footer-grid {
    grid-template-columns: 1fr !important;
    gap: 24px;
    width: 100%;
  }
  .footer-bottom .container {
    flex-direction: column;
    gap: 8px;
    text-align: center;
  }
}
@media (max-width: 900px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 600px) {
  .footer-grid {
    grid-template-columns: 1fr !important;
  }
}

/* ============================================================
   FIX 12: FINDER & FORMS
   ============================================================ */
@media (max-width: 600px) {
  .finder-tool {
    padding: 16px;
    width: 100%;
    box-sizing: border-box;
  }
  .filter-row {
    grid-template-columns: 1fr !important;
    width: 100%;
  }
  .filter-group,
  .filter-group select,
  .filter-group input {
    width: 100%;
    max-width: 100%;
    font-size: 16px;
    box-sizing: border-box;
  }
}

/* ============================================================
   FIX 13: NEWS GRID
   ============================================================ */
@media (max-width: 600px) {
  .news-grid {
    grid-template-columns: 1fr !important;
    width: 100%;
  }
}

/* ============================================================
   FIX 14: BREADCRUMB — wrap teks panjang
   ============================================================ */
@media (max-width: 768px) {
  .breadcrumb {
    flex-wrap: wrap;
    max-width: 100%;
  }
  .breadcrumb .current {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 200px;
  }
}

/* ============================================================
   FIX 15: TOUCH TARGETS — min 44px tapi tidak paksakan min-width
   ============================================================ */
@media (max-width: 768px) {
  .btn-cek-harga,
  .btn-compare-add,
  .menu-toggle,
  .scroll-top,
  button[type="submit"] {
    min-height: 44px;
  }
  /* Brand btn & tab btn: min-height saja, biarkan lebar fleksibel */
  .brand-btn,
  .tab-btn {
    min-height: 36px;
    min-width: unset !important;
  }
}

/* ============================================================
   FIX 16: SINGLE-SMARTPHONE — konten terpotong kanan (bug 3)
   ============================================================ */

/* Pastikan wrapper tidak overflow */
.phone-detail-wrap {
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  box-sizing: border-box;
}

@media (max-width: 768px) {
  /* Kurangi padding section agar tidak melebihi layar */
  .specs-section {
    padding: 16px !important;
  }
  .phone-detail-header {
    padding: 16px !important;
  }
  .phone-detail-wrap {
    border-radius: 0;
    margin-left: 0;
    margin-right: 0;
  }

  /* Pastikan info HP tidak overflow */
  .phone-detail-info {
    width: 100%;
    min-width: 0;
    overflow: hidden;
  }
  .phone-detail-info h1 {
    font-size: 1.2rem;
    word-break: break-word;
    overflow-wrap: break-word;
  }

  /* Quick specs grid: 2 kolom, tidak overflow */
  .phone-quick-specs {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px;
    width: 100%;
  }
  .quick-spec-item {
    min-width: 0;
    padding: 10px 8px;
  }
  .quick-spec-value {
    font-size: 0.85rem;
    word-break: break-word;
  }

  /* Tab content: tidak overflow */
  .tab-content {
    overflow: hidden;
    width: 100%;
  }

  /* Specs table: tidak stretch layar */
  .specs-group {
    overflow-x: hidden;
    width: 100%;
  }
  .specs-table {
    width: 100%;
    table-layout: fixed;
  }
  .specs-table td {
    word-break: break-word;
    overflow-wrap: break-word;
    white-space: normal;
  }
  .specs-table td:first-child {
    width: 38%;
    min-width: 0;
  }

  /* Tombol aksi: stack vertikal */
  .phone-price-section {
    flex-direction: column;
    gap: 10px;
    width: 100%;
  }
  .btn-cek-harga,
  .btn-compare-add {
    width: 100%;
    box-sizing: border-box;
    text-align: center;
    justify-content: center;
  }
}

/* ============================================================
   FIX 17: BANDINGKAN — live search terpotong di mobile (bug 4)
   ============================================================ */
@media (max-width: 768px) {
  /* Grid selector: 1 kolom di mobile */
  #compare-selectors {
    grid-template-columns: 1fr !important;
    gap: 12px;
  }

  /* Slot: full width, input tidak terpotong */
  .compare-slot {
    width: 100%;
    box-sizing: border-box;
    padding: 16px !important;
  }

  /* Input search dalam slot: full width */
  .slot-search {
    width: 100% !important;
    font-size: 16px !important; /* cegah iOS auto-zoom */
    padding: 10px 12px !important;
    box-sizing: border-box !important;
    min-height: 44px;
  }

  /* Suggestions dropdown: jangan keluar dari slot */
  .slot-suggestions {
    position: absolute !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    z-index: 9999 !important;
    font-size: 0.85rem;
  }

  /* Parent relative agar dropdown menempel ke input */
  .compare-slot > .slot-empty > div[style*="position:relative"],
  .compare-slot .slot-empty > div {
    position: relative;
    width: 100%;
  }

  /* Tombol compare & clear: full width di mobile */
  #do-compare,
  #clear-compare {
    width: 100%;
    margin: 0 0 8px 0 !important;
    box-sizing: border-box;
    min-height: 44px;
  }

  /* Hasil tabel: scroll horizontal */
  #compare-result {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
  }
  #compare-table {
    min-width: 400px;
    font-size: 0.78rem;
  }
  #compare-table th,
  #compare-table td {
    padding: 8px 10px;
    min-width: 100px;
    word-break: break-word;
  }
}

/* ============================================================
   FIX 18: SIDEBAR HOMEPAGE TAMPIL DI MOBILE (bug 5)
   ============================================================ */

/* Hapus display:none yang terlalu agresif di 1024px */
@media (max-width: 1024px) {
  .content-area {
    grid-template-columns: 1fr !important;
    padding: 0 16px;
    margin: 16px auto;
    gap: 20px;
  }
  /* Override: tampilkan sidebar di tablet & mobile */
  .sidebar {
    display: flex !important;
    flex-direction: column;
    gap: 16px;
    width: 100%;
  }
}

/* Di tablet: sidebar 2 kolom berdampingan */
@media (max-width: 1024px) and (min-width: 601px) {
  .sidebar {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }
  .widget-ad {
    grid-column: 1 / -1;
  }
}

/* Di mobile kecil: sidebar 1 kolom */
@media (max-width: 600px) {
  .sidebar {
    display: flex !important;
    flex-direction: column;
    gap: 16px;
  }
}
