/* ============================================================
   BundlePro Widget Styles - Front-end Checkout Widget
   Prefix: bpro-  (BEM notation, no conflicts with theme/WC)
   ============================================================ */

/* ── Reset & Variables ───────────────────────────────────── */
.bpro-widget {
  display: block;
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.4;
  color: #111827;
  box-sizing: border-box;

  /* Force variables for the design provided */
  --bpro-bg: #ffffff;
  --bpro-border-color: #ffcc99; /* Light orange for default */
  --bpro-border-width: 2px;
  --bpro-border-radius: 8px;
  --bpro-highlight: #f08c00; /* Main strong orange */
  --bpro-highlight-bg: #fff5e6; /* Soft orange background for selected */
  --bpro-badge-bg: #f08c00;
  --bpro-fs-title: 20px;
  --bpro-fs-price: 20px;
  --bpro-text-muted: #6b7280;
  --bpro-success: #10b981;
  
  margin: 1.5rem 0;
  overflow: hidden;
}

.bpro-widget * {
  box-sizing: border-box;
}

/* ─────────────────────────────────────────────────────────
   QUANTITY BREAKS BLOCK
   ───────────────────────────────────────────────────────── */

.bpro-tiers {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.bpro-tiers__divider {
  text-align: center;
  position: relative;
  margin: 10px 0 20px;
}

.bpro-tiers__divider::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  border-top: 1px solid #e5e7eb;
  z-index: 1;
}

.bpro-tiers__divider span {
  position: relative;
  z-index: 2;
  background: #fff;
  padding: 0 12px;
  font-weight: 700;
  font-size: 14px;
}

.bpro-tier {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--bpro-border-color);
  border-radius: var(--bpro-border-radius);
  cursor: pointer;
  background: #fff;
  transition: all 0.2s ease-in-out;
  user-select: none;
  position: relative;
}

.bpro-tier:hover {
  border-color: var(--bpro-highlight);
}

.bpro-tier--selected {
  border-color: var(--bpro-highlight);
  border-width: 2px;
  background: var(--bpro-highlight-bg);
  padding: 15px; /* Offset for border increment */
}

/* TIER RADIO CIRCLE */
.bpro-tier__radio {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid #d1d5db;
  background: #fff;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.bpro-tier__radio-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--bpro-highlight);
  opacity: 0;
  transition: opacity .15s;
}

.bpro-tier--selected .bpro-tier__radio {
  border-color: var(--bpro-highlight);
}

.bpro-tier--selected .bpro-tier__radio-dot { opacity: 1; }

/* TIER CONTENT MIDDLE */
.bpro-tier__content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.bpro-tier__title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.bpro-tier__qty {
  font-weight: 800;
  font-size: 18px;
  color: #000;
}

.bpro-tier__badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  background: var(--bpro-badge-bg);
  white-space: nowrap;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.bpro-tier__discount-lbl {
  font-size: 14px;
  color: #6b7280;
}

/* TIER PRICE RIGHT */
.bpro-tier__price-info {
  text-align: right;
  flex-shrink: 0;
}

.bpro-tier__price-top {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.bpro-tier__price {
  font-size: 22px;
  font-weight: 800;
  color: #000;
  line-height: 1;
}

.bpro-tier__price-original {
  font-size: 14px;
  color: #9ca3af;
  text-decoration: line-through;
  font-weight: 500;
}

.bpro-tier__per-unit {
  font-size: 13px;
  color: #6b7280;
  margin-top: 4px;
}

/* ─────────────────────────────────────────────────────────
   SUBSCRIPTION BLOCK
   ───────────────────────────────────────────────────────── */

.bpro-sub {
  margin-top: 16px;
  padding: 16px;
  border: 2px dashed var(--bpro-highlight);
  border-radius: var(--bpro-border-radius);
  background: #fff;
}

.bpro-sub__toggle-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
}

.bpro-sub__checkbox {
  width: 24px;
  height: 24px;
  accent-color: var(--bpro-highlight);
  cursor: pointer;
  flex-shrink: 0;
  margin-top: 2px;
}

.bpro-sub__content {
  flex: 1;
}

.bpro-sub__title {
  font-weight: 800;
  font-size: 16px;
  color: #000;
  line-height: 1.2;
  margin-bottom: 4px;
}

.bpro-sub__desc {
  font-size: 14px;
  color: #6b7280;
}

.bpro-sub__frequency-row {
  display: none;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed #e5e7eb;
}

.bpro-sub__frequency-row--visible { display: flex; }

.bpro-sub__cycle {
  padding: 6px 14px;
  border: 2px solid #e5e7eb;
  border-radius: 4px;
  font-size: 13px;
  cursor: pointer;
  transition: border-color .15s, background .15s;
  background: #fff;
}

.bpro-sub__cycle--selected {
  border-color: var(--bpro-highlight);
  background: var(--bpro-highlight-bg);
  color: var(--bpro-highlight);
  font-weight: 700;
}

/* ─────────────────────────────────────────────────────────
   WIDGET FOOTER (CTA area)
   ───────────────────────────────────────────────────────── */

.bpro-widget__footer {
  margin-top: 24px;
}

.bpro-widget__cta {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.bpro-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 16px 20px;
  border-radius: 4px;
  font-size: 16px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  border: none;
  outline: none;
  transition: transform .1s, filter .15s;
  text-decoration: none;
  font-family: inherit;
  width: 100%;
}

.bpro-btn:hover {
  filter: brightness(0.95);
}

.bpro-btn:active {
  transform: translateY(2px);
}

.bpro-btn--primary {
  background: var(--bpro-highlight);
  color: #fff;
}

.bpro-btn--gpay {
  background: #000;
  color: #fff;
  text-transform: none;
  letter-spacing: 0;
  font-size: 16px;
}

/* ─────────────────────────────────────────────────────────
   DYNAMIC VARIATIONS
   ───────────────────────────────────────────────────────── */
.bpro-tier__variations {
  padding: 0 16px 16px;
  background: var(--bpro-highlight-bg);
  border: 2px solid var(--bpro-highlight);
  border-top: none;
  border-radius: 0 0 var(--bpro-border-radius) var(--bpro-border-radius);
  margin-top: -8px; /* overlap to blend with tier */
}

/* Modify selected tier border to merge with variations */
.bpro-tier--selected {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  border-bottom: none;
  padding-bottom: 8px; /* reduce bottom padding */
}

.bpro-tier__variation-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
}

.bpro-tier__variation-img {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
}

.bpro-tier__variation-selects {
  display: flex;
  flex: 1;
  gap: 8px;
  flex-wrap: wrap;
}

.bpro-tier__variation-select {
  flex: 1;
  min-width: 100px;
}

.bpro-var-select {
  width: 100%;
  padding: 6px 10px;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  font-size: 13px;
  background: #fff;
  outline: none;
}
.bpro-var-select:focus {
  border-color: var(--bpro-highlight);
}

/* ─────────────────────────────────────────────────────────
   PROGRESSIVE GIFTS
   ───────────────────────────────────────────────────────── */
.bpro-gifts {
  margin-top: 24px;
  margin-bottom: 24px;
}

.bpro-gifts__header {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
  margin-bottom: 16px;
}

.bpro-gifts__title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--bpro-body-color);
}

.bpro-gifts__icon {
  font-size: 20px;
}

.bpro-gifts__slider {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px; /* For scrollbar */
  scrollbar-width: thin;
}
.bpro-gifts__slider::-webkit-scrollbar {
  height: 6px;
}
.bpro-gifts__slider::-webkit-scrollbar-track {
  background: #f1f1f1; 
  border-radius: 4px;
}
.bpro-gifts__slider::-webkit-scrollbar-thumb {
  background: #c1c1c1; 
  border-radius: 4px;
}

.bpro-gift-card {
  flex: 0 0 calc(33.333% - 8px);
  min-width: 100px;
  border: 1.5px solid #e5e7eb;
  border-radius: 8px;
  padding: 12px;
  text-align: center;
  position: relative;
  background: #fff;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
}

/* Locked state */
.bpro-gift-card--locked {
  background: #f9fafb;
  border-color: #e5e7eb;
}
.bpro-gift-card--locked .bpro-gift-card__overlay {
  display: flex;
}
.bpro-gift-card--locked .bpro-gift-card__img {
  opacity: 0.3;
}
.bpro-gift-card--locked .bpro-gift-card__locked-text {
  display: block;
}
.bpro-gift-card--locked .bpro-gift-card__title,
.bpro-gift-card--locked .bpro-gift-card__variations {
  display: none !important;
}

/* Unlocked state */
.bpro-gift-card--unlocked {
  border-color: #000;
}
.bpro-gift-card--unlocked .bpro-gift-card__overlay {
  display: none;
}
.bpro-gift-card--unlocked .bpro-gift-card__locked-text {
  display: none;
}
.bpro-gift-card--unlocked .bpro-gift-card__title {
  display: block;
}
.bpro-gift-card--unlocked .bpro-gift-card__badge--locked {
  display: none;
}
.bpro-gift-card--unlocked .bpro-gift-card__badge--unlocked {
  display: inline-block !important;
}

/* Internal elements */
.bpro-gift-card__status {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
}

.bpro-gift-card__badge {
  background: #e5e7eb;
  color: #374151;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  white-space: nowrap;
  text-transform: uppercase;
}

.bpro-gift-card__img-wrap {
  position: relative;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 8px;
  margin-bottom: 8px;
}

.bpro-gift-card__img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.bpro-gift-card__placeholder {
  font-size: 40px;
  line-height: 1;
}

.bpro-gift-card__overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  display: none;
  align-items: center;
  justify-content: center;
}

.bpro-gift-card__lock-icon {
  width: 24px;
  height: 24px;
  color: #9ca3af;
}

.bpro-gift-card__info {
  margin-top: auto;
}

.bpro-gift-card__title {
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 8px;
}

.bpro-gift-card__locked-text {
  font-size: 13px;
  color: #6b7280;
}

.bpro-gift-var-select {
  width: 100%;
  padding: 4px 6px;
  font-size: 11px;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  margin-top: 4px;
  background: #fff;
  outline: none;
}
