/* App Router Overrides & Enhancements */
/* Card Publisher (used in To Sell / To Buy) */
.cardPublisher {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
  height: 100%;
  display: flex;
  flex-direction: column;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  position: relative;
}

.cardPublisher:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}

.cardPublisher-header-thumb {
  position: relative;
  background: var(--acg-bg);
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 8px;
}

.cardPublisher-header-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}

.cardPublisher:hover .cardPublisher-header-thumb img {
  transform: scale(1.05);
}

.cardPublisher-body {
  padding: 12px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.cardPublisher-price {
  font-size: 1rem;
  font-weight: 700;
  color: var(--bs-primary);
}

.cardPublisher-price-symbol {
  font-size: 0.8rem;
  margin-left: 4px;
}

.badge-private-price {
  background-color: var(--acg-bg);
  color: var(--text-muted);
  border: 1px solid var(--border-light);
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: 20px;
  display: inline-block;
  font-weight: 500;
}

/* Products and To-Sell Filter Accordion */
.filter-container {
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 2px 14px rgba(0, 0, 0, 0.06);
  padding: 16px;
  position: sticky;
  top: 90px;
}

.filter-header-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  color: var(--bs-primary);
  font-size: 1.05rem;
  margin-bottom: 14px;
}

.filter-group-header {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  padding: 10px 0;
  cursor: pointer;
  border-top: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.filter-group-content {
  padding-bottom: 12px;
  max-height: 200px;
  overflow-y: auto;
}

.filter-group-content .form-check {
  margin-bottom: 6px;
  font-size: 0.83rem;
  color: var(--text-muted);
}

.btn-filter-apply {
  background: var(--bs-primary);
  color: #fff;
  border: none;
  border-radius: 20px;
  padding: 6px 20px;
  font-size: 0.85rem;
  font-weight: 600;
  transition: opacity 0.2s;
}

.btn-filter-apply:hover {
  opacity: 0.9;
  color: #fff;
}

.btn-filter-reset {
  background: transparent;
  color: var(--bs-primary);
  border: 1.5px solid var(--bs-primary);
  border-radius: 20px;
  padding: 6px 20px;
  font-size: 0.85rem;
  font-weight: 600;
  transition: all 0.2s;
}

.btn-filter-reset:hover {
  background: var(--bs-primary);
  color: #fff;
}


/* Detail pages and links */
.card-image-link { display: contents; }
.card-title-link { color: inherit; text-decoration: none; }
.card-title-link:hover { color: var(--bs-primary); }
a.listing-thumb { color: inherit; }
.legal-text p { color: var(--text-muted); line-height: 1.7; }
.detail-image { display: flex; align-items: center; justify-content: center; min-height: 320px; padding: 20px; border-radius: 10px; background: #fff; box-shadow: 0 2px 5.27px #0000000a, 0 0 37px #0000000d; }
.detail-image img { max-width: 100%; max-height: 420px; object-fit: contain; }
.detail-title { margin: 8px 0 14px; color: var(--bs-primary); font-size: 26px; font-weight: 600; overflow-wrap: anywhere; }
.detail-price { margin-bottom: 18px; font-size: 22px; }
.detail-specs { width: 100%; margin-bottom: 20px; border-collapse: collapse; }
.detail-specs th, .detail-specs td { padding: 9px 4px; border-bottom: 1px solid var(--border-light); font-size: 14px; text-align: start; overflow-wrap: anywhere; }
.detail-specs th { width: 40%; font-weight: 500; }
.detail-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.detail-actions button { position: static; display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border: 1px solid var(--bs-primary); border-radius: 50rem; background: #fff; color: var(--bs-primary); font-size: 14px; }
.detail-actions button.is-active { background: var(--bs-primary); color: #fff; }
.detail-buy { max-width: 320px; margin-bottom: 14px; }
.detail-listing-actions { display: flex; gap: 8px; max-width: 320px; }
.detail-listing-actions a { display: flex; flex: 1; align-items: center; justify-content: center; gap: 6px; padding: 10px; border-radius: 10px; font-weight: 500; text-decoration: none; }

/* Arabic layout */
[dir="rtl"] body { text-align: right; }
[dir="rtl"] .ticker-orange-bar { direction: ltr; }
[dir="rtl"] .ticker-text-item { direction: rtl; }
[dir="rtl"] .fa-chevron-right, [dir="rtl"] .fa-chevron-left { transform: scaleX(-1); }
[dir="rtl"] .form-check { padding-right: 1.5em; padding-left: 0; }
[dir="rtl"] .form-check .form-check-input { float: right; margin-right: -1.5em; margin-left: 0; }
[dir="rtl"] .form-select { padding-right: .75rem; padding-left: 2.25rem; background-position: left .75rem center; }
[dir="rtl"] .me-2 { margin-right: 0 !important; margin-left: .5rem !important; }
[dir="rtl"] .card-icon-action.fav, [dir="rtl"] .card-icon-action.compare, [dir="rtl"] .card-icon-action.quote { right: auto; left: 4px; }
[dir="rtl"] .inquiry-submit { margin: 24px auto 0 0; }
[dir="rtl"] .old-price { margin-right: 4px; margin-left: 0; }

/* Footer spacing */
.theFooter .container-xxl { padding-inline: 20px; }
.theFooter .theFooter-socials a { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; }
@media (max-width: 767.98px) {
  /* Keeps the copyright line clear of the fixed bottom navigation. */
  .theFooter { padding-bottom: 80px; }
}

/* How it Works: compact layout and motion */
.how-grid { max-width: 1040px; margin-inline: auto; gap: 16px 150px; }
.how-step { min-height: 92px; border-radius: 46px; transition: transform 0.25s ease, box-shadow 0.25s ease; }
.how-step:hover { box-shadow: 0 10px 24px rgba(var(--acg-blue-rgb), 0.22); transform: translateY(-3px); }
.how-text { padding: 10px 24px; }
.how-text i { font-size: 18px; }
.how-text p { margin-top: 5px; font-size: 14px; line-height: 1.4; }
.how-number { width: 92px; height: 92px; border-width: 5px; transition: transform 0.25s ease; }
.how-number small { font-size: 11px; letter-spacing: 0.5px; }
.how-number strong { font-size: 28px; }
.how-step:hover .how-number { transform: scale(1.06); }
.how-center { width: 112px; height: 112px; border: 0; font-size: 36px; }
.how-center::before { position: absolute; inset: 0; border: 2px dashed var(--bs-primary); border-radius: 50%; content: ''; animation: howRing 24s linear infinite; }
.how-center i { animation: howFloat 3.5s ease-in-out infinite; }

.how-animate .how-step { opacity: 0; transform: translateX(-28px); }
.how-animate .how-step.is-right { transform: translateX(28px); }
.how-animate .how-number { transform: scale(0.7); }
.how-animate .how-center { opacity: 0; }
.how-animate.is-visible .how-step { opacity: 1; transform: none; transition: opacity 0.55s ease var(--how-delay), transform 0.55s cubic-bezier(0.22, 1, 0.36, 1) var(--how-delay), box-shadow 0.25s ease; }
.how-animate.is-visible .how-number { transform: none; transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) calc(var(--how-delay) + 0.15s); }
.how-animate.is-visible .how-center { opacity: 1; transition: opacity 0.6s ease; }
/* Hover stays quick once the entrance animation has finished. */
.how-animate.is-done .how-step:hover { transform: translateY(-3px); transition: transform 0.25s ease, box-shadow 0.25s ease; }
.how-animate.is-done .how-step:hover .how-number { transform: scale(1.06); transition: transform 0.25s ease; }

@keyframes howRing { to { transform: rotate(360deg); } }
@keyframes howFloat { 50% { transform: translateY(-4px); } }

[dir="rtl"] .how-animate .how-step { transform: translateX(28px); }
[dir="rtl"] .how-animate .how-step.is-right { transform: translateX(-28px); }
[dir="rtl"] .how-animate.is-visible .how-step { transform: none; }

@media (max-width: 991.98px) {
  .how-grid { max-width: 560px; gap: 12px; }
  .how-step { min-height: 80px; border-radius: 40px; }
  .how-text { padding: 8px 18px; }
  .how-number { width: 80px; height: 80px; }
  .how-number strong { font-size: 24px; }
  .how-number small { font-size: 10px; }
  .how-animate .how-step, .how-animate .how-step.is-right, [dir="rtl"] .how-animate .how-step, [dir="rtl"] .how-animate .how-step.is-right { transform: translateY(18px); }
  .how-animate.is-visible .how-step, .how-animate.is-visible .how-step.is-right, [dir="rtl"] .how-animate.is-visible .how-step, [dir="rtl"] .how-animate.is-visible .how-step.is-right { transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .how-center::before, .how-center i { animation: none; }
  .how-step, .how-number { transition: none; }
  .how-step:hover, .how-step:hover .how-number { transform: none; }
}
.how-animate:not(.is-done) { overflow-x: clip; }

/* About page */
.about-intro { padding-top: 8px; }
.about-text p { color: var(--text-muted); font-size: 16px; line-height: 1.75; }
.about-text h2 { margin: 26px 0 12px; color: var(--bs-primary); font-size: 20px; font-weight: 700; }
.about-signature { display: flex; flex-direction: column; gap: 2px; margin: 22px 0 0; }
.about-signature strong { color: var(--bs-primary); font-size: 17px; }
.about-certs { position: sticky; top: 96px; padding: 20px; border-radius: 12px; background: #fff; box-shadow: 0 2px 5.27px #0000000a, 0 0 37px #0000000d; }
.about-certs h2 { margin-bottom: 16px; color: var(--bs-primary); font-size: 20px; font-weight: 700; }
.about-certs-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 14px; }
.about-certs-grid figure { margin: 0; }
.about-certs-grid figure:first-child { grid-row: span 2; }
.about-certs-grid a { display: block; overflow: hidden; border: 1px solid var(--acg-blue-tint); border-radius: 8px; transition: box-shadow 0.25s ease; }
.about-certs-grid a:hover { box-shadow: 0 8px 20px rgba(var(--acg-blue-rgb), 0.18); }
.about-certs-grid img { display: block; width: 100%; height: auto; }
.about-certs-grid figcaption { margin-top: 8px; color: var(--text-muted); font-size: 13px; line-height: 1.4; text-align: center; }
.about-section { margin-top: 44px; }
.about-blog-track .blog-card { flex: 0 0 320px; height: auto; }

@media (max-width: 991.98px) {
  .about-certs { position: static; }
}
@media (max-width: 575.98px) {
  .about-section { margin-top: 32px; }
  .about-certs { padding: 14px; }
  .about-certs-grid { grid-template-columns: 1fr 1fr; }
  .about-certs-grid figure:first-child { grid-column: 1 / -1; grid-row: auto; }
  .about-blog-track .blog-card { flex-basis: 260px; }
}

/* Brand card without a logo image */
.brand-box-name {
  font-weight: 700;
  font-size: 0.875rem;
  color: var(--acg-blue);
  text-align: center;
}

/* ------------------------------------------------------------------
   Server-rendered additions. The template builds these as buttons in
   JavaScript; the Razor pages use links and forms, styled the same.
   ------------------------------------------------------------------ */
.products-pagination a {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 36px; height: 36px; padding: 0 8px;
  border: 1px solid var(--border-light); border-radius: 8px;
  background: #fff; color: var(--text-muted); font-size: 14px; text-decoration: none;
}
.products-pagination a:hover { border-color: var(--bs-primary); color: var(--bs-primary); }
a.card-icon-action { display: flex; align-items: center; justify-content: center; text-decoration: none; }
a.btn-card-buy { display: flex; align-items: center; justify-content: center; gap: 6px; text-decoration: none; }
.detail-offer { padding: 14px 16px; border: 1px solid var(--border-light); border-radius: 12px; background: #fff; }
.detail-offer + .detail-offer { margin-top: 12px; }
.detail-offer .current-price { font-size: 18px; }
.detail-thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.detail-thumbs a { display: block; width: 64px; height: 64px; overflow: hidden; border: 1px solid var(--border-light); border-radius: 8px; background: #fff; }
.detail-thumbs img { width: 100%; height: 100%; object-fit: contain; }
.detail-actions form { display: contents; }
.detail-actions a { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border: 1px solid var(--bs-primary); border-radius: 50rem; background: #fff; color: var(--bs-primary); font-size: 14px; text-decoration: none; }
.detail-actions button.active { background: var(--bs-primary); color: #fff; }
