/**
 * CSS cho hệ thống quà tặng WooCommerce
 */

.gift-products-wrapper {
  margin: 10px 0 30px;
  /* padding: 20px;
  border: 2px dashed #ddd;
  border-radius: 8px;
  background: #f9f9f9; */
  position: relative;
  overflow: hidden;
}

/* .gift-products-wrapper::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #ff6b6b, #4ecdc4, #45b7d1, #96ceb4);
  background-size: 200% 100%;
  animation: gift-gradient 3s ease infinite;
} */

@keyframes gift-gradient {
  0%,
  100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

.gift-products-wrapper h3 {
  margin-top: 0;
  margin-bottom: 20px;
  color: #333;
  font-size: 18px;
  font-weight: 600;
  text-align: center;
  position: relative;
  padding-bottom: 10px;
}

.gift-products-wrapper h3::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 50px;
  height: 2px;
  background: var(--fs-color-primary);
  border-radius: 1px;
}

.gift-products-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 15px;
  margin-top: 20px;
}

.gift-item {
  border: 2px solid #eee;
  border-radius: 8px;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  background: white;
  /* box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); */
  position: relative;
  overflow: hidden;
}

.gift-item::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    45deg,
    transparent,
    rgba(255, 255, 255, 0.1),
    transparent
  );
  transform: rotate(45deg);
  transition: all 0.5s;
  opacity: 0;
}

.gift-item:hover {
  border-color: #007cba;
  box-shadow: 0 8px 25px rgba(0, 123, 186, 0.15);
  transform: translateY(-2px);
}

.gift-item:hover::before {
  animation: gift-shine 0.8s ease-in-out;
}

@keyframes gift-shine {
  0% {
    transform: translateX(-100%) translateY(-100%) rotate(45deg);
    opacity: 0;
  }
  50% {
    opacity: 1;
  }
  100% {
    transform: translateX(100%) translateY(100%) rotate(45deg);
    opacity: 0;
  }
}

.gift-item label {
  display: block;
  cursor: pointer;
  padding: 15px;
  margin: 0;
  height: 100%;
  transition: background-color 0.3s ease;
}

.gift-item:hover label {
  background: rgba(0, 123, 186, 0.02);
}

.gift-checkbox {
  position: absolute;
  top: 15px;
  right: 15px;
  width: 20px;
  height: 20px;
  cursor: pointer;
  accent-color: #007cba;
  transform: scale(1.3);
}

.gift-content {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-right: 30px;
}

.gift-image {
  width: 70px;
  height: 70px;
  object-fit: cover;
  border-radius: 8px;
  border: 2px solid #f0f0f0;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.gift-item:hover .gift-image {
  border-color: #007cba;
  transform: scale(1.05);
}

.gift-name {
  font-weight: 500;
  color: #333;
  font-size: 14px;
  line-height: 1.4;
  flex: 1;
}

/* Trạng thái khi được chọn */
.gift-item input:checked + .gift-content .gift-name {
  color: #007cba;
  font-weight: 600;
}

.gift-item:has(input:checked) {
  border-color: #007cba;
  background: linear-gradient(135deg, #f0f8ff 0%, #e6f3ff 100%);
  box-shadow: 0 4px 15px rgba(0, 123, 186, 0.2);
}

/* .gift-item:has(input:checked)::after {
  content: "✓";
  position: absolute;
  top: 10px;
  right: 45px;
  width: 25px;
  height: 25px;
  background: #007cba;
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: bold;
  animation: gift-check 0.3s ease-out;
} */

@keyframes gift-check {
  0% {
    transform: scale(0);
  }
  50% {
    transform: scale(1.2);
  }
  100% {
    transform: scale(1);
  }
}

/* Responsive */
@media (max-width: 768px) {
  .gift-products-list {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .gift-item {
    border-radius: 8px;
  }

  .gift-item label {
    padding: 15px;
  }

  .gift-content {
    gap: 12px;
    margin-right: 25px;
  }

  .gift-image {
    width: 50px;
    height: 50px;
  }

  .gift-name {
    font-size: 13px;
  }

  .gift-checkbox {
    width: 18px;
    height: 18px;
    transform: scale(1.2);
  }
}

@media (max-width: 480px) {
  .gift-products-wrapper {
    margin: 15px 0;
    padding: 15px;
  }

  .gift-products-wrapper h3 {
    font-size: 16px;
    margin-bottom: 15px;
  }

  .gift-content {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    margin-right: 20px;
  }

  .gift-image {
    width: 45px;
    height: 45px;
    align-self: center;
  }

  .gift-name {
    text-align: center;
    font-size: 12px;
  }
}
