/* ================================================================
   Customer Reviews Tab — Frontend CSS v2.0
   New design: overlay arrows · square dots · Arabic counter
   ================================================================ */

/* ----------------------------------------------------------------
   Custom Properties (base; PHP inline style overrides these)
   -------------------------------------------------------------- */
:root {
  --crt-btn-bg:           linear-gradient(to bottom, #f59e0b, #d97706);
  --crt-btn-text:         #ffffff;
  --crt-overlay:          rgba(0, 0, 0, 0.6);
  --crt-modal-bg:         #ffffff;
  --crt-modal-max-w:      400px;
  --crt-modal-radius:     20px;
  --crt-dot-active:       #F5A623;
  --crt-dot-inactive:     #E8E8E8;
  --crt-dot-size:         12px;
  --crt-dot-radius:       3px;          /* square=3px circle=50% line=2px */
  --crt-img-area-bg:      #ffffff;
  --crt-img-radius:       12px;
  --crt-img-padding:      20px;
  --crt-img-shadow:       0 4px 16px rgba(0,0,0,0.12), 0 1px 4px rgba(0,0,0,0.08);
  --crt-tab-top:          50%;
  --crt-tab-padding:      16px 12px;
  --crt-font-size:        14px;
  --crt-icon-size:        22px;
  --crt-ease:             cubic-bezier(0.4, 0, 0.2, 1);
}

/* ================================================================
   STICKY TAB
   position / left / right / z-index → PHP inline !important
   ================================================================ */
.crt-sticky-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 52px;
  min-height: 160px;
  padding: var(--crt-tab-padding);
  background: var(--crt-btn-bg);
  color: var(--crt-btn-text);
  border: none;
  cursor: pointer;
  box-shadow: 3px 3px 18px rgba(0,0,0,0.28);
  outline: none;
  font-family: inherit;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  transition: filter .25s var(--crt-ease), box-shadow .25s var(--crt-ease);
}
.crt-sticky-tab:hover  { filter: brightness(1.1); }
.crt-sticky-tab:active { filter: brightness(0.94); }
.crt-sticky-tab:focus-visible { outline: 3px solid var(--crt-dot-active); outline-offset: 2px; }

.crt-tab-icon { display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.crt-tab-icon svg { width: var(--crt-icon-size); height: var(--crt-icon-size); fill: currentColor; display: block; }

.crt-tab-text {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  font-size: var(--crt-font-size);
  font-weight: 700;
  letter-spacing: .4px;
  line-height: 1.3;
  direction: rtl;
  white-space: nowrap;
}

@keyframes crt-pulse {
  0%,100% { box-shadow: 3px 3px 18px rgba(0,0,0,0.28); }
  50%      { box-shadow: 3px 3px 26px rgba(245,158,11,.48); }
}
.crt-sticky-tab        { animation: crt-pulse 3s ease-in-out infinite; }
.crt-sticky-tab:hover,
.crt-sticky-tab:active { animation: none; }

/* ================================================================
   MODAL OVERLAY
   ================================================================ */
.crt-modal-overlay {
  position: fixed !important;
  inset: 0 !important;
  background: var(--crt-overlay);
  z-index: 1000000 !important;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  visibility: hidden;
  transition: opacity .3s var(--crt-ease), visibility .3s var(--crt-ease);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}
.crt-modal-overlay.is-open { opacity: 1; visibility: visible; }

/* ================================================================
   MODAL BOX — Portrait design
   ================================================================ */
.crt-modal {
  position: relative;
  background: var(--crt-modal-bg);
  border-radius: var(--crt-modal-radius);
  width: 100%;
  max-width: var(--crt-modal-max-w);
  max-height: calc(100dvh - 40px);
  max-height: calc(100vh  - 40px);
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding: 0 0 20px;          /* header handles its own padding */
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  transform: translateY(40px) scale(0.93);
  transition: transform .38s var(--crt-ease);
  direction: rtl;
  scrollbar-width: thin;
  scrollbar-color: #e5e7eb transparent;
}
.crt-modal::-webkit-scrollbar       { width: 4px; }
.crt-modal::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 4px; }
.crt-modal-overlay.is-open .crt-modal { transform: translateY(0) scale(1); }

/* ================================================================
   MODAL HEADER
   ================================================================ */
.crt-modal-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 15px 20px;
  border-bottom: 1px solid #eeeeee;
  flex-shrink: 0;
}

/* Logo */
.crt-modal-logo {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: #f5f5f5;
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.crt-modal-logo img { width: 100%; height: 100%; object-fit: contain; }

/* Placeholder logo (when no logo set) */
.crt-modal-logo-placeholder {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: #f5f5f5;
  flex-shrink: 0;
}

/* Title — right side (RTL) */
.crt-modal-title {
  flex: 1;
  font-size: 17px;
  font-weight: 700;
  color: #111827;
  margin: 0;
  line-height: 1.4;
  text-align: right;
}

/* Close button */
.crt-modal-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #f3f4f6;
  border: none;
  cursor: pointer;
  color: #6b7280;
  flex-shrink: 0;
  transition: background .2s, transform .25s;
  -webkit-tap-highlight-color: transparent;
}
.crt-modal-close:hover  { background: #e5e7eb; color: #111; transform: rotate(90deg); }
.crt-modal-close svg    { width: 15px; height: 15px; pointer-events: none; }

/* ================================================================
   CAROUSEL WRAPPER
   ================================================================ */
.crt-carousel {
  user-select: none;
  touch-action: pan-y pinch-zoom;
  padding: 0 0 4px;
}

/* ================================================================
   IMAGE AREA (contains track + overlay arrows)
   ================================================================ */
.crt-image-area {
  position: relative;
  background: var(--crt-img-area-bg);
  margin: 20px;           /* padding around the image area */
  border-radius: var(--crt-img-radius);
  box-shadow: var(--crt-img-shadow);
  /* removed overflow:hidden to allow arrows to overhang outside the area */
}

/* ── Track ── */
.crt-carousel-track-wrap { overflow: hidden; }

.crt-carousel-track {
  display: flex;
  transition: transform .45s cubic-bezier(0.4,0,0.2,1);
  will-change: transform;
}

/* ── Fade mode ── */
.crt-carousel[data-transition="fade"] .crt-carousel-track {
  display: block;
  position: relative;
}
.crt-carousel[data-transition="fade"] .crt-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity .5s ease;
  pointer-events: none;
}
.crt-carousel[data-transition="fade"] .crt-slide.is-active {
  position: relative;
  opacity: 1;
  pointer-events: auto;
}

/* ── Slide ── */
.crt-slide {
  flex: 0 0 100%;
  min-width: 0;
}

/* ── Slide inner (white padded frame — removed, image fills area) ── */
.crt-slide-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--crt-img-padding);
  background: var(--crt-img-area-bg);
}

.crt-slide-img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 56vh;
  max-height: 56dvh;
  object-fit: contain;   /* show full image, no cropping */
  border-radius: calc(var(--crt-img-radius) / 2);
}

.crt-slide-caption {
  text-align: center;
  font-size: 12px;
  color: #9ca3af;
  margin: 10px 0 0;
  line-height: 1.5;
}

/* ================================================================
   SVG ICON OVERRIDES
   Force-render SVG strokes regardless of theme CSS resets.
   Some themes set: svg { fill: inherit } or path { display:none }
   ================================================================ */
#crt-sticky-tab svg,
#crt-modal-overlay svg {
  display: inline-block !important;
  visibility: visible !important;
  overflow: visible !important;
}
#crt-modal-close svg path,
.crt-arrow svg path,
.crt-tab-icon svg path,
.crt-tab-icon svg,
.crt-modal-close svg {
  stroke: currentColor !important;
  fill: none !important;
  display: block !important;
  visibility: visible !important;
}
/* Tab button icon uses fill not stroke */
.crt-tab-icon svg { fill: currentColor !important; stroke: none !important; }
.crt-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: rgba(255,255,255,0.88);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border: 1px solid rgba(200,200,200,0.5);
  box-shadow: 0 2px 10px rgba(0,0,0,0.15);
  cursor: pointer;
  color: #374151;
  /* Always slightly visible — fully visible on hover/focus */
  opacity: 0.75;
  transition: opacity .2s, background .2s, transform .18s;
  -webkit-tap-highlight-color: transparent;
}

/* Show arrows on touch (always fully visible) */
@media (hover: none) {
  .crt-arrow { opacity: 0.9; }
}

.crt-arrow:hover {
  background: rgba(255,255,255,0.98);
  box-shadow: 0 4px 14px rgba(0,0,0,0.18);
  opacity: 1;
}
.crt-arrow:active { transform: translateY(-50%) scale(0.9); opacity: 1; }
.crt-arrow:disabled { opacity: 0 !important; pointer-events: none; }
.crt-arrow svg { width: 18px; height: 18px; pointer-events: none; }

/* Prev in RTL is to the Right */
.crt-arrow-prev { right: -18px; }
/* Next in RTL is to the Left */
.crt-arrow-next { left: -18px; }

/* ================================================================
   COUNTER — Arabic numerals
   ================================================================ */
.crt-counter {
  text-align: center;
  font-size: 12px;
  color: #adb5bd;
  font-weight: 500;
  letter-spacing: .3px;
  margin: 10px 0 0;
  line-height: 1;
}

/* ================================================================
   DOTS — Square / Circle / Line (data-shape on container)
   ================================================================ */
.crt-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 10px 0 0;
  padding: 0 20px 2px;
  flex-wrap: wrap;
}

.crt-dot {
  width: var(--crt-dot-size);
  height: var(--crt-dot-size);
  border-radius: var(--crt-dot-radius);
  background: var(--crt-dot-inactive);
  border: none;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  position: relative;
  transition: background .25s, width .28s, border-radius .28s, opacity .25s;
  -webkit-tap-highlight-color: transparent;
}

/* Invisible tap zone */
.crt-dot::before { content: ''; position: absolute; inset: -6px; }

/* Active dot */
.crt-dot.is-active {
  background: var(--crt-dot-active);
}

/* Shape overrides */
.crt-dots[data-shape="square"]  .crt-dot               { border-radius: 3px; }
.crt-dots[data-shape="square"]  .crt-dot.is-active      { border-radius: 3px; width: calc(var(--crt-dot-size) * 2); }

.crt-dots[data-shape="circle"]  .crt-dot               { border-radius: 50%; }
.crt-dots[data-shape="circle"]  .crt-dot.is-active      { border-radius: 50%; }

.crt-dots[data-shape="line"]    .crt-dot               { border-radius: 2px; height: 4px; width: calc(var(--crt-dot-size) * 1.5); }
.crt-dots[data-shape="line"]    .crt-dot.is-active      { width: calc(var(--crt-dot-size) * 2.5); }

/* ================================================================
   NO IMAGES
   ================================================================ */
.crt-no-images {
  text-align: center;
  padding: 30px 20px;
  color: #9ca3af;
  font-size: 14px;
}

/* ================================================================
   BODY SCROLL LOCK
   ================================================================ */
body.crt-modal-open {
  overflow: hidden !important;
  padding-right: var(--crt-scrollbar-width, 0px);
}

/* ================================================================
   RESPONSIVE
   ================================================================ */

/* Tablet portrait (480px – 767px) */
@media (max-width: 767px) {
  .crt-modal-overlay { align-items: flex-end; padding: 0; }
  .crt-modal {
    border-radius: 20px 20px 0 0;
    max-width: 100%;
    max-height: 88vh; max-height: 88dvh;
    padding-bottom: max(20px, env(safe-area-inset-bottom));
  }
  .crt-image-area { margin: 14px; }
  .crt-slide-img  { max-height: 48vh; max-height: 48dvh; }
}

/* Mobile (< 480px) */
@media (max-width: 479px) {
  .crt-sticky-tab { width: 44px; min-height: 120px; gap: 6px; }
  .crt-tab-icon svg { width: 18px; height: 18px; }
  .crt-tab-text  { font-size: 11px; }

  .crt-modal-overlay { align-items: flex-end; padding: 0; }
  .crt-modal {
    border-radius: 20px 20px 0 0;
    max-width: 100%;
    max-height: 92vh; max-height: 92dvh;
    padding-bottom: max(16px, env(safe-area-inset-bottom));
  }
  /* Drag handle */
  .crt-modal::before {
    content: '';
    display: block;
    width: 36px; height: 4px;
    background: #d1d5db;
    border-radius: 2px;
    margin: 10px auto 0;
  }

  .crt-modal-header { padding: 12px 16px; }
  .crt-modal-title  { font-size: 15px; }
  .crt-image-area   { margin: 12px; }
  .crt-slide-inner  { padding: max(12px, var(--crt-img-padding)); }
  .crt-slide-img    { max-height: 42vh; max-height: 42dvh; }

  .crt-arrow        { width: 36px; height: 36px; opacity: 1 !important; }
  .crt-arrow-prev   { left: 6px; }
  .crt-arrow-next   { right: 6px; }
}

/* Very small phones */
@media (max-width: 359px) {
  .crt-sticky-tab { width: 40px; min-height: 110px; }
  .crt-tab-text   { font-size: 10px; }
  .crt-tab-icon svg { width: 16px; height: 16px; }
  .crt-slide-img  { max-height: 38vh; max-height: 38dvh; }
}

/* Landscape phone */
@media (max-height: 500px) and (max-width: 900px) {
  .crt-modal-overlay { align-items: center; padding: 8px; }
  .crt-modal {
    border-radius: 16px;
    max-height: 96vh; max-height: 96dvh;
  }
  .crt-modal::before { display: none; }
  .crt-image-area { margin: 10px; }
  .crt-slide-img  { max-height: 48vh; max-height: 48dvh; }
  .crt-sticky-tab { width: 40px; min-height: 90px; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .crt-sticky-tab      { animation: none; }
  .crt-carousel-track  { transition: none; }
  .crt-modal           { transition: none; }
  .crt-modal-overlay   { transition: opacity .15s; }
  .crt-dot, .crt-arrow { transition: none; }
}
