/* ═══════════════════════════════════════
   الهيف — Mobile First Luxury
   Breakpoints: 768 · 430 · 390
   ═══════════════════════════════════════ */

/* ─── Touch & performance base ─── */
@media (max-width: 768px) {
  :root {
    --header-h: 68px;
    --section-pad: clamp(3.25rem, 10vw, 4.5rem);
    --lh-body: 1.8;
    --lh-heading: 1.4;
  }

  html {
    font-size: 15px;
    -webkit-text-size-adjust: 100%;
  }

  .header {
    padding-top: env(safe-area-inset-top, 0);
    z-index: 1001;
  }

  body {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
  }

  .container {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }

  .btn,
  .nav__link,
  .menu-toggle,
  .header__actions .btn-whatsapp {
    min-height: 48px;
    touch-action: manipulation;
  }

  .btn {
    padding: 0.85rem 1.5rem;
    font-size: 0.95rem;
  }

  .btn-sm {
    min-height: 44px;
    padding: 0.7rem 1.1rem;
    font-size: 0.9rem;
  }

  /* ─── Header & nav ─── */
  .logo--header .logo__img {
    height: 40px;
    max-width: 140px;
  }

  .header__inner {
    gap: 0.5rem;
  }

  .header__actions {
    gap: 0.5rem;
  }

  .header__actions .btn-whatsapp {
    padding: 0.55rem 0.85rem;
    font-size: 0.8rem;
  }

  .header__actions .btn-whatsapp svg {
    width: 16px;
    height: 16px;
  }

  .menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    padding: 0;
    border-radius: var(--radius);
    background: var(--gold-subtle);
    border: 1px solid var(--gold-border);
    gap: 6px;
    transition: background var(--transition), transform 0.2s ease;
  }

  .menu-toggle:active {
    transform: scale(0.96);
  }

  .menu-toggle span {
    width: 22px;
    height: 2px;
    border-radius: 2px;
    background: var(--navy);
  }

  .nav-overlay {
    position: fixed;
    inset: 0;
    top: var(--header-h);
    z-index: 998;
    background: rgba(30, 42, 56, 0.35);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity var(--transition), visibility var(--transition);
  }

  .nav-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  /* قائمة منسدلة للأسفل تحت الهيدر */
  .nav {
    display: flex;
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    width: 100%;
    max-width: 100%;
    z-index: 999;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 0.25rem;
    margin: 0;
    padding: 0 1.25rem;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    background: var(--ivory);
    border-top: 1px solid rgba(30, 42, 56, 0.08);
    border-bottom: 1px solid rgba(30, 42, 56, 0.08);
    box-shadow: 0 12px 28px rgba(30, 42, 56, 0.14);
    transform: none;
    transition:
      max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1),
      opacity 0.28s ease,
      visibility 0.4s,
      padding 0.4s ease;
    -webkit-overflow-scrolling: touch;
  }

  .nav.open {
    max-height: min(420px, calc(100dvh - var(--header-h) - 1rem));
    overflow-y: auto;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    padding: 0.65rem 1.25rem calc(1rem + env(safe-area-inset-bottom, 0px));
  }

  .nav__link {
    font-size: 1.1rem;
    font-weight: var(--fw-subheading);
    color: var(--text-primary);
    padding: 1rem 1.15rem;
    border-radius: var(--radius);
    border: 1px solid transparent;
    transition: background var(--transition), border-color var(--transition);
  }

  .nav__link::after {
    display: none;
  }

  .nav__link:active,
  .nav__link:hover {
    background: var(--gold-subtle);
    border-color: var(--gold-border);
  }

  .menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 6px);
  }

  .menu-toggle.active span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
  }

  .menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -6px);
  }

  /* ─── Hero ─── */
  .hero {
    min-height: 70vh;
    min-height: 70dvh;
    height: auto;
    max-height: none;
    align-items: flex-end;
  }

  @supports (height: 1svh) {
    .hero {
      min-height: 78svh;
      max-height: 88svh;
    }
  }

  /* إظهار المحتوى فوراً — reveal يعلق أحياناً على iOS */
  .reveal,
  .reveal.visible {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }

  .offer-card.reveal {
    transition: opacity 0.5s ease, transform 0.5s ease !important;
  }

  .offer-card.reveal:not(.visible) {
    opacity: 0;
    transform: translateY(16px);
  }

  .offer-card.reveal.visible {
    opacity: 1;
    transform: none;
  }

  .hero__bg img {
    object-position: center 30%;
  }

  .hero__content {
    padding: 2rem 0 2.75rem;
  }

  .hero__label {
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    padding: 0.45rem 0.95rem;
    margin-bottom: 0.85rem;
  }

  .hero__title {
    font-size: clamp(1.65rem, 7.5vw, 2.15rem);
    line-height: 1.35;
    max-width: 100%;
  }

  .hero__desc {
    font-size: 0.95rem;
    line-height: 1.75;
    margin-top: 1rem;
    max-width: 100%;
  }

  .hero__actions {
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1.75rem;
    width: 100%;
  }

  .hero__actions .btn {
    width: 100%;
    max-width: 100%;
  }

  .hero__scroll {
    display: none;
  }

  /* ─── Sections typography ─── */
  .section-header {
    margin-bottom: 2.25rem;
  }

  .section-title {
    font-size: clamp(1.5rem, 5.5vw, 1.85rem);
  }

  .section-subtitle {
    font-size: 0.95rem;
    margin-top: 0.9rem;
    line-height: 1.75;
  }

  .section-label {
    font-size: 0.72rem;
    margin-bottom: 0.65rem;
  }

  /* ─── Services ─── */
  .services__grid {
    grid-template-columns: 1fr;
    gap: 1.15rem;
  }

  .service-card {
    padding: 1.75rem 1.5rem;
  }

  .service-card__title {
    font-size: 1.05rem;
  }

  .service-card__desc {
    font-size: 0.9rem;
    line-height: 1.75;
  }

  /* ─── Offer cards ─── */
  .offers__grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .offer-card {
    border-radius: var(--radius-lg);
  }

  .offer-card__image {
    aspect-ratio: 16 / 10;
  }

  .offer-card__image img {
    object-fit: cover;
    object-position: center;
  }

  .offer-card__body {
    padding: 1.35rem 1.25rem 1.5rem;
  }

  .offer-card__title {
    font-size: 1.1rem;
    margin-bottom: 0.45rem;
    line-height: 1.4;
  }

  .offer-card__location {
    font-size: 0.88rem;
    margin-bottom: 1rem;
    line-height: 1.5;
  }

  .offer-card__meta {
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    align-items: flex-end;
    padding-top: 0.85rem;
    margin-bottom: 1.1rem;
  }

  .offer-card__price {
    font-size: 1.35rem;
    margin-right: auto;
  }

  .offer-card__area {
    font-size: 0.85rem;
    width: 100%;
    order: 2;
  }

  .offer-card__actions {
    flex-direction: column;
    gap: 0.65rem;
  }

  .offer-card__actions .btn {
    flex: none;
    width: 100%;
    min-height: 48px;
  }

  .offer-card:hover {
    transform: none;
  }

  /* ─── Forms ─── */
  .forms-grid {
    gap: 2rem;
  }

  .form-card {
    padding: 1.5rem 1.25rem;
  }

  .form-group {
    margin-bottom: 1.35rem;
  }

  .form-group input,
  .form-group select,
  .form-group textarea {
    padding: 0.95rem 1rem;
    font-size: 16px;
    min-height: 48px;
  }

  .form-group textarea {
    min-height: 130px;
  }

  .form-row {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .file-upload {
    padding: 1.75rem 1.25rem;
  }

  /* ─── Subscribe ─── */
  .subscribe__inner {
    gap: 2rem;
  }

  /* ─── Footer ─── */
  .footer {
    padding: 3rem 0 2rem;
  }

  .footer__grid {
    grid-template-columns: 1fr;
    gap: 2.25rem;
    justify-items: stretch;
    text-align: right;
  }

  .footer__brand .footer__logo {
    justify-content: flex-start;
    width: 100%;
  }

  .footer__logo-img {
    height: 48px;
    max-width: 160px;
  }

  .footer__col {
    padding-top: 0.25rem;
  }

  .footer__bottom {
    flex-direction: column;
    text-align: center;
    justify-content: center;
    gap: 0.75rem;
    padding-top: 1.75rem;
  }

  /* ─── Modal ─── */
  .modal__content {
    margin: 1rem;
    max-height: calc(100svh - 2rem);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .modal__image {
    aspect-ratio: 16 / 10;
  }

  .modal__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .modal__actions {
    flex-direction: column;
    gap: 0.65rem;
  }

  .modal__actions .btn {
    width: 100%;
    min-height: 48px;
  }

  .modal__details {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  /* Disable hover lift on touch */
  .service-card:hover,
  .offer-card:hover .offer-card__image img {
    transform: none;
  }
}

/* ─── iPhone standard ~390px ─── */
@media (max-width: 390px) {
  :root {
    --header-h: 64px;
  }

  .container {
    padding-left: 1.1rem;
    padding-right: 1.1rem;
  }

  .hero {
    min-height: 65vh;
    min-height: 65dvh;
  }

  .hero__title {
    font-size: 1.55rem;
  }

  .hero__desc {
    font-size: 0.9rem;
  }

  .offer-card__price {
    font-size: 1.25rem;
  }

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

/* ─── iPhone Plus / Pro Max ~430px ─── */
@media (min-width: 391px) and (max-width: 430px) {
  .hero__title {
    font-size: 1.75rem;
  }

  .hero {
    min-height: 68vh;
    min-height: 68dvh;
  }
}

/* ─── Tablet portrait ─── */
@media (min-width: 431px) and (max-width: 768px) {
  .offers__grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
  }

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

  .hero__actions {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .hero__actions .btn {
    width: auto;
    flex: 1;
    min-width: 140px;
  }

  .offer-card__actions {
    flex-direction: row;
  }

  .offer-card__actions .btn {
    flex: 1;
    width: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero__label,
  .hero__title,
  .hero__desc,
  .hero__actions {
    animation: none;
    opacity: 1;
  }

  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
