/* =========================================================
   Property Detail Page Styles
   File: themes/custom/awqaf/css/property-detail.css
   ========================================================= */

/* ----------------- GLOBAL PAGE WRAPPER ----------------- */
.property-detail {
  padding: 48px 28px;
  font-family: 'Cairo', sans-serif; /* matches Arabic style */
  direction: rtl;
  color: #445A5F;
  background: #fcfcfc;
}

.property-detail-page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

@media (max-width: 768px) {
  .property-detail-page {
    padding: 1rem;
  }
}

/* =========================================================
   TOP ROW LAYOUT (CAROUSEL LEFT + DETAILS RIGHT)
   ========================================================= */
.property-top-row {
  display: flex;
  flex-direction: row-reverse; /* RTL: details on right, carousel on left */
  justify-content: space-between;
  align-items: flex-start;
  gap: 2rem;
  margin-bottom: 2rem;
}



.property-header {
  flex: 1 1 50%;
  text-align: right;
}

/* ----------------- TEXT CONTENT ----------------- */
.property-status {
  display: inline-block;
  background: #19a34a;
  color: #fff;
  padding: 6px 12px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.85rem;
  font-family: 'Cairo', sans-serif; /* matches Arabic style */
}

.property-title {
  font-size: 1.8rem;
  font-weight: 700;
  margin: 0.3rem 0;
  font-family: 'Cairo', sans-serif; /* matches Arabic style */
}

.property-description {
  max-width: 550px;
  line-height: 1.6;
  margin: 0.4rem 0;
  font-size: 1rem;
  color: #445A5F;
  font-family: 'Cairo', sans-serif; /* matches Arabic style */
}

.application-deadline {
  margin-bottom: 1.8rem;
  font-weight: 300;
  color: #445A5F;
  font-family: 'Cairo', sans-serif; /* matches Arabic style */
}

/* =========================================================
   IMAGE SLIDER + ARROWS
   ========================================================= */
.property-carousel {
  flex: 1 1 50%;
  max-width: 600px;
  position: relative; /* for arrows positioning */
  overflow: hidden;   /* ✅ hides non-active slides */
}

/* Slides */
.carousel-slide {
  display: none;      /* ✅ hide all slides first */
  width: 100%;
}

.carousel-slide.active {
  display: block;     /* ✅ only active slide shows */
}

.carousel-slide img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

/* ARROWS */
.property-arrows {
  position: absolute;
  top: 50%;                        /* ✅ vertical center */
  left: 0;
  width: 100%;
  display: flex;
  justify-content: space-between;  /* ✅ one arrow left, one right */
  transform: translateY(-50%);
  padding: 0 10px;
  pointer-events: none; /* ✅ avoids blocking clicks except buttons */
}

.property-arrows .arrow {
  background: #e6e6e6;
  border: none;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
  pointer-events: all; /* ✅ clickable */
}

.property-arrows .arrow svg {
  width: 24px;
  height: 24px;
  stroke: #2c3e50;
}

.property-arrows .arrow:hover {
  background: #ccc;
}

/* ----------------- DOCUMENTS ----------------- */
.property-documents h3 {
  margin-bottom: 0.5rem;
  color: #445A5F;
  font-family: 'Cairo', sans-serif; /* matches Arabic style */
}

.property-documents ul,
.doc-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.doc-row {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1rem;
  padding: 0.6rem 0;
  text-decoration: none;
}

.pdf-icon {
  width: 35px;
  height: 35px;
  background-color: #445A5F;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.pdf-icon img {
  width: 18px;
  height: 18px;
  filter: brightness(0) invert(1);
}

.doc-title {
  font-size: 1rem;
  font-weight: 500;
  color: #445A5F;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: 'Cairo', sans-serif; /* matches Arabic style */
}

.download-icon {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  transition: background-color 0.3s;
  background-color: #f5f7f8;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' stroke='%23163a64' fill='none' viewBox='0 0 24 24'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M12 4v12m0 0l-5-5m5 5l5-5M4 20h16'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 22px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.08);
  cursor: pointer;
  justify-self: end;
  align-self: center;
}

.download-icon:hover {
  background-color: #e6ecef;
}

/* ----------------- MAP & CONTACT FORM ----------------- */
.map-form-wrapper {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  align-items: stretch;
  direction: rtl;
  flex-direction: row-reverse;
  max-width: 1150px;
  margin: 0 auto;
  padding: 1rem;
}

.map-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: #445A5F;
  font-family: 'Cairo', sans-serif; /* matches Arabic style */
}
.property-map-container,
.property-contact-form {
  flex: 1 1 48%; /* ✅ allows shrink */
  background: #f9f9f9;
  border-radius: 12px;
  padding: 1.8rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
  display: flex;
  flex-direction: column;
  min-width: 280px; /* ✅ avoids collapsing */
}

#property-map {
  flex: 1;
  width: 100%;
  min-height: 400px;
  border-radius: 10px;
  overflow: hidden;
  font-family: 'Cairo', sans-serif; /* matches Arabic style */
}

/* ----------------- CONTACT FORM ----------------- */
.contact-form {
  display: flex;
  flex-direction: column;
  flex: 1;
}
.contact-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 2rem;
  color: #445A5F;
  font-family: 'Cairo', sans-serif; /* matches Arabic style */
}

.contact-form field-label {
  font-weight: 200;
  font-size: 1rem;
  color: #445A5F;
  font-family: 'Cairo', sans-serif; /* matches Arabic style */
}
.contact-form label {
  margin-bottom: 1rem;
}

.contact-form input,
.contact-form textarea {
  background: #fff;
  padding: 0.85rem;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 1rem;
  width: 100%;
  font-family: 'Cairo', sans-serif; /* matches Arabic style */
}

.contact-form textarea {
  flex: 1;
}

.contact-submit {
  margin-top: auto;
  background: #0f2f2f;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 1rem;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.3s;
}
.contact-submit:hover {
  background: #1b4b4b;
}

/* ----------------- RESPONSIVE ----------------- */
@media (max-width: 991px) {
  .map-form-wrapper {
    flex-direction: column;
  }
  .property-map-container,
  .property-contact-form {
    flex: 1 1 100%;
  }
}

@media (max-width: 768px) {
  .property-detail {
    padding: 20px 15px;
  }
  .property-title {
    font-size: 1.4rem;
  }
  .property-arrows {
    gap: 1rem;
    left: 5px;
  }
  #property-map {
    min-height: 250px;
  }
}


/* ----------------- MOBILE RTL FIX ----------------- */
@media (max-width: 768px) {
  /* Full width layout */
  .property-detail-page,
  .property-detail {
    max-width: 100% !important;
    padding-left: 12px !important;
    padding-right: 12px !important;
    margin: 0 auto !important;
    box-sizing: border-box;
    overflow-x: hidden !important;
    direction: rtl;       /* ✅ enforce RTL alignment */
    text-align: right;    /* ✅ default text alignment */
  }

  /* ----------------- HEADER FLEX ----------------- */
  .property-header {
    display: flex;
    flex-direction: column;
    align-items: stretch !important; /* keep everything full width */
  }

  /* ----------------- ARROWS AT TOP ----------------- */
  .property-arrows {
    order: -1;                                    /* ✅ force arrows to top */
    display: flex !important;
    justify-content: center !important;           /* ✅ center horizontally */
    gap: 8rem !important;                       /* ✅ gap between arrows */
    width: 100% !important;
    margin: 10px 0 180px 0 !important;             /* ✅ space below arrows */
    position: relative !important;                /* ✅ no fixed */
    top: auto !important;
    left: auto !important;
    right: auto !important;
    transform: none !important;
  }

  .property-arrows .arrow {
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    min-height: 44px !important;
  }
  .property-arrows .arrow svg {
    width: 22px;
    height: 22px;
  }

  /* ----------------- TITLE ----------------- */
  .property-title {
    text-align: right !important;
    font-size: 1.4rem !important;
    margin-top: 0 !important;
  }

  /* ----------------- STATUS LABEL ----------------- */
.property-status {
  display: inline-block !important;
  padding: 4px 10px !important;
  font-size: 0.9rem !important;
  border-radius: 6px !important;
  margin-bottom: 8px !important;
  max-width: fit-content !important;
  text-align: center !important;
}

  /* ----------------- DOCUMENTS ----------------- */
  .property-documents h3 {
    display: block !important;
    text-align: right !important;
    font-size: 1.05rem;
    margin: 16px 0 8px !important;
  }

  .property-documents .doc-row {
    display: grid !important;
    grid-template-columns: auto 1fr 40px !important; /* pdf | title | download */
    align-items: center !important;
    gap: 0.6rem !important;
    padding: 0.4rem 0 !important;
    width: 100% !important;
    box-sizing: border-box;
  }

  .property-documents .doc-title {
    min-width: 0;
    text-align: right !important;
    display: block;
    font-size: 0.8rem !important;
  }

  .property-documents .pdf-icon {
    flex-shrink: 0;
    width: 26px !important;
    height: 26px !important;
  }

  /* Download button on left side (RTL) */
  .property-documents .download-icon {
    width: 30px !important;
    height: 30px !important;
    margin: 0 !important;
    justify-self: start !important;   /* ✅ push to left in RTL */
    align-self: center !important;
    background-size: 20px !important;
  }

  /* ----------------- MAP + FORM ----------------- */
  .map-form-wrapper {
    flex-direction: column !important;
    gap: 1rem !important;
  }
  .property-map-container,
  .property-contact-form {
    flex: 1 1 100% !important;
    width: 100% !important;
    min-width: 0 !important;
    font-family: 'Cairo', sans-serif;
  }
  #property-map {
    min-height: 500px !important;
  }

  /* Fix Google Maps marker icons on mobile/tablet */
.gm-style img {
  max-width: none !important;
  height: auto !important;
}

  /* ----------------- SAFETY ----------------- */
  html, body {
    overflow-x: hidden !important;
  }
}

/* Remove Olivero's dotted background globally */
body {
  background: #fcfcfc !important; /* solid white */
}

/* =========================================================
   LANGUAGE-BASED LAYOUT FLIP: Property Detail (Top row + Map/Form)
   Ensures top row (carousel/details) and second row (map/form)
   swap positions automatically when direction changes.
   ========================================================= */

/* ---------- RTL (Arabic) — keep existing RTL order ---------- */
html[dir="rtl"] .property-top-row {
  flex-direction: row-reverse; /* carousel left, details right (Arabic) */
}
html[dir="rtl"] .property-carousel  { order: 0; } /* image first (left) */
html[dir="rtl"] .property-header    { order: 1; text-align: right; direction: rtl; }

html[dir="rtl"] .map-form-wrapper  {
  flex-direction: row-reverse; /* map left, contact right (Arabic) */
  direction: rtl;
}
html[dir="rtl"] .property-map-container     { order: 0; } /* map left */
html[dir="rtl"] .property-contact-form      { order: 1; text-align: right; direction: rtl; }

/* ---------- LTR (English) — flipped order ---------- */
html[dir="ltr"] .property-top-row {
  flex-direction: row-reverse; /* carousel right, details left (English) */
}
html[dir="ltr"] .property-carousel  { order: 1; } /* image second (right) */
html[dir="ltr"] .property-header    { order: 0; text-align: left; direction: ltr; }

html[dir="ltr"] .map-form-wrapper  {
  flex-direction: row; /* contact left, map right (English) */
  direction: ltr;
}
html[dir="ltr"] .property-map-container     { order: 1; } /* map right */
html[dir="ltr"] .property-contact-form      { order: 0; text-align: left; direction: ltr; }

/* ---------- Mobile / responsive stacking (preserve language order) ---------- */
@media (max-width: 991px) {
  /* Force vertical stacking for all languages (keeps logical order) */
  .map-form-wrapper {
    flex-direction: column !important;
  }

  /* On mobile, show contact form first for English (LTR), keep map first for Arabic (RTL) */
  html[dir="ltr"] .property-contact-form     { order: 0 !important; }
  html[dir="ltr"] .property-map-container    { order: 1 !important; }

  html[dir="rtl"] .property-map-container    { order: 0 !important; }
  html[dir="rtl"] .property-contact-form     { order: 1 !important; }

  /* Top row stacking on mobile — put header above carousel for readability */
  .property-header  { order: 0 !important; }
  .property-carousel{ order: 1 !important; }
}

/* small polish: ensure arrows / icon alignment follow direction */
html[dir="ltr"] .property-arrows { justify-content: space-between; }
html[dir="rtl"] .property-arrows { justify-content: space-between; }


/* =========================================================
   FORCE SINGLE COLUMN ON MOBILE ONLY
   ========================================================= */
@media (max-width: 768px) {
  /* Top Row: Carousel + Details stacked vertically */
  .property-top-row {
    display: flex !important;
    flex-direction: column !important;  /* ✅ stack instead of side-by-side */
    align-items: stretch !important;
    gap: 1.5rem !important;
  }

  /* Carousel full width */
  .property-carousel {
    flex: 1 1 100% !important;
    max-width: 100% !important;
  }

  /* Header (details) full width */
  .property-header {
    flex: 1 1 100% !important;
    width: 100% !important;
    text-align: right !important;
  }

  /* Map + Contact Form stacked (already partly done, just reinforce it) */
  .map-form-wrapper {
    display: flex !important;
    flex-direction: column !important;
    gap: 1.5rem !important;
  }

  .property-map-container,
  .property-contact-form {
    flex: 1 1 100% !important;
    width: 100% !important;
  }
}

/* ====== Page Title Styling ====== */
.page-title-wrapper {
  text-align: center;              /* Centers the title */
  background-color: transparent;   /* Keep existing background, or add one if desired */
  padding: 40px 0;                 /* Optional: gives breathing space */
}

.page-title {
  color: #ffffff;                  /* White text */
  font-size: 3rem;                 /* Adjust for size consistency */
  font-weight: 800;                /* Bold for better readability */
  margin: 0;                       /* Remove default margin */
  font-family: 'Cairo', sans-serif; /* matches Arabic style */
}

/* ====== Responsive Adjustments ====== */
@media (max-width: 768px) {
  .page-title-wrapper {
    padding: 25px 0; /* Reduce padding on smaller screens */
  }

  .page-title {
    font-size: 1.5rem; /* Slightly smaller title on tablets and phones */
  }
}

@media (max-width: 480px) {
  .page-title {
    font-size: 1.2rem; /* Even smaller for very small screens */
  }
}


