/* مخفی‌کردن select */
.nwl-wrapper select {
  display: none !important;
}

#nwl-toast {
   position: fixed;
   bottom: 20px;
   right: 20px;
   background: #333;
   color: #fff;
   padding: 12px 16px;
   border-radius: 6px;
   opacity: 0;
   transition: opacity 0.4s;
   z-index: 999999;
}

#nwl-toast.show {
   opacity: 1;
}

/* Radio */
.nwl-radio-item {
  display: inline-flex;
  align-items: center;
  margin-right: 10px;
  cursor: pointer;
  color: var(--e-global-color-text) !important;
}

/* Swatches wrapper */
.nwl-swatches {
  margin-top: 8px;
}

/* -----------------------------------------------------------
   CIRCLE BUTTONS (Swatches)
----------------------------------------------------------- */
.nwl-swatch {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  margin: 4px;
  background: #fff !important;
  box-shadow: -14px 8px 20px rgba(0, 0, 0, 0.03) !important;
  border: none !important;
  transition: 0.3s;
  color: var(--e-global-color-text) !important;

  width: 40px !important;
  height: 40px !important;
  border-radius: 50% !important;
  overflow: hidden;
  text-align: center;
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
}

.nwl-swatch:hover {
  opacity: 0.85;
}

/* Selected state */
.nwl-selected {
  border: 2px solid #2ecc71 !important;
}

/* -----------------------------------------------------------
   Qty Buttons & Input Styles (در یک خط با هم)
----------------------------------------------------------- */
.nwl-qty-wrapper {
  display: inline-flex;
  align-items: center;
  direction: rtl;
  gap: 6px;
  border: 1px solid #ccc;
  border-radius: 12px;
  overflow: hidden;
  background: #fafafa;
  width: max-content;
}

/* دکمه‌ها (جمع و تفریق) */
.nwl-qty-btn {
  display: flex;
  align-items: center;
  justify-content: center;

  width: 38px;
  height: 38px;
  
  cursor: pointer;
  border: none;
  background: #fff;
  color: #000 !important;
  font-weight: bold;
  font-size: 20px;

  transition: background-color 0.15s ease, box-shadow 0.15s ease;
  user-select: none;
}

.nwl-qty-btn:not(:last-child) {
  border-right: 1px solid #ccc;
}

.nwl-qty-btn:hover {
  background: #f4f8fe;
  box-shadow: 0 0 0 2px #1761c3;
  color: #1761c3 !important;
}

/* input تعداد */
.nwl-qty-input.qty {
  width: 54px;
  height: 38px;
  text-align: center;
  border: none;
  outline: none;
  font-size: 18px;
  font-weight: 600;
  background: transparent;
  color: #000;
  /* کاملاً یکپارچه با دکمه‌ها */
  border-radius: 0;
  box-shadow: none;
  -moz-appearance: textfield;
}

/* حذف فلش های ورودی عددی در Webkit */
.nwl-qty-input.qty::-webkit-inner-spin-button,
.nwl-qty-input.qty::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Labels */
.variations th.label label,
.nwl-attribute-label,
.nwl-swatch-wrapper .label,
.nwl-swatch-wrapper label {
  color: #000 !important;
}

.radioSpacing {
    margin-left: 5px;
}

/* -----------------------------------------------------------
   TOOLTIP – Graphic Bubble Tooltip for NWL Swatches
----------------------------------------------------------- */

.nwl-swatch[data-tooltip],
.nwl-radio-item[data-tooltip] {
  position: relative;
}

/* Tooltip body */
.nwl-swatch[data-tooltip]:hover::after,
.nwl-radio-item[data-tooltip]:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 110%;
  right: 50%;
  transform: translateX(50%);
  min-width: 180px;
  max-width: 260px;
  padding: 10px 12px;
  background: rgba(0, 0, 0, 0.85);
  color: #fff;
  font-size: 12px;
  line-height: 1.6;
  border-radius: 8px;
  text-align: right;
  direction: rtl;

  opacity: 0;
  pointer-events: none;

  white-space: normal;
  z-index: 999999;

  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);

  transition: opacity 0.18s ease-in-out;
}

/* Tooltip arrow */
.nwl-swatch[data-tooltip]:hover::before,
.nwl-radio-item[data-tooltip]:hover::before {
  content: "";
  position: absolute;
  bottom: 95%;
  right: 50%;
  transform: translateX(50%);
  width: 0;
  height: 0;

  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-top: 8px solid rgba(0, 0, 0, 0.85);

  opacity: 0;
  pointer-events: none;

  z-index: 999998;
  transition: opacity 0.18s ease-in-out;
}

/* Hover show */
.nwl-swatch[data-tooltip]:hover::after,
.nwl-swatch[data-tooltip]:hover::before,
.nwl-radio-item[data-tooltip]:hover::after,
.nwl-radio-item[data-tooltip]:hover::before {
  opacity: 1;
}

/* Responsive fix */
@media (max-width: 480px) {
  .nwl-swatch[data-tooltip]:hover::after,
  .nwl-radio-item[data-tooltip]:hover::after {
    min-width: 140px;
    max-width: 180px;
    font-size: 11px;
  }
}

/* Disable tooltip when empty */
.nwl-swatch[data-tooltip=""]::after,
.nwl-swatch[data-tooltip=""]::before,
.nwl-radio-item[data-tooltip=""]::after,
.nwl-radio-item[data-tooltip=""]::before {
  display: none !important;
}

/**/
.nwl-radio-item.disabled {
    opacity: .5;
    cursor: not-allowed;
}

.nwl-radio-item.disabled input {
    pointer-events: none;
}

.nwl-radio-item.disabled label {
    cursor: not-allowed;
}

/* حالت خط خوردگی برای UX بهتر */
.nwl-radio-item.disabled label {
    text-decoration: line-through;
}

/* فاصله سازگار با RTL و LTR */
.nwl-radio-item {
    margin-inline-end: 8px;
}

