/* Mobile header & hero overrides — loaded after main.min.css */

.header .logo {
  gap: 8px;
  white-space: nowrap;
  flex-wrap: nowrap;
  font-size: clamp(16px, 4.5vw, 32px) !important;
}

.header .logo-text {
  white-space: nowrap;
  line-height: 1.2;
}

.header .main-nav {
  font-size: inherit;
}

.landing-hero-title {
  white-space: nowrap;
  font-size: clamp(1.15rem, 4.8vw, 2.25rem);
  line-height: 1.2;
}

.landing-video-poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

.landing-video-trigger {
  z-index: 2;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;
}

.landing-video.is-loaded .landing-video-iframe,
.landing-video.is-loaded .landing-video-player,
.landing-video.is-loaded .landing-video-player iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

@media (max-width: 767px) {
  .landing-video {
    min-height: 200px;
  }

  .landing-video-play-icon {
    font-size: 64px !important;
  }
}

/* pricing — السعر جنب العملة */
#section21.pricing .box .amount {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 0.25em;
  direction: rtl;
}

#section21.pricing .box .amount .sar-symbol {
  width: 0.65em;
  height: 0.72em;
  margin: 0 !important;
  flex-shrink: 0;
}

#section21.pricing .box .amount .amount-value {
  line-height: 1;
}

/* popular plan ribbon */
#section21.pricing .box.popular .label {
  top: 0;
  right: 0;
  width: 26px;
  padding: 5px 4px 12px;
  font-size: clamp(10px, 2.6vw, 12px);
  line-height: 1.1;
}

#section21.pricing .box.popular .label::before {
  border-width: 8px;
}

#section21.pricing .box.popular .title,
#section21.pricing .box.popular .price {
  padding-inline-end: 2rem;
}

@media (max-width: 768px) {
  #section21.pricing .box.popular .label {
    writing-mode: horizontal-tb;
    width: auto;
    max-width: calc(100% - 16px);
    padding: 5px 10px;
    font-size: 11px;
    border-radius: 0 0 0 6px;
  }

  #section21.pricing .box.popular .label::before {
    display: none;
  }

  #section21.pricing .box.popular .title,
  #section21.pricing .box.popular .price {
    padding-inline-end: 0;
    padding-top: 2rem;
  }
}

/* section14 slick — مسافات بين الكروت + ارتفاع موحّد */
#section14 .slick-list {
  overflow: hidden;
}

#section14 .slick-track {
  display: flex !important;
  align-items: stretch;
}

#section14 .slick-card.slick-slide {
  box-sizing: border-box;
  height: auto !important;
  padding-inline: 16px;
  background: transparent !important;
  box-shadow: none !important;
}

#section14 .slick-card .box {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-width: 0;
}

#section14 .slick-card .box > img {
  width: 100%;
  height: 220px;
  object-fit: contain;
  flex-shrink: 0;
}

#section14 .slick-card .box > .content {
  flex: 1;
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch;
  min-width: 0;
  width: 100%;
  padding: clamp(12px, 3vw, 20px);
  box-sizing: border-box;
}

#section14 .slick-card .box > .content h3 {
  display: block;
  width: 100%;
  margin: 0;
  font-size: clamp(15px, 4vw, 20px);
  font-weight: 700;
  line-height: 1.4;
  overflow-wrap: break-word;
  word-break: normal;
}

#section14 .slick-card .box > .content p {
  display: block;
  width: 100%;
  margin: clamp(8px, 2vw, 12px) 0 0;
  font-size: clamp(13px, 3.2vw, 16px);
  line-height: 1.6;
  color: #777;
  overflow-wrap: break-word;
  word-break: normal;
}

#section14 .slick-card .box > .info {
  flex-shrink: 0;
  width: 100%;
  padding: clamp(12px, 3vw, 20px);
  box-sizing: border-box;
}

#section14 .slick-card .box > .info a {
  font-size: clamp(13px, 3.2vw, 16px);
}

@media (max-width: 768px) {
  .container {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }

  .header .container {
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding-bottom: 6px;
    padding-left: 4px !important;
    padding-right: 4px !important;
  }

  .landing .max-w-\[85rem\],
  #sticky-div .max-w-\[75rem\],
  section > .px-4.mx-auto,
  section > div.mx-auto.px-4 {
    padding-left: 10px !important;
    padding-right: 10px !important;
  }

  /* aboutus — احمد صابر */
  .aboutus {
    overflow-x: hidden;
  }

  .aboutus .main-title,
  .aboutus > .main-title {
    width: auto;
    max-width: calc(100% - 24px);
    margin-inline: auto;
    padding: 8px 16px;
    font-size: clamp(18px, 5vw, 22px);
  }

  .main-title::before,
  .main-title::after {
    width: 10px;
    height: 10px;
  }

  .main-title::before {
    left: -6px;
  }

  .main-title::after {
    right: -6px;
  }

  .aboutus .container {
    flex-direction: column-reverse;
    gap: 24px;
    padding-inline: 12px !important;
  }

  .aboutus .info {
    width: 100%;
    min-width: 0;
    flex: none;
    padding-inline: 4px;
    box-sizing: border-box;
  }

  .aboutus .title {
    margin-top: 0;
    font-size: clamp(20px, 5.5vw, 28px);
    line-height: 1.4;
    padding-inline: 4px;
  }

  .aboutus .description {
    font-size: clamp(15px, 4vw, 18px);
    line-height: 1.75;
    padding-inline: 2px;
    overflow-wrap: break-word;
    word-break: normal;
  }

  .aboutus img {
    width: min(280px, 78vw) !important;
    height: min(280px, 78vw) !important;
    max-width: 100%;
    object-fit: cover;
    margin-inline: auto;
  }

  .aboutus .subscribe form {
    width: 100%;
    max-width: 100%;
    margin-inline: auto;
    box-sizing: border-box;
  }

  #section14 .slick-card.slick-slide {
    padding-inline: 20px;
  }

  #section14 .slick-card .box > img {
    height: clamp(140px, 38vw, 200px);
  }

  #section14 .slick-card .box > .content h3 {
    font-size: clamp(14px, 4.2vw, 18px);
  }

  #section14 .slick-card .box > .content p {
    font-size: clamp(12px, 3.5vw, 15px);
    line-height: 1.65;
  }

  .header .logo {
    width: 100%;
    height: auto;
    min-height: 48px;
    font-size: clamp(16px, 4.5vw, 24px) !important;
    justify-content: center;
    white-space: nowrap !important;
    flex-wrap: nowrap !important;
  }

  .header .logo-text {
    white-space: nowrap !important;
    flex-shrink: 1;
    min-width: 0;
  }

  .header .logo img,
  .header .logo .logo-img {
    width: clamp(38px, 10vw, 48px) !important;
    height: clamp(38px, 10vw, 48px) !important;
    flex-shrink: 0;
  }

  .header .main-nav {
    width: 100%;
    margin: 0 !important;
    display: flex !important;
    flex-wrap: nowrap;
    justify-content: center;
    align-items: center;
    column-gap: clamp(16px, 4.5vw, 28px);
    row-gap: 0;
    overflow: visible;
    font-size: inherit !important;
  }

  .header .main-nav > li {
    flex: 0 1 auto;
    min-width: 0;
  }

  /* 44px = الحد الموصى بيه لمساحة اللمس (WCAG 2.5.5 / Apple HIG) */
  .header .main-nav > li > a {
    padding: 6px 4px !important;
    font-size: clamp(12px, 3vw, 13px) !important;
    height: auto !important;
    min-height: 44px;
    display: flex !important;
    align-items: center;
    white-space: nowrap !important;
    text-align: center;
    justify-content: center;
    line-height: 1.25;
    word-break: keep-all;
  }
}

@media (max-width: 360px) {
  .header .main-nav {
    column-gap: 12px;
  }

  .header .main-nav > li > a {
    font-size: 12px !important;
  }

  .header .logo {
    font-size: 14px !important;
  }
}

/* ============================================================
   تحسينات التجاوب وأحجام العناصر
   الملف ده بيتحمّل بعد main.min.css فبيغلب عليه.
   مفيش Tailwind build في المشروع، فأي تعديل لازم يبقى CSS عادي هنا.
   ============================================================ */

/* ------------------------------------------------------------
   1) لينكات النافيجيشن كانت بتوقّع العناوين تحت البانر الثابت.
   main.css فيه scroll-behavior: smooth بس مفيش scroll-padding،
   و #sticky-div عنده position: fixed وبيروح top:0 بعد أول 100px.
   ------------------------------------------------------------ */
html {
  scroll-padding-top: 150px;
}

@media (min-width: 1024px) {
  html {
    scroll-padding-top: 110px;
  }
}

/* ------------------------------------------------------------
   2) الجريد كان عنده أرضية صلبة 300px، فبيطفح على الشاشات
   الأضيق من ~330px والطفح كان مستخبي وراء overflow-x: hidden.
   min(300px, 100%) بتسمح للتراك ينزل تحت 300px وقت الحاجة.
   ------------------------------------------------------------ */
:is(.gallery, .features, .testimonials, .team-member, .services, .pricing)
  .container,
.footer .container {
  grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr));
  gap: clamp(20px, 5vw, 40px);
}

.stats .container {
  grid-template-columns: repeat(auto-fill, minmax(min(250px, 100%), 1fr));
  gap: clamp(20px, 5vw, 40px);
}

/* ملحوظة: مش محتاجين نفرض عمود واحد على الموبايل. auto-fill مع
   minmax(min(300px,100%),1fr) بيعمل كده لوحده، وفرضه كان بيخلّي
   الأسعار عمود واحد بعرض 726px على 768px بينما باقي السكاشن عمودين. */

/* ------------------------------------------------------------
   5) البانر الثابت كان بيتداخل مع الـnotch / Dynamic Island.
   محتاج كمان viewport-fit=cover في ميتا الـviewport.
   ------------------------------------------------------------ */
#sticky-div {
  padding-top: env(safe-area-inset-top, 0px);
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
}

/* الفوتر عنده !pb-0 في الماركب فمينفعش نزوّد padding-bottom عليه،
   بنحط مساحة الـhome indicator على الـcopyright بدالها. */
.footer .copyright {
  padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
}

/* ------------------------------------------------------------
   7) .scroll-transition في main.css بيعمل transition لـ bottom
   بينما الجافاسكريبت بيغيّر top، فالانتقال كان كود ميت.
   ------------------------------------------------------------ */
.scroll-transition {
  transition: top 0.3s ease;
}

/* ------------------------------------------------------------
   صمام أمان للنافبار: لو العناصر مش لاقية مكانها تتزحلق أفقياً
   بدل ما تتقص وراء overflow-x: hidden بتاعة الـbody.
   ------------------------------------------------------------ */
@media (max-width: 768px) {
  .header .main-nav {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    scroll-snap-type: x proximity;
  }

  .header .main-nav::-webkit-scrollbar {
    display: none;
  }
}

/* ------------------------------------------------------------
   أحجام أكثر تناسباً على الموبايل: العناوين والأزرار والحشو
   ------------------------------------------------------------ */
@media (max-width: 768px) {
  /* أزرار الأسعار: مساحة لمس مريحة + نص ميتقصّش.
     main.css حاططها display:block و width:fit-content، والـmax-width
     دي ضمان إن النص الطويل ميطلعش بره الكارت. */
  .pricing .box a {
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: calc(100% - 24px);
    text-align: center;
    padding: 14px 18px;
    margin: 24px auto 28px;
    font-size: clamp(13px, 3.6vw, 16px);
    line-height: 1.4;
    overflow-wrap: break-word;
  }

  .pricing .box .amount {
    font-size: clamp(32px, 11vw, 48px);
  }

  .pricing .box .title {
    font-size: clamp(20px, 5.5vw, 25px);
    margin: 24px 16px;
  }

  .pricing .box ul li {
    font-size: clamp(13px, 3.5vw, 15px);
    line-height: 1.7;
  }

  /* عنوان البانر الثابت + العداد */
  #sticky-div .time .unit {
    min-width: clamp(48px, 16vw, 60px);
  }
}

/* لينكات القائمة المنسدلة كانت 43px، بفرق 1px عن الحد الموصى بيه */
.header .mega-menu .links li a {
  min-height: 44px;
  display: flex;
  align-items: center;
}

/* ------------------------------------------------------------
   6) احترام prefers-reduced-motion.
   الصفحة فيها smooth scroll وكاروسيل أوتوبلاي وأنيميشنز
   على العناوين، ومكانش فيها أي مراعاة للإعداد ده.
   ------------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
