/* ==========================================================================
   iComputer Urban Tech DZ — Global responsive rules
   Loaded last so it can resolve cross-component edge cases.
   ========================================================================== */

@media (max-width: 1279px) {
  :root {
    --gutter: 22px;
    --section-y: 84px;
  }
}

@media (max-width: 1024px) {
  :root {
    --section-y: 72px;
  }

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

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

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

  .footer-col:last-child {
    grid-column: 2 / -1;
  }
}

@media (max-width: 900px) {
  .grid-4,
  .grid-3,
  .grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .section-head--split {
    align-items: flex-start;
    flex-direction: column;
  }

  .section-head--split .btn {
    align-self: flex-start;
  }
}

@media (max-width: 680px) {
  :root {
    --gutter: 18px;
    --section-y: 56px;
    --header-h: 64px;
  }

  .grid-4,
  .grid-3,
  .grid-2 {
    grid-template-columns: minmax(0, 1fr);
  }

  .section-head {
    margin-bottom: 32px;
  }

  .section-sub {
    font-size: 0.98rem;
  }

  .footer-extended-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 28px 20px;
    padding-block: 40px 28px;
  }

  .footer-col:first-child {
    grid-column: 1 / -1;
  }

  .footer-col:last-child {
    grid-column: auto;
  }

  .footer-bottom-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    text-align: start;
  }

  .floating-whatsapp {
    inset-block-end: 16px;
    inset-inline-end: 16px;
    width: 48px;
    height: 48px;
  }

  .backup-banner,
  .lawyer-banner,
  .sub-banner {
    padding: 26px 18px;
  }

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

@media (max-width: 420px) {
  .footer-extended-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .footer-col:first-child,
  .footer-col:last-child {
    grid-column: auto;
  }

  .brand-text em {
    display: none;
  }

  .btn {
    padding-inline: 16px;
  }

  .pillars-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}


/* ==========================================================================
   Mobile Homepage Hero Optimization (Screen <= 768px, 390px, 375px, 360px, 320px)
   ========================================================================== */

@media (max-width: 768px) {
  /* 1. Reduce hero top and bottom padding */
  .hero {
    padding-block: 28px 24px;
  }

  .hero-inner {
    gap: 20px;
  }

  /* 8. Remove unnecessary margins around hero-visual */
  .hero-content {
    max-width: 100%;
  }

  .hero-visual {
    margin-top: 0;
    max-width: 100%;
  }

  /* 4. Reduce vertical gaps between hero elements */
  .hero-eyebrow {
    margin-bottom: 12px;
    padding: 4px 10px;
    font-size: 0.72rem;
    gap: 6px;
  }

  /* 2. Reduce headline font size while keeping it prominent */
  .hero-title {
    margin-bottom: 12px;
    font-size: clamp(1.65rem, 6.2vw, 2.25rem);
    line-height: 1.22;
    letter-spacing: -0.02em;
  }

  html[lang="ar"] .hero-title {
    font-size: clamp(1.6rem, 6vw, 2.15rem);
    line-height: 1.3;
  }

  /* 3. Reduce paragraph font size and line spacing slightly */
  .hero-sub {
    margin-bottom: 16px;
    font-size: 0.92rem;
    line-height: 1.55;
    max-width: 100%;
  }

  /* 5 & 6. Arrange CTA buttons efficiently without horizontal overflow */
  .hero-actions {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
    width: 100%;
  }

  .hero-actions .btn {
    flex: 1 1 140px;
    min-width: 0;
    min-height: 42px;
    padding: 9px 12px;
    font-size: 0.84rem;
    white-space: nowrap;
    justify-content: center;
  }

  .hero-actions .btn-whatsapp .btn-icon {
    margin-inline-end: 6px;
  }

  .hero-actions .btn-whatsapp .icon {
    width: 17px;
    height: 17px;
  }

  /* 7. Reduce hero metadata spacing and font size */
  .hero-meta {
    padding-top: 12px;
    margin-bottom: 4px;
    gap: 6px 14px;
    border-top: 1px solid var(--line);
  }

  .hero-meta li {
    font-size: 0.74rem;
    gap: 5px;
  }

  .hero-meta .icon {
    width: 13px;
    height: 13px;
  }

  /* 9. Reduce tools-launcher card padding and minimum height */
  .tools-launcher {
    padding: 16px;
    gap: 12px;
    border-radius: var(--radius-md);
  }

  /* 10. Place the tools icon and heading on the same row */
  .tools-launcher__intro {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-areas:
      "icon title"
      "desc desc"
      "btn  btn";
    align-items: center;
    column-gap: 12px;
    row-gap: 8px;
    direction: inherit !important;
  }

  .tools-launcher__icon {
    grid-area: icon;
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
  }

  .tools-launcher__icon .icon {
    width: 20px;
    height: 20px;
  }

  .tools-launcher__title {
    grid-area: title;
    font-size: 1.05rem;
    line-height: 1.3;
    margin: 0;
    text-align: start !important;
    direction: inherit !important;
    justify-self: stretch !important;
  }

  /* 11. Make the description compact and readable */
  .tools-launcher__description {
    grid-area: desc;
    font-size: 0.84rem;
    line-height: 1.5;
    margin: 0;
    text-align: start !important;
    direction: inherit !important;
    max-width: 100%;
  }

  /* 12. Reduce the tools button height */
  .tools-launcher__open {
    grid-area: btn;
    margin-top: 2px;
    min-height: 38px;
    padding: 8px 14px;
    font-size: 0.82rem;
    width: 100%;
    justify-content: center;
    direction: inherit !important;
    justify-self: stretch !important;
  }

  /* 13. Make opened tool cards smaller and better organized on mobile */
  .tools-launcher__panel {
    gap: 12px;
  }

  .tools-launcher__panel-head {
    align-items: center;
    gap: 10px;
  }

  .tools-launcher__panel-head h2 {
    font-size: 0.98rem;
  }

  .tools-launcher__close {
    min-height: 32px;
    padding: 4px 10px;
    font-size: 0.76rem;
  }

  .tools-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }

  .tool-card {
    min-height: 68px;
    padding: 10px 12px;
    gap: 10px;
    border-radius: var(--radius-sm);
  }

  .tool-card__icon {
    width: 32px;
    height: 32px;
  }

  .tool-card__icon .icon {
    width: 18px;
    height: 18px;
  }

  .tool-card__content strong {
    font-size: 0.82rem;
    line-height: 1.35;
  }

  .tool-card__content span {
    font-size: 0.74rem;
    line-height: 1.4;
  }

  .tool-card__arrow {
    width: 14px;
    height: 14px;
  }
}

/* Extra narrow screens: 375px, 360px, 320px */
@media (max-width: 390px) {
  .hero {
    padding-block: 22px 18px;
  }

  .hero-inner {
    gap: 16px;
  }

  .hero-eyebrow {
    font-size: 0.68rem;
    padding: 3px 8px;
  }

  .hero-title {
    font-size: clamp(1.45rem, 5.8vw, 1.75rem);
  }

  .hero-sub {
    font-size: 0.86rem;
  }

  .hero-actions .btn {
    flex: 1 1 100%;
    min-height: 40px;
    font-size: 0.82rem;
  }

  .tools-launcher {
    padding: 12px;
  }

  .tools-launcher__title {
    font-size: 0.95rem;
  }

  .tools-launcher__description {
    font-size: 0.8rem;
  }
}

@media (max-width: 320px) {
  .hero-title {
    font-size: 1.38rem;
  }

  .hero-actions .btn {
    padding-inline: 8px;
    font-size: 0.78rem;
  }

  .hero-meta li {
    font-size: 0.7rem;
  }

  .tools-launcher__intro {
    column-gap: 8px;
  }

  .tools-launcher__icon {
    width: 32px;
    height: 32px;
  }

  .tool-card {
    padding: 8px;
  }
}


/* Very wide screens: lock content, let margins absorb. */
@media (min-width: 1440px) {
  :root {
    --container: 1260px;
  }
}

/* Print: remove chrome, keep readable text. */
@media print {
  .navbar,
  .floating-whatsapp,
  .footer-social-links,
  .hero-visual,
  .hero-actions,
  .final-cta-section,
  .contact-hub {
    display: none !important;
  }

  body {
    background: #fff;
    color: #000;
  }

  body::before,
  body::after {
    display: none;
  }

  .section,
  .page-hero {
    padding-block: 20px;
  }

  a {
    text-decoration: underline;
  }
}
