/* =====================================================
   PT. HARAPAN MITRA ADV — Responsive Breakpoints
   Mobile-first approach
   ===================================================== */

/* ── Small (≥640px) ── */
@media (min-width: 640px) {
  :root {
    --container-padding: 1.5rem;
  }

  h1 {
    font-size: var(--text-6xl);
  }

  .hero__title {
    font-size: var(--text-6xl);
  }

  .hero__actions {
    flex-direction: row;
  }

  .card {
    flex-shrink: 0;
    width: 350px;
  }
}

/* ── Medium (≥768px) ── */
@media (min-width: 768px) {
  h1 {
    font-size: var(--text-7xl);
  }

  .hero__title {
    font-size: var(--text-7xl);
  }

  .hero__description {
    font-size: var(--text-xl);
  }

  .stats__grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .stats__number {
    font-size: var(--text-6xl);
  }

  .clients__logo {
    height: 6rem;
  }

  .service-item {
    grid-template-columns: auto 1fr 1fr auto;
  }

  .service-item__image {
    display: block;
  }

  .process__grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .process__step {
    border-bottom: none;
    border-right: var(--border-width) solid var(--color-dark-border);
  }

  .process__step:nth-child(2),
  .process__step:nth-child(4) {
    border-right: none;
  }

  .process__step:nth-child(1),
  .process__step:nth-child(2) {
    border-bottom: var(--border-width) solid var(--color-dark-border);
  }

  .portfolio-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .portfolio-card--offset {
    margin-top: var(--space-24);
  }

  .testimonial-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .cta-section__title {
    font-size: var(--text-7xl);
  }

  .section-title {
    font-size: var(--text-7xl);
  }

  .footer__bottom {
    flex-direction: row;
    justify-content: space-between;
  }

  .cookie-banner {
    flex-direction: row;
  }

  /* Desktop FAB styling is handled in components.css */

  /* About section two-col */
  .about-grid {
    grid-template-columns: 5fr 7fr;
  }

  .about-images {
    grid-template-columns: repeat(2, 1fr);
  }

  .about-images__item--offset {
    margin-top: var(--space-12);
  }

  /* Contact grid */
  .contact-grid {
    grid-template-columns: 1fr 1fr;
  }

  .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-6);
  }
}

/* ── Large (≥1024px) ── */
@media (min-width: 1024px) {
  :root {
    --container-padding: 2rem;
  }
  
  .lg-gap-16 {
    gap: var(--space-16);
  }

  h1 {
    font-size: var(--text-8xl);
  }

  .hero__title {
    font-size: var(--text-8xl);
  }

  /* Show desktop nav, hide hamburger */
  .navbar__links {
    display: flex;
  }

  .hamburger {
    display: none;
  }

  .navbar__logo img {
    height: 3rem;
  }

  .process__grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .process__step {
    border-bottom: none !important;
    border-right: var(--border-width) solid var(--color-dark-border);
  }

  .process__step:last-child {
    border-right: none;
  }

  .testimonial-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .footer__grid {
    grid-template-columns: 4fr 2fr 3fr 3fr;
  }

  /* Service detail page layout */
  .service-detail-grid {
    grid-template-columns: 1fr 1fr;
  }

  /* About section */
  .about-grid {
    grid-template-columns: 5fr 7fr;
    gap: var(--space-16);
  }
}

/* ── XL (≥1280px) ── */
@media (min-width: 1280px) {
  .section-title {
    font-size: var(--text-7xl);
  }
}

/* ── Small screens only (< 768px) ── */
@media (max-width: 767px) {
  :root {
    --container-padding: 1.25rem;
  }

  .section {
    padding: var(--space-16) 0;
  }

  .section-title {
    font-size: var(--text-4xl);
  }
  
  .hero__title {
    font-size: var(--text-4xl);
  }
  
  .hero__description {
    font-size: var(--text-base);
  }

  .portfolio-card__image img {
    height: 16rem;
  }

  .mobile-wa-bar {
    display: block;
  }

  /* Add bottom padding for mobile WA bar */
  body {
    padding-bottom: 4.5rem;
  }

  .back-to-top {
    bottom: calc(var(--space-8) + 4.5rem);
  }

  /* Service page hero */
  .service-hero__image {
    height: 16rem;
  }

  /* Horizontal Swipe Carousel for Products/Portfolio */
  .product-grid {
    display: flex !important;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding-bottom: var(--space-6);
    margin-right: calc(var(--container-padding) * -1); /* Extend to screen edge */
    padding-right: var(--container-padding);
    gap: var(--space-4);
  }

  .product-grid::-webkit-scrollbar {
    display: none;
  }
  .product-grid {
    -ms-overflow-style: none;
    scrollbar-width: none;
  }

  .product-card-grid {
    flex: 0 0 85%;
    scroll-snap-align: center;
  }

  /* Video carousel mobile — horizontal swipe */
  .video-carousel {
    max-width: 100%;
    flex-wrap: nowrap !important;
    justify-content: flex-start !important;
    padding-left: var(--space-2);
    padding-right: var(--space-2);
    margin: 0 calc(var(--container-padding) * -1);
    padding-left: var(--container-padding);
    padding-right: var(--container-padding);
    -ms-overflow-style: none;
    scrollbar-width: none;
  }

  .video-carousel::-webkit-scrollbar {
    display: none;
  }

  .video-card {
    flex: 0 0 240px;
  }
}

/* ── Print styles ── */
@media print {
  .navbar,
  .back-to-top,
  .mobile-wa-bar,
  .cookie-banner,
  .hamburger {
    display: none !important;
  }

  body {
    background: white;
    color: black;
    border-top: none;
  }

  .section {
    padding: 1rem 0;
    border: none;
  }
}
