:root {
  --rico-blue: #161616;
  --rico-blue-hover: #000000;
  --rico-primary: #176855;
  --rico-muted: #64748b;
  --rico-border: #e2e8f0;
  --rico-bg: #f8fafc;
}

/* حذف لینک پیش‌فرض مشاهده سبد خرید ووکامرس */
.added_to_cart,
a.added_to_cart,
.woocommerce a.added_to_cart,
.rico-product-cart a.wc-forward {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
  height: 0 !important;
  width: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  font-size: 0 !important;
}

.rico-single-product-notice {
  padding: 14px 18px;
  border-radius: 12px;
  background: #f7f9fc;
  border: 1px dashed var(--rico-border);
  color: var(--rico-muted);
  font-size: 14px;
  line-height: 1.7;
  text-align: center;
}

/* =============================================================
   ۱. ویجت افزودن به سبد خرید
============================================================= */
.rico-product-cart {
  box-sizing: border-box;
  width: 100%;
  padding: 24px;
  border: 1px solid var(--rico-border);
  border-radius: 14px;
  background: #fff;
  color: #17243b;
  direction: rtl;
  font-family: inherit;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.rico-cart-header-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 8px;
  background: #edf2f9;
  color: var(--rico-blue);
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 18px;
}

.rico-cart-header-badge svg {
  display: block;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.rico-cart-info-box {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 16px;
  background: #fafbfd;
  border: 1px solid #edf1f6;
  border-radius: 10px;
  margin-bottom: 20px;
}

.rico-cart-info-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 500;
  color: #2b3b52;
}

.rico-info-icon {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  color: var(--rico-blue);
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.rico-cart-stock-status {
  padding-top: 8px;
  border-top: 1px solid #edf1f6;
  font-weight: 600;
}

.rico-stock-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #25835d;
  box-shadow: 0 0 0 3px rgba(37, 131, 93, 0.15);
}

.rico-cart-stock-status.is-out-of-stock {
  color: #d94a54;
}

.rico-cart-stock-status.is-out-of-stock .rico-stock-indicator {
  background: #d94a54;
  box-shadow: 0 0 0 3px rgba(217, 74, 84, 0.15);
}

.rico-cart-price-block {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  border-top: 1px solid #edf1f6;
  border-bottom: 1px solid #edf1f6;
  margin-bottom: 20px;
}

.rico-cart-price-title {
  font-size: 14px;
  color: var(--rico-muted);
  font-weight: 500;
}

.rico-cart-price {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  text-align: left;
  direction: ltr;
}

.rico-cart-old-row {
  display: flex;
  align-items: center;
  gap: 8px;
  direction: ltr;
}

.rico-cart-regular {
  color: #9eabc4;
  font-size: 13px;
  font-weight: 400;
  text-decoration: line-through;
}

.rico-cart-discount {
  min-width: 38px;
  padding: 3px 8px;
  border-radius: 14px;
  background: var(--rico-primary);
  color: #fff;
  font-size: 12px;
  font-weight: 400;
  line-height: 13px;
  text-align: center;
  unicode-bidi: isolate;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 24px;
}

.rico-cart-current-row {
  display: flex;
  align-items: baseline;
  gap: 5px;
  direction: ltr;
}

.rico-price-current {
  color: #17243b;
  font-size: 22px;
  font-weight: 800;
}

.rico-price-unit {
  color: var(--rico-muted);
  font-size: 13px;
  font-weight: 500;
  direction: rtl;
  unicode-bidi: isolate;
}

.rico-cart-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.rico-cart-actions .rico-qty-stepper {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  height: 48px;
  width: 110px;
  box-sizing: border-box;
  padding: 4px;
  border: 1px solid #dfe5ec;
  border-radius: 10px;
  background: #fff;
}

.rico-cart-actions .rico-qty-button {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 32px;
  height: 38px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--rico-blue);
  cursor: pointer;
  line-height: 0;
}

.rico-cart-actions .rico-qty-button:disabled { opacity: .4; cursor: not-allowed; }

.rico-cart-actions .rico-qty-button svg {
  display: block;
  margin: auto;
  width: 15px;
  height: 15px;
}

.rico-cart-submit {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 48px;
  padding: 0 20px;
  border: 0;
  border-radius: 10px;
  background: var(--rico-blue);
  color: #fff;
  font: inherit;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  overflow: hidden;
  transition: background 0.2s, transform 0.15s, opacity 0.2s;
}

.rico-cart-submit:hover:not(:disabled) {
  background: var(--rico-blue-hover);
  transform: translateY(-1px);
}

.rico-cart-submit:disabled {
  background: #ccd4e0;
  color: #8c9ba5;
  cursor: not-allowed;
  transform: none;
}

.rico-cart-bag {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.rico-cart-submit-state {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
}

.rico-cart-submit-state:after {
  content: "";
  width: 18px;
  height: 18px;
  border: 2px solid #fff;
  border-top-color: transparent;
  border-radius: 50%;
  opacity: 0;
}

.rico-cart-submit.rico-is-loading .rico-cart-submit-label,
.rico-cart-submit.rico-is-loading .rico-cart-bag {
  opacity: 0;
  visibility: hidden;
}

.rico-cart-submit.rico-is-loading .rico-cart-submit-state:after {
  opacity: 1;
  animation: ricoSpin 0.7s linear infinite;
}

@keyframes ricoSpin {
  to { transform: rotate(360deg); }
}

/* =============================================================
   ۲. متغیرهای محصول
============================================================= */
.rico-product-variations {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  direction: rtl;
  margin-bottom: 20px;
}

.rico-variation-group {
  margin: 0;
  padding: 0;
  border: 0;
}

.rico-variation-group legend {
  margin-bottom: 8px;
  color: #2b3b52;
  font-size: 14px;
  font-weight: 600;
}

.rico-variation-options {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.rico-variation-choice {
  flex: 0 0 auto;
  padding: 8px 16px;
  border: 1px solid #dfe5ec;
  border-radius: 10px;
  background: #fff;
  color: #2b3b52;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: 0.18s;
}

.rico-variation-choice:hover {
  border-color: var(--rico-blue);
  background: #f7f9fb;
}

.rico-variation-choice[aria-pressed=true] {
  border-color: var(--rico-blue);
  background: var(--rico-blue);
  color: #fff;
  font-weight: 600;
}

/* =============================================================
   ۳. ویژگی‌های محصول
============================================================= */
.rico-product-attributes {
  width: 100%;
  direction: rtl;
}

.rico-attributes-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.rico-product-attribute,
.rico-attributes-more {
  box-sizing: border-box;
  min-height: 58px;
  padding: 10px 14px;
  border: 1px solid #edf1f6;
  border-radius: 10px;
  background: #fafbfd;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  text-align: right;
  transition: border-color 0.18s, background 0.18s;
}

.rico-product-attribute:hover {
  border-color: #dbe2ec;
  background: #fff;
}

.rico-attribute-label {
  color: var(--rico-muted);
  font-size: 12px;
  line-height: 1.4;
  font-weight: 500;
}

.rico-attribute-value {
  color: #17243b;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.rico-attributes-more {
  align-items: center;
  border: 1px dashed #cfd7e3;
  background: #fff;
  color: var(--rico-blue);
  font: inherit;
  font-size: 13px;
  font-weight: 400;
  cursor: pointer;
}

.rico-attributes-more:hover {
  background: #edf2f9;
  border-color: var(--rico-blue);
}

.rico-attribute-hidden[hidden] {
  display: none !important;
}

/* =============================================================
   ۴. بخش مشخصات فنی و توضیحات
============================================================= */
.rico-product-sections-container {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 30px;
  direction: rtl;
  font-family: inherit;
  box-sizing: border-box;
}

.rico-sections-top-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  align-items: stretch;
}

.rico-detail-card {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--rico-border);
  border-radius: 14px;
  background: #fff;
  padding: 22px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.02);
}

.rico-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 14px;
  border-bottom: 1px solid #edf1f6;
  margin-bottom: 16px;
  flex: 0 0 auto;
}

.rico-card-title-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.rico-card-title-group svg {
  display: block;
  width: 20px;
  height: 20px;
  color: var(--rico-blue);
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.rico-card-title-group h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--rico-blue);
}

.rico-card-body {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.rico-desc-card-body {
  justify-content: space-between;
}

.rico-desc-excerpt {
  color: #3b4859;
  font-size: 14.5px;
  line-height: 2;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 6;
  -webkit-box-orient: vertical;
}

.rico-desc-modal-open-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: flex-start;
  margin-top: auto;
  padding: 8px 16px;
  border: 1px solid #dfe5ec;
  border-radius: 8px;
  background: #fff;
  color: var(--rico-blue);
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: 0.18s;
}

.rico-desc-modal-open-btn:hover {
  background: #f7f9fb;
  border-color: var(--rico-blue);
}

.rico-desc-modal-open-btn svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
}

.rico-specs-scroll-table {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.rico-spec-row {
  display: flex;
  align-items: center;
  padding: 12px 14px;
  border-bottom: 1px solid #edf1f6;
  font-size: 13.5px;
}

.rico-spec-row:last-child {
  border-bottom: 0;
}

.rico-spec-row:nth-child(even) {
  background: #fafbfd;
  border-radius: 6px;
}

.rico-spec-label {
  flex: 0 0 160px;
  color: var(--rico-muted);
  font-weight: 500;
}

.rico-spec-value {
  flex: 1;
  color: #1c2738;
  font-weight: 600;
  line-height: 1.6;
}

/* =============================================================
   ۵. بخش نظرات و امتیازدهی
============================================================= */
.rico-reviews-section {
  width: 100%;
  border: 1px solid var(--rico-border);
  border-radius: 14px;
  background: #fff;
  padding: 26px;
  box-sizing: border-box;
}

.rico-reviews-container {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 32px;
  align-items: start;
}

.rico-reviews-summary-col {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.rico-rating-score-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px;
  border-radius: 12px;
  background: #fafbfd;
  border: 1px solid #edf1f6;
  text-align: center;
}

/* اصلاح استایل آیکون ستاره */
.rico-rating-star-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 6px;
}

.rico-rating-star-icon svg {
  width: 36px;
  height: 36px;
  fill: #f59e0b;
  stroke: #f59e0b;
}

.rico-rating-score-num {
  font-size: 32px;
  font-weight: 800;
  color: #2b3b52;
  line-height: 1.2;
}

.rico-rating-score-sub {
  font-size: 12px;
  color: var(--rico-muted);
  margin-bottom: 16px;
}

.rico-rating-bars {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rico-rating-bar-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.rico-star-num {
  font-size: 12px;
  color: var(--rico-muted);
  flex: 0 0 10px;
}

.rico-rating-bar-track {
  flex: 1;
  height: 6px;
  background: #eef2f6;
  border-radius: 4px;
  overflow: hidden;
}

.rico-rating-bar-fill {
  height: 100%;
  background: #f59e0b;
  border-radius: 4px;
}

.rico-add-review-card {
  padding: 16px;
  border-radius: 12px;
  background: #fafbfd;
  border: 1px solid #edf1f6;
}

/* اصلاح آیکون نظردهی */
.rico-add-review-prompt {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 500;
  color: #4b5869;
  margin-bottom: 14px;
}

.rico-add-review-prompt svg {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  fill: none;
  stroke: var(--rico-blue);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.rico-add-review-btn {
  width: 100%;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 10px;
  background: var(--rico-blue);
  color: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.18s, transform 0.15s;
}

.rico-add-review-btn:hover {
  background: var(--rico-blue-hover);
  transform: translateY(-1px);
}

.rico-add-review-btn svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 2.2;
}

.rico-reviews-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.rico-reviews-count-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  color: #2b3b52;
}

.rico-reviews-count-badge span {
  padding: 2px 8px;
  border-radius: 12px;
  background: #eef2f6;
  font-size: 12px;
  font-weight: 600;
}

.rico-reviews-filter-tools {
  display: flex;
  align-items: center;
  gap: 12px;
}

.rico-filter-funnel {
  width: 17px;
  height: 17px;
  color: #8c9ba5;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

.rico-rev-filter-btn {
  border: 0;
  background: none;
  color: var(--rico-muted);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
  transition: color 0.15s;
}

.rico-rev-filter-btn:hover,
.rico-rev-filter-btn.is-active {
  color: var(--rico-blue);
  font-weight: 600;
}

.rico-reviews-divider {
  width: 100%;
  height: 1px;
  background: #edf1f6;
  margin-bottom: 20px;
}

.rico-no-reviews-box {
  padding: 18px 22px;
  border-radius: 10px;
  background: #f7f9fb;
  color: var(--rico-muted);
  font-size: 14px;
}

.rico-comments-feed {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.rico-review-card {
  padding: 18px;
  border: 1px solid #edf1f6;
  border-radius: 12px;
  background: #fff;
}

.rico-review-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.rico-review-user {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: #1c2738;
}

.rico-buyer-badge {
  padding: 2px 7px;
  border-radius: 10px;
  background: #e7f7ed;
  color: #1d8348;
  font-size: 11px;
  font-weight: 600;
}

.rico-review-date {
  font-size: 12px;
  color: var(--rico-muted);
}

.rico-review-stars {
  display: flex;
  gap: 3px;
  margin-bottom: 10px;
}

.rico-review-stars svg {
  width: 14px;
  height: 14px;
}

.rico-review-stars .star-filled {
  fill: #f59e0b;
  color: #f59e0b;
}

.rico-review-stars .star-empty {
  fill: none;
  stroke: #cbd5e1;
}

.rico-review-text {
  color: #435266;
  font-size: 13.5px;
  line-height: 1.8;
}

/* =============================================================
   ۶. مدال‌ها
============================================================= */
.rico-desc-modal,
.rico-add-review-modal {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: grid;
  place-items: center;
  padding: 20px;
  direction: rtl;
  box-sizing: border-box;
}

.rico-desc-modal[hidden],
.rico-add-review-modal[hidden] {
  display: none !important;
}

.rico-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(12, 22, 42, 0.45);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.rico-modal-box {
  position: relative;
  z-index: 2;
  box-sizing: border-box;
  width: min(560px, 100%);
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(13, 31, 63, 0.25);
  overflow: hidden;
  animation: ricoModalIn 0.24s cubic-bezier(0.18, 0.89, 0.32, 1.28) both;
}

@keyframes ricoModalIn {
  from { opacity: 0; transform: translateY(16px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.rico-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid #edf1f6;
  background: #fafbfd;
}

.rico-modal-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--rico-blue);
}

.rico-modal-close {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 32px;
  height: 32px;
  border: 0;
  background: none;
  font-size: 18px;
  color: var(--rico-muted);
  cursor: pointer;
  padding: 0;
  margin: 0;
  line-height: 1;
}

.rico-modal-content-scroll {
  padding: 24px;
  overflow-y: auto;
  font-size: 14.5px;
  line-height: 2;
  color: #3b4859;
}

.rico-custom-review-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.rico-form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.rico-form-group label {
  font-size: 13px;
  font-weight: 600;
  color: #2b3b52;
}

.rico-form-group .req {
  color: #d94a54;
}

.rico-form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.rico-form-group input,
.rico-form-group textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 11px 14px;
  border: 1px solid #dfe5ec;
  border-radius: 10px;
  background: #fff;
  font-family: inherit;
  font-size: 13.5px;
  color: #17243b;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.rico-form-group input:focus,
.rico-form-group textarea:focus {
  border-color: var(--rico-blue);
  box-shadow: 0 0 0 2px rgba(29, 50, 101, 0.08);
}

.rico-interactive-stars {
  display: inline-flex;
  gap: 4px;
  font-size: 26px;
  cursor: pointer;
}

.rico-star-pick {
  color: #cbd5e1;
  transition: color 0.15s, transform 0.15s;
  user-select: none;
}

.rico-star-pick.is-active {
  color: #f59e0b;
}

.rico-custom-submit-btn {
  height: 46px;
  border: 0;
  border-radius: 10px;
  background: var(--rico-blue);
  color: #fff;
  font: inherit;
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.18s, transform 0.15s;
  margin-top: 6px;
}

.rico-custom-submit-btn:hover {
  background: var(--rico-blue-hover);
  transform: translateY(-1px);
}

@media (max-width: 767px) {
  .rico-attributes-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .rico-product-cart {
    padding: 16px;
  }
  .rico-price-current {
    font-size: 19px;
  }
  .rico-sections-top-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .rico-reviews-section {
    padding: 18px;
  }
  .rico-reviews-container {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .rico-form-row {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}