/* ============================================================
   HOJA360 — Responsive rules (media.css)
   Loaded AFTER style.css so these rules win the cascade.

   Desktop-first. Breakpoints are ordered high → low so each
   lower one inherits everything above it and only overrides
   what changes:

     • Tablet         ≤ 1199.98px   (+ 404 layout)
     • 404 stack      ≤ 1050px      (404 page only)
     • Mobile         ≤  767.98px
     • 404 small      ≤  575.98px   (404 page only)
     • Small mobile   ≤  479.98px

   The 404-only rules target their own selectors (.main-404-block,
   .robot-*, .page-404-*, …) and never overlap the general rules,
   so they slot into the cascade purely for readability.
   ============================================================ */

/* ============================================================
   TABLET  ≤ 1199.98px
   ============================================================ */
@media (max-width: 1199.98px) {
  .ab-card {
    padding: 20px;
  }
  .bs-80,
  .bs-40,
  .bs-64,
  .bs-32 {
    --bs-gutter-x: 1.5rem;
  }
  .site-header .navbar-actions {
    display: none;
  }
  /* ---------- Navigation (collapsed bar keeps search + demo) ---------- */
  .site-header .navbar-actions {
    order: 1;
  }
  .site-header .navbar-toggler {
    order: 2;
  }
  .site-header .navbar-collapse {
    order: 3;
    margin-top: 12px;
    border-top: 1px solid var(--color-gray-light);
  }
  .site-header .navbar-nav {
    align-items: stretch;
    gap: 4px;
    padding-top: 12px;
  }
  .site-header .navbar-nav .nav-link {
    padding-block: 10px;
  }
  /* .nav-search {
    max-width: 340px;
  } */
  .not-alone-section {
    padding-top: 120px;
  }
  .na-col {
    align-items: center;
    padding-top: 0;
    gap: 48px;
  }
  .na-col-center {
    order: -1; /* figure on top when stacked */
  }
  .na-col-left .na-item:nth-child(1),
  .na-col-left .na-item:nth-child(3),
  .na-col-right .na-item:nth-child(1),
  .na-col-right .na-item:nth-child(3) {
    transform: none;
  } /* undo arc stagger */

  /* ---------- Metrics → tighter dividers ---------- */
  .metric {
    padding-inline: 24px !important;
  }
  .matricBorder:not(:nth-child(3n + 3)) .metric::after {
    content: unset;
  }

  /* ---------- Features content → tighten column gap ---------- */
  .features-content {
    column-gap: 40px;
  }

  /* ---------- CTA banner ---------- */
  .cta-banner {
    padding: 48px;
  }
  /* CTA: shrink the illustration as the screen gets smaller (kept bottom-right) */
  .cta-person {
    width: 440px;
  }

  /* ---------- Footer → columns wrap, sized to content ---------- */
  .footer-cols {
    flex-wrap: wrap;
    gap: 40px;
  }
  .footer-col {
    flex: 0 1 auto;
  }

  /* ---------- Problem / Solution → stack, bridge goes horizontal ---------- */
  .problem-solution-header {
    margin-bottom: 48px;
  }
  .problem-solution-grid {
    flex-direction: column;
    gap: 40px;
  }
  .bridge-column {
    width: 100%;
    flex: 0 0 auto;
    min-height: unset;
  }
  .bridge-column-line {
    width: 100%;
    height: 1px;
    min-height: 1px;
  }
  .bridge-column-arrow {
    transform: rotate(90deg);
    top: -17px;
  }

  /* ---------- How it works ---------- */
  .how-it-works-header {
    margin-bottom: 40px;
  }

  /* ---------- Integrations → 3 per row (grid, not flex) ---------- */
  .integration-cards {
    width: 100%;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .integration-card {
    max-width: none;
  }

  .custom-plan-title,
  .custom-plan-title span {
    font-size: 20px;
  }
  .comparison-table tbody td {
    padding: 10px;
    font-size: 14px;
  }
  .comparison-title h2 {
    font-size: 15px;
  }
  /* ---------- CTA strip → stack copy over actions ---------- */
  .cta-strip {
    flex-direction: column;
    align-items: flex-start;
    gap: 32px;
  }
  .cta-strip-actions {
    flex-wrap: wrap;
  }
  .pricing-card {
    padding: 20px;
  }
  /* ---------- Pricing cards → 2 per row ---------- */
  /* .pricing-cards {
    flex-wrap: wrap;
  }
  .pricing-card {
    width: calc(50% - 12px);
  } */

  /* ---------- Pricing comparison table ---------- */
  /* .comparison-table-wrap {
    margin-inline: 0;
    overflow-x: auto;
    align-items: stretch;
  }

  .comparison-table {
    min-width: 720px;
  } */

  /* ---------- Partners → stack cards ---------- */
  /* .partner-cards {
    flex-direction: column;
    align-items: center !important;
  }
  .partner-card {
    max-width: 100%;
  } */

  /* ---------- 404 page layout ---------- */
  /* .main-404-block {
        gap: 48px;
    }

    .illustration-container {
        flex: 0 0 360px;
        min-height: 440px;
        overflow: visible;
    } */
  /* 
    .robot-assembly {
        width: 360px;
        min-height: 400px;
    }

    .robot-image {
        left: 50%;
        top: 58%;
        width: 260px;
        max-width: none;
    }

    .robot-label {
        z-index: 4;
        white-space: nowrap;
    }

    .robot-label-status {
        left: 0;
        top: 8%;
    }

    .robot-label-loop {
        right: 0;
        top: 10%;
    }

    .robot-label-critical {
        right: 0;
        bottom: 16%;
    }

    .robot-alert {
        min-width: 90px;
    } */
}

/* ============================================================
   404 STACK  ≤ 1050px   (404 page only)
   ============================================================ */
@media (max-width: 1050px) {
  .page-404-section {
    padding-block: 56px;
  }

  .main-404-block {
    flex-direction: column;
    align-items: center !important;
    gap: 40px;
    text-align: center;
  }

  .content-left {
    max-width: 640px;
    align-items: center;
  }

  .page-404-actions {
    justify-content: center;
  }

  /* .illustration-container {
    width: 100%;
    flex: none;
    min-height: auto;
    overflow: visible;
  }

  .robot-assembly {
    width: min(320px, 100%);
    min-height: auto;
    display: flex;
    justify-content: center;
  }

  .robot-image {
    position: static;
    width: min(260px, 70vw);
    max-width: none;
    transform: none;
  }

  .robot-alert,
  .robot-label {
    display: none;
  } */
}

/* ============================================================
   HERO STACK  ≤ 991.98px   (home hero columns stack)
   ============================================================ */
@media (max-width: 991.98px) {
  .bannerBlog {
    padding: 20px;
  }
  h1 {
    font-size: 30px;
  }
  .partner-card {
    padding: 15px;
  }

  /* CTA: keep the illustration but shrink it further on tablet */
  .cta-person {
    width: 340px;

    gap: 14px;
  }
  .channels-node--sm {
    width: 48px;
    height: 48px;
    font-size: 18px;
  }
  .channels-node--center {
    width: 84px;
    height: 84px;
  }
  .channels-node-logo {
    width: 46px;
    height: 46px;
  }
  /* Hero: keep side-by-side, just stack the CTA buttons (tablet + mobile) */
  .hero-actions {
    flex-direction: column;
    align-items: flex-start;
  }

  /* "Not alone" */
  .na-visual {
    position: static;
    max-width: 560px;
    margin: 40px auto 0;
    padding-top: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
  }
  .na-figure {
    display: none;
  }

  .na-visual > .na-item {
    position: static;
    width: auto;
    max-width: none;
    margin-left: 0;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 16px;
    text-align: left;
    padding: 16px 20px;
    border: 1px solid var(--color-border);
    border-radius: 14px;
    background: var(--light-bg);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
  }
  .na-visual > .na-item .na-item-icon {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
  }
  .na-visual > .na-item .na-item-label {
    max-width: 450px;
    font-size: 16px;
    line-height: 1.35;
  }

  .leads-showcase {
    min-height: 700px;
  }

  .leads-showcase-img {
    margin-bottom: 10px;
  }
  .leads-info {
    gap: 16px;
  }
  .leads-tabs {
    justify-content: flex-start;
  }
  .partner-card {
    padding: 20px;
  }
  .partner-card-icon {
    padding: 10px;
    height: 50px;
  }

  .hero-content {
    padding-block: 60px;
    padding-right: 40px;
  }
  .hero-title,
  .hero-title span {
    font-size: 30px;
    line-height: 100%;
  }

  .hero-visual:not(.hero-visual--mobile) {
    margin-inline: 0;
  }
  .hero-card--dashboard {
    width: 46%;
    left: 43%;
  }
  .hero-card--1 {
    width: 28%;
  }
  .hero-card--2 {
    width: 34%;
  }
  .hero-card--3 {
    width: 19%;
  }
  .hero-card--group {
    width: 19%;
  }
  .hero-card--home {
    width: 11%;
  }
  .hero-card--toggle {
    width: 11%;
  }
  .hero-deco {
    width: 9%;
  }
  .ab-stats-title {
    margin-top: 32px;
    text-align: center;
  }
  .value-grid {
    gap: 32px;
  }
  .hoja-app-visual {
    order: -1;
    /* max-width: 320px; 
    margin-inline: auto; centred */
  }
  .hoja-app-actions {
    justify-content: center;
  }
  .clientGrid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    justify-items: center;
  }
  .mt-50 {
    margin-top: 35px;
  }
  .na-cta {
    padding-top: 40px;
  }
  .article-right {
    margin-top: 32px;
  }
}

/* ============================================================
   MOBILE  ≤ 767.98px
   ============================================================ */
@media (max-width: 767.98px) {
  .blogCard,
  .extenalCard {
    padding: 15px;
  }
  .gap-40 {
    gap: 20px;
  }
  .site-header .dropdown-menu {
    border: unset;
    box-shadow: unset;
  }
  .site-header .dropdown-menu a {
    font-size: 13px;
  }
  .site-header .dropdown-item {
    padding: 8px;
  }
  .value-grid {
    grid-template-columns: 1fr;
  }
  .value-card,
  .contactForm,
  .contactDetails {
    padding: 15px;
  }
  .section-80 {
    padding-block: 40px;
  }
  .metric-number h2,
  .wh-title h2,
  .wh-title h2 span {
    font-size: 30px;
  }
  h2,
  h2 > span {
    font-size: 20px;
  }
  h3 {
    font-size: 18px;
  }
  h4 {
    font-size: 16px;
  }
  p {
    font-size: 14px;
  }

  .site-header .navbar-brand {
    order: 0;
  }
  .site-header .navbar-toggler {
    order: 1;
  }
  .site-header .navbar-collapse {
    order: 2;
    margin-top: 4px;
  }

  .navbar-actions {
    gap: 8px;
  }
  .nav-search {
    padding: 10px 12px;
  }
  .btn-cta {
    padding: 10px 16px;
  }
  /* ---------- Hero (home) — centred on mobile ---------- */
  .hero-content {
    max-width: none;
    padding-right: 20px;
    padding-block: 20px;
  }

  .hero-title,
  .hero-title span {
    font-size: 36px;
    text-align: center;
  }
  .hero-subtitle {
    font-size: 16px;
    text-align: center;
  }
  .hero-actions {
    flex-direction: row;
    align-items: center;
    justify-content: center;
  }
  .btn-hero-solid,
  .btn-hero-outline {
    padding: 12px 24px;
    font-size: 12px;
  }
  .hero-content {
    padding-block: 20px;
    padding-right: 0;
  }
  /* ---------- Why-Hoja hero ---------- */
  /* .wh-hero {
    padding-block: 56px;
  } */
  /* ---------- Automation demo ---------- */
  /* .automation-demo-section {
    padding-block: 48px;
  } */
  .automation-demo-section-header {
    margin-bottom: 18px;
  }

  /* ---------- Leads (compact tabs) ---------- */
  .leads-tabs {
    gap: 20px;
  }
  .leads-tab-icon {
    width: 20px;
    height: 20px;
  }
  .leads-tab-icon-wrap {
    padding: 8px;
  }
  .leads-tab-text {
    font-size: 13px;
  }
  .leads-showcase {
    padding: 16px;
    margin-top: 40px;
  }
  .leads-showcase-desc {
    font-size: 16px;
  }
  /* .leads-showcase-img {
    margin-bottom: 16px;
  } */

  /* ---------- "Not alone" ---------- */
  /* .not-alone-section {
    padding-top: 56px;
  } */
  .na-item-label {
    font-size: 20px;
  }

  /* ---------- Hoja app: image above the copy, smaller & centred, buttons centred ---------- */
  /* .hoja-app-row {
    margin-top: 12px;
    --bs-gutter-y: 32px;
  } */

  /* ---------- Value cards → 1 per row ---------- */
  /* .value-section {
    padding-block: 56px;
  } */
  /* ---------- Metrics → stack, dividers go horizontal ---------- */
  /* .metrics-section {
    padding-block: 56px;
  } */
  .metrics-row {
    grid-template-columns: 1fr;
  }
  .metric {
    padding-inline: 0;
    padding-block: 28px;
  }
  .metric + .metric {
    border-left: 0;
    border-top: 1px solid var(--color-border);
  }

  /* ---------- Features → stack copy over dashboard ---------- */
  .features-section {
    padding-block: 56px;
  }
  .features-tabs,
  .wh-hero-text {
    gap: 20px;
  }
  .features-content {
    grid-template-columns: 1fr;
    row-gap: 32px;
  }
  .wh-engine-card {
    padding: 15px;
  }
  /* ---------- Problem / Solution cards ---------- */
  .problem-card,
  .solution-flow-card {
    padding: 20px;
  }
  .problem-card-header,
  .solution-flow-card-header {
    align-items: flex-start !important;
  }
  .problem-card-title h5,
  .solution-flow-card-title h5 {
    font-size: 16px;
  }
  .problem-card-desc,
  .solution-flow-card-desc {
    font-size: 14px;
  }
  .problem-card-status,
  .solution-flow-card-status {
    font-size: 11px;
  }

  /* ---------- How it works → 2 per row ---------- */
  .step-card {
    padding: 20px;
    /* flex-basis: calc((100% - 24px) / 2);
    max-width: calc((100% - 24px) / 2); */
  }
  /* .step-card-number {
    margin-bottom: 20px;
  } */
  .features-tab .nav-link {
    font-size: 12px;
  }
  .features-actions .btn,
  .features-actions .btn-watch-demo {
    padding: 10px;
    font-size: 12px;
  }
  .step-card-title,
  .features-content-title h3 {
    font-size: 20px;
  }
  .step-card-desc {
    font-size: 14px;
  }

  /* ---------- Integrations → 2 per row ---------- */
  .integrations-header {
    margin-bottom: 40px;
  }
  .integration-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .integration-card {
    padding: 24px;
  }
  .integration-card-icon {
    width: 56px;
    height: 56px;
    font-size: 26px;
  }

  /* ---------- Testimonials ---------- */
  .testimonial-quote {
     font-size: 20px;
  }
  .testimonial-quote-icon {
    margin-bottom: 24px;
    font-size: 34px;
  }
  .testimonial-author {
    margin-top: 24px;
  }
  .testimonial-author-img {
    width: 44px;
    height: 44px;
  }

  /* ---------- CTA banner ---------- */
  .cta-banner {
    height: auto;
    padding: 40px 24px;
    margin-bottom: 0;
  }
  .cta-content {
    max-width: 100%;
    align-items: center;
    text-align: center;
    gap: 28px;
  }
  .cta-person,
  .cta-dots,
  .cta-arrow,
  .cta-star,
  .cta-square {
    display: none;
  }

  /* ---------- Footer → stack columns full width ---------- */
  .footer-top {
    padding-block: 56px 40px;
  }
  .footer-cols {
    flex-wrap: wrap;
    gap: 32px;
  }
  .footer-col {
    flex: 1 1 100%;
  }

  /* ---------- Pricing: cards 1-up, sections tighten ---------- */
  .pricing-hero-section {
    padding-block: 32px 0;
  }
  .pricing-section {
    padding-block: 48px;
  }
  /* .pricing-card {
    width: 100%;
  } */
  /* .custom-plan-section {
    padding-block: 0 48px;
  } */
  .custom-plan-banner {
    padding: 24px;
  }

  /* Comparison table → scroll inside its own box, not the page */
  /* .comparison-section {
    padding-block: 0 64px;
  } */
  /* .comparison-table-wrap {
    overflow-x: auto;
    align-items: stretch;
    margin-inline: calc(var(--page-x) * -1); 
    padding-inline: var(--page-x);
  } */

  /* FAQ + CTA */
  /* .pricing-faq-section {
    padding-block: 0 48px;
  } */
  .pricing-faq-item {
    padding: 18px;
  }
  /* .pricing-cta-section {
    padding-block: 0 48px;
  } */
  .pricing-cta {
    flex-direction: column;
    align-items: flex-start !important;
    padding: 24px;
  }
  .pricing-cta-btn {
    width: 100%;
    justify-content: center;
  }

  /* ---------- Partners ---------- */

  /* ---------- Search ---------- */
  .search-page-section {
    min-height: calc(100vh - 72px);
  }
  .search-page-form {
    margin-top: 16px;
  }
  .popular-searches {
    margin-top: 32px;
  }
  .popular-search-tag {
    padding-inline: 16px;
  }

  /* ---------- Search: no results ---------- */
  /* .search-no-results-section {
    min-height: calc(100vh - 72px);
  } */
  .empty-state-icon {
    width: 80px;
    height: 80px;
    font-size: 46px;
  }
  .empty-state-title {
    font-size: 28px;
  }
  .empty-state-actions {
    flex-wrap: wrap;
  }

  /* Automation Benefits */
  /* .automation-benefits {
    padding-block: 0;
    overflow-x: clip;
  } */
  .hoja-app-visual {
    margin: unset;
    max-width: unset;
  }
  .ab-card {
    padding: 20px;
    gap: 24px;
    /* margin-inline: calc(50% - 50vw); */
    /* border-radius: 0; */
  }

  .ab-stat-number {
    font-size: 30px;
    line-height: 100%;
  }
  .ab-stat {
    padding: 16px;
  }
  .cta-title {
    /* font-size: 36px; */
    /* line-height: 100%; */
  }

  .clients-cards {
    margin: 32px auto 64px;
  }
  .clients-card {
    max-width: 220px;
  }

  .hero-base {
    width: 90%;
    left: 6%;
  }
  .hero-card--dashboard {
    width: 58%;
    left: 23%;
  }
  .hero-card--1 {
    width: 28%;
  }
  .hero-card--2 {
    width: 34%;
  }
  .hero-card--3 {
    width: 19%;
  }
  .hero-card--group {
    width: 19%;
  }
  .hero-card--home {
    width: 11%;
  }
  .hero-card--toggle {
    width: 11%;
  }
  .hero-deco {
    width: 10%;
  }

  /*Inner Blog*/
  .article-title {
    font-size: 32px;
  }
  .article-hero p {
    font-size: 12px;
  }
  .article-hero h5 {
    font-size: 16px;
  }
  .article-hero h3 {
    font-size: 20px;
  }
  .article-body h5:first-child {
    font-size: 14px;
  }
  .article-featured-img  {
    height: 220px;
  }
}

/* ============================================================
   404 SMALL  ≤ 575.98px   (404 page only)
   ============================================================ */
@media (max-width: 575.98px) {
  .page-404-section {
    padding-block: 40px;
  }

  .content-left {
    align-items: stretch;
    text-align: left;
  }

  .error-code-badge {
    align-self: flex-start;
  }

  .page-404-actions {
    width: 100%;
    flex-direction: column;
    align-items: stretch !important;
  }

  .page-404-btn {
    width: 100%;
    justify-content: center;
  }

  .robot-image {
    width: min(230px, 72vw);
  }

  .newsletter-decoration {
    display: none;
  }

  .newsletter-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .newsletter-btn {
    align-self: center;
  }

  .hero-deco {
    display: none;
  }
  .wh-engine-card {
    height: 350px;
  }
   .wh-engine-title p {
    font-size: 12px;
  }
  .wh-task-title, 
  .wh-task-time {
    font-size: 10px;
  }
  .features-actions {
    justify-content: center;
  }
}

/* ============================================================
   SMALL MOBILE  ≤ 479.98px
   ============================================================ */
@media (max-width: 479.98px) {
  .hero-title,
  .hero-title span {
    font-size: 28px;
  }

  .hero-actions {
    flex-wrap: wrap;
  }
  .hero-actions .btn-hero-solid,
  .hero-actions .btn-hero-outline {
    width: 100%;
  }

  .hero-subtitle {
    font-size: 18px;
  }
  .leads-tabs {
    gap: 14px;
  }
  .leads-showcase-desc {
    font-size: 15px;
  }

  .leads-showcase {
    min-height: 550px;
  }

  .leads-learn-more {
    padding: 8px 16px;
  }

  .na-item-label {
    font-size: 18px;
  }
  .na-item-icon {
    width: 64px;
    height: 64px;
  }
  .ab-card {
    padding: 48px 20px;
  }
  .cta-title {
    font-size: 26px;
  }

  /* How it works → 1 per row */
  .step-card {
    flex-basis: 100%;
    max-width: 100%;
  }

  /* Integrations → 1 per row */
  .integration-cards {
    grid-template-columns: 1fr;
  }

  /* CTA strip → full-width buttons */
  /* .cta-strip-section {
    padding-block: 56px;
  } */
  .cta-strip-actions,
  .cta-strip-btn {
    width: 100%;
  }

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  /* All Your Channels, One Platform
  .channels-track {
justify-content: flex-start;
    overflow-x: auto;
    padding: 8px 8px 16px;
    margin-top: 48px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .channels-track::-webkit-scrollbar {
    display: none;
  } */
  .channels-line {
    left: 8px;
    right: 8px;
  }
  .channels-node--sm {
    width: 48px;
    height: 48px;
    font-size: 17px;
  }
  .channels-node--center {
    width: 84px;
    height: 84px;
  }
  .channels-node-logo {
    width: 46px;
    height: 46px;
  }
  .channels-node + .channels-node {
    margin-left: 26px;
  }
  /* The horizontal scroll rail already moves the icons; drop the
     flow-toward-hub drift so it doesn't fight the scroll container. */
  .channels-node--flow-in {
    animation: fadePop 0.6s ease both var(--d, 0s);
  }

}

@media (max-width: 575.98px) {
  .channels-deco--tr {
    width: 200px;
  }
  .channels-deco--br {
    width: 160px;
  }
}
