/* ============================================================
   Varianti Light — Shortcode [varianti_light]
   /wp-content/themes/hello-elementor-child/css/woo/varianti-light.css
   ============================================================ */

.vl-wrap {
  font-family: inherit;
}

/* Toolbar */
.vl-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.vl-macro-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}
.vl-macro-btn {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid transparent;
  background: none;
  padding: 2px;
  cursor: pointer;
  transition:
    border-color 0.15s,
    transform 0.15s;
  outline: none;
}
.vl-macro-btn:hover {
  transform: scale(1.1);
}
.vl-macro-btn.active {
  border-color: #000;
  border-radius: 100%;
}
.vl-macro-dot {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 1px solid black;
}
.vl-search {
  flex: 1;
  min-width: 120px;
  padding: 6px 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 13px;
  outline: none;
}
.vl-search:focus {
  border-color: #999;
}
.vl-count-label {
  font-size: 12px;
  color: #999;
  white-space: nowrap;
}

/* Griglia */
.vl-grid-wrap {
  max-height: 290px;
  overflow-y: auto;
  padding-right: 2px;
}
.vl-grid-wrap::-webkit-scrollbar {
  width: 4px;
}
.vl-grid-wrap::-webkit-scrollbar-track {
  background: #f5f5f5;
  border-radius: 2px;
}
.vl-grid-wrap::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 2px;
}
.vl-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  padding: 4px 2px;
}

/* Card */
.vl-card {
  position: relative;
  cursor: pointer;
  border: 2px solid transparent;
  border-radius: 6px;
  overflow: hidden;
  transition:
    border-color 0.15s,
    transform 0.1s;
  background: #f5f5f5;
  aspect-ratio: 1;
}
.vl-card:hover {
  border-color: #bbb;
  transform: scale(1.02);
}
.vl-card.selected {
  border-color: #000;
}
/* out-of-stock legacy — ora usa .vl-card-oos */
.vl-card.out-of-stock {
  opacity: 0.4;
}
.vl-card-img {
  width: 100%;
  height: 100% !important;
  object-fit: cover;
  display: block;
}
.vl-card-label {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 10px;
  font-weight: 500;
  padding: 3px 5px;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.vl-card-badge-out {
  position: absolute;
  top: 4px;
  right: 4px;
  background: rgba(198, 40, 40, 0.85);
  color: #fff;
  font-size: 9px;
  padding: 1px 5px;
  border-radius: 8px;
}
.vl-card-badge-backorder {
  position: absolute;
  top: 4px;
  right: 4px;
  background: rgba(230, 165, 0, 0.9);
  color: #fff;
  font-size: 9px;
  padding: 1px 5px;
  border-radius: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 90%;
}

/* Skeleton */
.vl-skeleton-card {
  aspect-ratio: 1;
  border-radius: 6px;
  background: linear-gradient(90deg, #f0f0f0 25%, #e8e8e8 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: vl-shimmer 1.2s infinite;
}
@keyframes vl-shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}
.vl-loading-more {
  text-align: center;
  padding: 10px;
}
.vl-spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid #ddd;
  border-top-color: #666;
  border-radius: 50%;
  animation: vl-spin 0.7s linear infinite;
}
@keyframes vl-spin {
  to {
    transform: rotate(360deg);
  }
}

/* Bottom bar */
.vl-bottom-bar {
  margin-top: 14px;
}
.vl-bottom-row1 {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
  flex-direction: column;
}
.vl-bottom-row2 {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.vl-selected-color {
  display: flex;
  align-items: center;
  gap: 8px;
}
.vl-sel-img {
  width: 36px;
  height: 36px !important;
  object-fit: cover;
  border-radius: 100% !important;
  border: 1px solid #eee;
  flex-shrink: 0;
}
.vl-sel-name,
.vl-confezione-label {
  font-size: 16px;
  font-weight: 700;
}
.vl-sel-name.has-selection {
  color: #111;
}

.vl-confezione-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.vl-confezione-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

/* Lista confezioni stile Variation Swatches radio */
.vl-conf-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 20px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.vl-conf-list .variable-item {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
}
.vl-conf-list .variable-item-radio-input-wrapper {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  padding: 3px 0;
  user-select: none;
}
.vl-conf-list .variable-item-radio-input {
  cursor: pointer;
  margin: 0;
}
.vl-conf-list .variable-item-radio-value-wrapper {
  cursor: pointer;
}
.vl-conf-list .variable-item .variable-item-radio-value-wrapper {
  font-weight: 700;
  font-size: 16px;
}
.vl-conf-list .wvs-variation-item-out-of-stock {
  opacity: 0.4;
}
.vl-conf-list
  .wvs-variation-item-out-of-stock
  .variable-item-radio-value-wrapper {
  text-decoration: line-through;
}

.woo-variation-swatches .variable-items-wrapper.radio-variable-items-wrapper {
  flex-direction: row !important;
}

.variable-item-contents .variable-item-radio-input {
  accent-color: var(--e-global-color-accent);
  height: 20px;
  width: 20px;
}

/* Card OOS — selezionabile ma con badge */
.vl-card.vl-card-oos {
  opacity: 0.7;
}
.vl-card.vl-card-oos:hover {
  border-color: #bbb;
  transform: scale(1.02);
  opacity: 1;
}

.vl-price-wrap {
  font-size: 25px;
  font-weight: 700;
  min-width: 60px;
}

/* Quantità — classi WooCommerce native */
.vl-wrap .quantity {
  display: flex;
  align-items: center;
  gap: 0;
  margin-left: auto;
  overflow: hidden;
}
.vl-wrap .quantity .minus,
.vl-wrap .quantity .plus {
  border: 0 !important;
  background-color: transparent !important;
  font-size: 24px !important;
  font-family: var(--e-global-typography-primary-font-family), Sans-serif;
  font-weight: 400;
  margin: 0 !important;
  line-height: 28px;
  cursor: pointer;
  padding: 10px 25px;
}
.vl-wrap .quantity .minus {
  border-radius: 4px 0 0 4px;
  border-right: none;
}
.vl-wrap .quantity .plus {
  border-radius: 0 4px 4px 0;
  border-left: none;
}
.vl-wrap .quantity .minus:hover,
.vl-wrap .quantity .plus:hover {
  background: #e8e8e8;
}
.vl-wrap .quantity .vl-qty {
  width: 44px;
  height: 36px;
  border: 1.5px solid #ddd;
  border-left: none;
  border-right: none;
  text-align: center;
  font-size: 14px;
  outline: none;
  -moz-appearance: textfield;
  border-radius: 0;
}
.vl-wrap .quantity .vl-qty::-webkit-outer-spin-button,
.vl-wrap .quantity .vl-qty::-webkit-inner-spin-button {
  -webkit-appearance: none;
}
.vl-oos-wrap {
  width: 100%;
}

.vl-add-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  border-radius: 4px;
  transition: opacity 0.2s;
  white-space: nowrap;
}
.vl-add-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.vl-msg {
  margin-top: 8px;
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 13px;
}
.vl-msg.success {
  background: #e8f5e9;
  color: #2e7d32;
}
.vl-msg.error {
  background: #fce4ec;
  color: #c62828;
}

/* Pulsante carrello */
.woocommerce-variation-add-to-cart.variations_button.vl-bottom-row2
  .single_add_to_cart_button {
  font-size: 20px;
  border-radius: 35px 35px 35px 35px;
  padding: 10px 25px 10px 25px;
  background-color: var(--e-global-color-primary) !important;
  transition: all 1.1s;
  border: 1px solid black;
}

.woocommerce-variation-add-to-cart.variations_button.vl-bottom-row2
  .single_add_to_cart_button:hover {
  box-shadow: 0px 5px 0px 0px var(--e-global-color-accent) !important;
  transform: translateY(-8px);
}

button.xoo-wl-action-btn.xoo-wl-open-form-btn.button.btn.xoo-wl-btn-popup.reseller {
  max-width: 100%;
}

/* Mobile */
@media (max-width: 600px) {
  .vl-grid-wrap {
    max-height: 200px;
  }
  .vl-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
  } /* mobile: 3 colonne */
  .vl-bottom-row1 {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .vl-bottom-row2 {
    align-items: flex-start;
  }

  .vl-price-wrap {
    width: 100%;
  }

  .vl-wrap .quantity {
    margin-left: 0;
  }
  .vl-add-btn {
    flex: 1;
    justify-content: center;
  }

  .vl-macro-wrap {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    gap: 8px;
    position: relative;

    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .vl-macro-wrap::-webkit-scrollbar {
    display: none;
  }

  .vl-macro-btn {
    flex: 0 0 auto;
  }

  /* sfumatura sinistra */
  .vl-macro-wrap::before,
  .vl-macro-wrap::after {
    content: "";
    position: sticky;
    top: 0;
    width: 24px;
    height: 100%;
    pointer-events: none;
    z-index: 2;
    flex-shrink: 0;
  }

  .vl-macro-wrap::before {
    left: 0;
    background: linear-gradient(to right, #fff 0%, rgba(255, 255, 255, 0) 100%);
  }

  .vl-macro-wrap::after {
    right: 0;
    margin-left: auto;
    background: linear-gradient(to left, #fff 0%, rgba(255, 255, 255, 0) 100%);
  }
}

/* Box collezioni */
.vl-collections-wrap {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.vl-collection-box {
  border: 1px solid #eee;
  border-radius: 6px;
  overflow: hidden;
}
.vl-collection-title {
  font-size: 12px;
  font-weight: 700;
  color: #555;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 8px 12px;
  background: #f8f8f8;
  border-bottom: 1px solid #eee;
}
.vl-collection-grid {
  padding: 8px;
  max-height: 290px;
  overflow-y: auto;
}
.vl-collection-grid::-webkit-scrollbar {
  width: 4px;
}
.vl-collection-grid::-webkit-scrollbar-track {
  background: #f5f5f5;
  border-radius: 2px;
}
.vl-collection-grid::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 2px;
}

/* Confezione in backorder (reseller) */
.vl-conf-list .vl-item-backorder .variable-item-radio-value-wrapper {
  color: #e65100;
}
.vl-conf-list .vl-item-backorder .variable-item-radio-value-wrapper::after {
  content: " *";
  font-size: 10px;
  color: #e65100;
}

/* Banner backorder reseller */
.vl-oos-wrap .b2bking-backorder-alert {
  display: block;
  background: #fff3e0;
  border-left: 3px solid #e65100;
  color: #e65100;
  font-size: 12px;
  padding: 8px 10px;
  border-radius: 0 4px 4px 0;
  margin-bottom: 6px;
  line-height: 1.4;
}
.vl-oos-wrap .b2bking-alert-icon {
  font-weight: 700;
  margin-right: 4px;
  margin-bottom: 5px;
}

/* Campo ricerca con pulsante reset */
.vl-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 120px;
}
.vl-search-wrap .vl-search {
  width: 100%;
  padding-right: 28px;
}
.vl-search-clear {
  position: absolute;
  right: 6px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 12px;
  color: #999;
  padding: 0;
  line-height: 1;
  display: none;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
}
.vl-search-clear:hover {
  color: #333;
}

/*
Pallini di caricamento
*/
.vl-dots-loader {
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 16px;
}
.vl-dots-loader span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  animation: vl-dots 1.2s infinite ease-in-out;
}
.vl-dots-loader span:nth-child(2) {
  animation-delay: 0.2s;
}
.vl-dots-loader span:nth-child(3) {
  animation-delay: 0.4s;
}
@keyframes vl-dots {
  0%,
  80%,
  100% {
    transform: scale(0.6);
    opacity: 0.4;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}
