/* =============================================
   DAWARTLK — BROCHURE DETAILS / VIEWER
   Inherits global tokens from style.css
============================================= */

.brc-main {
  direction: rtl;
  padding-top: 10px;
  padding-bottom: 28px;
  background:
    radial-gradient(circle at top left, rgba(17, 147, 74, 0.08), transparent 26%),
    radial-gradient(circle at top right, rgba(249, 168, 37, 0.10), transparent 24%),
    linear-gradient(180deg, #f7faf8 0%, #eef2f6 100%);
  min-height: calc(100vh - 80px);
}

.brc-main:has(.app-footer-custom) { padding-bottom: 0; }

.brc-shell {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 14px;
}

/* ── Breadcrumb ───────────────────────────── */
.brc-crumb {
  padding: 12px 2px 0;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.brc-crumb .breadcrumb-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.brc-crumb .breadcrumb-item { display: flex; align-items: center; gap: 6px; }

.brc-crumb .breadcrumb-item + .breadcrumb-item::before {
  content: '\f104';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  font-size: 0.7rem;
  color: var(--text-light);
}

.brc-crumb a { color: var(--text-muted); transition: color 0.2s ease; }
.brc-crumb a:hover { color: var(--green); }
.brc-crumb .breadcrumb-item.active { color: var(--text); font-weight: 700; }
.brc-crumb .breadcrumb-home-icon { font-size: 0.85rem; }

/* ═══════════════════════════════════════════
   HERO
═══════════════════════════════════════════ */
.brc-hero {
  position: relative;
  margin-top: 14px;
  border-radius: var(--r-xl);
  overflow: hidden;
  background: #0d1f16;
  box-shadow: 0 24px 60px rgba(13, 31, 22, 0.22);
  isolation: isolate;
}

.brc-hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-size: cover;
  background-position: center top;
  transform: scale(1.08);
  filter: blur(2px) saturate(1.05);
}

.brc-hero-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(285deg, rgba(8, 24, 16, 0.42) 0%, rgba(8, 24, 16, 0.80) 46%, rgba(8, 24, 16, 0.95) 100%);
}

.brc-hero-body {
  position: relative;
  z-index: 1;
  padding: 20px 18px 22px;
  color: #fff;
}

.brc-hero-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.brc-retailer { display: flex; align-items: center; gap: 12px; }

.brc-retailer-logo {
  position: relative;
  width: 58px;
  height: 58px;
  border-radius: 16px;
  background: #fff;
  padding: 6px;
  display: grid;
  place-items: center;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.28);
  flex-shrink: 0;
}

.brc-retailer-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 11px;
  position: relative;
  z-index: 1;
  background: #fff;
}

/* Shown only when the logo image is missing or fails to load. */
.brc-retailer-initials {
  position: absolute;
  inset: 4px;
  display: grid;
  place-items: center;
  text-align: center;
  font-size: 0.62rem;
  font-weight: 900;
  line-height: 1.25;
  color: var(--green);
}

.brc-retailer-meta { display: flex; flex-direction: column; gap: 5px; }

.brc-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: flex-start;
  background: rgba(255, 208, 0, 0.16);
  color: var(--yellow);
  border: 1px solid rgba(255, 208, 0, 0.35);
  padding: 3px 10px;
  border-radius: var(--r-pill);
  font-size: 0.7rem;
  font-weight: 800;
}

.brc-retailer-name { font-size: 1rem; font-weight: 800; }

.brc-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--r-pill);
  font-size: 0.75rem;
  font-weight: 800;
  backdrop-filter: blur(6px);
}

.brc-status.is-live    { background: rgba(33, 166, 91, 0.22); color: #7ff0ae; border: 1px solid rgba(127, 240, 174, 0.35); }
.brc-status.is-soon    { background: rgba(255, 208, 0, 0.18); color: #ffe07a; border: 1px solid rgba(255, 224, 122, 0.35); }
.brc-status.is-expired { background: rgba(229, 57, 53, 0.20); color: #ffb3b1; border: 1px solid rgba(255, 179, 177, 0.32); }

.brc-title {
  margin-top: 16px;
  font-size: clamp(1.35rem, 5vw, 2.1rem);
  font-weight: 900;
  line-height: 1.3;
}

.brc-desc {
  margin-top: 8px;
  max-width: 62ch;
  font-size: 0.9rem;
  line-height: 1.75;
  color: rgba(255, 255, 255, 0.78);
}

.brc-hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.brc-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.16);
  font-size: 0.78rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.92);
}

.brc-chip i { font-size: 0.75rem; opacity: 0.85; }
.brc-chip-accent { background: rgba(255, 208, 0, 0.16); border-color: rgba(255, 208, 0, 0.32); color: #ffe07a; }
.brc-chip-hot    { background: rgba(229, 57, 53, 0.20); border-color: rgba(255, 145, 142, 0.34); color: #ffb3b1; }

.brc-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 20px;
}

.brc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: var(--r-pill);
  font-size: 0.85rem;
  font-weight: 800;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
  cursor: pointer;
}

.brc-btn:hover { transform: translateY(-2px); }

.brc-btn-primary {
  background: linear-gradient(135deg, var(--green-light), var(--green));
  color: #fff;
  box-shadow: 0 12px 26px rgba(17, 147, 74, 0.38);
}

.brc-btn-ghost {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #fff;
}

.brc-btn-ghost:hover { background: rgba(255, 255, 255, 0.20); }

/* ═══════════════════════════════════════════
   VIEWER
═══════════════════════════════════════════ */
.brc-viewer {
  margin-top: 18px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.brc-viewer:fullscreen { background: #0d1f16; padding: 16px; }
.brc-viewer:fullscreen .brc-stage-wrap { height: calc(100vh - 210px); }

.brc-viewer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.brc-viewer-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
  font-weight: 800;
}

.brc-viewer-title i { color: var(--green); }

.brc-viewer-tools { display: flex; align-items: center; gap: 8px; }

.brc-counter {
  padding: 5px 12px;
  border-radius: var(--r-pill);
  background: var(--green-bg);
  color: var(--green);
  font-size: 0.8rem;
  font-weight: 800;
}

.brc-counter strong { font-size: 0.9rem; }

.brc-tool {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #f4f6f5;
  color: var(--text-muted);
  transition: background 0.18s ease, color 0.18s ease;
}

.brc-tool:hover { background: var(--green); color: #fff; }

.brc-stage-wrap {
  position: relative;
  background:
    repeating-linear-gradient(45deg, #f6f8f7 0 12px, #f1f4f3 12px 24px);
  padding: 14px;
  display: grid;
  place-items: center;
  min-height: 300px;
}

.brc-stage {
  position: relative;
  width: 100%;
  max-width: 760px;
  cursor: zoom-in;
}

.brc-slide { display: none; }
.brc-slide.active { display: block; animation: brcFade 0.28s ease; }

@keyframes brcFade {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}

.brc-page-img {
  width: 100%;
  height: auto;
  border-radius: var(--r-md);
  background: #fff;
  box-shadow: 0 14px 34px rgba(15, 33, 24, 0.14);
}

.brc-slide-cap {
  margin-top: 8px;
  text-align: center;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
}

.brc-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #fff;
  color: var(--text);
  box-shadow: var(--shadow-md);
  z-index: 3;
  transition: background 0.18s ease, color 0.18s ease;
}

.brc-nav:hover { background: var(--green); color: #fff; }
.brc-nav-prev { right: 10px; }
.brc-nav-next { left: 10px; }

.brc-progress {
  height: 4px;
  background: var(--border);
  overflow: hidden;
}

.brc-progress-bar {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--green), var(--green-light));
  transition: width 0.3s ease;
}

/* ── Thumbnails ───────────────────────────── */
.brc-thumbs-wrap {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 10px;
  background: #fafbfa;
}

.brc-thumbs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scroll-behavior: smooth;
  scrollbar-width: none;
  padding: 2px;
  flex: 1;
}

.brc-thumbs::-webkit-scrollbar { display: none; }

.brc-thumb {
  position: relative;
  flex: 0 0 auto;
  width: 62px;
  height: 84px;
  border-radius: var(--r-sm);
  overflow: hidden;
  border: 2px solid transparent;
  background: #fff;
  box-shadow: var(--shadow-xs);
  transition: border-color 0.18s ease, transform 0.18s ease;
}

.brc-thumb img { width: 100%; height: 100%; object-fit: cover; }
.brc-thumb:hover { transform: translateY(-2px); }
.brc-thumb.active { border-color: var(--green); }

.brc-thumb-num {
  position: absolute;
  inset-inline-end: 4px;
  bottom: 4px;
  min-width: 18px;
  padding: 1px 4px;
  border-radius: var(--r-pill);
  background: rgba(0, 0, 0, 0.62);
  color: #fff;
  font-size: 0.62rem;
  font-weight: 800;
  text-align: center;
}

.brc-thumb.active .brc-thumb-num { background: var(--green); }

.brc-thumb-arrow {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #fff;
  color: var(--text-muted);
  box-shadow: var(--shadow-xs);
}

.brc-thumb-arrow:hover { background: var(--green); color: #fff; }

/* ═══════════════════════════════════════════
   SECTIONS
═══════════════════════════════════════════ */
.brc-section { margin-top: 22px; }

.brc-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.brc-section-title {
  position: relative;
  font-size: 1.05rem;
  font-weight: 900;
  padding-inline-start: 12px;
}

.brc-section-title::before {
  content: '';
  position: absolute;
  inset-inline-start: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 18px;
  border-radius: var(--r-pill);
  background: linear-gradient(180deg, var(--green-light), var(--green));
}

.brc-section-hint { font-size: 0.75rem; color: var(--text-muted); }

/* ── Page offers ──────────────────────────── */
.brc-offers { display: none; }

.brc-offers.active {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}

.brc-offer-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-xs);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.brc-offer-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }

.brc-offer-img {
  position: relative;
  height: 128px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #f7f9f8;
}

.brc-offer-img img { width: 100%; height: 100%; object-fit: contain; padding: 8px; }
.brc-offer-img i { font-size: 1.8rem; color: var(--text-light); }

.brc-offer-badge {
  position: absolute;
  top: 8px;
  inset-inline-start: 8px;
  padding: 3px 8px;
  border-radius: var(--r-pill);
  background: var(--red);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 800;
}

.brc-offer-body { padding: 10px; }

.brc-offer-title {
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.5;
  min-height: 2.5em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.brc-offer-prices {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 8px;
}

.brc-price-now { font-size: 0.95rem; font-weight: 900; color: var(--green); }
.brc-price-was { font-size: 0.78rem; color: var(--text-light); text-decoration: line-through; }

.brc-offers-empty {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px;
  border-radius: var(--r-lg);
  border: 1px dashed var(--border);
  background: var(--card-bg);
  color: var(--text-muted);
  font-size: 0.85rem;
}

.brc-offers-empty i { color: var(--text-light); }

/* ── Related brochures ────────────────────── */
.brc-related {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}

.brc-related-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-xs);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.brc-related-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }

.brc-related-img { position: relative; height: 150px; background: #f7f9f8; }
.brc-related-img img { width: 100%; height: 100%; object-fit: cover; }

.brc-related-pages {
  position: absolute;
  top: 8px;
  inset-inline-start: 8px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: var(--r-pill);
  background: rgba(0, 0, 0, 0.62);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
}

.brc-related-body { padding: 10px; }
.brc-related-store { font-size: 0.85rem; font-weight: 800; }
.brc-related-title { margin-top: 3px; font-size: 0.78rem; color: var(--green); font-weight: 700; }

.brc-related-date {
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.brc-related-date i { color: var(--yellow-dark); }

/* ── Empty state ──────────────────────────── */
.brc-empty {
  margin-top: 18px;
  padding: 44px 20px;
  text-align: center;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-xs);
}

.brc-empty i { font-size: 2.4rem; color: var(--text-light); }
.brc-empty h3 { margin-top: 12px; font-size: 1rem; font-weight: 800; }
.brc-empty p { margin: 6px 0 16px; font-size: 0.85rem; color: var(--text-muted); }
.brc-empty .brc-btn { display: inline-flex; }

/* ═══════════════════════════════════════════
   LIGHTBOX
═══════════════════════════════════════════ */
.brc-lightbox {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 50px 16px;
  background: rgba(8, 18, 13, 0.94);
  backdrop-filter: blur(4px);
}

.brc-lightbox.open { display: flex; }

.brc-lightbox img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: var(--r-md);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
}

.brc-lb-close,
.brc-lb-nav {
  position: absolute;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  transition: background 0.18s ease;
}

.brc-lb-close:hover,
.brc-lb-nav:hover { background: rgba(255, 255, 255, 0.28); }

.brc-lb-close { top: 14px; inset-inline-end: 14px; width: 40px; height: 40px; font-size: 1.1rem; }
.brc-lb-nav { top: 50%; transform: translateY(-50%); width: 44px; height: 44px; }
.brc-lb-prev { right: 14px; }
.brc-lb-next { left: 14px; }

.brc-lb-counter {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  padding: 5px 14px;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 800;
}

/* ═══════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════ */
@media (min-width: 768px) {
  .brc-shell { padding: 0 20px; }
  .brc-hero-body { padding: 26px 28px 28px; }
  .brc-retailer-logo { width: 66px; height: 66px; }
  .brc-retailer-name { font-size: 1.15rem; }
  .brc-stage-wrap { padding: 20px; min-height: 420px; }
  /* Keep a full page readable without scrolling the whole viewport. */
  .brc-page-img { max-height: 76vh; width: auto; max-width: 100%; margin: 0 auto; }
  .brc-thumb { width: 74px; height: 100px; }
  .brc-offers.active { grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 12px; }
  .brc-related { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
}

@media (min-width: 1024px) {
  .brc-hero-body { padding: 32px 34px; }
  .brc-viewer { display: block; }
  .brc-stage-wrap { min-height: 520px; padding: 24px; }
  .brc-page-img { max-height: 82vh; }
  .brc-stage { max-width: 820px; }
  .brc-nav { width: 48px; height: 48px; }
  .brc-thumb { width: 82px; height: 110px; }
}

/* Bottom nav clearance on mobile */
@media (max-width: 767px) {
  .brc-main { padding-bottom: calc(var(--bnav-h) + 18px); }
}

.brc-offers-more {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px 14px;
  border-radius: var(--r-md);
  background: var(--green-bg);
  color: var(--green);
  font-size: 0.8rem;
  font-weight: 700;
}
