/* ===== TABLET & MOBILE ===== */
@media (max-width: 768px) {
  /* Improved hamburger menu positioning and styling */
  .hamburger {
    display: flex;
    z-index: 101;
  }

  .nav-menu {
    position: absolute;
    left: -100%;
    top: 70px;
    flex-direction: column;
    background-color: var(--primary-color);
    width: 100%;
    text-align: center;
    transition: 0.3s;
    gap: 0;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
  }

  .nav-menu.active {
    left: 0;
  }

  .nav-menu li {
    padding: 1rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  }

  /* Improved hero section for mobile with better sizing */
  .hero-section {
    height: auto;
    min-height: 350px;
    padding: 3rem 1rem;
  }

  .hero-content {
    padding: 0 1rem;
  }

  .hero-title {
    font-size: 1.5rem !important;
    line-height: 1.3;
    margin-bottom: 0.75rem;
  }

  .hero-subtitle {
    font-size: 0.95rem !important;
    margin-bottom: 1.5rem;
    line-height: 1.5;
  }

  .hero-buttons {
    flex-direction: column;
    gap: 0.75rem;
    width: 100%;
  }

  .hero-buttons .btn {
    width: 100%;
    padding: 0.875rem 1.25rem;
    font-size: 0.95rem;
  }

  /* Improved section spacing and typography */
  .content-section {
    padding: 2rem 0;
  }

  .section-header {
    margin-bottom: 1.5rem;
    padding: 0 1rem;
  }

  .section-title {
    font-size: 1.4rem;
    line-height: 1.3;
  }

  .section-subtitle {
    font-size: 0.9rem;
    line-height: 1.5;
  }

  /* Better table responsiveness with better spacing */
  .table-wrapper {
    font-size: 0.85rem;
    margin: 0 0.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    position: relative;
  }

  .umkm-table {
    min-width: 600px;
    border-collapse: separate;
    border-spacing: 0;
  }

  .umkm-table th,
  .umkm-table td {
    padding: 0.75rem 0.5rem;
    font-size: 0.85rem;
    white-space: nowrap;
  }

  /* Body row default backgrounds so sticky col can hide content behind it */
  .umkm-table tbody tr {
    background: #ffffff;
  }
  .umkm-table tbody tr:nth-child(even) {
    background: #f8fafb;
  }
  .umkm-table tbody tr:hover {
    background: #ecfdf5;
  }

  /* Make "No" column truly sticky on mobile: solid bg + on-top z-index */
  .umkm-table th:first-child,
  .umkm-table td:first-child {
    position: sticky;
    left: 0;
    padding-left: 1rem;
    background-color: inherit;
    z-index: 2;
    box-shadow: 4px 0 6px -3px rgba(0, 0, 0, 0.10);
  }
  /* Header first-child needs its own solid bg + higher z-index */
  .umkm-table thead th:first-child {
    background: #0d7377;
    color: #fff;
    z-index: 3;
  }

  .umkm-table th:last-child,
  .umkm-table td:last-child {
    padding-right: 1rem;
  }

  .umkm-note {
    margin: 1rem;
    padding: 0.875rem;
    font-size: 0.9rem;
  }

  /* Improved grid layouts for cards with consistent spacing */
  .destinasi-grid,
  .berita-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding: 0 1rem;
  }

  .destinasi-card,
  .berita-card {
    margin: 0 auto;
    max-width: 500px;
  }

  .destinasi-image,
  .berita-image {
    height: 220px;
  }

  .destinasi-content,
  .berita-content {
    padding: 1.25rem;
  }

  .destinasi-content h3,
  .berita-content h3 {
    font-size: 1.15rem;
    margin-bottom: 0.75rem;
  }

  .destinasi-content p,
  .berita-content p {
    font-size: 0.9rem;
    line-height: 1.6;
  }

  /* Better form layout on mobile with touch-friendly inputs */
  .form-container {
    padding: 1.5rem;
    margin: 0 1rem;
  }

  .form-row {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .form-group {
    margin-bottom: 1.25rem;
  }

  .form-group label {
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
  }

  .form-group input,
  .form-group textarea,
  .form-group select {
    font-size: 16px;
    padding: 0.875rem;
  }

  .btn-large {
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
  }

  /* Improved contact section layout with better spacing */
  .kontak-wrapper {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding: 0 1rem;
  }

  .kontak-section,
  .maps-section {
    padding: 1.5rem;
  }

  .kontak-section h3,
  .maps-section h3 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
  }

  .contact-list li {
    padding: 0.625rem 0;
    font-size: 0.9rem;
  }

  /* Better footer spacing */
  .footer {
    padding: 2rem 0 1rem;
  }

  .footer-content {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .footer-section {
    text-align: center;
  }

  .footer-section h4 {
    font-size: 1.05rem;
  }

  /* Improved page header for mobile */
  .page-header {
    padding: 2rem 1rem;
  }

  .page-header h1 {
    font-size: 1.65rem;
    line-height: 1.3;
  }

  .page-header p {
    font-size: 0.95rem;
    line-height: 1.5;
  }

  /* Better filter section layout */
  .filter-section {
    flex-direction: column;
    gap: 0.75rem;
    padding: 0 1rem;
  }

  .search-input,
  .filter-select {
    width: 100%;
    font-size: 16px;
    padding: 0.875rem;
  }

  /* Improved pagination on mobile */
  .pagination {
    gap: 0.375rem;
    padding: 0 1rem;
  }

  .pagination-btn {
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    min-width: 42px;
  }

  /* Better status badge sizing */
  .status-badge {
    padding: 0.375rem 0.75rem;
    font-size: 0.8rem;
  }

  /* Better button touch targets */
  .btn {
    min-height: 44px;
  }
}

/* Extra small mobile devices optimization for better readability */
@media (max-width: 480px) {
  .container {
    padding: 0 1rem;
  }

  /* Compact navbar on small screens */
  .logo {
    gap: 0.5rem;
  }

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

  .logo-text {
    font-size: 1rem;
  }

  .btn-login {
    padding: 0.5rem 0.875rem;
    font-size: 0.875rem;
  }

  /* Smaller hero on tiny screens with better proportions */
  .hero-section {
    min-height: 320px;
    padding: 2.5rem 0.75rem;
  }

  .hero-title {
    font-size: 1.3rem !important;
  }

  .hero-subtitle {
    font-size: 0.875rem !important;
  }

  .hero-buttons .btn {
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
  }

  /* Section improvements for small screens */
  .section-title {
    font-size: 1.25rem;
  }

  .section-subtitle {
    font-size: 0.85rem;
  }

  /* Compact table for small screens with better readability */
  .table-wrapper {
    margin: 0 0.5rem;
  }

  .umkm-table {
    font-size: 0.75rem;
  }

  .umkm-table th,
  .umkm-table td {
    padding: 0.625rem 0.375rem;
    font-size: 0.75rem;
  }

  /* Smaller card elements for better fit */
  .destinasi-card h3,
  .berita-card h3 {
    font-size: 1.05rem;
  }

  .destinasi-content,
  .berita-content {
    padding: 1rem;
  }

  .destinasi-image,
  .berita-image {
    height: 180px;
  }

  /* Compact form on small screens */
  .form-container {
    padding: 1.25rem;
    margin: 0 0.5rem;
  }

  .form-group label {
    font-size: 0.9rem;
  }

  /* Smaller contact elements for better spacing */
  .kontak-section,
  .maps-section {
    padding: 1.25rem;
  }

  .kontak-section h3,
  .maps-section h3 {
    font-size: 1.1rem;
  }

  .contact-list li {
    font-size: 0.85rem;
  }

  /* Better page header on small screens */
  .page-header {
    padding: 1.75rem 0.75rem;
  }

  .page-header h1 {
    font-size: 1.35rem;
  }

  .page-header p {
    font-size: 0.875rem;
  }

  /* Compact pagination buttons for small screens */
  .pagination-btn {
    padding: 0.425rem 0.625rem;
    font-size: 0.8rem;
    min-width: 38px;
  }

  .status-badge {
    padding: 0.3rem 0.6rem;
    font-size: 0.75rem;
  }
}
