/**
 * WPL Product Builder - Frontend Design Tokens and Responsive Component Styles
 */
:root {
  --wplpb-primary: #0071a1;
  --wplpb-primary-hover: #005177;
  --wplpb-primary-contrast: #ffffff;
  --wplpb-bg-surface: #ffffff;
  --wplpb-bg-alt: #f6f7f7;
  --wplpb-border: #dcdcde;
  --wplpb-border-focus: #0071a1;
  --wplpb-text-main: #2c3338;
  --wplpb-text-muted: #646970;
  --wplpb-success: #008a20;
  --wplpb-error: #d63638;
  --wplpb-radius-sm: 4px;
  --wplpb-radius-md: 8px;
  --wplpb-radius-lg: 12px;
  --wplpb-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --wplpb-shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
  --wplpb-transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --wplpb-focus-ring: 0 0 0 3px rgba(0, 113, 161, 0.35);
}

/* Container & Layout */
.wplpb-builder-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin: 20px 0;
  font-family: inherit;
}

/* Grid & List Layouts */
.wplpb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

@media (max-width: 600px) {
  .wplpb-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}

.wplpb-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Component Option Cards */
.wplpb-card {
  background: var(--wplpb-bg-surface);
  border: 1px solid var(--wplpb-border);
  border-radius: var(--wplpb-radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: var(--wplpb-transition);
  cursor: pointer;
  outline: none;
}

.wplpb-card:hover {
  border-color: var(--wplpb-primary);
  box-shadow: var(--wplpb-shadow-sm);
}

.wplpb-card:focus-visible {
  outline: none;
  box-shadow: var(--wplpb-focus-ring);
  border-color: var(--wplpb-border-focus);
}

.wplpb-card.is-selected {
  border-color: var(--wplpb-primary);
  background: #f0f7fb;
  box-shadow: 0 0 0 1px var(--wplpb-primary);
}

.wplpb-card-thumbnail {
  width: 100%;
  height: 160px;
  object-fit: cover;
  border-radius: var(--wplpb-radius-sm);
  background: var(--wplpb-bg-alt);
  margin-bottom: 10px;
}

.wplpb-card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--wplpb-text-main);
  margin: 0 0 6px 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wplpb-card-price {
  font-size: 13px;
  color: var(--wplpb-primary);
  font-weight: 600;
  margin-bottom: 8px;
}

.wplpb-card-stock {
  font-size: 12px;
  color: var(--wplpb-text-muted);
}

.wplpb-card-stock.in-stock {
  color: var(--wplpb-success);
}

.wplpb-card-stock.out-of-stock {
  color: var(--wplpb-error);
}

/* Wizard Step Navigation */
.wplpb-wizard-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 2px solid var(--wplpb-border);
  padding-bottom: 12px;
  margin-bottom: 20px;
  overflow-x: auto;
  gap: 16px;
}

.wplpb-wizard-step {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--wplpb-text-muted);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  background: none;
  border: none;
  padding: 6px 12px;
  border-radius: var(--wplpb-radius-sm);
  transition: var(--wplpb-transition);
}

.wplpb-wizard-step.is-active {
  color: var(--wplpb-primary);
  font-weight: 700;
  background: #f0f7fb;
}

.wplpb-wizard-step.is-completed {
  color: var(--wplpb-success);
}

.wplpb-step-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--wplpb-border);
  color: var(--wplpb-text-main);
  font-size: 11px;
}

.wplpb-wizard-step.is-active .wplpb-step-badge {
  background: var(--wplpb-primary);
  color: var(--wplpb-primary-contrast);
}

.wplpb-wizard-step.is-completed .wplpb-step-badge {
  background: var(--wplpb-success);
  color: var(--wplpb-primary-contrast);
}

/* Accordion Presentation */
.wplpb-accordion-item {
  border: 1px solid var(--wplpb-border);
  border-radius: var(--wplpb-radius-md);
  margin-bottom: 10px;
  overflow: hidden;
}

.wplpb-accordion-header {
  width: 100%;
  background: var(--wplpb-bg-alt);
  padding: 14px 18px;
  border: none;
  text-align: left;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--wplpb-transition);
}

.wplpb-accordion-header:hover {
  background: #eaecee;
}

.wplpb-accordion-header:focus-visible {
  outline: none;
  box-shadow: inset var(--wplpb-focus-ring);
}

.wplpb-accordion-body {
  padding: 16px 18px;
  background: var(--wplpb-bg-surface);
  border-top: 1px solid var(--wplpb-border);
}

.wplpb-accordion-body.is-hidden {
  display: none;
}

/* Live Pricing Bar */
.wplpb-pricing-summary {
  background: var(--wplpb-bg-alt);
  border: 1px solid var(--wplpb-border);
  border-radius: var(--wplpb-radius-md);
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 15px;
}

.wplpb-pricing-total-label {
  font-size: 13px;
  color: var(--wplpb-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.wplpb-pricing-total-amount {
  font-size: 22px;
  font-weight: 700;
  color: var(--wplpb-text-main);
}

/* Loading & Validation States */
.wplpb-loading {
  opacity: 0.6;
  pointer-events: none;
  position: relative;
}

.wplpb-spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid var(--wplpb-border);
  border-top-color: var(--wplpb-primary);
  border-radius: 50%;
  animation: wplpb-spin 0.6s linear infinite;
  vertical-align: middle;
  margin-right: 6px;
}

@keyframes wplpb-spin {
  to { transform: rotate(360deg); }
}

.wplpb-error-notice {
  background: #fdf2f2;
  border-left: 4px solid var(--wplpb-error);
  padding: 10px 14px;
  color: #991b1b;
  font-size: 13px;
  border-radius: var(--wplpb-radius-sm);
  margin-bottom: 12px;
}

.wplpb-empty-state {
  text-align: center;
  padding: 30px 20px;
  color: var(--wplpb-text-muted);
  font-style: italic;
  font-size: 14px;
}

/* ==========================================================================
   Configurable Product Options - Frontend Storefront Styles
   ========================================================================== */
.wplpb-options-wrapper {
  margin: 24px 0;
  padding: 0;
  clear: both;
}

.wplpb-options-heading {
  font-size: 16px;
  font-weight: 700;
  color: var(--wplpb-text-main, #1d2327);
  margin: 0 0 16px 0;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--wplpb-border, #e2e8f0);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.wplpb-options-fields {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.wplpb-option-field-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-sizing: border-box;
}

.wplpb-option-field-row > label {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--wplpb-text-main, #2c3338);
  margin: 0;
  cursor: pointer;
}

.wplpb-option-field-row > label .required {
  color: var(--wplpb-error, #d63638);
  margin-left: 2px;
}

.wplpb-option-badge {
  display: inline-block;
  background: #e0f2fe;
  color: #0369a1;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 9999px;
  line-height: 1.3;
}

.wplpb-option-field-row .description {
  margin: 0;
  font-size: 12.5px;
  color: var(--wplpb-text-muted, #646970);
  line-height: 1.4;
}

/* Form Inputs */
.wplpb-option-field-row input[type="text"],
.wplpb-option-field-row input[type="number"],
.wplpb-option-field-row textarea,
.wplpb-option-field-row select,
.wplpb-option-field-row input[type="file"] {
  width: 100%;
  box-sizing: border-box;
  font-size: 14px;
  padding: 9px 12px;
  border: 1px solid var(--wplpb-border, #dcdcde);
  border-radius: var(--wplpb-radius-sm, 4px);
  background: var(--wplpb-bg-surface, #ffffff);
  color: var(--wplpb-text-main, #2c3338);
  transition: var(--wplpb-transition, all 0.2s ease);
}

.wplpb-option-field-row input[type="text"]:focus,
.wplpb-option-field-row input[type="number"]:focus,
.wplpb-option-field-row textarea:focus,
.wplpb-option-field-row select:focus {
  border-color: var(--wplpb-primary, #0071a1);
  box-shadow: var(--wplpb-focus-ring, 0 0 0 3px rgba(0, 113, 161, 0.2));
  outline: none;
}

/* Swatches Container & Items */
.wplpb-swatches-container {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 4px;
}

.wplpb-swatch-item {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  border: 1.5px solid var(--wplpb-border, #dcdcde);
  border-radius: 6px;
  padding: 6px 10px;
  background: var(--wplpb-bg-surface, #ffffff);
  transition: all 0.15s ease;
  user-select: none;
}

.wplpb-swatch-item:hover {
  border-color: #94a3b8;
  background: #f8fafc;
}

.wplpb-swatch-item.is-selected,
.wplpb-swatch-item:has(input:checked) {
  border-color: var(--wplpb-primary, #0071a1);
  background: #f0f7fb;
  box-shadow: 0 0 0 1px var(--wplpb-primary, #0071a1);
}

.wplpb-swatch-radio {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.wplpb-swatch-color {
  display: inline-block;
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.15);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.15);
}

.wplpb-swatches-square .wplpb-swatch-color {
  border-radius: 4px;
}

.wplpb-swatch-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--wplpb-text-main, #2c3338);
}

.wplpb-swatch-price-badge {
  font-size: 11px;
  color: var(--wplpb-text-muted, #646970);
  margin-left: 2px;
}

/* Live Character Counter */
.wplpb-char-counter {
  font-size: 11.5px;
  color: var(--wplpb-text-muted, #646970);
  align-self: flex-end;
  margin-top: 2px;
}

/* ==========================================================================
   Premade Theme 1: Modern Cards (Default)
   ========================================================================== */
.wplpb-theme-cards .wplpb-option-field-row {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 16px 18px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.wplpb-theme-cards .wplpb-option-field-row:hover {
  border-color: #cbd5e1;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.06);
}

.wplpb-theme-cards .wplpb-option-badge {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #dbeafe;
}

/* ==========================================================================
   Premade Theme 2: Clean Minimal
   ========================================================================== */
.wplpb-theme-minimal .wplpb-option-field-row {
  background: transparent;
  border: none;
  border-bottom: 1px solid #f1f5f9;
  padding: 12px 0 16px 0;
  border-radius: 0;
}

.wplpb-theme-minimal .wplpb-option-badge {
  background: transparent;
  color: #64748b;
  font-weight: 500;
  padding: 0;
}

/* ==========================================================================
   Premade Theme 3: Compact Grid
   ========================================================================== */
.wplpb-theme-compact .wplpb-options-fields {
  gap: 10px;
}

.wplpb-theme-compact .wplpb-option-field-row {
  background: #fafafa;
  border: 1px solid #e5e7eb;
  border-radius: 5px;
  padding: 10px 12px;
  font-size: 13px;
}

.wplpb-theme-compact .wplpb-option-field-row > label {
  font-size: 13px;
}

.wplpb-theme-compact .wplpb-option-field-row input[type="text"],
.wplpb-theme-compact .wplpb-option-field-row input[type="number"],
.wplpb-theme-compact .wplpb-option-field-row select {
  padding: 6px 10px;
  height: 32px;
  font-size: 13px;
}

.wplpb-theme-compact .wplpb-swatch-item {
  padding: 4px 8px;
}

.wplpb-theme-compact .wplpb-swatch-color {
  width: 18px;
  height: 18px;
}

/* ==========================================================================
   Premade Theme 4: Left Accent Border
   ========================================================================== */
.wplpb-theme-accent .wplpb-option-field-row {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-left: 4px solid var(--wplpb-primary, #0071a1);
  border-radius: 0 8px 8px 0;
  padding: 14px 18px;
  transition: all 0.2s ease;
}

.wplpb-theme-accent .wplpb-option-field-row:hover,
.wplpb-theme-accent .wplpb-option-field-row:focus-within {
  background: #ffffff;
  border-color: #cbd5e1;
  border-left-color: var(--wplpb-primary-hover, #005177);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.wplpb-theme-accent .wplpb-option-badge {
  background: #0071a1;
  color: #ffffff;
}

/* ==========================================================================
   Live Inline Active Price & Real-time Total Breakdown Summary Box
   ========================================================================== */
.wplpb-inline-active-cost {
  display: none;
  font-size: 11px;
  font-weight: 600;
  color: #047857;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  border-radius: 9999px;
  padding: 2px 8px;
  line-height: 1.3;
  margin-left: auto;
  align-items: center;
  gap: 4px;
}

.wplpb-inline-active-cost.is-active {
  display: inline-flex;
}

.wplpb-factor-detail {
  font-size: 10px;
  font-weight: 500;
  color: #065f46;
  opacity: 0.9;
}

/* Price Summary & Breakdown Card */
.wplpb-price-summary-box {
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: var(--wplpb-radius-md, 8px);
  padding: 16px 20px;
  margin-top: 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.wplpb-summary-header {
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #e2e8f0;
}

.wplpb-summary-title {
  font-size: 13.5px;
  font-weight: 700;
  color: #1e293b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.wplpb-summary-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.wplpb-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13.5px;
  color: #334155;
  padding: 3px 0;
}

.wplpb-summary-factors {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.wplpb-row-factor {
  font-size: 13px;
  color: #475569;
  background: #ffffff;
  border: 1px solid #f1f5f9;
  border-radius: 4px;
  padding: 6px 10px;
}

.wplpb-row-factor .wplpb-row-price {
  color: #047857;
  font-weight: 600;
}

.wplpb-factor-tag {
  color: #64748b;
  font-size: 11.5px;
  font-weight: normal;
  margin-left: 4px;
}

.wplpb-summary-empty {
  font-size: 12.5px;
  color: #94a3b8;
  font-style: italic;
  padding: 4px 0;
}

.wplpb-summary-divider {
  height: 1px;
  background: #cbd5e1;
  margin: 10px 0 6px 0;
}

.wplpb-row-total {
  font-size: 15px;
  color: #0f172a;
  padding-top: 4px;
}

.wplpb-summary-total-amount {
  font-size: 20px;
  font-weight: 800;
  color: var(--wplpb-primary, #0071a1);
}

/* ── Options rows in cart / checkout (classic + WC Blocks) ─────────── */

/* Each option row: value on left, price on right */
.wplpb-opt-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  width: 100%;
  font-size: 0.88em;
}

.wplpb-opt-value {
  color: #111827;
  font-weight: 500;
  flex: 1;
}

.wplpb-opt-price {
  white-space: nowrap;
  color: #2e7d32;
  font-weight: 600;
  font-size: 0.92em;
}

/* WC Blocks: each detail item as a two-column grid (name | value+price) */
.wc-block-components-product-details > span {
  display: grid !important;
  grid-template-columns: max-content 1fr;
  align-items: baseline;
  width: 100%;
  gap: 0 4px;
  margin-bottom: 2px;
}

/* Hide WC Blocks' " / " separator between items */
.wc-block-components-product-details > span > span[aria-hidden="true"] {
  display: none !important;
}

.wc-block-components-product-details .wc-block-components-product-details__value {
  display: block;
  width: 100%;
}

/* ==========================================================================
   Visual Product Designer Studio - Modern Theme
   ========================================================================== */
.wplpb-visual-designer-wrapper {
  box-sizing: border-box;
  font-family: inherit;
  position: relative;
  margin: 24px 0;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  box-shadow: 0 10px 30px -5px rgba(15, 23, 42, 0.08), 0 4px 6px -2px rgba(15, 23, 42, 0.02);
  overflow: hidden;
}

.wplpb-visual-designer-wrapper *,
.wplpb-visual-designer-wrapper *::before,
.wplpb-visual-designer-wrapper *::after {
  box-sizing: border-box;
}

/* Studio Header */
.wplpb-designer-header {
  background: #ffffff;
  border-bottom: 1px solid #f1f5f9;
  padding: 12px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.wplpb-header-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.wplpb-brand-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, #0284c7 0%, #2563eb 100%);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
}

.wplpb-brand-title {
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.2px;
}

/* Surface Segmented Control */
.wplpb-surface-tabs {
  display: inline-flex;
  background: #f1f5f9;
  padding: 3px;
  border-radius: 9999px;
  gap: 2px;
  border: 1px solid #e2e8f0;
}

.wplpb-surface-tab {
  background: transparent !important;
  color: #64748b !important;
  border: none !important;
  border-radius: 9999px !important;
  padding: 5px 14px !important;
  font-size: 12.5px !important;
  font-weight: 600 !important;
  line-height: 1.4 !important;
  cursor: pointer;
  box-shadow: none !important;
  transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
}

.wplpb-surface-tab:hover {
  color: #0f172a !important;
}

.wplpb-surface-tab.is-active {
  background: #ffffff !important;
  color: #0f172a !important;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08), 0 0 0 1px rgba(0, 0, 0, 0.04) !important;
}

/* History Tools */
.wplpb-history-tools {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.wplpb-btn-action {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  padding: 6px 11px !important;
  background: #f8fafc !important;
  color: #475569 !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 7px !important;
  font-size: 12px !important;
  font-weight: 500 !important;
  line-height: 1 !important;
  cursor: pointer;
  box-shadow: none !important;
  transition: all 0.15s ease;
}

.wplpb-btn-action:hover {
  background: #f1f5f9 !important;
  color: #0f172a !important;
  border-color: #cbd5e1 !important;
  transform: translateY(-1px);
}

.wplpb-btn-action:active {
  transform: translateY(0);
}

.wplpb-btn-action.wplpb-btn-reset {
  color: #e11d48 !important;
}

.wplpb-btn-action.wplpb-btn-reset:hover {
  background: #ffe4e6 !important;
  border-color: #fecdd3 !important;
  color: #be123c !important;
}

/* Studio Toolbar */
.wplpb-designer-toolbar {
  background: #fafafa;
  border-bottom: 1px solid #e2e8f0;
  padding: 10px 18px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.wplpb-tool-btn {
  display: inline-flex !important;
  align-items: center !important;
  gap: 7px !important;
  padding: 7px 14px !important;
  background: #ffffff !important;
  color: #1e293b !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 8px !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  line-height: 1.4 !important;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03) !important;
  transition: all 0.15s ease;
}

.wplpb-tool-btn svg {
  color: #0284c7;
  transition: transform 0.15s ease;
}

.wplpb-tool-btn:hover {
  background: #f8fafc !important;
  border-color: #cbd5e1 !important;
  color: #0284c7 !important;
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.05) !important;
}

.wplpb-tool-btn:hover svg {
  transform: scale(1.1);
}

.wplpb-tool-btn.button-primary,
.wplpb-tool-btn.is-active {
  background: #0284c7 !important;
  color: #ffffff !important;
  border-color: #0284c7 !important;
  box-shadow: 0 3px 10px rgba(2, 132, 199, 0.3) !important;
}

.wplpb-tool-btn.button-primary svg,
.wplpb-tool-btn.is-active svg {
  color: #ffffff;
}

/* Canvas Viewport */
.wplpb-designer-canvas-container {
  touch-action: none;
  position: relative;
  width: 100%;
  margin: 20px auto;
  background: #ffffff;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.06);
  overflow: hidden;
  background-image:
    radial-gradient(#e2e8f0 0.8px, transparent 0.8px),
    radial-gradient(#e2e8f0 0.8px, #ffffff 0.8px);
  background-size: 20px 20px;
  background-position: 0 0, 10px 10px;
}

.wplpb-mockup-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

.wplpb-printable-area-guide {
  position: absolute;
  border: 1.5px dashed rgba(2, 132, 199, 0.45);
  border-radius: 8px;
  pointer-events: none;
  box-shadow: 0 0 0 9999px rgba(248, 250, 252, 0.35);
}

.wplpb-guide-badge {
  position: absolute;
  top: 6px;
  left: 8px;
  background: rgba(255, 255, 255, 0.95);
  color: #0284c7;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  border: 1px solid rgba(2, 132, 199, 0.25);
  backdrop-filter: blur(4px);
}

.wplpb-canvas-objects-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

/* Canvas Object Styles */
.wplpb-canvas-obj {
  position: absolute;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  transform-origin: center center;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: outline 0.12s ease;
}

.wplpb-canvas-obj:active {
  cursor: grabbing;
}

.wplpb-canvas-obj.is-selected {
  outline: 2px solid #0284c7;
  outline-offset: 3px;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.2);
}

.wplpb-canvas-obj .wplpb-obj-delete {
  display: none;
  position: absolute;
  top: -12px;
  right: -12px;
  width: 22px;
  height: 22px;
  background: #e11d48;
  color: #ffffff;
  border: 2px solid #ffffff;
  border-radius: 50%;
  font-size: 14px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  z-index: 100;
  transition: transform 0.12s ease, background 0.12s ease;
}

.wplpb-canvas-obj .wplpb-obj-delete:hover {
  background: #be123c;
  transform: scale(1.15);
}

.wplpb-canvas-obj.is-selected .wplpb-obj-delete {
  display: block;
}

/* Floating Contextual Controls Bar */
.wplpb-designer-controls-bar {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 8px 14px;
  margin: 12px 18px 0 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 13px;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.04);
}

.wplpb-designer-controls-bar input[type="text"] {
  padding: 5px 10px;
  font-size: 13px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  min-width: 160px;
  outline: none;
  transition: border-color 0.15s ease;
}

.wplpb-designer-controls-bar input[type="text"]:focus {
  border-color: #0284c7;
  box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.15);
}

.wplpb-designer-controls-bar input[type="color"] {
  width: 32px;
  height: 30px;
  padding: 1px 2px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  cursor: pointer;
  background: #ffffff;
}

.wplpb-designer-controls-bar select {
  padding: 5px 8px;
  font-size: 13px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #ffffff;
  outline: none;
}

.wplpb-designer-controls-bar select:focus {
  border-color: #0284c7;
}

.wplpb-ctrl-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 5px 9px !important;
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 6px !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  color: #334155 !important;
  cursor: pointer;
  box-shadow: none !important;
  transition: all 0.15s ease;
}

.wplpb-ctrl-btn:hover {
  background: #f1f5f9 !important;
  border-color: #cbd5e1 !important;
  color: #0f172a !important;
}

.wplpb-ctrl-btn.wplpb-btn-del {
  color: #e11d48 !important;
  margin-left: auto;
}

.wplpb-ctrl-btn.wplpb-btn-del:hover {
  background: #ffe4e6 !important;
  border-color: #fecdd3 !important;
}

/* Modals (Clipart & Shapes) */
.wplpb-designer-modal {
  position: absolute;
  top: 105px;
  left: 18px;
  right: 18px;
  max-width: 480px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 20px 40px -10px rgba(15, 23, 42, 0.15), 0 0 0 1px rgba(15, 23, 42, 0.05);
  padding: 16px;
  z-index: 60;
  animation: wplpbModalFadeIn 0.18s ease-out;
}

@keyframes wplpbModalFadeIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.wplpb-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid #f1f5f9;
  font-weight: 700;
  font-size: 14px;
  color: #0f172a;
}

.wplpb-modal-close {
  background: transparent !important;
  border: none !important;
  font-size: 20px !important;
  line-height: 1 !important;
  cursor: pointer;
  color: #94a3b8 !important;
  padding: 2px 6px !important;
  border-radius: 4px;
  box-shadow: none !important;
  transition: color 0.15s ease;
}

.wplpb-modal-close:hover {
  color: #0f172a !important;
}

.wplpb-clipart-grid, .wplpb-shapes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(46px, 1fr));
  gap: 10px;
  max-height: 240px;
  overflow-y: auto;
  padding: 2px;
}

.wplpb-clipart-item, .wplpb-shape-item {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 24px !important;
  padding: 10px !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 8px !important;
  cursor: pointer;
  background: #f8fafc !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02) !important;
  transition: all 0.15s ease !important;
}

.wplpb-clipart-item:hover, .wplpb-shape-item:hover {
  background: #ffffff !important;
  transform: translateY(-2px) scale(1.06) !important;
  border-color: #0284c7 !important;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.15) !important;
}

/* Custom Fee Pill */
.wplpb-custom-fee-notice {
  background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%) !important;
  border: 1px solid #bbf7d0 !important;
  border-radius: 8px !important;
  padding: 10px 16px !important;
  margin: 14px 18px !important;
  color: #166534 !important;
  font-weight: 600 !important;
  font-size: 13px !important;
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  box-shadow: 0 1px 3px rgba(22, 101, 52, 0.05);
}

/* Responsive Studio Adjustments */
@media (max-width: 640px) {
  .wplpb-designer-header {
    flex-direction: column;
    align-items: stretch;
  }
  .wplpb-surface-tabs {
    justify-content: center;
  }
  .wplpb-history-tools {
    justify-content: center;
  }
  .wplpb-designer-toolbar {
    justify-content: center;
  }
  .wplpb-tool-btn span {
    display: none;
  }
}

/* ==========================================================================
   Chained (Companion) Products Showcase - Compact Box UI/UX
   ========================================================================== */
.wplpb-chained-showcase {
  margin: 18px 0;
  padding: 12px 16px;
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.04);
  font-family: inherit;
}

.wplpb-chained-compact-header {
  margin-bottom: 10px;
}

.wplpb-chained-compact-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #334155;
}

.wplpb-gift-svg {
  color: #0284c7;
  flex-shrink: 0;
}

.wplpb-chained-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.wplpb-chained-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.wplpb-chained-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
}

.wplpb-chained-img-wrap {
  position: relative;
  width: 72px;
  height: 72px;
  min-width: 72px;
  flex-shrink: 0;
  border-radius: 8px;
  overflow: hidden;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.wplpb-chained-img-wrap img,
.wplpb-chained-product-img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  display: block !important;
}

.wplpb-chained-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-grow: 1;
  min-width: 0;
}

.wplpb-chained-product-name {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wplpb-chained-product-name a {
  color: inherit;
  text-decoration: none;
  transition: color 0.15s ease;
}

.wplpb-chained-product-name a:hover {
  color: #0284c7;
  text-decoration: underline;
}

.wplpb-chained-pricing-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 14px;
  line-height: 1.3;
}

.wplpb-chained-qty-badge {
  display: inline-flex;
  align-items: center;
  background: #f1f5f9;
  color: #1e293b;
  font-size: 12px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 5px;
  border: 1px solid #cbd5e1;
  line-height: 1.2;
}

.wplpb-chained-orig-price {
  color: #94a3b8;
  font-size: 13px;
  text-decoration: line-through;
}

.wplpb-chained-final-price {
  color: #0f172a;
  font-weight: 700;
  font-size: 15px;
  text-decoration: none;
}

.wplpb-badge-free {
  display: inline-flex;
  align-items: center;
  background: #10b981;
  color: #ffffff !important;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  line-height: 1.2;
}

.wplpb-badge-discount {
  display: inline-flex;
  align-items: center;
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  text-transform: uppercase;
  line-height: 1.2;
}

/* =========================================================
   Bundle Product Form
   ========================================================= */
.wplpb-bundle-items {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.wplpb-bundle-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--wplpb-bg-surface);
  border: 1px solid var(--wplpb-border);
  border-radius: var(--wplpb-radius-md);
  padding: 12px 14px;
  transition: border-color 0.15s ease;
}

.wplpb-bundle-item:hover {
  border-color: var(--wplpb-primary);
}

.wplpb-bundle-item-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.wplpb-bundle-item-thumb {
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  border-radius: var(--wplpb-radius-sm);
  overflow: hidden;
  background: var(--wplpb-bg-alt);
}

.wplpb-bundle-item-thumb img {
  width: 56px;
  height: 56px;
  object-fit: cover;
  display: block;
}

.wplpb-bundle-item-info {
  min-width: 0;
}

.wplpb-bundle-item-title {
  margin: 0 0 4px 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--wplpb-text-main);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.wplpb-bundle-required-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  color: var(--wplpb-error);
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 3px;
  padding: 1px 5px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  line-height: 1.4;
}

.wplpb-bundle-item-price {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 13px;
}

.wplpb-bundle-price-original {
  color: var(--wplpb-text-muted);
  text-decoration: line-through;
  font-size: 12px;
}

.wplpb-bundle-price-final {
  color: var(--wplpb-text-main);
  font-size: 14px;
  font-weight: 700;
}

.wplpb-bundle-save-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  background: var(--wplpb-success);
  border-radius: 3px;
  padding: 1px 5px;
  line-height: 1.4;
}

.wplpb-bundle-included {
  font-size: 12px;
  color: var(--wplpb-text-muted);
  font-style: italic;
}

.wplpb-bundle-out-of-stock {
  font-size: 12px;
  font-weight: 600;
  color: var(--wplpb-error);
}

/* Variation selects inside bundle items */
.wplpb-bundle-item-qty {
  flex-shrink: 0;
}

.wplpb-bundle-variation-wrapper {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex-shrink: 0;
}

.wplpb-bundle-variation-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 120px;
}

.wplpb-variation-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--wplpb-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.wplpb-bundle-variation-select {
  height: 34px;
  padding: 0 28px 0 10px;
  border: 1px solid var(--wplpb-border);
  border-radius: var(--wplpb-radius-sm);
  background: var(--wplpb-bg-surface);
  color: var(--wplpb-text-main);
  font-size: 13px;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%236b7280'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  transition: border-color 0.15s ease;
}

.wplpb-bundle-variation-select:focus {
  outline: none;
  border-color: var(--wplpb-border-focus);
}

/* Qty stepper — shared by item qty and bundle qty */
.wplpb-qty-stepper {
  display: flex;
  align-items: center;
  border: 1px solid var(--wplpb-border);
  border-radius: var(--wplpb-radius-sm);
  overflow: hidden;
  height: 36px;
}

.wplpb-qty-btn {
  width: 32px;
  height: 36px;
  background: var(--wplpb-bg-alt);
  border: none;
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
  color: var(--wplpb-text-main);
  line-height: 1;
  transition: background 0.15s ease;
  flex-shrink: 0;
}

.wplpb-qty-btn:hover {
  background: var(--wplpb-border);
}

.wplpb-qty-btn:active {
  background: #d0d5db;
}

.wplpb-qty-input {
  width: 44px !important;
  height: 36px;
  border: none !important;
  border-left: 1px solid var(--wplpb-border) !important;
  border-right: 1px solid var(--wplpb-border) !important;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--wplpb-text-main);
  background: var(--wplpb-bg-surface);
  padding: 0 4px !important;
  -moz-appearance: textfield;
  appearance: textfield;
  box-shadow: none !important;
}

.wplpb-qty-input::-webkit-outer-spin-button,
.wplpb-qty-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Bundle footer */
.wplpb-bundle-footer {
  border-top: 2px solid var(--wplpb-border);
  padding-top: 16px;
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.wplpb-bundle-total-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--wplpb-bg-alt);
  border: 1px solid var(--wplpb-border);
  border-radius: var(--wplpb-radius-md);
  padding: 10px 16px;
}

.wplpb-bundle-total-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--wplpb-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.wplpb-bundle-total-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--wplpb-primary);
}

.wplpb-bundle-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.wplpb-bundle-qty {
  flex-shrink: 0;
}

.wplpb-bundle-submit {
  flex: 1;
}

/* Responsive */
@media (max-width: 600px) {
  .wplpb-bundle-item {
    flex-wrap: wrap;
    gap: 10px;
  }
  .wplpb-bundle-item-left {
    flex: 1 1 100%;
  }
  .wplpb-bundle-item-qty {
    margin-left: auto;
  }
  .wplpb-bundle-actions {
    flex-wrap: wrap;
  }
  .wplpb-bundle-submit {
    width: 100%;
    flex: 1 1 100%;
  }
}

/* =========================================================
   Bundle Cart & Checkout — Grouped Display
   ========================================================= */

/* Parent row: subtle top border to separate bundle groups */
.wplpb-bundle-parent-row td {
  border-top: 2px solid var(--wplpb-primary) !important;
}

.wplpb-bundle-parent-row .product-name {
  font-weight: 700;
}

/* "Bundle" tag next to parent product name */
.wplpb-bundle-parent-row .product-name a::after {
  content: 'Bundle';
  display: inline-block;
  margin-left: 7px;
  font-size: 10px;
  font-weight: 700;
  color: var(--wplpb-primary);
  background: #e8f4fb;
  border: 1px solid #b3d9ef;
  border-radius: 3px;
  padding: 1px 5px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  vertical-align: middle;
  line-height: 1.5;
}

/* Child rows: indented, muted, no top border */
.wplpb-bundle-child-row td {
  background: var(--wplpb-bg-alt) !important;
  border-top: 1px dashed var(--wplpb-border) !important;
  padding-top: 8px !important;
  padding-bottom: 8px !important;
}

/* Last child row: bottom border to close the group */
.wplpb-bundle-child-row:last-of-type td,
.wplpb-bundle-child-row + tr:not(.wplpb-bundle-child-row) td {
  border-bottom: 2px solid var(--wplpb-border) !important;
}

/* Tree connector line inside child product name cell */
.wplpb-bundle-child-row .product-name {
  padding-left: 28px !important;
  position: relative;
  font-size: 13px;
  color: var(--wplpb-text-muted);
}

/* Vertical + horizontal connector drawn with pseudo-elements */
.wplpb-bundle-child-connector {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-block;
  width: 12px;
  height: 1px;
  background: var(--wplpb-border);
  pointer-events: none;
}

.wplpb-bundle-child-connector::before {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 1px;
  height: 200%;
  background: var(--wplpb-border);
}

/* Child thumbnail: smaller */
.wplpb-bundle-child-row .product-thumbnail img {
  width: 44px !important;
  height: 44px !important;
  object-fit: cover;
  border-radius: var(--wplpb-radius-sm);
  opacity: 0.85;
}

/* Child qty: read-only look */
.wplpb-bundle-child-row .product-quantity .qty {
  background: transparent;
  border-color: var(--wplpb-border);
  color: var(--wplpb-text-muted);
  pointer-events: none;
  opacity: 0.8;
}

/* "Included" subtotal chip */
.wplpb-bundle-child-included {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  color: var(--wplpb-success);
  background: #f0fdf4;
  border: 1px solid #86efac;
  border-radius: 3px;
  padding: 2px 7px;
  letter-spacing: 0.02em;
}

/* Mini-cart: indent children */
.widget_shopping_cart .wplpb-bundle-child-row {
  padding-left: 12px;
  opacity: 0.85;
}

/* Checkout order review table */
.woocommerce-checkout-review-order .wplpb-bundle-child-row td {
  font-size: 12px;
  color: var(--wplpb-text-muted);
  padding-left: 24px !important;
  background: var(--wplpb-bg-alt) !important;
}

/* Mobile: keep indentation readable */
@media (max-width: 600px) {
  .wplpb-bundle-child-row .product-name {
    padding-left: 16px !important;
  }
  .wplpb-bundle-child-connector {
    left: 4px;
    width: 8px;
  }
}

/* ─── Promotions: Cart Progress Bar ────────────────────────────────────────── */
.wplpb-cart-progress-wrap {
    margin: 0 0 16px 0;
    padding: 12px 16px;
    background: var(--wplpb-bg-alt, #f8fafc);
    border: 1px solid var(--wplpb-border, #e2e8f0);
    border-left: 4px solid var(--wplpb-accent, #2563eb);
    border-radius: 8px;
}
.wplpb-cart-progress-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 13.5px;
    color: var(--wplpb-text, #1e293b);
}
.wplpb-cart-progress-icon { font-size: 18px; flex-shrink: 0; }
.wplpb-cart-progress-msg strong { color: var(--wplpb-accent, #2563eb); }
.wplpb-cart-progress-bar {
    width: 100%;
    height: 8px;
    background: var(--wplpb-border, #e2e8f0);
    border-radius: 999px;
    overflow: hidden;
}
.wplpb-cart-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--wplpb-accent, #2563eb), #7c3aed);
    border-radius: 999px;
    transition: width 0.4s ease;
    min-width: 4px;
}
