/**
 * descustomaddtocartproduct - front.css
 * Styles for the custom quantity stepper + add-to-cart button widget
 */

.descustomaddtocart-wrapper {
  margin-top: 1.25rem;
}

.descustomaddtocart-inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

/* ── Stepper ── */
.descustomaddtocart-stepper {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  gap: 0px;
  width: auto;
  flex-shrink: 0;
}

.descustomaddtocart-step {
  border: 1px solid #e3e3e3;
  background: transparent;
  cursor: pointer;
  position: static;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  -webkit-box-pack: center;
  -ms-flex-pack: center;
  justify-content: center;
  color: #000;
  min-width: 42px;
  width: 42px;
  height: 50px;
  font-size: 1.2rem;
  line-height: 1;
  user-select: none;
  padding: 0;
  border-radius: 0;
  -webkit-transition: opacity 0.15s;
  transition: opacity 0.15s;
}

.descustomaddtocart-minus {
  border-radius: 0;
}

.descustomaddtocart-plus {
  border-radius: 0;
}

.descustomaddtocart-step:hover {
  opacity: 0.6;
}

.descustomaddtocart-qty {
  border-style: solid;
  border-width: 1px;
  border-color: #e3e3e3;
  border-radius: 0;
  font: 500 18px/21px Roboto;
  padding: 0 5px;
  color: black;
  height: 50px;
  min-width: 42px;
  width: auto;
  field-sizing: content;
  text-align: center;
  background: transparent;
  -moz-appearance: textfield;
  appearance: textfield;
}

.descustomaddtocart-qty:focus {
  outline: none;
}

.descustomaddtocart-qty::-webkit-inner-spin-button,
.descustomaddtocart-qty::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.descustomaddtocart-qty[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}

/* ── Add to cart button ── */
.descustomaddtocart-btn {
  flex: 1 1 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  height: 50px;
  background-color: #ba86a9;
  color: #fff;
  border: none;
  border-radius: 0;
  font-family: "Rubik", sans-serif;
  font-size: 14px;
  font-weight: 400;
  white-space: nowrap;
  cursor: pointer;
  -webkit-transition: background 0.3s ease;
  transition: background 0.3s ease;
}

.descustomaddtocart-btn:hover:not(:disabled) {
  background-color: #8e507a;
}

.descustomaddtocart-btn:active:not(:disabled) {
  background-color: #7a3f69;
}

/* No valid combination selected */
.descustomaddtocart-btn:disabled:not(.loading) {
  background-color: #ccc;
  cursor: not-allowed;
  opacity: 0.7;
}

.descustomaddtocart-btn.loading {
  opacity: 0.85;
  cursor: wait;
  pointer-events: none;
  position: relative;
  color: transparent;
}

.descustomaddtocart-btn.loading .material-icons,
.descustomaddtocart-btn.loading .descustomaddtocart-icon {
  visibility: hidden;
}

.descustomaddtocart-btn.loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin-top: -10px;
  margin-left: -10px;
  border: 3px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: descustomaddtocart-spin 0.7s linear infinite;
}

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

.descustomaddtocart-btn .material-icons {
  font-size: 1.2em;
}

.descustomaddtocart-btn .descustomaddtocart-icon {
  fill: #fff;
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* ── Attribute / combination selectors ── */
.descustomaddtocart-attributes {
  margin-bottom: 1rem;
}

.descustomaddtocart-group {
  margin-bottom: 0.75rem;
}

.descustomaddtocart-group-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: #1a1a1a;
}

/* Select */
.descustomaddtocart-attr-select {
  display: block;
  width: 100%;
  max-width: 280px;
  padding: 0.45rem 0.75rem;
  border: 1px solid #e3e3e3;
  border-radius: 0;
  background: transparent;
  font-family: "Rubik", sans-serif;
  font-size: 14px;
  color: #1a1a1a;
  cursor: pointer;
  appearance: auto;
}

.descustomaddtocart-attr-select:focus {
  outline: 2px solid #ba86a9;
  outline-offset: 1px;
}

/* Radio buttons */
.descustomaddtocart-attr-radios {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -ms-flex-wrap: wrap;
  flex-wrap: wrap;
  gap: 12px;
}

.descustomaddtocart-radio-label {
  display: -webkit-inline-box;
  display: -ms-inline-flexbox;
  display: inline-flex;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  padding: 0.3rem 0.9rem;
  border: 1px solid #a3a3a3;
  border-radius: 2px;
  cursor: pointer;
  font: 500 12px/15px Poppins, sans-serif;
  color: #000;
  -webkit-transition: border-color 0.15s, background 0.15s, color 0.15s;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
  margin: 0;
}

.descustomaddtocart-radio-label input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.descustomaddtocart-radio-label.selected,
.descustomaddtocart-radio-label:has(input:checked),
.descustomaddtocart-radio-label:hover:not(.unavailable) {
  color: #f8f4fc;
  background: #bc89df;
  border-color: #bc89df;
}

/* Unavailable radio */
.descustomaddtocart-radio-label.unavailable {
  opacity: 0.4;
  cursor: not-allowed;
  text-decoration: line-through;
  pointer-events: none;
  border-color: #d0d0d0;
  color: #999;
}

/* Color / texture swatches */
.descustomaddtocart-attr-swatches {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -ms-flex-wrap: wrap;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.descustomaddtocart-swatch {
  display: inline-block;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  position: relative;
  -webkit-box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.15);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.15);
  -webkit-transition: border-color 0.15s, -webkit-transform 0.15s;
  transition: border-color 0.15s, transform 0.15s;
}

.descustomaddtocart-swatch:hover:not(.unavailable) {
  -webkit-transform: scale(1.12);
  transform: scale(1.12);
  border-color: #ba86a9;
}

.descustomaddtocart-swatch.selected {
  border-color: #ba86a9;
  -webkit-box-shadow: 0 0 0 1px #ba86a9;
  box-shadow: 0 0 0 1px #ba86a9;
}

/* Unavailable swatch — diagonal line */
.descustomaddtocart-swatch.unavailable {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}

.descustomaddtocart-swatch.unavailable::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: linear-gradient(
    to bottom right,
    transparent calc(50% - 1px),
    rgba(0, 0, 0, 0.55) calc(50% - 1px),
    rgba(0, 0, 0, 0.55) calc(50% + 1px),
    transparent calc(50% + 1px)
  );
}

/* ── Cart error notification ── */
.descustomaddtocart-error {
  display: block;
  width: 100%;
  margin-top: 0.5rem;
  padding: 0.45rem 0.75rem;
  background-color: #fff3f3;
  border-left: 3px solid #c0392b;
  color: #c0392b;
  font-family: "Rubik", sans-serif;
  font-size: 13px;
  line-height: 1.4;
  animation: descustomaddtocart-fadein 0.2s ease;
}

@keyframes descustomaddtocart-fadein {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}
