/* =========================================
   MOBILE APP LAYOUT
   ========================================= */

@media (max-width: 767px) {
  .app-sidebar,
  .search-desktop,
  .desktop,
  .ticker-section {
    display: none;
  }
  .app-header {
    height: 60px;
    padding: 0 1rem;
  }
  .header-left {
    gap: 0;
  }

  .header-right {
    gap: 0;
  }
  .header-right .btn {
    display: none;
  }
  .banner-hero {
    width: 100%;
    border-radius: 9px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
    padding: 0;
    margin: 0 0 1.25rem 0;
  }
  .main-content {
    padding: 1.5rem 0.5rem;
  }
}

/* ================================
   MAIN CONTENT
================================ */
@media (max-width: 767px) {
  .main-content {
    padding: 12px;
  }

  .main-content::before {
    width: 260px;
    height: 450px;
    opacity: 0.35;
  }

  .banner-hero {
    width: 100%;
    margin: 12px auto 20px;
    border-radius: 12px;
  }

  .section-title {
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 1rem;
  }

  .section-heading {
    min-width: 0;
  }

  .section-eyebrow {
    font-size: 9px;
    letter-spacing: 1.5px;
    margin-bottom: 5px;
  }

  .section-heading h1 {
    font-size: clamp(18px, 4.5vw, 25px);
    letter-spacing: -0.5px;
  }

  .badge-count {
    padding: 5px 8px;
    font-size: 0.68rem;
  }

  .projects-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2px;
  }

  .project-card {
    border-radius: 10px;
    padding: 6px;
  }

  .card-thumbnail {
    border-radius: 7px;
    margin-bottom: 9px;
  }

  .card-badge-wrapper {
    gap: 4px;
    margin-bottom: 7px;
  }

  .card-actions {
    gap: 5px;
    padding: 4px;
  }
  .btn {
    font-size: 9px;
  }

  .project-card:hover {
    transform: none;
    box-shadow: none;
  }

  .project-card:hover .card-thumbnail img {
    transform: none;
  }
}

/* =========================================
   MOBILE BOTTOM NAVIGATION
   ========================================= */

.bottom-nav {
  display: none;
}

@media (max-width: 767px) {
  .bottom-nav {
    display: block;
    position: fixed;
    left: 14px;
    right: 14px;
    bottom: 14px;
    height: 76px;
    z-index: 1000;
  }

  .bottom-nav-inner {
    position: relative;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    align-items: end;
    width: 100%;
    height: 100%;
    padding: 8px 6px 7px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
  }

  /* Lekukan area tombol tengah */
  .bottom-nav-inner::before {
    content: "";
    position: absolute;
    width: 74px;
    height: 50px;
    left: 50%;
    top: -1px;
    transform: translateX(-50%);
    background: var(--bg-main);
    border-radius: 0 0 42px 42px;
    border: 1px solid var(--border-color);
    border-top: 0;
  }

  .bottom-nav-item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-width: 0;
    height: 100%;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font: inherit;
    cursor: pointer;
    z-index: 2;
  }

  .bottom-nav-item > svg {
    width: 21px;
    height: 21px;
    stroke-width: 1.8;
  }

  .bottom-nav-item > span:not(.search-nav-outer):not(.search-nav-label) {
    font-size: 10px;
    font-weight: 500;
  }

  .bottom-nav-item.active {
    color: var(--emerald-primary);
  }

  /* Floating Search */
  .search-nav-item {
    justify-content: flex-start;
    gap: 3px;
  }

  .search-nav-outer {
    position: absolute;
    top: -29px;
    left: 50%;
    transform: translateX(-50%);
    display: grid;
    place-items: center;
    width: 68px;
    height: 68px;
    border-radius: 50%;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    box-shadow: 0 -4px 14px rgba(0, 0, 0, 0.06);
  }

  .search-nav-button {
    display: grid;
    place-items: center;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    color: #fff;
    background: var(--emerald-primary);
    box-shadow: 0 5px 14px rgba(0, 0, 0, 0.2);
  }

  .search-nav-button svg {
    width: 23px;
    height: 23px;
    stroke-width: 2.3;
  }

  .search-nav-label {
    position: absolute;
    bottom: 3px;
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
  }

  /* Ruang agar konten tidak tertutup navbar */
  .main-content {
    padding-bottom: 110px;
  }
}

/* =========================================
   MOBILE SEARCH PANEL
   ========================================= */

.mobile-search-panel {
  display: none;
}

@media (max-width: 767px) {
  .mobile-search-panel {
    position: fixed;
    display: flex;
    top: calc(var(--header-height) + 10px);
    left: 16px;
    right: 16px;
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-12px);
    transition:
      opacity 0.28s ease,
      transform 0.28s ease,
      visibility 0.28s ease;
  }

  .mobile-search-panel.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
  }

  .mobile-search-panel .search-box {
    display: flex;
    align-items: center;
    width: 100%;
    max-width: none;
    min-height: 62px;
    padding: 0 10px 0 18px;
    gap: 12px;
    background: color-mix(in srgb, var(--bg-surface) 88%, transparent);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 18px 18px 18px 5px;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.15);
  }

  .mobile-search-panel .search-icon {
    position: static;
    flex-shrink: 0;
    transform: none;
    color: var(--emerald-primary);
  }

  .mobile-search-panel input {
    flex: 1;
    min-width: 0;
    width: 100%;
    padding: 12px 0;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-main);
    font: inherit;
    font-size: 14px;
  }

  .mobile-search-panel input::placeholder {
    color: var(--text-muted);
  }

  .mobile-search-panel input::-webkit-search-cancel-button {
    display: none;
  }

  #close-mobile-search {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    border: 1px solid var(--border-color);
    border-radius: 12px 12px 12px 4px;
    background: var(--bg-main);
    color: var(--text-muted);
    cursor: pointer;
  }

  #close-mobile-search svg {
    width: 18px;
    height: 18px;
  }
}

/* =========================================
   MOBILE SERVICES PANEL
   ========================================= */

.mobile-services-panel {
  display: none;
}

@media (max-width: 767px) {
  .mobile-services-panel {
    display: block;
    position: fixed;
    left: 14px;
    right: 14px;
    bottom: 115px;
    z-index: 1000;

    padding: 18px;
    border: 1px solid var(--border-color);
    border-radius: 22px;
    background: var(--bg-surface);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);

    opacity: 0;
    visibility: hidden;
    transform: translateY(14px) scale(0.98);
    transition:
      opacity 0.25s ease,
      transform 0.25s ease,
      visibility 0.25s ease;
  }

  .mobile-services-panel.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
  }

  /* HEADER */
  .mobile-services-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
  }

  .mobile-services-header h3 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.3px;
  }

  .mobile-services-header button {
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border: none;
    border-radius: 50%;
    background: var(--bg-main);
    color: var(--text-muted);
  }

  .mobile-services-header button svg {
    width: 17px;
    height: 17px;
  }

  /* CATEGORY GRID */
  .mobile-services-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
  }

  .mobile-service-category {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 9px;

    padding: 10px 4px;
    min-height: 68px;

    border: 1px solid transparent;
    border-radius: 14px;
    background: var(--bg-main);
    color: var(--text-main);
    cursor: pointer;
    transition: 0.2s ease;
  }

  .mobile-service-category i {
    width: 16px;
    height: 16px;
    color: var(--emerald-primary);
  }

  .mobile-service-category span {
    font-size: 0.7rem;
    font-weight: 500;
    text-align: center;
    line-height: 1.3;
  }

  .mobile-service-category.active {
    background: rgba(16, 185, 129, 0.09);
    border-color: rgba(16, 185, 129, 0.25);
  }

  .mobile-service-category:active {
    transform: scale(0.96);
  }

  /* SUBCATEGORIES */
  .mobile-services-subcategories {
    display: none;
    margin-top: 14px;
    padding-top: 10px;
    border-top: 1px solid var(--border-color);
  }

  .mobile-services-subcategories.active {
    display: grid;
    gap: 4px;
  }

  .mobile-services-subcategories button {
    display: flex;
    align-items: center;
    gap: 10px;

    width: 100%;
    padding: 11px 10px;

    border: none;
    border-radius: 10px;
    background: transparent;
    color: var(--text-main);

    font-size: 0.8rem;
    text-align: left;
    cursor: pointer;
    transition: background 0.2s ease;
  }

  .mobile-services-subcategories button i {
    width: 17px;
    height: 17px;
    color: var(--text-muted);
  }

  .mobile-services-subcategories button:active {
    background: var(--bg-main);
  }
}
