/* =====================================================
   ILOVE SAMPLE SELECTOR - CSS COMPLETO
   ===================================================== */

.ilove-sample-selector {
  margin: 30px 0;
  padding: 35px;
  background: linear-gradient(135deg, #fafafa 0%, #ffffff 100%);
  border-radius: 16px;
  border: 2px solid #e8e8e8;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

/* Header */
.selector-header {
  text-align: center;
  margin-bottom: 35px;
}

.selector-title {
  font-size: 28px;
  font-weight: 700;
  color: #333;
  margin: 0 0 12px 0;
  line-height: 1.3;
}

.selector-description {
  font-size: 16px;
  color: #666;
  margin: 10px auto 25px;
  max-width: 600px;
  line-height: 1.5;
}

/* Counter */
.selector-counter {
  display: inline-block;
  padding: 14px 35px;
  background: white;
  border: 3px solid #dea876;
  border-radius: 35px;
  font-size: 19px;
  font-weight: 700;
  color: #333;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 10px rgba(222, 168, 118, 0.15);
}

.counter-current {
  color: #dea876;
  font-size: 26px;
  font-weight: 800;
}

.selector-counter.complete {
  background: linear-gradient(135deg, #4caf50, #45a049);
  border-color: #4caf50;
  color: white;
  transform: scale(1.05);
  box-shadow: 0 4px 20px rgba(76, 175, 80, 0.4);
  animation: pulseComplete 0.5s ease;
}

.selector-counter.complete .counter-current {
  color: white;
}

@keyframes pulseComplete {
  0%, 100% { transform: scale(1.05); }
  50% { transform: scale(1.12); }
}

/* Grid Prodotti */
.samples-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 22px;
  margin-top: 35px;
}

.sample-item {
  cursor: pointer;
  display: block;
  margin: 0;
  position: relative;
}

.sample-checkbox {
  display: none;
}

.sample-card {
  position: relative;
  background: white;
  border: 2px solid #e0e0e0;
  border-radius: 14px;
  padding: 16px;
  height: 100%;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.sample-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(222, 168, 118, 0.12), transparent);
  transition: left 0.5s ease;
  z-index: 1;
}

.sample-item:hover .sample-card {
  border-color: #dea876;
  transform: translateY(-6px);
  box-shadow: 0 10px 25px rgba(222, 168, 118, 0.25);
}

.sample-item:hover .sample-card::before {
  left: 100%;
}

/* Stato Selezionato */
.sample-checkbox:checked + .sample-card {
  border-color: #dea876;
  border-width: 3px;
  background: linear-gradient(135deg, #fff8f0 0%, #ffffff 100%);
  box-shadow: 0 10px 30px rgba(222, 168, 118, 0.35);
  transform: translateY(-4px);
}

.sample-checkbox:checked + .sample-card .sample-check {
  opacity: 1;
  transform: scale(1);
}

/* Immagine Prodotto */
.sample-image {
  width: 100%;
  height: 160px;
  margin-bottom: 14px;
  border-radius: 10px;
  overflow: hidden;
  background: linear-gradient(135deg, #f5f5f5, #ececec);
  position: relative;
  z-index: 2;
}

.sample-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.sample-item:hover .sample-image img {
  transform: scale(1.08);
}

/* Info Prodotto */
.sample-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  z-index: 2;
}

.sample-name {
  font-size: 15px;
  font-weight: 700;
  color: #333;
  margin: 0 0 8px 0;
  line-height: 1.3;
  min-height: 38px;
}

.sample-desc {
  font-size: 13px;
  color: #777;
  margin: 0;
  line-height: 1.4;
}

/* Checkmark */
.sample-check {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, #dea876, #d49865);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: bold;
  opacity: 0;
  transform: scale(0);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 10px rgba(222, 168, 118, 0.5);
  z-index: 3;
}

/* Lista Selezionati */
.selected-list {
  margin-top: 30px;
  padding: 25px;
  background: linear-gradient(135deg, #f0f8ff 0%, #ffffff 100%);
  border-radius: 12px;
  border: 2px solid #4caf50;
  animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.selected-title {
  font-size: 18px;
  font-weight: 700;
  color: #333;
  margin: 0 0 15px 0;
}

#selected-items {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
}

#selected-items li {
  padding: 10px 15px;
  background: white;
  border-radius: 8px;
  font-size: 14px;
  color: #333;
  border-left: 3px solid #4caf50;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* No Products Message */
.no-products {
  text-align: center;
  padding: 40px 20px;
  font-size: 16px;
  color: #999;
}

/* Responsive - Tablet */
@media (max-width: 768px) {
  .ilove-sample-selector {
    padding: 25px 20px;
  }
  
  .selector-title {
    font-size: 24px;
  }
  
  .samples-grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
  }
  
  .sample-image {
    height: 140px;
  }
  
  #selected-items {
    grid-template-columns: 1fr;
  }
}

/* Responsive - Mobile */
@media (max-width: 480px) {
  .ilove-sample-selector {
    padding: 20px 15px;
    margin: 20px 0;
  }
  
  .selector-title {
    font-size: 22px;
  }
  
  .selector-description {
    font-size: 14px;
  }
  
  .selector-counter {
    padding: 12px 25px;
    font-size: 16px;
  }
  
  .counter-current {
    font-size: 22px;
  }
  
  .samples-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 14px;
  }
  
  .sample-card {
    padding: 12px;
  }
  
  .sample-image {
    height: 120px;
  }
  
  .sample-name {
    font-size: 14px;
    min-height: auto;
  }
  
  .sample-desc {
    font-size: 12px;
  }
  
  .sample-check {
    width: 28px;
    height: 28px;
    font-size: 16px;
  }
  
  .selected-list {
    padding: 18px;
  }
}

/* Animation Loading */
.samples-grid.loading {
  opacity: 0.6;
  pointer-events: none;
}

/* Button Disabled State */
.single_add_to_cart_button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
