/* ---------- Header Layout (Title + Buttons) ---------- */
.opportunities-section,
.op-header {
  display: flex;
  align-items: center;
  justify-content: flex-start; /* we'll control inline alignment with logical margins */
  gap: 10px;
  margin-left: 50px;
  margin-right: 5%;
  margin-top: 40px;
  margin-bottom: 20px;
  font-family: 'Cairo', sans-serif;
}

/* Use logical margin (margin-inline-start) so behavior is correct for LTR and RTL.
   The .buttons element will be pushed to the inline-end in both writing-modes,
   which places the buttons on the right in LTR and on the left in RTL. */
.op-header .buttons,
.opportunities-section .buttons {
  margin-inline-start: auto; /* pushes buttons to inline-end (right in LTR, left in RTL) */
  display: flex;
  gap: 20px;
  align-items: center;
}


/* ---------- Title ---------- */
.op-title,
.op-header .op-title {
  font-size: 28px;
  font-weight: 700;
  color: goldenrod;
  font-family: 'Cairo', sans-serif;
  margin: 15px;
}

.op-title span {
  color: #1f2f2f;
}

/* ---------- Remove underline from card titles ---------- */
.op-card-title a {
  text-decoration: none !important;
  color: inherit;
}

.op-card-title a:hover,
.op-card-title a:focus,
.op-card-title a:active {
  text-decoration: none !important;
  color: inherit;
}

.op-card-title a:hover {
  color: goldenrod;
}

/* ---------- Toggle Buttons (general) ---------- */
.opportunities-wrapper .op-btn,
.op-btn {
  padding: 14px 34px;
  border-radius: 12px;
  border: none;
  font-size: 18px;
  cursor: pointer;
  background: #f2f2f2;
  color: #344a4a;
  transition: all 0.3s ease;
  box-shadow: 0 3px 6px rgba(0,0,0,0.1);
  font-family: 'Cairo', sans-serif;
}

.opportunities-wrapper .op-btn:hover,
.op-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

.opportunities-wrapper .op-btn.active,
.op-btn.active {
  background: #1f2f2f;
  color: #fff;
}

/* Small variant (some parts of your CSS used smaller op-btn) */
.op-btn {
  padding: 8px 16px; /* fallback smaller padding where used */
  border-radius: 8px;
}

/* ---------- Toggle Sections ---------- */
.toggle-section {
  display: none;
}
.toggle-section.active {
  display: block;
}

/* ---------- Opportunities Grid ---------- */
.op-grid-row {
  display: grid;
  gap: 30px;
  font-family: 'Cairo', sans-serif;
  margin-left: 50px;
  margin-right: 50px;
  margin-top: 50px;
}

/* Mobile: 1 column */
@media (max-width: 767px) {
  .op-grid-row {
    grid-template-columns: 1fr;
  }
}

/* Tablet: 2 columns */
@media (min-width: 768px) and (max-width: 991px) {
  .op-grid-row {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Desktop: 3 columns */
@media (min-width: 992px) {
  .op-grid-row {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ---------- Card ---------- */
.op-card {
  flex: 1;
  max-width: 360px;
  position: relative;
  background: #FAFAFA;
  border-radius: 16px;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  padding: 20px;
  margin-bottom: 20px;
  font-family: 'Cairo', sans-serif;
}

.op-card:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow: 0 8px 18px rgba(0,0,0,0.2);
}

.op-card:active {
  transform: scale(0.97);
}

/* ---------- Top Image ---------- */
.op-card-image {
  width: 100%;
  margin-bottom: 16px;
}

.op-card-image img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 12px;
}

/* ---------- Title ---------- */
.op-card-title {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 10px;
  color: #222;
  font-family: 'Cairo', sans-serif;
}

/* ---------- Text ---------- */
.op-card-text {
  font-size: 14px;
  color: #555;
  line-height: 1.6;
  margin: 0 0 12px;
  font-family: 'Cairo', sans-serif;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  max-height: calc(1.6em * 4); /* 4 lines max */
}

/* ---------- Decorative bottom image ---------- */
.op-card-deco {
  position: absolute;
  bottom: 10px;
  left: 10px;
  width: 70px;
  opacity: 0.4;
  pointer-events: none;
}

.op-card-deco img {
  width: 100%;
  display: block;
}

/* ---------- Responsive: stack on small screens ---------- */
@media (max-width: 768px) {
  .opportunities-header,
  .op-header {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 15px;
  }

  /* cancel the auto-margin so buttons center under title */
  .op-header .buttons,
  .opportunities-section .buttons {
    margin-inline-start: 0;
    justify-content: center;
  }

  .opportunities-wrapper .buttons {
    justify-content: center;
    flex-wrap: wrap;
  }

  .op-title {
    font-size: 24px;
  }
}

/* Remove Olivero's dotted background globally */
body {
  background: #fff !important;
}

/* Small header override used elsewhere */
.op-header {
  justify-content: space-between;
  margin-left: 30px;
  margin-right: 25px;
}

/* --- Auction Section Layout --- */
.auction-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 40px 50px 20px 50px;
  font-family: 'Cairo', sans-serif;
}

/* Arabic (RTL) and English (LTR) support */
html[dir="rtl"] .auction-section {
  flex-direction: row; /* Title right, buttons left */
  text-align: right;
}

html[dir="ltr"] .auction-section {
  flex-direction: row; /* Title left, buttons right */
  text-align: left;
}

/* --- Buttons --- */
.auction-section .buttons {
  display: flex;
  gap: 20px;
}

.op-btn {
  padding: 14px 34px;
  border-radius: 12px;
  border: none;
  background: #f2f2f2;
  color: #344a4a;
  font-size: 18px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 3px 6px rgba(0,0,0,0.1);
}

.op-btn.active {
  background: #1f2f2f;
  color: #fff;
}

.op-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

/* --- Auction Grid --- */
.auction-grid {
  display: none;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
  margin: 40px 50px;
}

.auction-grid.active {
  display: grid;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .auction-section {
    flex-direction: column;
    text-align: center;
  }

  .auction-section .buttons {
    justify-content: center;
    margin-top: 10px;
  }
}

.op-title {
  font-size: 2rem;
  font-weight: bold;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* First part (gold) */
.op-title .gold-text {
  color: goldenrod; /* or any gold color you use */
}

/* Second part (black) */
.op-title .black-text {
  color: #000; /* solid black */
}

/* ---------- Responsive: Tablet & Mobile ---------- */
@media (max-width: 991px) {
  .opportunities-section {
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin: 20px 15px;
    gap: 10px;
  }

  .op-title {
    font-size: 22px;
    margin-bottom: 10px;
  }

  .opportunities-wrapper .buttons {
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
  }

  .opportunities-wrapper .op-btn {
    padding: 8px 18px;
    font-size: 14px;
  }
}

/* ---------- Opportunities Section Layout ---------- */
html[dir="ltr"] .opportunities-section {
  display: flex;
  flex-direction: row; /* English: title left, toggle right */
  align-items: center;
  justify-content: space-between;
  text-align: left;
}

html[dir="rtl"] .opportunities-section {
  display: flex;
  flex-direction: row; /* Arabic: title right, toggle left */
  align-items: center;
  justify-content: space-between;
  text-align: right;
}


/* ============================================================
   MOBILE-ONLY AUCTION SECTION (Title on top, toggles below)
   ============================================================ */
@media (max-width: 768px) {
  .auction-section {
    display: flex;
    flex-direction: column;   /* stack vertically */
    align-items: center;      /* center horizontally */
    justify-content: center;
    text-align: center;
    width: 100%;
    max-width: 100%;
    margin: 0 auto 25px auto; /* keep clean spacing */
    padding: 0 15px;
    box-sizing: border-box;
  }

  /* Title: full width, centered */
  .auction-section .op-title {
    font-size: 22px;
    font-weight: 700;
    color: goldenrod;
    text-align: center;
    width: 100%;
    margin-bottom: 15px; /* space between title and buttons */
  }

  /* Toggle buttons: centered under title */
  .auction-section .buttons {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap; /* allow wrap if too wide */
    gap: 12px;
    width: 100%;
  }

  /* Buttons style scaled for mobile */
  .auction-section .op-btn {
    font-size: 14px;
    padding: 10px 20px;
    border-radius: 10px;
  }
}

/* ============================================================
   FINAL MOBILE-ONLY OPPORTUNITIES SECTION FIX (Overrides RTL/LTR)
   ============================================================ */
@media (max-width: 768px) {
  .opportunities-section {
    display: flex !important;
    flex-direction: column !important;  /* stack vertically */
    align-items: center !important;      /* center content horizontally */
    justify-content: center !important;
    text-align: center !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 auto 25px auto !important;
    padding: 0 15px !important;
    box-sizing: border-box !important;
  }

  /* Title */
  .opportunities-section .op-title {
    font-size: 22px !important;
    font-weight: 700 !important;
    color: goldenrod !important;
    text-align: center !important;
    width: 100% !important;
    margin-bottom: 15px !important;
  }

  /* Buttons */
  .opportunities-section .buttons {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    flex-wrap: wrap !important;
    gap: 12px !important;
    width: 100% !important;
  }

  /* Button styles */
  .opportunities-section .op-btn {
    font-size: 14px !important;
    padding: 10px 20px !important;
    border-radius: 10px !important;
  }
}
