.ysleadgen-popup * {
  box-sizing: border-box;
}

.ysleadgen-popup .ysi-close-btn,
.ysleadgen-popup [data-gjs-type="close-button"],
.ysi-close-btn,
[data-gjs-type="close-button"] {
  cursor: pointer;
  text-decoration: none;
  font-family: Arial, sans-serif;
}

.ysi-close-btn:hover,
[data-gjs-type="close-button"]:hover {
  opacity: 0.8;
}

.ysleadgen-popup .floating-bar-inner {
  position: relative !important;
  overflow: visible !important;
  width: 100% !important;
}

.ysleadgen-popup .floating-bar-free-text,
.ysleadgen-popup .overlay-text {
  position: absolute !important;
  z-index: 999 !important;
}

.ysi-close-btn {
  z-index: 10000 !important;
  width: 30px !important;
  height: 30px !important;
  min-width: 30px !important;
  min-height: 30px !important;
  max-width: 30px !important;
  max-height: 30px !important;
  border-radius: 50% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 !important;
  margin: 0 !important;
  box-sizing: border-box !important;
  line-height: 1 !important;
  flex-shrink: 0 !important;
  color: #000000 !important;
  background: #ffffff !important;
  border: none !important;
}

#ysi-deactivation-modal {
  all: initial;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

#ysi-deactivation-modal.ysi-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

#ysi-deactivation-modal.active {
  opacity: 1;
  pointer-events: auto;
}

.ysi-modal-content {
  background: #fff;
  padding: 24px;
  border-radius: 8px;
  width: 90%;
  max-width: 500px;
  max-height: none;
  overflow-y: visible;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  transform: scale(0.9);
  transition: transform 0.3s ease;
  box-sizing: border-box;
}

.ysi-modal-content.active {
  transform: scale(1);
}

.ysi-modal-title {
  margin: 0 0 12px;
  color: #111;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.4;
}

.ysi-modal-description {
  margin: 0 0 20px;
  color: #555;
  font-size: 14px;
  line-height: 1.5;
}

.ysi-form {
  margin-top: 16px;
}

.ysi-reasons-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

.ysi-reason-group {
  display: flex;
  flex-direction: column;
}

.ysi-radio-label,
.ysi-checkbox-label,
.ysi-delete-data-label {
  display: flex;
  align-items: center !important;
  cursor: pointer;
  font-size: 14px;
  color: #333;
  line-height: 1.4;
}

.ysi-radio-input,
.ysi-checkbox-input {
  appearance: auto !important;
  -webkit-appearance: auto !important;
  margin: 0 8px 0 0 !important;
  width: 16px !important;
  height: 16px !important;
  padding: 0 !important;
  border: 1px solid #787c82;
  vertical-align: middle !important;
  position: static !important;
  flex-shrink: 0;
  background: white;
}

.ysi-radio-text {
  font-weight: 500;
}

.ysi-reason-details {
  padding-left: 24px;
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ysi-options-title {
  font-size: 13px;
  font-weight: 600;
  color: #666;
  margin: 0 0 4px;
}

.ysi-input-wrapper,
.ysi-conditional-input {
  margin-top: 8px;
}

.ysi-text-input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 14px;
  box-sizing: border-box;
}

.ysi-text-input:focus {
  border-color: #0088f8d8;
  outline: 1px solid #047ee2b3;
  box-shadow: 0 0 0 1px #008cff;
}

.ysi-hidden {
  display: none !important;
}

.ysi-footer-actions {
  border-top: 1px solid #eee;
  padding-top: 16px;
  margin-top: 16px;
}

.ysi-delete-data-desc {
  font-size: 12px;
  color: #777;
  margin: 4px 0 0 24px;
}

.ysi-modal-actions {
  margin-top: 24px;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.ysi-submit-btn {
  background-color: #0c8af2f4;
  color: #fff;
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s, opacity 0.2s;
}

.ysi-submit-btn:hover {
  background-color: #008bf6;
}

.ysi-submit-btn:disabled,
.ysi-submit-btn.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background-color: #1589e7;
}

/* Dynamic product recommendations */
.yslg-product-recommendations {
  width: 100%;
  max-width: 100%;
  margin: 12px 0;
  box-sizing: border-box;
  container-type: inline-size;
  container-name: yslg-pr;
  overflow: hidden;
}

.yslg-product-recommendations-heading {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 12px;
  text-align: center;
  color: inherit;
}

.yslg-product-recommendations-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 110px), 1fr));
  gap: 12px;
  width: 100%;
}

.yslg-product-recommendations-grid > .yslg-product-card,
.yslg-product-recommendations-list > .yslg-product-card {
  min-width: 0;
}

.yslg-product-recommendations-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.yslg-product-recommendations-list .yslg-product-card {
  flex-direction: row;
  align-items: center;
  text-align: left;
  gap: 10px;
}

.yslg-product-recommendations-list .yslg-product-card-image {
  width: 72px;
  height: 72px;
  flex-shrink: 0;
  margin-bottom: 0;
}

.yslg-product-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 10px;
  background: #fff;
  transition: box-shadow 0.2s;
  box-sizing: border-box;
  width: 100%;
}

.yslg-product-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.yslg-product-card-image {
  width: 100%;
  max-width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 6px;
  margin-bottom: 8px;
}

.yslg-product-card-title {
  font-size: 13px;
  font-weight: 600;
  margin: 0 0 6px;
  line-height: 1.3;
  color: #111827;
  width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.yslg-product-card-title a {
  color: inherit;
  text-decoration: none;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.yslg-product-card-title a:hover {
  text-decoration: underline;
}

.yslg-product-card-price {
  font-size: 13px;
  color: #374151;
  margin-bottom: 8px;
  width: 100%;
  line-height: 1.25;
}

.yslg-product-card-price del {
  opacity: 0.6;
  margin-right: 4px;
}

.yslg-product-card-cta {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  background: #2563eb;
  color: #fff !important;
  border-radius: 6px;
  text-decoration: none !important;
  max-width: 100%;
  box-sizing: border-box;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.yslg-product-card-cta:hover {
  background: #1d4ed8;
}

/* Narrow popup column – 2-up compact grid */
@container yslg-pr (max-width: 420px) {
  .yslg-product-recommendations-heading {
    font-size: 14px;
    margin-bottom: 8px;
  }

  .yslg-product-recommendations-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .yslg-product-card {
    padding: 8px 6px;
  }

  .yslg-product-card-title {
    font-size: 11px;
  }

  .yslg-product-card-price {
    font-size: 11px;
    margin-bottom: 6px;
  }

  .yslg-product-card-cta {
    font-size: 10px;
    padding: 5px 8px;
    width: 100%;
  }
}

/* Very narrow column – horizontal swipe row */
@container yslg-pr (max-width: 260px) {
  .yslg-product-recommendations-grid {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 8px;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }

  .yslg-product-recommendations-grid .yslg-product-card {
    flex: 0 0 calc(50% - 4px);
    min-width: 96px;
    scroll-snap-align: start;
  }
}

/* JS-driven width classes (fallback / extra tuning) */
.yslg-product-recommendations.yslg-pr-narrow .yslg-product-recommendations-grid,
.yslg-product-recommendations.yslg-pr-tight .yslg-product-recommendations-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.yslg-product-recommendations.yslg-pr-tight .yslg-product-recommendations-grid {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
}

.yslg-product-recommendations.yslg-pr-tight .yslg-product-card {
  flex: 0 0 calc(50% - 4px);
  min-width: 90px;
  scroll-snap-align: start;
}

/* Mobile viewport */
@media (max-width: 520px) {
  .ysleadgen-popup .yslg-product-recommendations {
    margin: 10px 0;
  }

  .ysleadgen-popup .yslg-product-recommendations-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .ysleadgen-popup .yslg-product-recommendations-list .yslg-product-card-image {
    width: 60px;
    height: 60px;
  }

  .ysleadgen-popup .yslg-product-card-cta {
    font-size: 11px;
    padding: 5px 10px;
  }
}

@media (max-width: 380px) {
  .ysleadgen-popup .yslg-product-recommendations-grid {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 8px;
    padding-bottom: 4px;
  }

  .ysleadgen-popup .yslg-product-recommendations-grid .yslg-product-card {
    flex: 0 0 46%;
    min-width: 120px;
    scroll-snap-align: start;
  }
}

.yslg-product-recommendations-loading,
.yslg-product-recommendations-empty {
  font-size: 13px;
  color: #6b7280;
  text-align: center;
  padding: 16px;
}

.yslg-product-recommendations-placeholder {
  margin: 0;
  font-size: 13px;
  color: #64748b;
}