/* Arabic layout and section-specific presentation. */
html[dir="rtl"] body {
  direction: rtl;
  font-family: Cairo, var(--sans);
}

html[dir="rtl"] h1,
html[dir="rtl"] h2,
html[dir="rtl"] h3 {
  font-family: Cairo, var(--sans);
  letter-spacing: 0;
  text-transform: none;
}

html[dir="rtl"] .hero h1 {
  max-width: 760px;
  font-size: clamp(50px, 5vw, 78px);
  line-height: 1.2;
}

html[dir="rtl"] ::selection {
  background: var(--burgundy);
  color: var(--light);
}

html[dir="rtl"] .site-header {
  direction: rtl;
  background: linear-gradient(180deg, rgba(8, 28, 44, .22), transparent);
}

html[dir="rtl"] .site-header.scrolled {
  box-shadow: 0 10px 28px rgba(0, 0, 0, .18);
}

html[dir="rtl"] .brand,
html[dir="rtl"] .footer-brand {
  direction: ltr;
}

html[dir="rtl"] .site-header nav {
  margin-right: auto;
  margin-left: 0;
  letter-spacing: 0;
}

html[dir="rtl"] .header-cta,
html[dir="rtl"] .btn,
html[dir="rtl"] .eyebrow,
html[dir="rtl"] .section-label {
  letter-spacing: 0;
}

html[dir="rtl"] .header-cta span {
  margin-right: 7px;
  margin-left: 0;
}

html[dir="rtl"] .hero-copy,
html[dir="rtl"] .product-info,
html[dir="rtl"] .intro-content,
html[dir="rtl"] .about-copy,
html[dir="rtl"] .contact,
html[dir="rtl"] .stores-copy {
  text-align: right;
}

html[dir="rtl"] .hero-object {
  left: 7%;
  right: auto;
}

html[dir="rtl"] .hero:after {
  left: -29vw;
  right: auto;
}

html[dir="rtl"] .hero {
  background: radial-gradient(circle at 23% 46%, rgba(35, 72, 97, .25), transparent 32%), var(--deep);
}

html[dir="rtl"] .technical-grid {
  mask-image: linear-gradient(270deg, #000 0%, transparent 62%);
}

html[dir="rtl"] .m-one {
  left: 7%;
  right: auto;
}

html[dir="rtl"] .m-two {
  left: 4%;
  right: auto;
}

html[dir="rtl"] .scroll-mark {
  right: clamp(24px, 5vw, 76px);
  left: auto;
}

html[dir="rtl"] .eyebrow i {
  margin: 0 0 2px 9px;
}

html[dir="rtl"] .intro {
  grid-template-columns: 20% 53% 27%;
}

html[dir="rtl"] .section-index span {
  margin-left: 13px;
  margin-right: 0;
}

.about-paragraphs {
  max-width: 590px;
  margin-top: 35px;
}

html[dir="rtl"] .intro-content .about-paragraphs p {
  max-width: none;
  margin: 0 0 18px;
  font-size: 14px;
  line-height: 2;
}

html[dir="rtl"] .product-info .text-link {
  right: clamp(26px, 4vw, 65px);
  left: auto;
  letter-spacing: 0;
}

.btn {
  transition: transform .3s, background-color .3s, border-color .3s, box-shadow .3s;
}

.btn.primary:hover {
  background: #842936;
  border-color: #842936;
  box-shadow: 0 12px 20px rgba(75, 20, 29, .22);
}

.btn.outline:hover {
  background: rgba(232, 220, 200, .1);
}

.product-slider {
  box-shadow: 0 18px 45px rgba(0, 0, 0, .1);
}

.product-info::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 68px;
  height: 3px;
  background: var(--burgundy);
}

.product-art.art-partners {
  background: #25475b;
}

.product-art.art-partners .pump-body {
  transform: rotate(15deg) scale(.92);
}

.partners .about-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
}

/* Product-category cards retain their original destinations and imagery. */
.categories .category-grid {
  width: min(100%, 1200px);
  margin-inline: auto;
}

.categories .category {
  text-align: center;
}

.categories .category span,
.categories .category i {
  align-self: center;
}

.categories .category.cat-large {
  background: linear-gradient(rgba(8, 28, 44, .38), rgba(8, 28, 44, .72)), url('assets/categouries images/bronz.jpeg') center / cover;
}

.categories .category.cat-pvc {
  background: linear-gradient(rgba(8, 28, 44, .28), rgba(8, 28, 44, .68)), url('assets/categouries images/Plastiqe.jpeg') center / cover;
}

.categories .category.cat-tall {
  background: linear-gradient(rgba(8, 28, 44, .36), rgba(8, 28, 44, .74)), url('assets/categouries images/pieces noir.avif') center / cover;
}

.categories .category.cat-gaz {
  background: #f7f4ed url('assets/categouries images/energical.jpg') center / contain no-repeat;
  color: var(--navy);
}

.categories .category.cat-large::before,
.categories .category.cat-tall::before,
.categories .category.cat-wide::before {
  background: none;
}

.categories .category.cat-wide {
  background: linear-gradient(rgba(8, 28, 44, .30), rgba(8, 28, 44, .66)), url('assets/categouries images/plomberie.jpg') center / cover;
}

.categories .category.cat-gaz b {
  position: absolute;
  z-index: 2;
  right: 0;
  bottom: 16px;
  left: 0;
}

.categories .category.cat-gaz i {
  position: absolute;
  right: 18px;
  bottom: 16px;
  align-self: auto;
}

/* Dedicated category pages. These rules are intentionally independent from
   the homepage RTL rules so they also work on the existing category pages. */
.category-page {
  min-height: 100vh;
  padding: 180px 24px 100px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  background: var(--deep);
  color: var(--beige);
  text-align: center;
}

.category-page h1 {
  margin: 0;
  font: 700 clamp(64px, 12vw, 160px) / .85 var(--display);
  letter-spacing: -.08em;
}

.category-page > p {
  max-width: 520px;
  margin: 0;
  line-height: 1.8;
}

.category-page .eyebrow {
  margin-bottom: 0;
}

.category-page .button-row {
  justify-content: center;
}

.category-products-title {
  margin: 8px 0 -4px;
  color: var(--beige);
  font: 700 clamp(26px, 3vw, 38px) / 1 var(--display);
  letter-spacing: -.05em;
  text-transform: uppercase;
}

.subcategory-list {
  width: min(100%, 760px);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  gap: 10px;
  margin: 10px auto 4px;
}

.subcategory-card {
  min-height: 96px;
  display: grid;
  place-items: center;
  padding: 16px;
  border: 1px solid rgba(232, 220, 200, .32);
  background: rgba(232, 220, 200, .08);
  color: var(--beige);
  font: 700 18px / 1 var(--display);
  letter-spacing: -.03em;
  text-transform: uppercase;
  transition: border-color .25s, background-color .25s, transform .25s;
}

.subcategory-card span {
  color: #d9b47e;
  font: 700 9px var(--sans);
  letter-spacing: 1.2px;
}

.subcategory-card small {
  font: 500 9px var(--sans);
  letter-spacing: .8px;
  text-transform: uppercase;
}

.subcategory-card:hover {
  border-color: var(--burgundy);
  background: var(--burgundy);
  transform: translateY(-3px);
}

.product-detail-grid {
  width: min(100%, 1120px);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.product-detail-grid-single {
  grid-template-columns: 1fr;
  max-width: 365px;
}

.product-detail-card {
  overflow: hidden;
  background: #f8f3ea;
  color: var(--navy);
  text-align: right;
  box-shadow: 0 14px 30px rgba(0, 0, 0, .16);
  transition: transform .3s, box-shadow .3s;
}

.product-detail-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 38px rgba(0, 0, 0, .24);
}

.product-detail-card figure {
  position: relative;
  height: 300px;
  margin: 0;
  overflow: hidden;
  background: #e8dcc8;
}

.product-detail-card img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  transition: transform .45s ease;
  mix-blend-mode: multiply; /* يذيب الخلفية البيضاء للصور داخل خلفية البطاقة */
}

.product-detail-card:hover img {
  transform: scale(1.06);
}

.product-detail-card img.image-center {
  object-position: center;
}

.product-detail-card img.image-bottom {
  object-position: center bottom;
}

/* بطاقة تعريفية تظهر عند تمرير الفأرة فوق المنتج */
.product-info-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 8px;
  padding: 16px 18px;
  background: linear-gradient(to top, rgba(8, 28, 44, .95) 0%, rgba(8, 28, 44, .78) 55%, rgba(8, 28, 44, .12) 100%);
  color: var(--beige);
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .3s ease, transform .3s ease;
  pointer-events: none;
}

.product-detail-card:hover .product-info-overlay,
.product-detail-card:focus-within .product-info-overlay {
  opacity: 1;
  transform: translateY(0);
}

.product-info-overlay h4 {
  margin: 0;
  font: 700 15px Cairo, var(--sans);
  color: #fff;
}

.product-info-overlay p {
  margin: 0;
  font-size: 11.5px;
  line-height: 1.8;
  opacity: .92;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-info-overlay .overlay-cta {
  color: #e8b4bd;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1px;
}

/* منتج غير متوفر (من لوحة الإدارة): شارة + تخفيت البطاقة */
.unavailable-badge {
  position: absolute;
  top: 10px;
  inset-inline-start: 10px;
  z-index: 3;
  background: #c0392b;
  color: #fff;
  font: 800 10.5px Cairo, var(--sans);
  letter-spacing: .5px;
  padding: 5px 10px;
  border-radius: 999px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, .25);
}

.product-detail-card.product-unavailable img {
  filter: grayscale(1);
  opacity: .45;
}

.product-detail-card.product-unavailable:hover img {
  transform: none;
}

/* صور المنتجات داخل القاعدة: تُعرض كاملة دون اقتصاص ودون خلفية بيضاء */
.product-detail-card img.img-contain {
  object-fit: contain;
  padding: 0;
  background: transparent;
}

.why {
  background: var(--deep);
  color: var(--beige);
}

.section-heading {
  display: grid;
  grid-template-columns: 28% 72%;
  margin-bottom: 58px;
}

.section-heading h2 {
  font-size: clamp(52px, 7vw, 110px);
}

.why-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  border-top: 1px solid var(--line);
}

.why-card {
  min-height: 285px;
  padding: 28px 22px;
  border-left: 1px solid var(--line);
  background: rgba(232, 220, 200, .035);
  transition: background .3s, transform .3s;
}

.why-card:first-child {
  border-right: 1px solid var(--line);
}

.why-card:hover {
  background: var(--burgundy);
  transform: translateY(-6px);
  box-shadow: 0 14px 28px rgba(0, 0, 0, .16);
}

.why-card span {
  color: #c56c78;
  font-size: 11px;
}

.why-card h3 {
  margin: 54px 0 16px;
  font: 700 24px/1.15 Cairo, var(--sans);
}

.why-card p {
  margin: 0;
  color: rgba(232, 220, 200, .8);
  font-size: 13px;
  line-height: 1.85;
}

.stores {
  display: grid;
  grid-template-columns: 28% 44% 28%;
  align-items: end;
  gap: 18px;
}

.stores .eyebrow {
  align-self: start;
}

.stores h2 {
  font-size: clamp(55px, 7vw, 110px);
}

.stores-copy {
  display: grid;
  gap: 24px;
  font-size: 14px;
  line-height: 1.9;
}

.stores-copy p {
  margin: 0;
}

.stores-copy .btn {
  justify-self: start;
}

html[dir="rtl"] .contact h2 {
  font-size: clamp(48px, 5.5vw, 86px);
  line-height: 1.08;
  letter-spacing: 0;
}

html[dir="rtl"] .contact-details span,
html[dir="rtl"] .form-grid label {
  letter-spacing: 0;
}

html[dir="rtl"] .final-cta {
  grid-template-columns: 24% 50% 26%;
}

html[dir="rtl"] .final-cta h2 {
  letter-spacing: 0;
  line-height: 1.1;
}

html[dir="rtl"] footer {
  direction: ltr;
}

html[dir="rtl"] footer > div:not(.footer-brand) {
  direction: rtl;
  text-align: right;
}

html[dir="rtl"] footer b {
  letter-spacing: 0;
}

@media (min-width: 901px) {
  html[dir="rtl"] .site-header {
    direction: ltr;
  }

  html[dir="rtl"] .site-header .brand {
    order: 1;
    margin-left: 0;
  }

  html[dir="rtl"] .site-header .header-cta {
    order: 2;
    margin-left: auto;
    direction: rtl;
  }

  html[dir="rtl"] .site-header nav {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    margin: 0;
    direction: rtl;
  }
}

@media (max-width: 1000px) {
  .product-detail-grid {
    grid-template-columns: repeat(2, 1fr);
  }

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

  .why-card:nth-child(4) {
    border-right: 1px solid var(--line);
  }

  .stores {
    grid-template-columns: 1fr 1fr;
  }

  .stores-copy {
    grid-column: 2;
  }
}

@media (max-width: 900px) {
  .category-page {
    padding-top: 125px;
    padding-bottom: 70px;
  }

  .category-page h1 {
    font-size: clamp(56px, 18vw, 92px);
  }

  .product-detail-grid,
  .product-detail-grid-single {
    grid-template-columns: 1fr;
    max-width: 440px;
  }

  html[dir="rtl"] .site-header nav {
    right: 0;
    left: auto;
  }

  html[dir="rtl"] .menu-toggle {
    margin-right: auto;
    margin-left: 0;
  }

  html[dir="rtl"] .hero-object {
    left: -44px;
    right: auto;
  }

  html[dir="rtl"] .intro {
    grid-template-columns: 1fr;
  }

  .about-paragraphs {
    margin-top: 28px;
  }

  .section-heading {
    display: block;
  }

  .section-heading .section-label {
    margin-bottom: 34px;
  }

  .why-grid {
    grid-template-columns: 1fr;
  }

  .why-card,
  .why-card:first-child,
  .why-card:nth-child(4) {
    min-height: auto;
    border-right: 1px solid var(--line);
    border-left: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
  }

  .why-card h3 {
    margin-top: 28px;
  }

  .stores {
    display: block;
  }

  .stores h2 {
    margin: 34px 0;
  }

  .stores-copy {
    max-width: 340px;
  }

  html[dir="rtl"] .product-info .text-link {
    right: 22px;
    left: auto;
  }

  html[dir="rtl"] .final-cta {
    display: block;
  }
}

/* Latin copy inside the RTL flow: keep punctuation at the correct end of the
   line without changing alignment (Arabic strings still resolve RTL). */
[data-i18n],
[data-i18n-html],
.form-success {
  unicode-bidi: plaintext;
}

/* Category slider: tabs appear first, then one horizontal slide of products
   per selected category. Track direction is flipped for RTL pages in JS. */
.category-slider {
  width: min(100%, 1120px);
  margin: 4px auto 0;
  text-align: right;
}

.category-tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: 0 0 22px;
}

.category-tab {
  min-width: 170px;
  display: grid;
  gap: 7px;
  justify-items: center;
  padding: 15px 18px;
  border: 1px solid rgba(232, 220, 200, .32);
  background: rgba(232, 220, 200, .08);
  color: var(--beige);
  cursor: pointer;
  font: 700 16px / 1 var(--display);
  letter-spacing: -.03em;
  text-transform: uppercase;
  transition: border-color .25s, background-color .25s, color .25s, transform .25s;
}

.category-tab small {
  font: 500 11px Cairo, var(--sans);
  letter-spacing: 0;
  text-transform: none;
  opacity: .78;
}

.category-tab:hover {
  border-color: var(--burgundy);
  transform: translateY(-3px);
}

.category-tab.active {
  background: var(--burgundy);
  border-color: var(--burgundy);
  color: var(--light);
}

.category-slider-viewport {
  overflow: hidden;
  border-top: 1px solid rgba(232, 220, 200, .22);
  border-bottom: 1px solid rgba(232, 220, 200, .22);
  transition: height .45s ease;
}

.category-slider-track {
  display: flex;
  transition: transform .55s cubic-bezier(.22, .61, .36, 1);
}

.category-slide {
  min-width: 100%;
  align-self: flex-start; /* كل شريحة بارتفاعها الطبيعي — لا تتمدد لأطول شريحة */
  padding: 26px 0 8px;
}

.category-slider-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 18px;
}

.category-slider-nav {
  display: flex;
  gap: 8px;
}

.category-slider-nav button {
  width: 45px;
  height: 45px;
  border: 1px solid rgba(232, 220, 200, .5);
  background: transparent;
  color: var(--beige);
  font-size: 20px;
  transition: .25s;
}

.category-slider-nav button:hover {
  background: var(--burgundy);
  border-color: var(--burgundy);
}

.category-slider-status {
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: #c56c78;
}

.category-empty {
  width: min(100%, 1120px);
  padding: 34px 28px;
  border: 1px dashed rgba(232, 220, 200, .35);
  background: rgba(232, 220, 200, .05);
  text-align: right;
}

.category-empty p {
  margin: 0 0 6px;
  font-size: 14px;
  line-height: 1.9;
  color: rgba(232, 220, 200, .9);
}

.category-empty p:last-child {
  margin: 0;
  font-size: 12px;
  color: rgba(232, 220, 200, .65);
}

@media (max-width: 900px) {
  .category-tabs {
    gap: 8px;
  }

  .category-tab {
    flex: 1 1 44%;
    min-width: 0;
    padding: 12px 10px;
    font-size: 14px;
  }

  .category-tab small {
    font-size: 10px;
  }

  .category-slider-footer {
    margin-top: 14px;
  }
}



/* ===== تحسينات الاستجابة — نسخة RTL (هذا الملف يُحمّل أخيرًا فتسود قواعده) ===== */
@media (max-width:1120px){
  html[dir="rtl"] .hero-object{left:2%;right:auto}
}
@media (max-width:900px){
  html[dir="rtl"] .hero-object{left:-24px;right:auto}
}

/* ===== قسم شركاؤنا: بانر ثابت بعرض الموقع كاملًا، ملصوق بقسم «تواصل معنا» ===== */
.partners{grid-template-columns:1fr;gap:38px;padding-bottom:0}
.partners-banner{
  order:2;
  width:calc(100% + 2 * clamp(24px,9vw,150px));
  margin-inline:calc(-1 * clamp(24px,9vw,150px));
  border-inline:0;
}
.partners + .contact{padding-top:clamp(28px,4vw,54px)}
@media (max-width:900px){
  .partners-banner{
    width:calc(100% + 40px);
    margin-inline:-20px;
  }
}

/* ===== صورة الهيرو (RTL) ===== */
.hero-photo{left:7%;right:auto}
@media (max-width:900px){
  .hero-photo{left:-22px;right:auto;top:auto;bottom:-38px;width:300px}
}
