/* Styles for the freebies dropdown and related elements in the WooCommerce cart */

.wtf-cart-block {
  margin: 16px 0 24px;
}

.threshold-progress {
  margin: 20px 0;
  padding: 12px 14px;
  border: 1px solid #e5e5e5;
  border-radius: 6px;
  background: #fff;
}

.threshold-progress h2 {
  margin: 0 0 10px;
  font-size: 16px;
}

.progress-bar {
  width: 100%;
  height: 10px;
  background: #f1f1f1;
  border-radius: 10px;
  overflow: hidden;
}

.progress-bar .progress {
  height: 100%;
  background: #2ea2cc;
}

.cart-freebies-dropdown {
  margin: 20px 0;
  padding: 10px;
  border: 1px solid #e5e5e5;
  border-radius: 5px;
  background-color: #f9f9f9;
}

.cart-freebies-dropdown.is-locked {
  opacity: 0.7;
}

.wtf-freebie-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.wtf-freebie-header-left {
  min-width: 0;
}

.wtf-freebie-header-title {
  font-weight: 700;
  line-height: 1.25;
  font-size: 18px;
}

.wtf-freebie-selected {
  margin-top: 4px;
  font-size: 14px;
  font-weight: 700;
  color: #1a7f37;
  word-break: break-word;
}

button.wtf-freebie-toggle {
  flex: 0 0 auto;
  min-width: 38px;
  padding: 5px !important;
  border-radius: 0 !important;
  border: none !important;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.wtf-freebie-toggle .wtf-chev {
  display: block;
  transition: transform 160ms ease;
}

.wtf-freebie-toggle[aria-expanded="true"] .wtf-chev {
  transform: rotate(180deg);
}

.wtf-freebie-panel {
  margin-top: 10px;
}

.cart-freebies-dropdown select {
  width: 100%;
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 4px;
}

.wtf-freebie-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
  align-items: center;
}

.wtf-freebie-actions .button-link {
  margin-left: 0 !important;
}

.cart-freebies-notice {
  margin: 15px 0;
  padding: 10px;
  background-color: var(--secondary_hover);
  border-left: 6px solid var(--primary_hover);
  color: #fff;
}

.cart-freebies-notice.is-success {
  background-color: #74836d;
  border-left-color: var(--secondary_hover);
  color: #fff;
}

.cart-freebies-notice-title {
  font-weight: 700;
  font-size: 18px;
  margin-bottom: 4px;
}

.cart-freebies-notice-subtitle {
  font-weight: 600;
  margin-top: 8px;
}

.wtf-scent-samples {
  margin: 6px 0 0;
  padding-left: 18px;
}

.wtf-freebie-qty {
  font-weight: 600;
}

.cart-freebies-message {
  font-size: 14px;
  color: #555;
}

.wtf-inline-message {
  margin-top: 8px;
  font-size: 13px;
}

.wtf-scope-hint {
  margin-top: 4px;
  font-size: 12px;
  color: #555;
}

.wtf-stages {
  margin: 14px 0 18px;
  padding: 12px 14px;
  border: 1px solid #e5e5e5;
  border-radius: 6px;
  background: #f9f9f9;
}

.wtf-stages-header {
  font-weight: 600;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.wtf-stages-title {
  line-height: 1.2;
  font-weight: 700;
  font-size: 18px;
}

.wtf-stages-progress {
  position: relative;
  flex: 0 0 140px;
  max-width: 100%;
  height: 8px;
  border-radius: 999px;
  background: #e6e6e6;
  overflow: hidden;
}

.wtf-stages-progress-amount {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(
    90deg,
    var(--secondary) 0%,
    var(--secondary_hover) 50%,
    var(--secondary) 100%
  );
  background-size: 200% 100%;
  animation: wtf-stages-progress 2.2s linear infinite;
  transition: width 240ms ease;
}

.wtf-stages-progress.is-complete .wtf-stages-progress-amount {
  animation: none;
  background: var(--secondary);
}

@keyframes wtf-stages-progress {
  0% {
    background-position: 0% 50%;
  }
  100% {
    background-position: 200% 50%;
  }
}

.wtf-stages-list {
  margin: 0;
  padding-left: 1rem;
}

.wtf-stages-list li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 0;
}

.wtf-stages-list li.is-done .wtf-stage-status {
  color: #1a7f37;
  font-weight: 600;
}

.wtf-stages-list li.is-todo .wtf-stage-status {
  color: #b32d2e;
}

.wtf-stage-title {
  font-size: 16px;
  font-weight: 700;
}

.wtf-stage-status {
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
}

.wtf-locked-hint {
  margin: 8px 0 0;
  font-size: 12px;
  color: #666;
}

@media (max-width: 600px) {
  .wtf-stages-list li {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .wtf-stages-progress {
    flex: 1 1 100%;
  }

  .wtf-stage-status {
    white-space: normal;
  }

  .wtf-freebie-toggle {
    padding: 5px;
    border-radius: 0;
    border: none;
  }

  .wtf-freebie-header {
    align-items: flex-start;
  }
}
