/**
 * Moatamad — Mobile & responsive retouch (public website)
 * Loaded AFTER per-page styles so it reliably overrides legacy inline rules.
 * Structural fixes (overflow, hamburger) live in newstyle.css / theme.css so
 * they apply on every viewport; this file handles phone/tablet sizing only.
 */

/* ============================================================
   0. Global comfort on small screens
   ============================================================ */
@media (max-width: 991.98px) {
  body {
    font-size: 16px;
    line-height: 1.6;
    -webkit-text-size-adjust: 100%;
  }

  img,
  svg,
  video,
  iframe {
    max-width: 100%;
  }

  /* Arabic content reads right-to-left — keep paragraphs/headings right-aligned */
  .text-container,
  .custom-background,
  .inner-div,
  .about-text-header,
  .content-form-container,
  .accordion,
  .footer,
  .re-card__body,
  .rd-info {
    text-align: right;
  }
}

/* ============================================================
   1. Navbar (collapsed menu) — hamburger colour fixed in theme.css
   ============================================================ */
@media (max-width: 991.98px) {
  .moatamad-navbar {
    padding: 10px 16px;
  }

  .moatamad-navbar .navbar-collapse {
    margin-top: 12px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
  }

  .moatamad-navbar .navbar-nav {
    width: 100%;
  }

  .navbar-nav .nav-item {
    margin-right: 0 !important;
    margin-bottom: 2px;
  }

  .navbar-nav .nav-item .nav-link {
    padding: 12px 4px;
    border-radius: 8px;
    text-align: right;
  }

  .navbar-nav .nav-item .nav-link:hover,
  .navbar-nav .nav-item .nav-link:focus {
    background: rgba(255, 255, 255, 0.06);
  }

  /* Login / account block becomes a clean vertical stack (RTL = right) */
  .rg-container {
    flex: 0 0 100% !important;
    width: 100%;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
  }

  /* Guest: full-width login button */
  .rg-container .register-btn {
    width: 100%;
    height: 50px;
    line-height: 50px;
  }

  /* Logged-in: each item is a full-width row, list bullets removed */
  .rg-container > li,
  .rg-container .nav-item,
  .rg-container .loginnav,
  .rg-container .dropdown {
    list-style: none;
    width: 100%;
    margin: 0;
    text-align: right;
  }

  /* "طلب الخدمة" service button — full width, readable on the dark navbar */
  .rg-container .btnService,
  .nav-item .btnService {
    display: block !important;
    width: 100%;
    margin: 0 0 4px !important;
    padding: 12px 16px !important;
    border-radius: 10px;
    text-align: center;
    font-size: 0.95rem !important;
    color: #fff !important;
    border-color: rgba(255, 255, 255, 0.65) !important;
    background-color: rgba(255, 255, 255, 0.06) !important;
  }

  .rg-container .btnService:hover,
  .rg-container .btnService:focus {
    background-color: var(--moatamad-slate-blue) !important;
    border-color: var(--moatamad-slate-blue) !important;
    color: #fff !important;
  }

  /* Notification bell — labelled, right-aligned row */
  .rg-container .notif-bell {
    display: flex !important;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    padding: 12px 4px !important;
    color: #fff !important;
  }

  .rg-container .notif-bell i {
    font-size: 1.35rem;
    color: #fff;
  }

  .rg-container .notif-bell::before {
    content: "الإشعارات";
    order: 2;
    font-size: 0.95rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
  }

  .rg-container .notif-bell .noti-icon-badge {
    order: 3;
  }

  /* Account toggle — clean row with avatar/name */
  .rg-container .nav-user {
    display: flex !important;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    width: 100%;
    padding: 12px 4px !important;
  }

  .rg-container .nav-user .account-user-name {
    color: #fff !important;
    max-width: 100%;
  }

  /* Dropdowns (account + notifications) render inline, full width */
  .moatamad-navbar .dropdown-menu,
  .moatamad-navbar .dropdown-menu.dropdown-lg {
    position: static !important;
    float: none;
    width: 100% !important;
    min-width: 0;
    transform: none !important;
    margin: 4px 0 6px !important;
    box-shadow: none;
    border: 1px solid var(--moatamad-border);
    background: rgba(255, 255, 255, 0.06);
  }

  .moatamad-navbar .dropdown-menu .dropdown-item,
  .moatamad-navbar .dropdown-menu a {
    color: rgba(255, 255, 255, 0.92) !important;
    white-space: normal;
  }

  .moatamad-navbar .dropdown-menu .dropdown-item i {
    margin-left: 8px;
  }
}

/* ============================================================
   2. Home hero (.section-two)
   ============================================================ */
@media (max-width: 991.98px) {
  .section-two {
    height: auto !important;
    min-height: 78vh;
    padding: 90px 0 60px;
    background-attachment: scroll !important;
    background-position: center center !important;
    background-size: cover !important;
  }

  .txt-negatif-m {
    margin-top: 0 !important;
  }

  .text-container {
    background: rgba(20, 31, 53, 0.5);
    border-radius: 12px;
    padding: 18px 18px 22px !important;
  }

  .section-two h1 {
    font-size: 3rem !important;
    margin-bottom: 6px;
  }

  .section-two p {
    width: 100% !important;
    font-size: 1.4rem !important;
    line-height: 1.6;
  }

  .section-two a.second-register-btn,
  .section-two button {
    width: 100% !important;
    max-width: 320px;
    height: 56px !important;
    line-height: 56px !important;
    font-size: 1.05rem;
    margin-top: 18px;
  }
}

@media (max-width: 575.98px) {
  .section-two {
    min-height: 68vh;
    padding: 80px 0 48px;
  }

  .section-two h1 {
    font-size: 2.4rem !important;
  }

  .section-two p {
    font-size: 1.15rem !important;
  }
}

/* ============================================================
   3. Home — section titles & service items
   ============================================================ */
@media (max-width: 767.98px) {
  .row.text-center > .left-bottom-border,
  .row.text-center > .only-left-border {
    padding: 22px 14px;
  }

  .mobile-border {
    border: none !important;
    border-bottom: 1px solid var(--moatamad-border-strong) !important;
  }

  .row.text-center h3 {
    font-size: 1.2rem;
    margin-top: 14px;
  }

  .row.text-center p {
    font-size: 0.95rem;
    line-height: 1.7;
  }

  .component-title {
    font-size: 1.5rem;
    padding: 0 12px;
  }

  .line-marg-t {
    margin-top: 48px !important;
  }

  .line-marg-b {
    margin-bottom: 36px !important;
  }

  .line-div {
    max-width: 56px !important;
    margin-bottom: 16px !important;
  }
}

/* ============================================================
   4. Home — promo band
   ============================================================ */
@media (max-width: 767.98px) {
  .custom-background {
    text-align: right;
    padding: 40px 22px !important;
  }

  .custom-background p {
    width: 100% !important;
    font-size: 1.05rem;
    line-height: 1.8 !important;
  }

  .custom-image {
    min-height: 220px;
  }

  .custom-image img {
    margin-top: 0 !important;
    object-fit: cover;
  }
}

/* ============================================================
   5. Blog cards (.col-violet / .inner-div) — home + tousProject
   ============================================================ */
@media (max-width: 991.98px) {
  .custom-column {
    margin-bottom: 8px;
  }

  .col-violet {
    height: auto !important;
    min-height: 170px;
    padding: 22px 18px;
  }

  .col-violet p {
    font-size: 1.1rem;
  }

  .inner-div {
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    margin-top: -36px !important;
    padding: 22px !important;
    text-align: right;
  }

  .inner-div p {
    font-size: 0.97rem;
    line-height: 1.8;
  }
}

/* ============================================================
   6. CTA band (.section-4)
   ============================================================ */
@media (max-width: 767.98px) {
  .section-4 {
    height: auto !important;
    padding: 50px 20px;
  }

  .section-4 h2 {
    font-size: 1.5rem !important;
    line-height: 1.5;
  }

  .section-4 a.second-register-btn,
  .section-4 button {
    width: 100% !important;
    max-width: 320px;
    height: 56px !important;
    line-height: 56px !important;
    font-size: 1.05rem;
  }
}

/* ============================================================
   7. Footer + newsletter + socials
   ============================================================ */
@media (max-width: 767.98px) {
  .footer {
    padding: 44px 20px !important;
    text-align: right;
  }

  .footer .col,
  .footer .col-md-4 {
    margin-bottom: 26px;
    padding: 0;
  }

  .footer-heading {
    font-size: 1.05rem;
    line-height: 1.8;
  }

  .scroll-col {
    text-align: right;
    margin-top: 8px;
  }

  #scroll-img {
    width: 46px;
    height: 46px;
  }

  .col-md-4 h5,
  .footer h5 {
    font-size: 1.1rem;
    margin-bottom: 12px;
  }

  /* Newsletter input + button stack so the button never overlaps the text */
  .contact-container {
    width: 100% !important;
  }

  .contact-container input {
    height: 54px;
    padding-right: 16px;
  }

  .contact-container button,
  .button-footer {
    position: static !important;
    width: 100% !important;
    height: 48px;
    margin-top: 10px;
  }

  .socials-container {
    width: 100% !important;
    max-width: 220px;
    justify-content: flex-start;
    gap: 18px;
  }

  .copyright-container {
    height: auto;
    padding: 16px 14px;
    text-align: center;
  }

  .copyright-container p {
    font-size: 0.85rem;
    line-height: 1.5;
  }
}

/* ============================================================
   8. About page (whoAreWe)
   ============================================================ */
@media (max-width: 991.98px) {
  .about-purple-side {
    display: none !important;
  }

  .about-text-header {
    flex: 0 0 100% !important;
    max-width: 100% !important;
    padding: 24px 18px !important;
    text-align: right;
  }

  .about-text-header h1 {
    font-size: 2.2rem !important;
    line-height: 1.3 !important;
    padding: 8px 0 !important;
  }

  .about-text-header p {
    font-size: 1.02rem !important;
    line-height: 1.9 !important;
    padding: 6px 0 !important;
  }

  .about-img {
    width: 100% !important;
    height: auto;
    display: block;
    margin: 0 auto;
  }

  .color-line {
    margin-right: 0 !important;
  }

  /* "مراحل الفحص" steps: stack vertically instead of squeezing into one row */
  .row.mb-goals > .col,
  .fx-center {
    flex: 0 0 100% !important;
    max-width: 100% !important;
    margin-bottom: 30px;
  }

  .text-content {
    width: 100% !important;
    max-width: 480px;
    line-height: 1.8 !important;
  }

  .purple-heading {
    font-size: 1.1rem !important;
  }

  .rounded-number {
    font-size: 2rem !important;
    height: 80px !important;
    width: 80px !important;
  }

  .line-of-items {
    display: none !important;
  }
}

/* ============================================================
   9. Contact page (form)
   ============================================================ */
@media (max-width: 991.98px) {
  .yellow-container {
    display: none !important;
  }

  .content-form-container {
    flex: 0 0 100% !important;
    max-width: 100% !important;
    padding: 0 6px;
  }

  .content-form-container h1 {
    font-size: 1.9rem !important;
    line-height: 1.4 !important;
  }

  .content-form-container .p-4,
  .content-form-container .p-xl-5 {
    padding: 16px !important;
  }

  .sent-msg-btn {
    width: 100% !important;
    height: 54px;
  }

  /* reCAPTCHA can overflow narrow screens — let it scale to fit */
  .g-recaptcha {
    transform: scale(0.85);
    transform-origin: top right;
  }
}

/* ============================================================
   10. FAQ page (accordion)
   ============================================================ */
@media (max-width: 767.98px) {
  .accordion {
    max-width: 100% !important;
    padding-left: 14px !important;
    padding-right: 14px !important;
  }

  .accordion h1 {
    font-size: 1.6rem;
    line-height: 1.4 !important;
    padding-top: 28px !important;
    padding-bottom: 24px !important;
  }

  .accordion-header {
    padding: 14px 6px;
  }

  .accordion-header p {
    font-size: 1rem;
    margin: 0;
    padding-left: 10px;
  }

  .accordion-content {
    padding: 8px 10px !important;
  }

  .accordion-content p {
    font-size: 0.95rem !important;
    line-height: 1.8 !important;
  }
}

/* ============================================================
   11. Blog detail (show)
   ============================================================ */
@media (max-width: 991.98px) {
  .row.right-align-col > .col {
    flex: 0 0 100%;
    max-width: 100%;
  }

  .mr-right {
    padding-right: 12px !important;
    padding-left: 12px !important;
  }

  /* The hero article image was a fixed 715px — make it fluid */
  .img-size {
    width: 100% !important;
    height: auto !important;
    max-height: 320px;
    object-fit: cover;
    border-radius: 10px;
  }

  .line-div-show {
    width: 56px !important;
  }

  .post-container {
    width: 100% !important;
    height: auto !important;
    margin: 0 0 16px !important;
  }

  .post-container .date-text {
    margin-right: 0 !important;
  }

  .post-container h3 {
    font-size: 1.15rem;
    line-height: 1.5;
  }
}

/* ============================================================
   12. Real-estate market & property details (polish)
   ============================================================ */
@media (max-width: 767.98px) {
  .re-section,
  .rd-wrap {
    padding-left: 16px;
    padding-right: 16px;
  }

  .re-section__head {
    flex-direction: column;
    align-items: flex-start;
  }

  .re-aisearch {
    flex-wrap: wrap;
    border-radius: 16px;
  }

  .re-aisearch input {
    flex: 1 1 100%;
    text-align: right;
  }

  .re-aisearch button {
    flex: 1 1 auto;
  }

  .rd-lightbox {
    padding: 14px;
  }

  .rd-lightbox__nav.prev { right: 10px; }
  .rd-lightbox__nav.next { left: 10px; }
  .rd-lightbox__close { top: 12px; left: 12px; }
}

/* ============================================================
   13. Forms & tap targets — comfort on phones
   ============================================================ */
@media (max-width: 767.98px) {
  /* 16px inputs prevent iOS Safari auto-zoom on focus */
  input,
  select,
  textarea,
  .form-control {
    font-size: 16px !important;
  }

  .form-control {
    height: auto;
    min-height: 48px;
    padding: 12px 14px;
  }

  textarea.form-control {
    min-height: 120px;
  }

  .btn,
  button {
    min-height: 44px;
  }

  .alert {
    font-size: 0.95rem;
  }
}
