﻿/* --- Tuwayq Smart Product Box Attribute Overlay Styles --- */

@keyframes tuwayq-spb-attr-in {
  from {
    transform: translateX(100%);
    opacity: 0.96;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.product-item.tuwayq-product-box .spb-attr-overlay {
  border-radius: 12px;
  background: #fff;
  border: 1px solid #e8e8e8;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.12);
  animation: tuwayq-spb-attr-in 0.32s ease forwards;
}

.product-item.tuwayq-product-box .spb-attr-overlay__price-wrap {
  flex-direction: row;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 10px 16px;
}

.product-item.tuwayq-product-box .spb-attr-overlay__price-current {
  color: #ff3549;
  font-size: 22px;
}

.product-item.tuwayq-product-box .spb-attr-overlay__title {
  font-size: 18px;
  margin-top: 36px;
}

.product-item .spb-attr-overlay__close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  background: #ececec;
  color: #ff3549;
  font-size: 24px;
  line-height: 30px;
  cursor: pointer;
}

.product-item .spb-attr-overlay__action {
  min-height: 36px;
  border: 0;
  border-radius: 6px;
  color: #fff;
  font-size: 14px;
  line-height: 1.1;
  font-weight: 500;
  cursor: pointer;
}

.product-item .spb-attr-overlay__details {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border-radius: 10px;
  border: 1px solid #bcbcbc;
  background: #f6f6f6;
  color: #666;
  text-decoration: none;
  font-size: 16px;
  line-height: 1.1;
  font-weight: 500;
}

/* --- Color squares: 30×30, ns-check only when selected --- */
.product-item .spb-attr-values.color-squares label,
.product-item .spb-attr-values.image-squares label {
  width: 30px;
  min-width: 30px;
  height: 30px;
  min-height: 30px;
  padding: 0;
  border: 1px solid #e0e0e0;
  background: transparent;
  box-sizing: border-box;
}

.product-item .spb-attr-values.color-squares .attribute-square-container {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.product-item .spb-attr-values.color-squares .attribute-square {
  width: 100%;
  height: 100%;
  max-width: 30px;
  max-height: 30px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.12);
  box-sizing: border-box;
}

.product-item .spb-attr-values.color-squares i.ns-check.spb-attr-color-check {
  display: none;
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
  line-height: 1;
  pointer-events: none;
  z-index: 2;
  font-size: 14px;
}

.product-item .spb-attr-values.color-squares li.selected-value i.ns-check.spb-attr-color-check {
  display: block;
}

.product-item .spb-attr-values.color-squares i.ns-check.spb-attr-color-check:before {
  color: var(--white);
  font-size: 14px;
}

.product-item.tuwayq-product-box .spb-attr-values.color-squares li.selected-value .attribute-square,
.product-item.tuwayq-product-box .spb-attr-values.image-squares li.selected-value .attribute-square {
  outline: 0;
  box-shadow: 0 0 0 2px #ff3549;
}

.product-item .spb-attr-values.image-squares .attribute-square-container {
  width: 100%;
  height: 100%;
}

.product-item .spb-attr-values.image-squares .attribute-square {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.12);
  box-sizing: border-box;
}

/* --- Radio / text attribute values (not color or image swatches) --- */
.product-item .spb-attr-values:not(.color-squares):not(.image-squares) label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  min-height: 30px;
  padding: 1px 10px;
  border: 1px solid #cfcfcf;
  border-radius: 30px;
  background: #f7f7f7;
  color: #4b4b4b;
  cursor: pointer;
  transition: all 0.15s ease;
  font-size: 14px;
  box-sizing: border-box;
}

/* Single-letter: fixed circle */
.product-item .spb-attr-values:not(.color-squares):not(.image-squares) li.spb-attr-radio--single label {
  width: 30px;
  max-width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 50%;
  font-weight: 600;
}

/* Multi: pill grows with text; inherits base padding */
.product-item .spb-attr-values:not(.color-squares):not(.image-squares) li.spb-attr-radio--multi label {
  width: auto;
  height: 30px;
  min-height: 30px;
  padding: 1px 10px;
  border-radius: 30px;
  font-weight: 600;
}

/* List view / narrow layout: keep same sizing (overrides plugin responsive label padding) */
.product-list .product-item.has-attribute .details .spb-attr-values:not(.color-squares):not(.image-squares) li.spb-attr-radio--single label {
  width: 30px;
  max-width: 30px;
  height: 30px;
  padding: 0 !important;
  border-radius: 50%;
  font-weight: 600;
}

.product-list .product-item.has-attribute .details .spb-attr-values:not(.color-squares):not(.image-squares) li.spb-attr-radio--multi label {
  min-height: 30px;
  height: 30px;
  padding: 1px 10px !important;
  border-radius: 30px;
  font-weight: 600;
}

.product-list .product-item.has-attribute .details .spb-attr-values.color-squares label,
.product-list .product-item.has-attribute .details .spb-attr-values.image-squares label {
  width: 30px;
  min-width: 30px;
  height: 30px;
  min-height: 30px;
  padding: 0 !important;
}

/* --- Tuwayq overlay panel (Figma) --- */
.product-item.tuwayq-product-box.has-attribute.spb-attr-overlay-open {
  overflow: hidden;
}

.product-item.tuwayq-product-box .spb-attr-overlay {
  inset: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  text-align: start;
}

.product-item.tuwayq-product-box .spb-attr-overlay__price-old {
  color: #767676;
  font-size: 14px;
  line-height: 1.2;
  font-weight: 400;
  text-decoration: line-through;
}

.product-item.tuwayq-product-box .spb-attr-overlay__content {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding-inline-end: 4px;
}

.product-item.tuwayq-product-box .spb-attr-overlay__form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.product-item.tuwayq-product-box .spb-attr-label {
  margin-bottom: 8px;
  color: #202020;
  font-size: 16px;
  line-height: 1.3;
  font-weight: 600;
}

.product-item.tuwayq-product-box .spb-attr-label-value {
  color: #202020;
  font-weight: 600;
}

.product-item.tuwayq-product-box .spb-attr-overlay__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.product-item.tuwayq-product-box .spb-attr-overlay__action--add {
  background: #ff3549;
}

.product-item.tuwayq-product-box .spb-attr-overlay__action--buy {
  background: #0f4e85;
}

.product-item.tuwayq-product-box .spb-attr-overlay__details {
  width: 100%;
  margin-top: 0;
  background: #fff;
}

/* Radio / size pills: default, selected, hover */
.product-item.tuwayq-product-box .spb-attr-values:not(.color-squares):not(.image-squares) label {
  border-color: #cfcfcf;
  background: #fff;
  color: #1f1f1f;
}

.product-item.tuwayq-product-box .spb-attr-values:not(.color-squares):not(.image-squares) li.selected-value label {
  border-color: #ff3549;
  color: #ff3549;
  background: #fff;
}

.product-item.tuwayq-product-box .spb-attr-values:not(.color-squares):not(.image-squares) li:not(.selected-value) label:hover {
  border-color: #ff3549;
  color: #ff3549;
}

/* Unavailable option (out of stock) */
.product-item.tuwayq-product-box .spb-attr-values li.spb-attr-unavailable label {
  color: #b8b8b8;
  border-color: #d8d8d8;
  background: #fff;
  cursor: not-allowed;
  pointer-events: none;
}

.product-item.tuwayq-product-box .spb-attr-values li.spb-attr-unavailable .spb-attr-value-text {
  position: relative;
  display: inline-block;
}

.product-item.tuwayq-product-box .spb-attr-values li.spb-attr-unavailable .spb-attr-value-text::after {
  content: "";
  position: absolute;
  left: -4px;
  right: -4px;
  top: 50%;
  height: 1px;
  background: #b0b0b0;
  transform: rotate(-32deg);
  pointer-events: none;
}

@media (max-width: 767px) {
  .product-item.tuwayq-product-box .spb-attr-overlay__title {
    margin-top: 28px;
    font-size: 16px;
  }

  .product-item.tuwayq-product-box .spb-attr-overlay__price-current {
    font-size: 20px;
  }

  .product-item.tuwayq-product-box .spb-attr-overlay__action,
  .product-item.tuwayq-product-box .spb-attr-overlay__details {
    min-height: 40px;
    font-size: 14px;
  }

  .product-item.tuwayq-product-box .spb-attr-values:not(.color-squares):not(.image-squares) label {
    min-height: 30px;
    min-width: 30px;
    padding: 0 10px;
  }
}
