/* ==========================================================================
   DWAKA HOLIDAY - COMPREHENSIVE RESPONSIVE CSS (redesigned)
   Desktop-first base (style.css) + breakpoint refinements down to 320px.
   Goal: clean, proportionate layout with fonts & cards scaled to the screen.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. EXTRA SMALL MOBILE (320px to 374px - e.g., iPhone SE, Galaxy Fold)
   -------------------------------------------------------------------------- */
@media (max-width: 374.98px) {
  html, body {
    font-size: 14px;
  }

  .container, .container-fluid {
    padding-left: 14px !important;
    padding-right: 14px !important;
  }

  /* Typography */
  h1, .fs-1 { font-size: 1.5rem !important; }
  h2, .fs-2 { font-size: 1.3rem !important; }
  h3, .fs-3 { font-size: 1.15rem !important; }
  h4, .fs-4 { font-size: 1.05rem !important; }
  h5, .fs-5 { font-size: 0.95rem !important; }
  p, span, label, small { font-size: 0.85rem; }

  .section-title {
    font-size: 1.4rem !important;
  }

  /* Navbar */
  :root { --navbar-height: 56px; }
  .navbar-dwaka.navbar-over-hero { margin-top: -10px; }
  .navbar-brand-logo { height: 30px; }
  .navbar-brand span { font-size: 0.92rem !important; }
  .navbar-brand small { font-size: 0.56rem !important; }
  .navbar-toggler { padding: 5px 7px; border-radius: 8px; }
  .navbar-toggler-icon { width: 20px; height: 20px; }

  /* Hero: fixed static height, text anchored at bottom */
  .hero-slide-item {
    height: 100vh;
    height: 100svh;
    padding: 0;
  }
  .hero-content {
    padding: 10px 14px 36px !important;
    text-align: center;
    left: 0;
    right: 0;
  }
  .hero-title {
    font-size: 1.4rem !important;
    line-height: 1.22;
  }
  .hero-subtitle {
    font-size: 0.8rem !important;
    margin-bottom: 14px !important;
  }
  .hero-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
  }

  /* Buttons: full-width tap targets */
  .btn-custom-primary,
  .btn-custom-outline,
  .btn-custom-wa {
    width: 100%;
    justify-content: center;
    padding: 10px 16px;
    font-size: 0.85rem;
    min-height: 44px;
  }

  /* Post-hero content breathing room */
  .page-card-dwaka {
    margin: 8px auto 0;
    padding: 0 10px;
  }

  /* About & features */
  .about-card-container {
    padding: 18px !important;
    margin-top: 0 !important;
    border-radius: 10px !important;
  }
  .feature-box {
    padding: 18px 14px !important;
  }
  .feature-icon-wrapper {
    width: 46px;
    height: 46px;
    font-size: 1.15rem;
    margin-bottom: 12px;
  }

  /* Package cards: full width on tiny screens, tidy proportions */
  .package-item-col { flex: 0 0 100%; max-width: 100%; }
  .package-img-wrapper { height: 200px; }
  .package-body { padding: 14px !important; }
  .package-title { font-size: 1.02rem !important; }
  .package-desc { font-size: 0.82rem; }
  .package-price-value { font-size: 1.15rem; }

  /* Gallery: single column on tiny screens */
  .gallery-grid { grid-template-columns: repeat(1, 1fr) !important; gap: 10px !important; }
  .gallery-item { height: auto !important; aspect-ratio: 4 / 3; }

  /* Reviews */
  .review-card { padding: 18px !important; }
  .review-avatar { width: 44px; height: 44px; }

  /* Sections */
  .katalog-section,
  .review-section,
  .gallery-section,
  .faq-section {
    padding: 40px 0 !important;
    border-radius: 0 !important;
    margin: 0 0 8px !important;
  }

  /* Package detail */
  .package-detail-gallery-main { height: 50vw !important; max-height: 230px; border-radius: 10px !important; }
  .package-detail-thumb { height: 54px !important; border-radius: 6px !important; }
  .itinerary-timeline { padding-left: 18px !important; margin-left: 5px !important; }
  .itinerary-dot { left: -26px !important; width: 15px !important; height: 15px !important; }
  iframe#pdfDetailIframe { height: 300px !important; }
  .sticky-booking-card { position: static !important; padding: 18px !important; border-radius: 10px !important; }

  /* Forms & modals */
  .form-request-card { padding: 18px !important; border-radius: 10px !important; }
  .modal-dialog { margin: 8px !important; }
}

/* --------------------------------------------------------------------------
   2. SMALL MOBILE (375px to 575px - most phones)
   -------------------------------------------------------------------------- */
@media (min-width: 375px) and (max-width: 575.98px) {
  .container, .container-fluid {
    padding-left: 16px !important;
    padding-right: 16px !important;
  }

  /* ---- Header / navbar scaled down on phones for a leaner, balanced look ----
     Overriding --navbar-height also moves the hero pull-up (margin-top:
     calc(-1 * var(--navbar-height))) so the seamless over-hero merge holds. */
  :root { --navbar-height: 58px; }
  .navbar-dwaka.navbar-over-hero { margin-top: -10px; }
  .navbar-dwaka .navbar-brand { gap: 8px; }
  .navbar-brand-logo { height: 32px; }
  .navbar-brand span { font-size: 0.98rem !important; }
  .navbar-brand small { font-size: 0.58rem !important; }
  .navbar-toggler { padding: 6px 8px; border-radius: 8px; }
  .navbar-toggler-icon { width: 22px; height: 22px; }

  /* Hero: fixed static height */
  .hero-slide-item {
    height: 100vh;
    height: 100svh;
  }
  .hero-content {
    padding: 14px 16px 44px !important;
    text-align: center;
  }
  .hero-title { font-size: 1.65rem !important; line-height: 1.2; }
  .hero-subtitle { font-size: 0.9rem !important; margin-bottom: 18px !important; }
  .hero-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
  }

  .section-title { font-size: 1.6rem !important; }

  /* Buttons */
  .btn-custom-primary,
  .btn-custom-outline,
  .btn-custom-wa {
    width: 100%;
    justify-content: center;
    min-height: 46px;
  }

  .page-card-dwaka { padding: 0 12px; }

  .about-card-container { padding: 24px; margin-top: 0 !important; }
  .feature-box { padding: 22px 18px !important; }

  /* Package cards: compact 2-column on phones */
  .package-img-wrapper { height: 38vw; max-height: 200px; }
  .package-body { padding: 14px; }
  .package-title { font-size: 1rem; margin-bottom: 6px; }
  .package-desc {
    font-size: 0.8rem;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .package-price-value { font-size: 1.15rem; }
  .package-body .btn { font-size: 0.85rem; padding: 10px 12px; white-space: nowrap; }

  /* Gallery: clean single column */
  .gallery-grid { grid-template-columns: repeat(1, 1fr); gap: 14px; }
  .gallery-item { height: auto !important; aspect-ratio: 16 / 10; }

  .review-card { padding: 20px; }

  /* Sections */
  .katalog-section,
  .review-section,
  .gallery-section,
  .faq-section {
    padding: 48px 0 !important;
    border-radius: 0 !important;
    margin: 0 0 10px !important;
  }

  /* Forms & modals */
  .form-dwaka .form-control,
  .form-dwaka .form-select {
    padding: 12px 14px;
    min-height: 46px;
  }
  .form-request-card { padding: 24px; }
  .modal-dialog { margin: 10px !important; }
}

/* --------------------------------------------------------------------------
   3. LARGER PHONE / PHABLET (576px to 767px)
   -------------------------------------------------------------------------- */
@media (min-width: 576px) and (max-width: 767.98px) {
  .hero-slide-item { height: 100vh; height: 100svh; }
  .hero-title { font-size: 1.9rem; }
  .hero-subtitle { font-size: 0.95rem !important; }
  .hero-content { padding: 14px 20px 36px !important; text-align: center; }

  .section-title { font-size: 1.7rem !important; }

  .page-card-dwaka { padding: 0 18px; }

  /* Package cards: 2 columns with compact images */
  .package-img-wrapper { height: 30vw; max-height: 220px; }
  .package-title { font-size: 1.08rem; }

  .about-card-container { padding: 28px; margin-top: 0 !important; }

  .gallery-grid { grid-template-columns: repeat(1, 1fr); gap: 16px; }
  .gallery-item { height: auto !important; aspect-ratio: 16 / 9; }

  .review-card { padding: 22px; }

  .katalog-section,
  .review-section,
  .gallery-section,
  .faq-section {
    padding: 54px 0 !important;
    border-radius: 0 !important;
    margin: 0 0 12px !important;
  }

}

/* --------------------------------------------------------------------------
   4. GENERAL MOBILE WRAPPER (Up to 767.98px) - layout utilities
   -------------------------------------------------------------------------- */
@media (max-width: 767.98px) {
  .table-responsive {
    overflow-x: auto;
    margin-bottom: 1rem;
  }

  .modal-dialog {
    max-width: 96%;
    margin: 1.75rem auto;
  }

  .footer-dwaka {
    padding: 40px 0 20px;
    text-align: left;
  }
  .footer-dwaka h5 { margin-top: 14px; }

  #btnBackToTop {
    bottom: 16px;
    right: 16px;
    width: 42px;
    height: 42px;
    font-size: 1.05rem;
  }

  /* Revitalize sticky booking card on mobile (no overlap with content) */
  .sticky-booking-card {
    position: static !important;
    margin-top: 20px;
  }

  /* Full-bleed section content on phones: cards/content reach the screen
     edges. Desktop is untouched (these rules only apply under 768px). */
  #clientsSection .container,
  #katalogSection .container,
  #aboutSection .container,
  .gallery-section .container,
  .review-section .container,
  .faq-section .container,
  .request-section .container {
    max-width: none !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
  #katalogSection .row.g-4,
  #clientsSection .row,
  .gallery-section .row,
  .review-section .row,
  .faq-section .row {
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  /* Remove the card box around home package items on phones only */
  #katalogSection .package-card {
    box-shadow: none !important;
    border: none !important;
    border-top: none !important;
    background: transparent !important;
    border-radius: 0 !important;
  }
  #katalogSection .package-card:hover {
    transform: none !important;
    box-shadow: none !important;
  }
  #katalogSection .package-img-wrapper {
    border-radius: 12px;
    overflow: hidden;
  }
  #katalogSection .package-body {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  /* Remove the blue-tinted section backgrounds on phones only (clean white) */
  #clientsSection,
  .katalog-section,
  .review-section {
    background: #ffffff !important;
    border-bottom: none !important;
  }

  /* Scrollspy nav mobile responsive */
  #pkgScrollspy {
    position: static;
  }
  .pkg-scrollspy-desktop {
    display: none !important;
  }
}

/* --------------------------------------------------------------------------
   5. TABLET / SMALL TABLET (768px to 991.98px - iPads)
   -------------------------------------------------------------------------- */
@media (min-width: 768px) and (max-width: 991.98px) {
  .hero-slide-item { height: 100vh; height: 100svh; }
  .hero-title { font-size: 2.2rem; }
  .hero-content { padding: 20px 28px 40px; }

  .section-title { font-size: 2rem; }

  .page-card-dwaka { padding: 0 20px; }

  .about-card-container { margin-top: 0; padding: 36px; }

  .feature-box { padding: 24px 20px; }

  /* Package cards: consistent 2-col with tidy image height */
  .package-img-wrapper { height: 230px; }
  .package-title { font-size: 1.1rem; }

  .gallery-grid { grid-template-columns: repeat(3, 1fr); gap: 12px; }
  .gallery-item { height: 22vw !important; max-height: 220px; }

  .review-card { padding: 24px; }

  .katalog-section,
  .review-section,
  .gallery-section,
  .faq-section { padding: 64px 0; }

  .form-request-card { padding: 32px; }

  .package-detail-gallery-main { height: 360px; }
  .package-detail-thumb { height: 84px; }
  .sticky-booking-card { position: static; margin-top: 24px; }
}

/* --------------------------------------------------------------------------
    6. MOBILE NAVBAR SIDEBAR (Offcanvas — active below 992px)
    -------------------------------------------------------------------------- */
@media (max-width: 991.98px) {
  .offcanvas-dwaka {
    width: 86%;
    max-width: 360px;
    border-left: none;
    box-shadow: -20px 0 40px -20px rgba(9, 20, 33, 0.35);
  }

  /* Offcanvas header — dark navy gradient */
  .offcanvas-dwaka .offcanvas-header {
    background: linear-gradient(135deg, var(--navy-dark) 0%, #173f63 55%, var(--accent-dark) 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    padding: 18px 20px;
  }
  .offcanvas-dwaka .offcanvas-header .navbar-brand {
    margin: 0;
    max-width: calc(100% - 48px);
  }
  .offcanvas-dwaka .offcanvas-header .navbar-brand span {
    color: #ffffff;
    font-size: 1.05rem;
    white-space: nowrap;
  }
  .offcanvas-dwaka .offcanvas-header .navbar-brand small {
    color: #cfe7f5;
  }
  .offcanvas-dwaka .offcanvas-header .btn-close {
    background: rgba(255, 255, 255, 0.14);
    border-radius: 50%;
    padding: 8px;
    margin-left: auto;
    opacity: 1;
  }
  .offcanvas-dwaka .offcanvas-header .btn-close:hover {
    background: rgba(255, 255, 255, 0.28);
  }
  .offcanvas-dwaka .offcanvas-header .btn-close:focus-visible {
    outline: 2px solid #ffffff;
    outline-offset: 2px;
  }

  /* Offcanvas body — soft background */
  .offcanvas-dwaka .offcanvas-body {
    background: linear-gradient(180deg, var(--bg-canvas) 0%, var(--secondary) 100%);
    padding: 18px 16px 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
  }

  /* Clean nav list */
  .offcanvas-dwaka .navbar-nav {
    gap: 6px;
    flex-grow: 0;
  }
  .offcanvas-dwaka .navbar-nav .nav-item {
    border-bottom: 1px solid var(--line);
  }
  .offcanvas-dwaka .navbar-nav .nav-item:last-child {
    border-bottom: none;
  }
  .offcanvas-dwaka .navbar-nav .nav-link-dwaka {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.02rem;
    font-weight: 600;
    padding: 14px 12px !important;
    border-radius: var(--radius-md);
    transition: var(--transition);
    min-height: 44px;
  }
  .offcanvas-dwaka .navbar-nav .nav-link-dwaka:hover {
    background-color: rgba(74, 163, 216, 0.12);
    color: var(--accent-dark);
    padding-left: 16px;
  }
  .offcanvas-dwaka .navbar-nav .nav-link-dwaka:focus-visible {
    outline: 2px solid var(--accent-dark);
    outline-offset: 2px;
    box-shadow: var(--header-focus-ring);
  }
  .offcanvas-dwaka .navbar-nav .nav-link-dwaka.active {
    background: linear-gradient(90deg, var(--primary) 0%, rgba(168, 213, 229, 0.35) 100%);
    color: var(--navy-dark);
    font-weight: 700;
  }
  .offcanvas-dwaka .navbar-nav .nav-link-dwaka.active::after {
    display: none;
  }

  /* Mobile reservation CTA area pinned to the bottom */
  .offcanvas-dwaka .navbar-nav .nav-item.d-lg-none {
    margin-top: 14px;
    border-bottom: none;
  }
  .offcanvas-dwaka .navbar-nav .nav-item.d-lg-none .btn {
    min-height: 46px;
    justify-content: center;
    font-weight: 700;
  }

  /* Private package itinerary highlight responsive */
  .itinerary-section-active::before {
    font-size: 0.6rem;
    top: -11px;
    left: 8px;
    padding: 0 6px;
  }
  .itinerary-step-highlighted {
    margin-left: -8px;
    padding-left: 8px;
    padding-right: 8px;
  }
}

/* --------------------------------------------------------------------------
    7. LAPTOP / DESKTOP (992px to 1199.98px)
   -------------------------------------------------------------------------- */
@media (min-width: 992px) and (max-width: 1199.98px) {
  .hero-title { font-size: 2.4rem; }

  .about-card-container { padding: 40px; }

  .package-img-wrapper { height: 210px; }

  .gallery-grid { grid-template-columns: repeat(3, 1fr); gap: 14px; }
}

/* --------------------------------------------------------------------------
   8. LARGE DESKTOP (1200px+)
   -------------------------------------------------------------------------- */
@media (min-width: 1200px) {
  .hero-slide-item { height: 100vh; height: 100svh; }

  .gallery-grid { grid-template-columns: repeat(3, 1fr); gap: 16px; }
}

/* ==========================================================================
   9. PILIHAN OUTING FAVORIT — KATALOG POLISH (clean & responsive)
   Consolidates the package grid, filter tabs, and section header so the
   "PILIHAN OUTING FAVORIT" area reads cleanly at every breakpoint.
   ========================================================================== */

/* ---- Section header: aligned + balanced breathing room ---- */
.katalog-section .text-center.mb-4,
.katalog-section .section-eyebrow {
  margin-bottom: 0.5rem !important;
}

/* ---- Filter tabs: two rows (3 pills on top, Custom Corporate below),
       top row scrolls sideways on small screens, bar sticks to navbar ---- */
@media (max-width: 643.98px) {
  #categoryFilterButtons {
    top: calc(var(--navbar-height) + 4px);
    margin-left: -10px !important;
    margin-right: -10px !important;
    padding: 8px 10px;
    border-radius: 14px;
  }
  #categoryFilterButtons .katalog-filter-row {
    flex-wrap: nowrap !important;
    justify-content: flex-start;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 8px !important;
    padding-bottom: 2px;
    scrollbar-width: none;
  }
  #categoryFilterButtons .katalog-filter-row::-webkit-scrollbar { display: none; }
  #categoryFilterButtons .filter-btn {
    flex: 0 0 auto;
    white-space: nowrap;
    font-size: 0.82rem !important;
    padding: 8px 14px !important;
    border-radius: 50rem !important;
  }
}

/* ---- Package grid: clean, equal-height cards scaled to the screen ---- */
@media (max-width: 643.98px) {
  /* Single full-width column on phones so cards stay roomy (not small/flat) */
  #packageCardsGrid > .package-item-col {
    flex: 0 0 100%;
    max-width: 100%;
  }
  .package-card {
    display: flex;
    flex-direction: column;
    height: 100%;
  }
  .package-img-wrapper {
    height: 52vw !important;
    max-height: 280px !important;
    min-height: 190px;
  }
  .package-body {
    padding: 18px 18px 20px !important;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
  }
  .package-title { font-size: 1.15rem !important; margin-bottom: 8px; }
  .package-desc {
    font-size: 0.9rem !important;
    line-height: 1.55;
    margin-bottom: 12px;
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .package-body .mb-3 { margin-bottom: 12px !important; padding-top: 10px; }
  .package-price-label { font-size: 0.72rem !important; }
  .package-price-value { font-size: 1.3rem !important; }
  .package-rating { font-size: 0.82rem; }
  .package-body .btn {
    font-size: 0.9rem !important;
    padding: 11px 14px !important;
    min-height: 44px;
    white-space: nowrap;
  }
}

/* ---- Tablet: tidy 2-col cards with consistent image ratio ---- */
@media (min-width: 644px) and (max-width: 991.98px) {
  .package-img-wrapper { height: 220px !important; }
  .package-title { font-size: 1.05rem; }
  .package-desc {
    font-size: 0.82rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
}

/* ---- Small desktop: balanced 3-col cards ---- */
@media (min-width: 992px) and (max-width: 1199.98px) {
  .package-img-wrapper { height: 200px !important; }
}

/* ==========================================================================
   10. HOME PREVIEW — katalog & gallery limit to 2 full rows + see-more button
   Shows exactly two complete rows at each breakpoint, then "Lihat Selengkapnya".
   Only applies to the home page (.home-preview is added by index.php).
   ========================================================================== */

/* Catalog columns: 1 col mobile, 2 col tablet (>=768), 3 col desktop (>=992)
   -> keep 2 / 4 / 6 items so the grid stays balanced. */
#katalogSection.home-preview .package-item-col:nth-child(n+3) { display: none !important; }
@media (min-width: 768px) {
  #katalogSection.home-preview .package-item-col:nth-child(n+3) { display: block !important; }
  #katalogSection.home-preview .package-item-col:nth-child(n+5) { display: none !important; }
}
@media (min-width: 992px) {
  #katalogSection.home-preview .package-item-col:nth-child(n+5) { display: block !important; }
  #katalogSection.home-preview .package-item-col:nth-child(n+7) { display: none !important; }
}

/* Gallery grid columns: 1 col mobile, 3 col tablet & desktop
   -> keep 4 / 6 / 6 items so the grid stays balanced. */
#gallerySection.home-preview .gallery-item:nth-child(n+5) { display: none !important; }
@media (min-width: 768px) {
  #gallerySection.home-preview .gallery-item:nth-child(n+5) { display: block !important; }
  #gallerySection.home-preview .gallery-item:nth-child(n+7) { display: none !important; }
}
