*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
    /* FIX 4: Cegah overscroll horizontal di level root */
    overflow-x: hidden;
}

body {
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    /* FIX 4: Cegah overscroll horizontal di level body */
    overflow-x: hidden;
    max-width: 100vw;
}

img,
picture,
video,
canvas,
svg {
    display: block;
    max-width: 100%;
    height: auto;
}

input,
button,
textarea,
select {
    font: inherit;
    border: none;
    outline: none;
    background: none;
}

button {
    cursor: pointer;
}

a {
    text-decoration: none;
    color: inherit;
}

ul,
ol {
    list-style: none;
}

table {
    border-collapse: collapse;
    border-spacing: 0;
}


@font-face {
  font-family: 'Inter';
  src: url('../fonts/inter.ttf') format('truetype');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
    --primary: #16a34a;
    --primary-dark: #15803d;
    --secondary: #facc15;
    --bg-light: #f9fafb;
    --bg-white: #ffffff;
    --text-main: #1f2937;
    --text-muted: #6b7280;
    --border-color: #e5e7eb;
    --font-main: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --header-height: 80px;
    --header-height-mobile: 60px;
    --topbar-height: 42px;
    --topbar-height-mobile: 0px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-main);
    color: var(--text-main);
    background: var(--bg-light);
    line-height: 1.6;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

ul {
    list-style: none;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
    /* FIX 4: Pastikan container tidak overflow */
    box-sizing: border-box;
}

.section-padding {
    padding: 80px 0;
}

.text-center { text-align: center; }
.text-primary { color: var(--primary); }
.bg-white { background: var(--bg-white); }

.section-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.section-subtitle {
    color: var(--text-muted);
    margin-bottom: 40px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.divider {
    width: 80px;
    height: 4px;
    background: var(--primary);
    border-radius: 4px;
    margin: 15px auto 40px auto;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 50px;
    font-weight: bold;
    cursor: pointer;
    border: none;
    transition: 0.3s;
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 6px rgba(22, 163, 74, 0.3);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    color: white;
    border: 2px solid rgba(255,255,255,0.5);
}

.btn-outline:hover {
    background: rgba(255,255,255,0.1);
    transform: translateY(-2px);
}

.grid {
    display: grid;
    gap: 30px;
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.top-bar {
    background: var(--primary-dark);
    color: white;
    padding: 8px 20px;
    font-size: 0.85rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 50;
    position: relative;
    flex-wrap: wrap;
    gap: 10px;
    /* FIX 4: Pastikan top-bar tidak overflow */
    width: 100%;
    max-width: 100vw;
    overflow: hidden;
}

.top-contact {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.top-contact span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.ticker-wrapper {
    overflow: hidden;
    white-space: nowrap;
    flex: 1;
    margin-left: 20px;
    color: var(--secondary);
    font-weight: bold;
}

.ticker-content {
    display: inline-block;
    animation: ticker 25s linear infinite;
}

@keyframes ticker {
    0% { transform: translateX(100%); }
    100% { transform: translateX(-100%); }
}

/* ========== NAVBAR ========== */
.navbar {
    background: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 40;
    transition: all 0.3s ease;
    /* FIX 4: Pastikan navbar tidak overflow */
    width: 100%;
    max-width: 100vw;
    overflow: hidden;
}

.navbar.scrolled {
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: var(--header-height);
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-logo-icon {
    width: 45px;
    height: 45px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    overflow: hidden;
    flex-shrink: 0;
}

.nav-logo-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.nav-logo-text h1 {
    font-size: 1.2rem;
    line-height: 1.2;
    color: var(--text-main);
}

.nav-logo-text span {
    font-size: 0.7rem;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: bold;
}

.nav-menu {
    display: flex;
    gap: 25px;
}

.nav-menu a {
    font-size: 0.9rem;
    font-weight: bold;
    color: var(--text-muted);
    padding-bottom: 5px;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
}

.nav-menu a:hover, .nav-menu a.active {
    color: var(--primary);
    border-bottom: 2px solid var(--primary);
}

.mobile-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-main);
    cursor: pointer;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
}

.mobile-menu {
    display: none;
    flex-direction: column;
    background: white;
    border-top: 1px solid var(--border-color);
    padding: 10px 20px;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1000;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    max-height: calc(100vh - var(--header-height));
    overflow-y: auto;
    /* FIX 4: Pastikan mobile menu tidak overflow horizontal */
    width: 100%;
    overflow-x: hidden;
}

.mobile-menu.active {
    display: flex;
}

.mobile-menu a {
    display: block;
    padding: 12px 0;
    font-weight: bold;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.95rem;
}

.mobile-menu a:last-child {
    border-bottom: none;
}

.mobile-menu a.active {
    color: var(--primary);
}

/* ========== HERO ========== */
.hero {
    min-height: 85vh;
    background-image: linear-gradient(rgba(15, 23, 42, 0.75), rgba(15, 23, 42, 0.75)), url('../images/hero-bg.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    display: flex;
    align-items: center;
    position: relative;
    color: white;
}

.hero-content {
    max-width: 800px;
    position: relative;
    z-index: 10;
    width: 100%;
}

.hero-badge {
    background: rgba(22, 163, 74, 0.9);
    padding: 6px 18px;
    border-radius: 30px;
    font-size: 0.8rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: inline-block;
    margin-bottom: 20px;
}

.hero h1 {
    font-size: 3.5rem;
    line-height: 1.2;
    margin-bottom: 20px;
}

.hero h1 span {
    color: var(--secondary);
}

.hero p {
    font-size: 1.1rem;
    margin-bottom: 30px;
    color: #e2e8f0;
}

.hero-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.wave-divider {
    position: absolute;
    bottom: 0;
    width: 100%;
    line-height: 0;
    left: 0;
}

.wave-divider svg {
    width: 100%;
    height: 70px;
}

/* ========== PROFIL ========== */
.profil-content {
    display: flex;
    gap: 50px;
    align-items: flex-start;
}

.profil-text {
    flex: 1;
    font-size: 1.05rem;
    color: var(--text-muted);
    text-align: justify;
}

.dropcap {
    float: left;
    font-size: 3rem;
    font-weight: bold;
    color: var(--primary);
    line-height: 0.8;
    margin-right: 12px;
}

.batas-wilayah {
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    padding: 20px;
    margin-top: 25px;
    display: flex;
    align-items: center;
    gap: 20px;
}

.batas-icon {
    width: 60px;
    height: 60px;
    background: #dcfce7;
    color: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.visi-misi {
    flex: 1;
}

.visi-box {
    background: var(--primary);
    color: white;
    padding: 30px;
    border-radius: 20px;
    margin-bottom: 30px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 20px rgba(22, 163, 74, 0.2);
}

.visi-box i.bg-icon {
    position: absolute;
    right: -20px;
    bottom: -20px;
    font-size: 8rem;
    opacity: 0.1;
}

.visi-box p {
    position: relative;
    z-index: 2;
    font-size: 1rem;
}

.misi-list li {
    background: white;
    border: 1px solid var(--border-color);
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 15px;
    display: flex;
    gap: 15px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.02);
}

.misi-number {
    width: 30px;
    height: 30px;
    background: #dcfce7;
    color: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    flex-shrink: 0;
}

/* ========== PEMERINTAHAN ========== */
.kades-card {
    max-width: 350px;
    margin: 0 auto 50px auto;
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    text-align: center;
    border: 1px solid var(--border-color);
}

.kades-bg {
    height: 180px;
    background: var(--primary-dark);
    overflow: hidden;
}

.kades-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.4;
}

.kades-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 4px solid white;
    margin: -60px auto 15px auto;
    object-fit: cover;
    position: relative;
    z-index: 2;
    background: white;
}

.kades-card h3 { margin-bottom: 5px; }
.kades-card p.jabatan { color: var(--primary); font-weight: bold; margin-bottom: 15px; }
.kades-card p.quote { font-style: italic; color: var(--text-muted); font-size: 0.9rem; padding: 0 20px 20px;}

/* FIX 1: Perangkat desa section - pastikan tidak overflow dari container */
.perangkat-desa-section {
    width: 100%;
    overflow: hidden;
}

.perangkat-card {
    background: white;
    padding: 20px;
    border-radius: 15px;
    text-align: center;
    border: 1px solid var(--border-color);
    transition: 0.3s;
    /* FIX 1: Pastikan card tidak overflow */
    min-width: 0;
    overflow: hidden;
}

.perangkat-card:hover { transform: translateY(-5px); box-shadow: 0 5px 15px rgba(0,0,0,0.05); }
.perangkat-card img {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    object-fit: cover;
    margin: 5px auto;
    margin-bottom: 10px;
    border: 2px solid #dcfce7;
    /* FIX 1: Pastikan gambar tidak overflow card */
    flex-shrink: 0;
    display: block;
}
.perangkat-card h4 {
    font-size: 1rem;
    margin-bottom: 5px;
    /* FIX 1: Teks panjang tidak overflow card */
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}
.perangkat-card p {
    font-size: 0.8rem;
    color: var(--text-muted);
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.mitra-desa {
    margin-top: 60px;
    padding-top: 40px;
    border-top: 1px solid var(--border-color);
    text-align: center;
}
.mitra-logos {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 30px;
    opacity: 0.7;
}
.mitra-logos div { display: flex; align-items: center; gap: 8px; font-weight: bold; font-size: 0.9rem; }

/* ========== STATISTIK ========== */
.statistik {
    background: var(--primary);
    color: white;
    position: relative;
}
.stat-card {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    padding: 25px;
    border-radius: 15px;
    text-align: center;
    transition: transform 0.3s ease;
}
.stat-card:hover { transform: translateY(-5px); }
.stat-card i { font-size: 2.5rem; color: var(--secondary); margin-bottom: 15px; display: block; }
.stat-card h3 { font-size: 2.5rem; }
.stat-card p { font-size: 0.9rem; opacity: 0.8; }

.chart-container {
    background: white;
    color: var(--text-main);
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}
.chart-title { font-size: 1.2rem; border-bottom: 1px solid var(--border-color); padding-bottom: 10px; margin-bottom: 20px; }

.progress-item { margin-bottom: 15px; }
.progress-label { display: flex; justify-content: space-between; font-size: 0.85rem; font-weight: bold; margin-bottom: 5px;}
.progress-bar-bg { width: 100%; background: #e5e7eb; border-radius: 10px; height: 12px; overflow: hidden;}
.progress-bar-fill { height: 100%; border-radius: 10px; }

.edu-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.edu-box { border: 1px solid var(--border-color); padding: 15px; text-align: center; border-radius: 10px;}
.edu-box h5 { font-size: 1.5rem; margin-bottom: 5px; }
.edu-box p { font-size: 0.75rem; color: var(--text-muted); }

/* ========== LAYANAN ========== */
.service-card {
    background: white;
    padding: 25px;
    border-radius: 15px;
    border: 1px solid var(--border-color);
    transition: 0.3s;
    height: 100%;
    display: flex;
    flex-direction: column;
}
.service-card:hover { transform: translateY(-5px); box-shadow: 0 10px 20px rgba(0,0,0,0.05); }
.service-icon {
    width: 50px; height: 50px;
    background: #dcfce7; color: var(--primary);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem; margin-bottom: 15px;
}
.service-card h3 { font-size: 1.1rem; margin-bottom: 10px; }
.service-card p { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 15px; flex: 1;}
.service-card button { background: none; border: none; color: var(--primary); font-weight: bold; cursor: pointer; text-align: left; padding: 0; }

/* FIX 2: Table wrapper - header harus ikut saat scroll horizontal */
.table-wrapper {
    background: white;
    border-radius: 15px;
    border: 1px solid var(--border-color);
    margin-top: 40px;
    /* FIX 2: overflow pada wrapper agar header juga scroll bersama tabel */
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* FIX 2: table-header harus di DALAM alur scroll, bukan di luar */
.table-header {
    background: #1f2937;
    color: white;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    /* FIX 2: Lebar minimal sama dengan tabel agar header tidak terpotong */
    min-width: 600px;
}

table { width: 100%; border-collapse: collapse; text-align: left; min-width: 600px; }
th, td { padding: 15px 20px; border-bottom: 1px solid var(--border-color); font-size: 0.9rem;}
th { background: var(--bg-light); text-transform: uppercase; font-size: 0.8rem; color: var(--text-muted); font-weight: 600;}
tr:hover { background: #f0fdf4; }
.badge { padding: 4px 8px; border-radius: 5px; font-weight: bold; font-size: 0.7rem; display: inline-block; }
.badge-red { background: #fee2e2; color: #dc2626; }
.badge-blue { background: #dbeafe; color: #2563eb; }
.btn-download { background: var(--primary); color: white; padding: 6px 12px; border-radius: 5px; font-size: 0.8rem; font-weight: bold; border: none; cursor: pointer; transition: 0.2s;}
.btn-download:hover { background: var(--primary-dark); }

/* ========== POTENSI ========== */
.potensi-header { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 40px; flex-wrap: wrap; gap: 20px;}
.product-card {
    background: white; border-radius: 15px; overflow: hidden;
    border: 1px solid var(--border-color); transition: 0.3s;
}
.product-card:hover { transform: translateY(-5px); box-shadow: 0 10px 25px rgba(0,0,0,0.1); }
.product-img { height: 220px; overflow: hidden; position: relative; }
.product-img img { width: 100%; height: 100%; object-fit: cover; transition: 0.5s; }
.product-card:hover .product-img img { transform: scale(1.08); }
.product-badge {
    position: absolute; top: 15px; left: 15px;
    background: var(--secondary); color: #713f12;
    padding: 5px 12px; border-radius: 20px; font-size: 0.7rem; font-weight: bold; z-index: 2;
}
.product-info { padding: 20px; }
.product-info h3 { font-size: 1.1rem; margin-bottom: 8px; }
.product-info p { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 15px; line-height: 1.5;}
.product-action { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }
.product-price { font-weight: bold; color: var(--primary); }

/* ========== TRANSPARANSI ========== */
.transparansi-box {
    background: #111827; border-radius: 20px; overflow: hidden;
    display: flex; position: relative;
}
.trans-left { flex: 0 0 40%; padding: 40px; color: white; position: relative; z-index: 2;}
.trans-right { flex: 0 0 60%; background: white; padding: 40px; position: relative; z-index: 2;}
.trans-tag { background: var(--primary); display: inline-block; padding: 5px 15px; border-radius: 20px; font-size: 0.75rem; font-weight: bold; margin-bottom: 15px;}
.total-budget { background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.15); padding: 20px; border-radius: 15px; margin: 20px 0;}
.total-budget h3 { color: var(--secondary); font-size: 1.8rem;}

/* ========== GALERI ========== */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}
.gallery-item {
    border-radius: 12px; overflow: hidden; height: 200px; position: relative;
}
.gallery-item img {
    width: 100%; height: 100%; object-fit: cover; transition: 0.4s;
}
.gallery-item:hover img { transform: scale(1.08); }
.gallery-wide { grid-column: span 2; }

/* ========== BERITA ========== */
.news-layout { display: flex; gap: 40px; align-items: flex-start;}
.news-main { flex: 0 0 65%; }
.news-sidebar { flex: 0 0 35%; top: 100px;}

.news-card {
    display: flex; gap: 20px; background: white; padding: 15px;
    border-radius: 15px; border: 1px solid var(--border-color); margin-bottom: 20px;
    transition: 0.3s;
}
.news-card:hover { transform: translateY(-3px); box-shadow: 0 5px 15px rgba(0,0,0,0.05); }
.news-img { width: 30%; border-radius: 10px; overflow: hidden; flex-shrink: 0; min-height: 120px;}
.news-img img { width: 100%; height: 100%; object-fit: cover; }
.news-info { display: flex; flex-direction: column; justify-content: center; flex: 1; }
.news-meta { font-size: 0.7rem; font-weight: bold; color: var(--primary); margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.5px; }
.news-info h3 { font-size: 1rem; margin-bottom: 8px; line-height: 1.4; }
.news-info p { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 12px; line-height: 1.5;}
.news-readmore { font-size: 0.8rem; font-weight: bold; color: var(--primary); margin-top: auto; display: inline-flex; align-items: center; gap: 5px;}

/* FIX 3: Sidebar agenda - full width di mobile */
.sidebar-box {
    background: white;
    border-radius: 15px;
    border: 1px solid var(--border-color);
    overflow: hidden;
    /* Pastikan full width saat jadi block */
    width: 100%;
}
.sidebar-header { background: var(--primary-dark); color: white; padding: 15px 20px; display: flex; gap: 10px; align-items: center;}
.agenda-list { padding: 20px; }
.agenda-item { display: flex; gap: 15px; border-bottom: 1px solid var(--border-color); padding-bottom: 15px; margin-bottom: 15px;}
.agenda-item:last-child { border: none; margin: 0; padding: 0; }
.agenda-date { width: 55px; height: 55px; background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--primary); flex-shrink: 0;}
.agenda-date span:first-child { font-size: 0.65rem; font-weight: bold; text-transform: uppercase;}
.agenda-date span:last-child { font-size: 1.2rem; font-weight: 900;}
.agenda-detail h4 { font-size: 0.9rem; margin-bottom: 5px; }
.agenda-detail p { font-size: 0.7rem; color: var(--text-muted); margin-bottom: 2px; display: flex; align-items: center; gap: 5px;}

/* ========== FOOTER ========== */
.footer { background: #111827; color: white; padding-top: 60px; border-top: 5px solid var(--primary);}
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px; margin-bottom: 50px;}
.footer-about p { font-size: 0.85rem; color: #9ca3af; margin: 20px 0; line-height: 1.7;}
.social-links { display: flex; gap: 12px; }
.social-links a { width: 36px; height: 36px; background: #1f2937; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: white; transition: 0.3s;}
.social-links a:hover { background: var(--primary); transform: translateY(-3px); }
.footer-title { font-size: 1rem; margin-bottom: 20px; border-bottom: 1px solid #374151; padding-bottom: 10px; display: inline-block;}
.footer-links li { margin-bottom: 10px; font-size: 0.85rem; color: #9ca3af;}
.footer-links a:hover { color: var(--primary); }
.footer-bottom { background: #030712; padding: 20px 0; font-size: 0.75rem; color: #6b7280; text-align: center; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 15px;}

/* ========== MAP ========== */
#map {
    height: 500px;
    width: 100%;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

/* ========== RESPONSIVE TABLET 1024px ========== */
@media (max-width: 1024px) {
    .grid-4, .grid-3 { grid-template-columns: repeat(2, 1fr); }
    .transparansi-box { flex-direction: column; }
    .news-layout { flex-direction: column; }
    .gallery-grid { grid-template-columns: repeat(2, 1fr); }
    .gallery-wide { grid-column: span 1; }
    .footer-grid { grid-template-columns: repeat(2, 1fr); }
    .hero h1 { font-size: 2.8rem; }

    /* FIX 3: Sidebar full width saat layout berubah jadi kolom */
    .news-sidebar {
        width: 100%;
        position: static;
    }
}

/* ========== RESPONSIVE MOBILE 768px ========== */
@media (max-width: 768px) {
    :root {
        --header-height: 60px;
    }

    .top-contact { display: none; }
    .ticker-wrapper { margin-left: 0; }

    .nav-menu { display: none; }
    .mobile-toggle { display: flex; }

    .hero {
        min-height: 100vh;
        background-attachment: scroll;
    }
    .hero h1 { font-size: 2rem; }
    .hero p { font-size: 0.95rem; }
    .hero-buttons { flex-direction: column; align-items: stretch; }
    .hero-buttons .btn { justify-content: center; }

    .section-padding { padding: 50px 0; }
    .section-title { font-size: 1.6rem; }

    .profil-content { flex-direction: column; gap: 30px;}
    .grid-2 { grid-template-columns: 1fr; }

    /* FIX 1: Grid perangkat desa 2 kolom di mobile, teks tetap di dalam */
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .perangkat-desa-section .grid-4 {
        grid-template-columns: repeat(2, 1fr);
        width: 100%;
    }
    .perangkat-card {
        width: 100%;
        min-width: 0;
        overflow: hidden;
    }
    .perangkat-card h4 {
        font-size: 0.85rem;
        word-break: break-word;
        overflow-wrap: break-word;
    }
    .perangkat-card p {
        font-size: 0.75rem;
    }

    .edu-grid { grid-template-columns: 1fr; }

    .news-layout { flex-direction: column; }
    .news-card { flex-direction: column; }
    .news-img { width: 100%; height: 180px; }

    /* FIX 3: Sidebar agenda full width di mobile */
    .news-sidebar {
        position: static;
        width: 100%;
        margin-top: 30px;
        flex: none;
    }
    .sidebar-box {
        width: 100%;
    }

    .footer-grid { grid-template-columns: 1fr; gap: 30px; }
    .footer-bottom { flex-direction: column; align-items: center; text-align: center; }

    /* FIX 2: Table wrapper tidak perlu overflow di sini karena sudah di parent */
    .table-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    table { min-width: 600px; }
    /* FIX 2: Header tabel ikut scroll */
    .table-header { min-width: 600px; }

    .gallery-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .gallery-item { height: 150px; }

    .trans-left, .trans-right { padding: 25px; }
    .trans-left h2 { font-size: 1.5rem; }

    .wave-divider svg { height: 40px; }

    .mitra-logos { gap: 20px; }
    .mitra-logos div { font-size: 0.8rem; }

    .kades-card { max-width: 100%; margin: 0 0 30px 0; }
}

/* ========== RESPONSIVE MOBILE KECIL 480px ========== */
@media (max-width: 480px) {
    .section-title { font-size: 1.4rem; }
    .section-subtitle { font-size: 0.85rem; margin-bottom: 25px; }
    .divider { margin: 10px auto 25px auto; width: 60px; }

    .container { padding: 0 15px; }

    .hero h1 { font-size: 1.5rem; }
    .hero-badge { font-size: 0.65rem; padding: 4px 12px; }

    .btn { padding: 10px 18px; font-size: 0.85rem; }

    /* FIX 1: Di layar sangat kecil, perangkat desa tetap 2 kolom tapi lebih compact */
    .grid-4 { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .grid-3 { grid-template-columns: 1fr; gap: 20px; }

    .perangkat-card { padding: 12px; }
    .perangkat-card img { width: 65px; height: 65px; }
    .perangkat-card h4 { font-size: 0.78rem; line-height: 1.3; }
    .perangkat-card p { font-size: 0.7rem; }

    .kades-avatar { width: 90px; height: 90px; margin: -45px auto 12px auto; }
    .kades-bg { height: 120px; }

    .stat-card { padding: 18px; }
    .stat-card i { font-size: 1.8rem; }
    .stat-card h3 { font-size: 1.6rem; }

    .chart-container { padding: 20px; }

    .service-card { padding: 18px; }
    .service-card p { min-height: auto; }

    .product-img { height: 160px; }
    .product-info { padding: 15px; }
    .product-info h3 { font-size: 1rem; }

    .trans-left, .trans-right { padding: 20px; }
    .trans-left h2 { font-size: 1.2rem; }
    .total-budget h3 { font-size: 1.3rem; }
    .total-budget { padding: 12px; margin: 15px 0; }

    .gallery-item { height: 120px; }

    .news-card { padding: 12px; }
    .news-img { height: 140px; }
    .news-info h3 { font-size: 0.9rem; }
    .news-meta { font-size: 0.65rem; }

    .agenda-item { gap: 12px; }
    .agenda-date { width: 48px; height: 48px; }
    .agenda-date span:last-child { font-size: 1rem; }
    .agenda-detail h4 { font-size: 0.85rem; }

    .footer { padding-top: 40px; }
    .footer-grid { gap: 25px; margin-bottom: 30px; }

    .dropcap { font-size: 2rem; }

    .batas-wilayah { flex-direction: column; text-align: center; padding: 15px; }
    .batas-icon { width: 50px; height: 50px; font-size: 1.2rem; }

    .visi-box { padding: 20px; }
    .visi-box p { font-size: 0.9rem; }

    .misi-list li { padding: 12px; gap: 12px; }
    .misi-number { width: 26px; height: 26px; font-size: 0.8rem; }

    /* FIX 2: Header dan tabel sudah min-width 600px, tidak perlu override lagi */
    .table-header { padding: 12px 15px; }
    th, td { padding: 10px 12px; font-size: 0.75rem; }
    .btn-download { padding: 4px 8px; font-size: 0.7rem; }

    #map { height: 350px; }

    .mitra-logos { gap: 12px; }
    .mitra-logos div { font-size: 0.7rem; gap: 4px; }
}

@media (max-width: 768px) and (orientation: landscape) {
    .hero { min-height: auto; padding: 60px 0; }
    .hero h1 { font-size: 1.8rem; }
    .section-padding { padding: 40px 0; }
    .gallery-item { height: 100px; }
    .product-img { height: 140px; }
}

@media (hover: none) {
    .service-card:hover,
    .product-card:hover,
    .perangkat-card:hover,
    .stat-card:hover {
        transform: none;
    }

    .btn-primary:hover,
    .btn-outline:hover {
        transform: none;
    }
}