/**
 * Single Product Stylesheet - Top2Card Store
 * 
 * - Standard full desktop width (1080px) matching the rest of the store
 * - Two balanced columns on desktop (Media: 280px | Info: 1fr)
 * - Proportional compact image (280px on desktop, 200px on mobile)
 * - Tight, cohesive vertical rhythm (no excessive gaps)
 * - Original payment gateways design preserved exactly
 */

:root {
  --spx-accent: var(--color-primary, #01696f);
  --spx-accent-hover: var(--color-primary-hover, #0c4e54);
  --spx-accent-tint: var(--color-primary-light, #e8f5f5);
  --spx-border: var(--color-border, #e0e0e0);
  --spx-divider: var(--color-divider, #e8e8e8);
  --spx-text: var(--color-text, #111111);
  --spx-text-muted: var(--color-text-muted, #555555);
  --spx-text-subtle: var(--color-text-subtle, #777777);
  --spx-bg-card: #ffffff;
  --spx-bg-block: var(--color-block, #f8f8fa);
  --spx-bg-subtle: #f9f9fb;
}

/* ══════════════════════════════════════
   Wrapper & Breadcrumbs
══════════════════════════════════════ */
.spx-wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 28px 20px 60px;
  direction: rtl;
  color: var(--spx-text);
  font-family: inherit;
}

.spx-breadcrumbs-wrap {
  margin-bottom: 20px;
  font-size: 0.8125rem;
  color: var(--spx-text-subtle);
}

.spx-breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  line-height: 1.4;
}

.spx-breadcrumbs a {
  color: var(--spx-text-muted);
  text-decoration: none;
  transition: color 140ms ease-out;
}

.spx-breadcrumbs a:hover {
  color: var(--spx-accent);
}

.spx-crumb-sep {
  opacity: 0.4;
  user-select: none;
}

.spx-crumb-item.current {
  color: var(--spx-text);
  font-weight: 500;
}

/* ══════════════════════════════════════
   Main Layout Grid (Two Columns Desktop)
══════════════════════════════════════ */
.spx-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 36px;
  align-items: start;
}

/* ── عمود الصورة ── */
.spx-media {
  position: sticky;
  top: 96px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 280px;
}

.spx-img-frame {
  width: 280px;
  height: 280px;
  border-radius: 16px;
  border: 1px solid var(--spx-border);
  background: var(--spx-bg-block);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.spx-img {
  width: 82%;
  height: 82%;
  object-fit: contain;
  display: block;
}

/* التقييم أسفل الصورة */
.spx-rating-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  align-self: center;
  background: var(--spx-bg-block);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--spx-text-muted);
}

.spx-stars {
  display: flex;
  gap: 2px;
}

.spx-star {
  width: 12px;
  height: 12px;
  stroke: #eab308;
  fill: none;
  stroke-width: 2;
}

.spx-star.on {
  fill: #eab308;
}

.spx-rc {
  opacity: 0.65;
  font-weight: 400;
}

/* ── عمود المعلومات ── */
.spx-info {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* الاسم والسعر */
.spx-title-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--spx-divider);
}

.spx-meta-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.spx-cat-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--spx-accent);
  text-decoration: none;
  line-height: 1;
  width: fit-content;
}

.spx-cat-label:hover {
  text-decoration: underline;
}

.spx-title {
  font-size: clamp(1.35rem, 2.2vw, 1.75rem);
  font-weight: 700;
  color: var(--spx-text);
  line-height: 1.3;
  margin: 0;
}

.spx-price-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
}

.spx-price {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--spx-accent);
  line-height: 1;
}

.spx-price .woocommerce-Price-amount {
  color: inherit;
}

.spx-discount-pill {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  background: #fee2e2;
  color: #dc2626;
  border: 1px solid #fecaca;
  line-height: 1.3;
}

/* المميزات */
.spx-features {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.spx-features li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.86rem;
  color: var(--spx-text-muted);
  line-height: 1.4;
}

.spx-feature-icon {
  width: 15px;
  height: 15px;
  color: var(--spx-accent);
  flex-shrink: 0;
}

/* نموذج WooCommerce */
#wc-cart-form {
  margin: 0;
  padding: 0;
}

#wc-cart-form .single_add_to_cart_button {
  display: none !important;
}

#wc-cart-form table.variations {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 12px;
}

#wc-cart-form table.variations tr {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 10px;
}

#wc-cart-form table.variations td.label {
  padding: 0;
}

#wc-cart-form table.variations td.label label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--spx-text);
  margin-bottom: 2px;
  display: block;
}

#wc-cart-form table.variations td.value {
  padding: 0;
}

#wc-cart-form select {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  background-color: var(--spx-bg-card);
  border: 1px solid var(--spx-border);
  border-radius: 8px;
  color: var(--spx-text);
  font-size: 0.875rem;
  font-family: inherit;
  transition: border-color 140ms ease-out;
  cursor: pointer;
}

#wc-cart-form select:focus-visible {
  outline: none;
  border-color: var(--spx-accent);
}

#wc-cart-form .reset_variations {
  display: inline-block;
  margin-top: 4px;
  font-size: 0.72rem;
  color: var(--spx-text-subtle);
  text-decoration: underline;
}

/* هامش حقل الكمية المودرن */
.modern-qty-wrapper {
  margin-bottom: 10px !important;
}

/* ══════════════════════════════════════
   بوابات الدفع (بالتصميم الأصلي تماماً)
══════════════════════════════════════ */
.spx-gateways {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
}

.spx-gw-label {
  font-size: .78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--color-text-muted);
  margin: 0;
}

.spx-gw-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.spx-gw-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1.5px solid var(--color-border, #e0e0e0);
  cursor: pointer;
  transition: border-color .18s, background .18s;
  background: var(--card-bg, #fff);
  user-select: none;
}

.spx-gw-item:hover {
  border-color: var(--color-primary, #01696f);
}

.spx-gw-item.active {
  border-color: var(--color-primary, #01696f);
  background: var(--color-primary-light, #e8f5f5);
}

.spx-gw-item input[type=radio] {
  display: none;
}

/* مؤشر الاختيار */
.spx-gw-check {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--color-border, #ccc);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: border-color .18s, background .18s;
}

.spx-gw-check svg {
  width: 10px;
  height: 10px;
  fill: #fff;
  opacity: 0;
  transition: opacity .15s;
}

.spx-gw-item.active .spx-gw-check {
  border-color: var(--color-primary, #01696f);
  background: var(--color-primary, #01696f);
}

.spx-gw-item.active .spx-gw-check svg {
  opacity: 1;
}

.spx-gw-name {
  flex: 1;
  font-size: .92rem;
  color: var(--color-text);
}

.spx-gw-icon img {
  height: 20px;
  width: auto;
  display: block;
}

.spx-gw-fields {
  display: none;
  padding: 13px 16px;
  background: var(--color-bg-secondary, #f9f9f9);
  border-radius: 10px;
  margin-top: -2px;
}

.spx-gw-fields.open {
  display: block;
}

.spx-gw-fields p {
  font-size: .84rem;
  color: var(--color-text-muted);
  margin: 0;
}

.spx-empty-wallet {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 16px;
  background: var(--alert-warning-bg, #fff8e1);
  color: var(--alert-warning-text, #795548);
  border: 1px solid var(--alert-warning-border, #ffe082);
  border-radius: 10px;
  font-size: .86rem;
  font-weight: 500;
}

.spx-empty-wallet svg {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
}

/* ══════════════════════════════════════
   Status Messages & Alerts
══════════════════════════════════════ */
.spx-status {
  display: none;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 0.84rem;
  line-height: 1.5;
  border: 1px solid transparent;
  margin-top: 4px;
}

.spx-status.success {
  background: #f0fdf4;
  color: #166534;
  border-color: #bbf7d0;
}

.spx-status.error {
  background: #fef2f2;
  color: #991b1b;
  border-color: #fecaca;
}

.spx-status.warning {
  background: #fffbeb;
  color: #92400e;
  border-color: #fde68a;
}

.spx-status-inner {
  display: block;
}

.spx-recharge {
  display: inline-block;
  margin-top: 4px;
  color: var(--spx-accent);
  font-weight: 600;
  text-decoration: underline;
}

/* ══════════════════════════════════════
   Primary Buy Button
══════════════════════════════════════ */
.spx-buy-btn {
  width: 100%;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 24px;
  font-size: 0.95rem;
  font-weight: 700;
  font-family: inherit;
  border: none;
  cursor: pointer;
  border-radius: 12px;
  background: var(--btn-bg, var(--color-primary, #01696f));
  color: var(--btn-text, #ffffff);
  transition: background-color 140ms ease-out;
  margin-top: 4px;
}

.spx-buy-btn:hover:not(:disabled) {
  background: var(--btn-hover-bg, #0c4e54);
}

.spx-buy-btn:focus-visible {
  outline: 2px solid var(--spx-accent);
  outline-offset: 2px;
}

.spx-buy-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.spx-buy-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.spx-field-error {
  border-color: #dc2626 !important;
  background-color: #fff5f5 !important;
}

/* ══════════════════════════════════════
   Lower Sections: Description & Specs (Accordion)
══════════════════════════════════════ */
.spx-desc-section {
  margin-top: 36px;
  background: var(--spx-bg-card);
  border: 1px solid var(--spx-border);
  border-radius: 14px;
  overflow: hidden;
  transition: border-color 160ms ease;
}

.spx-desc-section.is-open {
  border-color: var(--spx-border);
}

.spx-desc-header {
  margin: 0;
}

.spx-desc-heading {
  margin: 0;
  padding: 0;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
}

.spx-desc-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--spx-text);
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 700;
  text-align: right;
  direction: rtl;
  user-select: none;
  transition: background-color 150ms ease, color 150ms ease;
}

.spx-desc-toggle:hover {
  background-color: var(--spx-bg-subtle);
  color: var(--spx-accent);
}

.spx-desc-toggle:focus-visible {
  outline: 2px solid var(--spx-accent);
  outline-offset: -2px;
}

.spx-desc-title-text {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.spx-desc-icon {
  width: 18px;
  height: 18px;
  color: var(--spx-accent);
  flex-shrink: 0;
}

.spx-desc-chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--spx-text-muted);
  transition: transform 220ms ease, color 150ms ease;
}

.spx-desc-toggle:hover .spx-desc-chevron {
  color: var(--spx-accent);
}

.spx-desc-toggle[aria-expanded="true"] .spx-desc-chevron {
  transform: rotate(180deg);
}

.spx-desc-collapse {
  border-top: 1px solid var(--spx-divider);
}

.spx-desc-collapse[hidden] {
  display: none;
}

.spx-desc-body {
  padding: 22px;
}

.spx-desc-content {
  font-size: 0.92rem;
  color: var(--spx-text-muted);
  line-height: 1.8;
}

.spx-desc-content p {
  margin: 0 0 14px;
}

.spx-desc-content p:last-child {
  margin-bottom: 0;
}

.spx-desc-content img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  border: 1px solid var(--spx-border);
}

.spx-desc-content ul,
.spx-desc-content ol {
  padding-right: 20px;
  margin: 0 0 14px;
}

.spx-desc-content li {
  margin-bottom: 4px;
}

/* Specifications Table */
.spx-specs-block {
  margin-top: 24px;
}

.spx-specs-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--spx-text);
  margin-bottom: 10px;
}

.spx-specs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
  border: 1px solid var(--spx-border);
  border-radius: 8px;
  overflow: hidden;
}

.spx-specs-table tr {
  border-bottom: 1px solid var(--spx-border);
}

.spx-specs-table tr:last-child {
  border-bottom: none;
}

.spx-specs-table tr:nth-child(even) {
  background: var(--spx-bg-subtle);
}

.spx-specs-table th {
  padding: 10px 14px;
  text-align: right;
  font-weight: 600;
  color: var(--spx-text);
  width: 32%;
  background: var(--spx-bg-block);
}

.spx-specs-table td {
  padding: 10px 14px;
  color: var(--spx-text-muted);
}

/* ══════════════════════════════════════
   Reviews & Related Wrappers
══════════════════════════════════════ */
.spx-reviews-wrap {
  margin-top: 36px;
}

/* ══════════════════════════════════════
   Order Processing Overlay Modal
══════════════════════════════════════ */
.op-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 140ms ease-out;
}

.op-overlay.visible {
  opacity: 1;
  pointer-events: all;
}

.op-badge {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--spx-bg-card);
  border-radius: 14px;
  border: 1px solid var(--spx-border);
  padding: 18px 26px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  font-size: 0.94rem;
  font-weight: 600;
  color: var(--spx-text);
}

.op-spinner {
  width: 20px;
  height: 20px;
  border: 2.5px solid var(--spx-accent);
  border-top-color: transparent;
  border-radius: 50%;
  animation: op-spin 0.65s linear infinite;
  flex-shrink: 0;
}

@keyframes op-spin {
  to { transform: rotate(360deg); }
}

/* ══════════════════════════════════════
   Responsive Adjustments (Mobile & Tablet)
══════════════════════════════════════ */
@media (max-width: 860px) {
  .spx-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .spx-media {
    position: static;
    max-width: 220px;
    margin: 0 auto;
    width: 100%;
    align-items: center;
  }
  .spx-img-frame {
    width: 220px;
    height: 220px;
  }
  .spx-wrap {
    padding: 16px 14px 40px;
  }
  .spx-desc-toggle {
    padding: 14px 16px;
    font-size: 0.98rem;
  }
  .spx-desc-body {
    padding: 16px;
  }
}

/* ══════════════════════════════════════
   Product Reviews & Comments (custom-reviews)
══════════════════════════════════════ */
.rv {
  font-family: var(--font-family);
  margin-top: var(--space-xl);
}

.rv-wrap {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--card-border-radius);
  overflow: hidden;
}

/* Head */
.rv-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--color-divider);
}

.rv-title {
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-bold);
  color: var(--color-heading);
  margin: 0;
}

.rv-badge {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.rv-avg {
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-bold);
  color: var(--color-primary);
  line-height: 1;
}

.rv-badge-right {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.rv-stars-row {
  display: flex;
  align-items: center;
  gap: 1px;
}

.rv-stars-row .rv-stars {
  display: flex;
  align-items: center;
  gap: 1px;
}

.rv-count {
  font-size: var(--font-size-xs);
  color: var(--color-text-subtle);
}

/* List */
.rv-list {
  display: flex;
  flex-direction: column;
}

.rv-item {
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--color-divider);
  transition: background var(--transition-fast);
}

.rv-item:hover {
  background: var(--color-block);
}

.rv-extra {
  display: none;
}

.rv-item-head {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-sm);
}

.rv-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--color-border);
}

.rv-avatar-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-primary-light);
  color: var(--color-primary);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-bold);
}

.rv-item-meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.rv-author {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semi);
  color: var(--color-heading);
}

.rv-item-sub {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.rv-date {
  font-size: var(--font-size-xs);
  color: var(--color-text-subtle);
}

.rv-content {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  line-height: 1.7;
  margin: 0;
  padding-right: calc(36px + var(--space-sm));
}

/* More btn */
.rv-more-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  width: 100%;
  background: transparent;
  border: none;
  border-top: 1px solid var(--color-divider);
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
  padding: var(--space-md);
  cursor: pointer;
  transition: color var(--transition-fast), background var(--transition-fast);
  border-radius: 0;
  box-shadow: none;
}

.rv-more-btn:hover {
  color: var(--color-primary);
  background: var(--color-block);
  box-shadow: none;
}

.rv-more-btn svg {
  width: 16px;
  height: 16px;
  transition: transform var(--transition-base);
  flex-shrink: 0;
}

.rv-more-btn.rv-open svg {
  transform: rotate(180deg);
}

/* Empty */
.rv-empty {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-xl) var(--space-lg);
  color: var(--color-text-subtle);
}

.rv-empty svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.rv-empty p {
  font-size: var(--font-size-sm);
  margin: 0;
  color: var(--color-text-subtle);
}

/* Footer */
.rv-footer {
  padding: var(--space-md) var(--space-lg);
  border-top: 1px solid var(--color-divider);
  background: var(--color-bg-secondary);
}

.rv-write-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  background: var(--btn-bg);
  color: var(--btn-text);
  border: none;
  border-radius: var(--btn-border-radius);
  padding: 9px var(--space-lg);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semi);
  cursor: pointer;
  transition: var(--btn-transition);
}

.rv-write-btn:hover {
  background: var(--btn-hover-bg);
  box-shadow: var(--shadow-primary);
}

.rv-write-btn svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.rv-login-msg {
  font-size: var(--font-size-sm);
  color: var(--color-text-subtle);
  margin: 0;
}

.rv-login-msg a {
  color: var(--color-primary);
  font-weight: var(--font-weight-semi);
}

.rv-login-msg a:hover {
  color: var(--color-primary-hover);
}

/* Modal */
.rv-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  z-index: var(--z-modal);
  align-items: flex-end;
  justify-content: center;
  padding: 0;
}

@media (min-width: 600px) {
  .rv-modal {
    align-items: center;
    padding: var(--space-md);
  }
}

.rv-modal.rv-open {
  display: flex;
}

.rv-modal-box {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--card-border-radius) var(--card-border-radius) 0 0;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: rv-slide-up 0.25s ease;
}

@media (min-width: 600px) {
  .rv-modal-box {
    border-radius: var(--card-border-radius);
  }
}

@keyframes rv-slide-up {
  from {
    transform: translateY(30px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.rv-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--color-divider);
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-bold);
  color: var(--color-heading);
  position: sticky;
  top: 0;
  background: var(--card-bg);
}

.rv-modal-close {
  background: transparent;
  border: none;
  color: var(--color-text-muted);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition: color var(--transition-fast), background var(--transition-fast);
  box-shadow: none;
}

.rv-modal-close:hover {
  color: var(--alert-error-text);
  background: var(--alert-error-bg);
  box-shadow: none;
}

.rv-modal-body {
  padding: var(--space-lg);
}

/* Form */
.rv-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

/* Stars pick */
.rv-stars-pick {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  justify-content: center;
  padding: var(--space-sm) 0;
}

.rv-star-pick {
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition: transform var(--transition-fast);
  box-shadow: none;
}

.rv-star-pick:hover {
  transform: scale(1.2);
  box-shadow: none;
}

.rv-star-pick svg {
  width: 36px;
  height: 36px;
  fill: var(--color-border);
  transition: fill var(--transition-fast);
  display: block;
}

.rv-star-pick.active svg,
.rv-star-pick.hovered svg {
  fill: var(--color-primary);
}

.rv-stars-hint {
  text-align: center;
  font-size: var(--font-size-xs);
  color: var(--color-text-subtle);
  min-height: 16px;
  margin: 0;
}

.rv-form textarea {
  background: var(--input-bg);
  color: var(--input-text);
  border: 1px solid var(--input-border);
  border-radius: var(--input-border-radius);
  padding: var(--input-padding);
  font-size: var(--input-font-size);
  font-family: var(--font-family);
  width: 100%;
  resize: vertical;
  min-height: 110px;
  outline: none;
  transition: border-color var(--transition-base), box-shadow var(--transition-base);
}

.rv-form textarea:focus {
  border-color: var(--input-focus-border);
  box-shadow: var(--input-focus-shadow);
}

.rv-form textarea::placeholder {
  color: var(--input-placeholder);
}

.rv-submit-btn {
  width: 100%;
  background: var(--btn-bg);
  color: var(--btn-text);
  border: none;
  border-radius: var(--btn-border-radius);
  padding: 12px;
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-bold);
  font-family: var(--font-family);
  cursor: pointer;
  transition: var(--btn-transition);
  justify-content: center;
}

.rv-submit-btn:hover {
  background: var(--btn-hover-bg);
  box-shadow: var(--shadow-primary);
}

.rv-submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.rv-form-msg {
  text-align: center;
  font-size: var(--font-size-sm);
  min-height: 20px;
  margin: 0;
}

.rv-form-msg.ok {
  color: var(--alert-success-text);
}

.rv-form-msg.err {
  color: var(--alert-error-text);
}

/* Locked */
.rv-locked {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-xl) var(--space-md);
  text-align: center;
  color: var(--color-text-muted);
}

.rv-locked svg {
  width: 36px;
  height: 36px;
  color: var(--color-text-subtle);
}

.rv-locked p {
  font-size: var(--font-size-sm);
  margin: 0;
}

/* ══════════════════════════════════════
   Related Products — Carousel Section
══════════════════════════════════════ */
.related-section {
  width: 100%;
  margin-top: 48px;
  padding-top: 36px;
  border-top: 1px solid var(--spx-divider, #e8e8e8);
  direction: rtl;
  box-sizing: border-box;
}

.related-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.related-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.related-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--spx-text, #111111);
  margin: 0;
  line-height: 1.25;
}

.related-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.rc-btn {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--spx-border, #e5e7eb);
  background-color: #ffffff;
  color: var(--spx-text-muted, #555555);
  cursor: pointer;
  transition: background-color 140ms ease-out, border-color 140ms ease-out, color 140ms ease-out;
  padding: 0;
  box-shadow: none !important;
}

.rc-btn:hover {
  background-color: var(--spx-accent, #0053dc);
  border-color: var(--spx-accent, #0053dc);
  color: #ffffff;
}

.rc-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  background-color: var(--spx-bg-block, #f8f8fa);
  border-color: var(--spx-border, #e5e7eb);
  color: var(--spx-text-subtle, #999999);
  pointer-events: none;
}

.rc-btn svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
}

/* Track wrapper */
.rc-track-wrap {
  overflow: hidden;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  width: 100%;
  border-radius: 12px;
}

.rc-track-wrap.is-dragging {
  cursor: grabbing;
}

.rc-track {
  display: flex;
  gap: 16px;
  transition: transform 0.36s cubic-bezier(0.2, 0, 0, 1);
  will-change: transform;
  box-sizing: border-box;
}

/* Related Product Card */
.rc-card {
  flex: 0 0 var(--rc-card-w, calc((100% - 48px) / 4));
  display: flex;
  flex-direction: column;
  background-color: #ffffff;
  border: 1px solid var(--spx-border, #e5e7eb);
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  box-sizing: border-box;
  transition: border-color 140ms ease-out;
  box-shadow: none !important;
}

.rc-card:hover {
  border-color: var(--spx-accent, #0053dc);
}

.rc-thumb-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  background-color: var(--spx-bg-block, #f8f8fa);
  overflow: hidden;
}

.rc-thumb-link {
  display: block;
  width: 100%;
  height: 100%;
  text-decoration: none;
}

.rc-thumb-link img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 12px;
  box-sizing: border-box;
  display: block;
  transition: transform 160ms ease-out;
}

.rc-card:hover .rc-thumb-link img {
  transform: scale(1.05);
}

.rc-sale-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background-color: #dc2626;
  color: #ffffff;
  font-size: 0.6875rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 6px;
  pointer-events: none;
  z-index: 2;
}

.rc-card .card-wishlist-btn {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 3;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--spx-border, #e5e7eb);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--spx-text-subtle, #777777);
  cursor: pointer;
  transition: color 140ms ease-out, border-color 140ms ease-out, background-color 140ms ease-out;
  padding: 0;
}

.rc-card .card-wishlist-btn:hover {
  color: #dc2626;
  border-color: #dc2626;
  background-color: #ffffff;
}

.rc-card .card-wishlist-btn.is-active {
  color: #dc2626;
  border-color: #dc2626;
  background-color: #ffffff;
}

.rc-card .card-wishlist-btn.is-active svg {
  fill: #dc2626;
}

.rc-card .card-wishlist-btn svg {
  width: 15px;
  height: 15px;
}

.rc-info {
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background-color: #ffffff;
  border-top: 1px solid var(--spx-divider, #f0f0f0);
  flex: 1;
}

.rc-name {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--spx-text, #111111);
  text-decoration: none;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
  transition: color 140ms ease-out;
}

.rc-card:hover .rc-name {
  color: var(--spx-accent, #0053dc);
}

.rc-action-btn {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--spx-bg-block, #f4f4f5);
  color: var(--spx-text-muted, #71717a);
  flex-shrink: 0;
  text-decoration: none;
  transition: background-color 140ms ease-out, color 140ms ease-out;
}

.rc-action-btn svg {
  width: 13px;
  height: 13px;
}

.rc-card:hover .rc-action-btn {
  background-color: var(--spx-accent, #0053dc);
  color: #ffffff;
}

@media (max-width: 768px) {
  .related-section {
    margin-top: 32px;
    padding-top: 24px;
  }

  .related-header {
    margin-bottom: 14px;
  }

  .related-title {
    font-size: 1.0625rem;
  }

  /* إخفاء أزرار الأسهم في الهاتف والاعتماد على السحب باللمس */
  .related-nav {
    display: none !important;
  }

  /* تمكين التحريك الطبيعي بالسحب باللمس (Touch Swipe) مع المحاذاة التلقائية */
  .rc-track-wrap {
    overflow: hidden;
    cursor: auto;
    -webkit-overflow-scrolling: touch;
  }

  .rc-track {
    gap: 8px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
    transform: none !important;
  }

  .rc-track::-webkit-scrollbar {
    display: none;
  }

  /* 3 بطاقات بالضبط في الصف الواحد */
  .rc-card {
    flex: 0 0 calc((100% - 16px) / 3) !important;
    min-width: calc((100% - 16px) / 3);
    scroll-snap-align: start;
    border-radius: 10px;
  }

  .rc-thumb-wrap {
    border-radius: 9px 9px 0 0;
  }

  .rc-thumb-link img {
    padding: 6px;
  }

  .rc-card .card-wishlist-btn {
    top: 5px;
    left: 5px;
    width: 24px;
    height: 24px;
  }

  .rc-card .card-wishlist-btn svg {
    width: 12px;
    height: 12px;
  }

  .rc-sale-badge {
    top: 5px;
    right: 5px;
    font-size: 0.625rem;
    padding: 1px 5px;
    border-radius: 4px;
  }

  .rc-info {
    padding: 6px 6px 8px;
    gap: 4px;
  }

  .rc-name {
    font-size: 0.6875rem;
    line-height: 1.3;
    -webkit-line-clamp: 2;
  }

  .rc-action-btn {
    display: none;
  }
}

