/**
 * BDP Addons Frontend Styles
 */

.bdp-addons-wrapper {
    margin: 20px 0;
    min-width: 280px;
}

.bdp-addon-group {
    margin-bottom: 24px;
    padding: 16px;
    background: #fafafa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
}

.bdp-group-title {
    margin: 0 0 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e0e0e0;
    font-size: 1.1em;
    font-weight: 600;
}

.bdp-group-description {
    margin: -8px 0 16px;
    color: #555;
    font-size: 0.95em;
    line-height: 1.4;
}

.bdp-fields {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.bdp-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.bdp-field-hidden {
    display: none !important;
}

.bdp-field-label {
    font-weight: 500;
    color: #333;
}

.bdp-field-description {
    margin: 0;
    color: #555;
    font-size: 0.9em;
    line-height: 1.4;
}

.bdp-field-label .required {
    color: #e53935;
}

.bdp-price-label {
    font-weight: 600;
    color: #666;
    font-size: 0.9em;
    font-family: inherit;
}

/* Ensure WooCommerce price markup inside BDP price labels inherits body font */
.bdp-price-label .woocommerce-Price-amount,
.bdp-price-label .woocommerce-Price-amount bdi {
    font-family: inherit !important;
    font-size: inherit !important;
}

.bdp-field-help {
    margin: 4px 0 0;
    font-size: 0.85em;
    color: #666;
}

/* Input styles */
.bdp-input {
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1em;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.bdp-input:focus {
    outline: none;
    border-color: #333;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.1);
}

.bdp-textarea-input {
    resize: vertical;
    min-height: 80px;
}

.bdp-number-input {
    max-width: 150px;
}

/* Checkbox single */
.bdp-field-checkbox .bdp-field-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.bdp-checkbox-input {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Radio and checkboxes groups */
.bdp-radio-group,
.bdp-checkboxes-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Buttons (pills) mode for radio + checkbox group */
.bdp-radio-group.bdp-choice-buttons,
.bdp-checkboxes-group.bdp-choice-buttons {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
}

.bdp-radio-option,
.bdp-checkbox-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

.bdp-choice-buttons .bdp-radio-option,
.bdp-choice-buttons .bdp-checkbox-option {
    border-radius: 999px;
    padding: 8px 12px;
    background: #fff;
}

.bdp-choice-buttons .bdp-radio-option input,
.bdp-choice-buttons .bdp-checkbox-option input {
    width: 16px;
    height: 16px;
}

.bdp-choice-buttons .bdp-radio-option input:checked + .bdp-radio-label,
.bdp-choice-buttons .bdp-checkbox-option input:checked + .bdp-checkbox-label {
    font-weight: 600;
}

.bdp-choice-buttons .bdp-radio-option.is-selected,
.bdp-choice-buttons .bdp-checkbox-option.is-selected {
    border-color: var(--bdp-primary, #2271b1);
    background: rgba(34, 113, 177, 0.06);
}

.bdp-radio-option:hover,
.bdp-checkbox-option:hover {
    border-color: #999;
    background: #f5f5f5;
}

.bdp-radio-option input,
.bdp-checkbox-option input {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.bdp-radio-label,
.bdp-checkbox-label {
    flex: 1;
}

/* Clear selection button */
.bdp-clear-selection {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 6px;
    padding: 2px 8px;
    font-size: 12px;
    color: #666;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 4px;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.bdp-clear-selection:hover {
    color: #333;
    border-color: #ccc;
    background: #f5f5f5;
}

.bdp-clear-selection--hidden {
    display: none;
}

.bdp-clear-selection__icon {
    font-size: 14px;
    line-height: 1;
}

/* Select */
.bdp-select-input {
    max-width: 300px;
    cursor: pointer;
}

/* Heading and content */
.bdp-heading {
    margin: 8px 0;
    color: #333;
}

.bdp-content {
    color: #555;
    line-height: 1.5;
}

.bdp-separator {
    margin: 8px 0;
}

.bdp-separator--line {
    border: 0;
    border-top: 2px solid #e0e0e0;
}

.bdp-paragraph {
    margin: 0;
    color: #555;
    line-height: 1.5;
}

.bdp-callout {
    border: 1px solid #e0e0e0;
    border-left-width: 4px;
    border-left-color: #e0e0e0;
    border-radius: 8px;
    padding: 12px;
    background: transparent;
}

.bdp-callout--subtle {
    background: transparent;
}

.bdp-callout--filled {
    background: #f3f4f6;
}

.bdp-callout--outlined {
    background: transparent;
    border-color: #cfcfcf;
}

.bdp-callout--accent {
    background: transparent;
}

.bdp-callout--accent_bright {
    background: #fff;
}

.bdp-callout--filled .bdp-callout-title,
.bdp-callout--filled .bdp-callout-content {
    color: inherit;
}

.bdp-callout-title {
    font-weight: 600;
    margin-bottom: 6px;
    color: #333;
}

.bdp-callout-content {
    color: #555;
    line-height: 1.5;
}

.bdp-list {
    margin: 0;
    padding-left: 18px;
    color: #555;
    line-height: 1.5;
}

/* Slider */
.bdp-slider-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
}

.bdp-slider-input {
    flex: 1;
    max-width: 300px;
    height: 6px;
    cursor: pointer;
}

.bdp-slider-value {
    min-width: 40px;
    text-align: center;
    font-weight: 500;
}

/* Validation states */
.bdp-field.bdp-field-error .bdp-input,
.bdp-field.bdp-field-error .bdp-select-input {
    border-color: #e53935;
}

.bdp-field-error-message {
    color: #e53935;
    font-size: 0.85em;
}

/* Condition states */
.bdp-field.bdp-condition-hidden {
    display: none !important;
}

.bdp-field.bdp-condition-disabled {
    opacity: 0.5;
    pointer-events: none;
}

.bdp-field.bdp-condition-disabled .bdp-input,
.bdp-field.bdp-condition-disabled .bdp-select-input,
.bdp-field.bdp-condition-disabled .bdp-checkbox-input {
    background-color: #f5f5f5;
    cursor: not-allowed;
}

/* Transition for smooth show/hide */
.bdp-field {
    transition: opacity 0.2s ease-in-out;
}

/* Repeater Field */
.bdp-repeater {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 16px;
    background: #fafafa;
}

.bdp-repeater-rows {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.bdp-repeater-row {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    overflow: hidden;
}

.bdp-repeater-row-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: #f5f5f5;
    border-bottom: 1px solid #e0e0e0;
}

.bdp-repeater-row-handle {
    cursor: grab;
    color: #999;
    font-size: 14px;
}

.bdp-repeater-row-label {
    flex: 1;
    font-weight: 500;
    font-size: 14px;
    color: #333;
}

.bdp-repeater-row-actions {
    display: flex;
    gap: 4px;
}

.bdp-repeater-row-actions button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    color: #666;
    font-size: 16px;
    line-height: 1;
    transition: all 0.15s;
}

.bdp-repeater-row-actions button:hover:not(:disabled) {
    background: rgba(0, 0, 0, 0.05);
    color: #333;
}

.bdp-repeater-row-actions button:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.bdp-repeater-remove:hover:not(:disabled) {
    color: #e53935 !important;
    background: rgba(229, 57, 53, 0.1) !important;
}

.bdp-repeater-row-content {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.bdp-repeater-row-content.collapsed {
    display: none;
}

.bdp-repeater-row.collapsed .bdp-toggle-icon {
    transform: rotate(-90deg);
}

.bdp-toggle-icon {
    display: inline-block;
    transition: transform 0.2s;
    font-size: 12px;
}

.bdp-repeater-child {
    margin-bottom: 0;
}

.bdp-repeater-add {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    margin-top: 12px;
    padding: 10px 16px;
    background: white;
    border: 2px dashed #ccc;
    border-radius: 6px;
    color: #666;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.15s;
}

.bdp-repeater-add:hover:not(:disabled) {
    border-color: #999;
    color: #333;
    background: #f9f9f9;
}

.bdp-repeater-add:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.bdp-repeater-add-icon {
    font-size: 18px;
    font-weight: bold;
}

.bdp-repeater-template {
    display: none;
}

/* Date field */
.bdp-date-input {
    max-width: 200px;
}

/* ========================================
   File Upload Field
   ======================================== */
.bdp-file-upload {
    width: 100%;
}

.bdp-file-dropzone {
    border: 2px dashed #ddd;
    border-radius: 8px;
    padding: 24px;
    text-align: center;
    background: #fafafa;
    transition: all 0.2s ease;
    cursor: pointer;
}

.bdp-file-dropzone:hover,
.bdp-file-dropzone.bdp-file-dragover {
    border-color: var(--bdp-primary, #2271b1);
    background: #f0f7fc;
}

.bdp-file-dropzone-content {
    pointer-events: none;
}

.bdp-file-dropzone-content .bdp-file-icon {
    font-size: 32px;
    display: block;
    margin-bottom: 8px;
}

.bdp-file-dropzone-text {
    margin: 0 0 4px;
    color: #555;
}

.bdp-file-browse {
    background: none;
    border: none;
    color: var(--bdp-primary, #2271b1);
    text-decoration: underline;
    cursor: pointer;
    font-size: inherit;
    padding: 0;
    pointer-events: auto;
}

.bdp-file-browse:hover {
    color: #135e96;
}

.bdp-file-info {
    margin: 0;
    font-size: 0.85em;
    color: #888;
}

/* File list */
.bdp-file-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
}

.bdp-file-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.bdp-file-item.bdp-file-uploading {
    opacity: 0.8;
}

.bdp-file-item.bdp-file-deleting {
    opacity: 0.5;
    pointer-events: none;
}

.bdp-file-preview {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    border-radius: 4px;
    overflow: hidden;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bdp-file-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.bdp-file-ext {
    font-size: 11px;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
}

.bdp-file-details {
    flex: 1;
    min-width: 0;
}

.bdp-file-name {
    display: block;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}

.bdp-file-size {
    font-size: 0.85em;
    color: #888;
}

/* Upload progress */
.bdp-file-progress {
    height: 4px;
    background: #e0e0e0;
    border-radius: 2px;
    margin-top: 6px;
    overflow: hidden;
}

.bdp-file-progress-bar {
    height: 100%;
    background: var(--bdp-primary, #2271b1);
    border-radius: 2px;
    transition: width 0.2s ease;
}

/* Remove button */
.bdp-file-remove {
    width: 28px;
    height: 28px;
    border: none;
    background: #f5f5f5;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    color: #888;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.bdp-file-remove:hover {
    background: #ffebee;
    color: #c62828;
}

/* Error message */
.bdp-file-error {
    background: #ffebee;
    color: #c62828;
    padding: 10px 14px;
    border-radius: 4px;
    margin-top: 8px;
    font-size: 0.9em;
}

/* ========================================
   Swatch Options (native input + label)
   ======================================== */

/* Screen reader only - hide input visually but keep accessible */
.bdp-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Swatch container */
.bdp-swatch-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* Prevent Variation Swatches frontend styles from affecting Addons swatches */
.bdp-addons-wrapper .bdp-swatch-options {
    align-items: flex-start;
}

.bdp-addons-wrapper .bdp-swatch-option {
    width: auto;
    height: auto;
    min-width: 0;
    min-height: 0;
    padding: 0;
    margin: 0;
    border: 0;
    background: transparent;
    aspect-ratio: auto;
    box-shadow: none;
}

.bdp-swatch-options--grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
}

.bdp-swatch-options--vertical {
    flex-direction: column;
}

/* Swatch option label (clickable) */
.bdp-swatch-option {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    position: relative;
}

.bdp-swatch-option--small {
    --bdp-swatch-size: 32px;
}

.bdp-swatch-option--medium {
    --bdp-swatch-size: 44px;
}

.bdp-swatch-option--large {
    --bdp-swatch-size: 56px;
}

.bdp-swatch-option--shape-square .bdp-swatch-visual,
.bdp-swatch-option--shape-square .bdp-swatch-color,
.bdp-swatch-option--shape-square .bdp-swatch-image {
    border-radius: 0;
}

.bdp-swatch-option--shape-rounded .bdp-swatch-visual,
.bdp-swatch-option--shape-rounded .bdp-swatch-color,
.bdp-swatch-option--shape-rounded .bdp-swatch-image {
    border-radius: 6px;
}

.bdp-swatch-option--shape-circle .bdp-swatch-visual,
.bdp-swatch-option--shape-circle .bdp-swatch-color,
.bdp-swatch-option--shape-circle .bdp-swatch-image {
    border-radius: 999px;
}

.bdp-swatch-option:hover {
    transform: translateY(-1px);
}

/* Swatch visual container */
.bdp-swatch-visual {
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
    overflow: hidden;
    box-sizing: border-box;
    border: 2px solid rgba(0, 0, 0, 0.12);
    background: #fff;
}

/* Size variants */
.bdp-swatch-options--size-small .bdp-swatch-visual { width: 32px; height: 32px; }
.bdp-swatch-options--size-medium .bdp-swatch-visual { width: 44px; height: 44px; }
.bdp-swatch-options--size-large .bdp-swatch-visual { width: 56px; height: 56px; }

/* Color swatches shouldn't have a grey border, only an inset edge + selection ring */
.bdp-swatch-options--color .bdp-swatch-visual {
    border-color: transparent;
}

/* Hover state */
.bdp-swatch-option:hover .bdp-swatch-visual {
    transform: scale(1.06);
    border-color: rgba(0, 0, 0, 0.2);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Focus state (keyboard navigation) */
.bdp-sr-only:focus + .bdp-swatch-option .bdp-swatch-visual,
.bdp-sr-only:focus-visible + .bdp-swatch-option .bdp-swatch-visual {
    outline: 2px solid var(--bdp-primary, #2271b1);
    outline-offset: 2px;
}

/* Selected state (native :checked) */
.bdp-sr-only:checked + .bdp-swatch-option .bdp-swatch-visual {
    border-color: var(--bdp-primary, #2271b1);
    box-shadow: 0 0 0 1px var(--bdp-primary, #2271b1);
}

.bdp-swatch-options--color .bdp-sr-only:checked + .bdp-swatch-option .bdp-swatch-visual {
    border-color: transparent;
    box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--bdp-primary, #2271b1);
}

/* Color swatch */
.bdp-swatch-color {
    width: 100%;
    height: 100%;
    display: block;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.1);
}

/* Image swatch */
.bdp-swatch-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Placeholder for missing image */
.bdp-swatch-placeholder {
    font-size: 14px;
    font-weight: 600;
    color: #999;
    text-transform: uppercase;
}

/* Label swatch (text button) */
.bdp-swatch-options--label .bdp-swatch-visual {
    padding: 8px 16px;
    width: auto;
    height: auto;
    min-width: 44px;
    border-color: rgba(0, 0, 0, 0.12);
}

.bdp-swatch-options--label .bdp-sr-only:checked + .bdp-swatch-option .bdp-swatch-visual {
    background: var(--bdp-primary, #2271b1);
    border-color: var(--bdp-primary, #2271b1);
    box-shadow: none;
}

.bdp-swatch-options--label .bdp-sr-only:checked + .bdp-swatch-option .bdp-swatch-text {
    color: #fff;
}

.bdp-swatch-text {
    font-size: 13px;
    font-weight: 500;
    color: #333;
    white-space: nowrap;
}

/* Label below swatch */
.bdp-swatch-label {
    font-size: 11px;
    color: #666;
    text-align: center;
    max-width: 60px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.2;
    margin-top: 2px;
    position: relative;
    z-index: 1;
}

/* Price badge */
.bdp-swatch-price {
    font-size: 10px;
    color: var(--bdp-price-accent, #1f2937);
    font-weight: 600;
    font-family: inherit;
}

/* Check indicator for color/image swatches */
.bdp-sr-only:checked + .bdp-swatch-option .bdp-swatch-visual::after {
    content: '✓';
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 16px;
    height: 16px;
    background: var(--bdp-primary, #2271b1);
    color: #fff;
    font-size: 10px;
    line-height: 16px;
    text-align: center;
    border-radius: 50%;
}

.bdp-swatch-options--color .bdp-swatch-visual,
.bdp-swatch-options--image .bdp-swatch-visual {
    position: relative;
}

/* ========================================
   Image Choice Field
   ======================================== */
.bdp-image-choice {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.bdp-image-choice-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    padding: 8px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: #fff;
    transition: all 0.15s ease;
}

.bdp-image-choice-option:hover {
    border-color: #999;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Focus state */
.bdp-sr-only:focus + .bdp-image-choice-option,
.bdp-sr-only:focus-visible + .bdp-image-choice-option {
    outline: 2px solid var(--bdp-primary, #2271b1);
    outline-offset: 2px;
}

/* Selected state */
.bdp-sr-only:checked + .bdp-image-choice-option {
    border-color: var(--bdp-primary, #2271b1);
    box-shadow: 0 0 0 2px var(--bdp-primary, #2271b1);
}

.bdp-image-choice-img {
    border-radius: 4px;
    object-fit: cover;
}

.bdp-image-choice-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
    border-radius: 4px;
    font-size: 24px;
    font-weight: 600;
    color: #999;
}

/* Size variants */
.bdp-image-choice--size-small .bdp-image-choice-img,
.bdp-image-choice--size-small .bdp-image-choice-placeholder {
    width: 60px;
    height: 60px;
}

.bdp-image-choice--size-medium .bdp-image-choice-img,
.bdp-image-choice--size-medium .bdp-image-choice-placeholder {
    width: 100px;
    height: 100px;
}

.bdp-image-choice--size-large .bdp-image-choice-img,
.bdp-image-choice--size-large .bdp-image-choice-placeholder {
    width: 140px;
    height: 140px;
}

.bdp-image-choice-label {
    font-size: 13px;
    font-weight: 500;
    color: #333;
    text-align: center;
}

.bdp-image-choice-price {
    font-size: 12px;
    color: var(--bdp-price-accent, #1f2937);
    font-weight: 600;
    font-family: inherit;
}

/* Hybrid mode (image + label side by side) */
.bdp-image-choice--hybrid .bdp-image-choice-option {
    flex-direction: row;
    padding: 12px;
}

.bdp-image-choice--hybrid .bdp-image-choice-img,
.bdp-image-choice--hybrid .bdp-image-choice-placeholder {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
}

.bdp-image-choice--hybrid .bdp-image-choice-label {
    text-align: left;
}

/* ========================================
   Product Selector Field
   ======================================== */
.bdp-product-selector {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.bdp-product-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.12s ease, box-shadow 0.12s ease, background-color 0.12s ease;
    position: relative;
}

.bdp-product-option:hover {
    border-color: #cbd5e1;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.10);
    background: #f8fafc;
}

.bdp-sr-only:focus-visible + .bdp-product-option {
    outline: none;
    box-shadow: 0 0 0 2px rgba(15, 23, 42, 0.22);
}

.bdp-sr-only:focus:not(:focus-visible) + .bdp-product-option {
    outline: none;
    box-shadow: none;
}

.bdp-sr-only:checked + .bdp-product-option {
    border-color: #64748b;
    box-shadow: none;
    background: #f1f5f9;
}

.bdp-product-input:disabled + .bdp-product-option {
    cursor: not-allowed;
    opacity: 0.55;
}

.bdp-product-input:disabled + .bdp-product-option:hover {
    border-color: #d1d5db;
    box-shadow: none;
    background: #fff;
}

.bdp-product-thumb {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.bdp-product-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.bdp-product-placeholder {
    font-size: 16px;
    font-weight: 600;
    color: #999;
}

.bdp-product-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    flex: 1;
}

.bdp-product-name {
    font-size: 0.95em;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bdp-product-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 0.75rem;
    color: #777;
}

.bdp-product-price {
    margin-left: auto;
    font-size: 0.9em;
    font-weight: 600;
    color: #1f2933;
    white-space: nowrap;
}

.bdp-product-selector--no-thumbnails .bdp-product-thumb {
    display: none;
}

.bdp-product-selector--no-prices .bdp-product-price {
    display: none;
}

/* ========================================
   Color Picker Field
   ======================================== */
.bdp-color-wrapper {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.bdp-color-input {
    width: 48px;
    height: 48px;
    padding: 0;
    border: 2px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    background: transparent;
}

.bdp-color-input::-webkit-color-swatch-wrapper {
    padding: 4px;
}

.bdp-color-input::-webkit-color-swatch {
    border: none;
    border-radius: 4px;
}

.bdp-color-input::-moz-color-swatch {
    border: none;
    border-radius: 4px;
}

.bdp-color-picker {
    position: relative;
    display: inline-flex;
    flex-direction: column;
    gap: 8px;
}

.bdp-color-iro-wrap {
    width: fit-content;
}

.bdp-color-controls {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.bdp-color-swatch {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: 1px solid #ddd;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,0.08);
    background: #fff;
}

.bdp-color-swatch.is-empty {
    background: repeating-linear-gradient(
        45deg,
        #f5f5f5,
        #f5f5f5 6px,
        #ffffff 6px,
        #ffffff 12px
    );
}

.bdp-color-hex-input {
    width: 110px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.bdp-color-toggle,
.bdp-color-clear {
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.bdp-color-toggle:hover,
.bdp-color-clear:hover {
    border-color: #999;
}

.bdp-color-toggle:focus,
.bdp-color-clear:focus {
    outline: none;
    border-color: #333;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.1);
}

.bdp-color-picker--popup .bdp-color-iro-wrap {
    display: none;
    position: absolute;
    z-index: 999;
    top: 100%;
    left: 0;
    margin-top: 8px;
    padding: 10px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
}

.bdp-color-picker--popup.is-open .bdp-color-iro-wrap {
    display: block;
}

.bdp-color-picker--inline .bdp-color-iro-wrap {
    display: block;
    position: static;
    padding: 10px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
}

/* ========================================
   Price Summary Display
   ======================================== */
.bdp-price-summary {
    margin-top: 20px;
    padding: 16px;
    background: linear-gradient(135deg, #f8f9fa 0%, #fff 100%);
    border: 1px solid #e0e0e0;
    border-radius: 8px;
}

.bdp-price-summary-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.bdp-price-breakdown {
    padding-bottom: 12px;
    border-bottom: 1px dashed #ddd;
}

.bdp-price-breakdown-items {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.bdp-breakdown-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9em;
    color: #555;
}

.bdp-breakdown-label {
    flex: 1;
    padding-right: 12px;
}

.bdp-breakdown-price {
    font-weight: 500;
    color: var(--bdp-price-accent, #1f2937);
    white-space: nowrap;
}

.bdp-price-totals {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.bdp-price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.bdp-price-addons {
    font-size: 0.95em;
    color: #666;
}

.bdp-price-addons .bdp-price-value {
    color: var(--bdp-price-accent, #1f2937);
    font-weight: 500;
}

.bdp-price-total {
    font-size: 1.1em;
    font-weight: 600;
    padding-top: 8px;
    border-top: 1px solid #e0e0e0;
}

.bdp-price-total .bdp-price-label {
    color: #333;
}

.bdp-price-total .bdp-price-value {
    color: var(--bdp-primary, #2271b1);
    font-size: 1.15em;
}

/* Price animation on update */
.bdp-price-value {
    transition: transform 0.15s ease, color 0.15s ease;
}

.bdp-price-updating .bdp-price-value {
    transform: scale(1.05);
}

/* ========================================
   Addon Swatches (Isolated from Variation Swatches)
   Uses native input + label pattern with :checked CSS
   ======================================== */

:root {
    --bdp-addon-swatch-size-small: 32px;
    --bdp-addon-swatch-size-medium: 44px;
    --bdp-addon-swatch-size-large: 56px;
    --bdp-addon-swatch-gap: 8px;
    --bdp-addon-swatch-border-color: #ddd;
    --bdp-addon-swatch-border-width: 2px;
    --bdp-addon-swatch-selected-color: #000;
    --bdp-addon-swatch-radius-square: 0;
    --bdp-addon-swatch-radius-rounded: 8px;
    --bdp-addon-swatch-radius-circle: 50%;
    --bdp-addon-swatch-transition: all 0.2s ease;
}

/* Container */
.bdp-addon-swatch-options {
    display: flex;
    flex-wrap: wrap;
    gap: var(--bdp-addon-swatch-gap);
    align-items: flex-start;
}

.bdp-addon-swatch-options--grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
}

.bdp-addon-swatch-options--vertical {
    flex-direction: column;
}

/* Base swatch option (the label) */
.bdp-addon-swatch {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    position: relative;
    transition: var(--bdp-addon-swatch-transition);
}

.bdp-addon-swatch:hover {
    transform: translateY(-1px);
}

/* Visual container */
.bdp-addon-swatch-visual {
    display: flex;
    align-items: center;
    justify-content: center;
    width: var(--bdp-addon-swatch-size-medium);
    height: var(--bdp-addon-swatch-size-medium);
    border: var(--bdp-addon-swatch-border-width) solid var(--bdp-addon-swatch-border-color);
    background: #fff;
    position: relative;
    transition: var(--bdp-addon-swatch-transition);
    box-sizing: border-box;
    overflow: hidden;
}

.bdp-addon-swatch:hover .bdp-addon-swatch-visual {
    border-color: #999;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Size variants */
.bdp-addon-swatch-options--size-small .bdp-addon-swatch-visual {
    width: var(--bdp-addon-swatch-size-small);
    height: var(--bdp-addon-swatch-size-small);
}

.bdp-addon-swatch-options--size-medium .bdp-addon-swatch-visual {
    width: var(--bdp-addon-swatch-size-medium);
    height: var(--bdp-addon-swatch-size-medium);
}

.bdp-addon-swatch-options--size-large .bdp-addon-swatch-visual {
    width: var(--bdp-addon-swatch-size-large);
    height: var(--bdp-addon-swatch-size-large);
}

/* Shape variants */
.bdp-addon-swatch-options--shape-square .bdp-addon-swatch-visual {
    border-radius: var(--bdp-addon-swatch-radius-square);
}

.bdp-addon-swatch-options--shape-rounded .bdp-addon-swatch-visual {
    border-radius: var(--bdp-addon-swatch-radius-rounded);
}

.bdp-addon-swatch-options--shape-circle .bdp-addon-swatch-visual {
    border-radius: var(--bdp-addon-swatch-radius-circle);
}

/* Focus state (keyboard navigation) */
.bdp-sr-only:focus + .bdp-addon-swatch .bdp-addon-swatch-visual,
.bdp-sr-only:focus-visible + .bdp-addon-swatch .bdp-addon-swatch-visual {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

.bdp-sr-only:focus:not(:focus-visible) + .bdp-addon-swatch .bdp-addon-swatch-visual {
    outline: none;
}

/* Selected state (native :checked) */
.bdp-sr-only:checked + .bdp-addon-swatch .bdp-addon-swatch-visual {
    border-color: var(--bdp-addon-swatch-selected-color);
    box-shadow: 0 0 0 1px var(--bdp-addon-swatch-selected-color);
}

/* --- Color Swatches --- */
.bdp-addon-swatch-options--color .bdp-addon-swatch-visual {
    border-color: transparent;
}

.bdp-addon-swatch-options--color .bdp-addon-swatch:hover .bdp-addon-swatch-visual {
    border-color: transparent;
}

/* Color swatch selected: double ring */
.bdp-addon-swatch-options--color .bdp-sr-only:checked + .bdp-addon-swatch .bdp-addon-swatch-visual {
    border-color: transparent;
    box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--bdp-addon-swatch-selected-color);
}

/* Color swatch inner element */
.bdp-addon-swatch-options--color .bdp-swatch-color {
    width: 100%;
    height: 100%;
    display: block;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.1);
}

/* Checkmark indicator for color swatches */
.bdp-addon-swatch-options--color .bdp-sr-only:checked + .bdp-addon-swatch .bdp-addon-swatch-visual::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 16px;
    font-weight: bold;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    color: #fff;
}

/* Dark background: use dark checkmark */
.bdp-addon-swatch-options--color .bdp-sr-only:checked + .bdp-addon-swatch--text-dark .bdp-addon-swatch-visual::after {
    color: #000;
    text-shadow: none;
}

/* --- Image Swatches --- */
.bdp-addon-swatch-options--image .bdp-addon-swatch-visual {
    position: relative;
}

.bdp-addon-swatch-options--image .bdp-swatch-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.bdp-addon-swatch-options--image .bdp-swatch-placeholder {
    font-size: 14px;
    font-weight: 600;
    color: #999;
    text-transform: uppercase;
}

/* Image swatch checkmark */
.bdp-addon-swatch-options--image .bdp-sr-only:checked + .bdp-addon-swatch .bdp-addon-swatch-visual::after {
    content: '✓';
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 16px;
    height: 16px;
    background: var(--bdp-addon-swatch-selected-color);
    color: #fff;
    font-size: 10px;
    line-height: 16px;
    text-align: center;
    border-radius: 50%;
}

/* --- Label Swatches (text buttons) --- */
.bdp-addon-swatch-options--label .bdp-addon-swatch-visual {
    padding: 8px 16px;
    width: auto;
    height: auto;
    min-width: 44px;
    min-height: 36px;
    border-color: var(--bdp-addon-swatch-border-color);
}

.bdp-addon-swatch-options--label .bdp-sr-only:checked + .bdp-addon-swatch .bdp-addon-swatch-visual {
    background: var(--bdp-addon-swatch-selected-color);
    border-color: var(--bdp-addon-swatch-selected-color);
    box-shadow: none;
}

.bdp-addon-swatch-options--label .bdp-sr-only:checked + .bdp-addon-swatch .bdp-swatch-text {
    color: #fff;
}

.bdp-addon-swatch-options--label .bdp-swatch-text {
    font-size: 14px;
    font-weight: 500;
    color: #333;
    white-space: nowrap;
}

/* Label type with circle shape = pill */
.bdp-addon-swatch-options--shape-circle.bdp-addon-swatch-options--label .bdp-addon-swatch-visual {
    border-radius: 999px;
}

/* --- Labels below swatches --- */
.bdp-addon-swatch-label {
    font-size: 11px;
    color: #666;
    text-align: center;
    max-width: 60px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.2;
    margin-top: 2px;
}

/* --- Price badge --- */
.bdp-addon-swatch-price {
    font-size: 10px;
    color: var(--bdp-price-accent, #1f2937);
    font-weight: 600;
    font-family: inherit;
}

/* --- Animations --- */
.bdp-addon-swatch {
    animation: bdp-addon-swatch-fade-in 0.2s ease forwards;
}

@keyframes bdp-addon-swatch-fade-in {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Staggered animation */
.bdp-addon-swatch:nth-child(1) { animation-delay: 0ms; }
.bdp-addon-swatch:nth-child(2) { animation-delay: 30ms; }
.bdp-addon-swatch:nth-child(3) { animation-delay: 60ms; }
.bdp-addon-swatch:nth-child(4) { animation-delay: 90ms; }
.bdp-addon-swatch:nth-child(5) { animation-delay: 120ms; }
.bdp-addon-swatch:nth-child(6) { animation-delay: 150ms; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .bdp-addon-swatch {
        animation: none;
        transition: none;
    }
    .bdp-addon-swatch-visual {
        transition: none;
    }
}

/* High contrast mode */
@media (forced-colors: active) {
    .bdp-sr-only:checked + .bdp-addon-swatch .bdp-addon-swatch-visual {
        outline: 3px solid CanvasText;
    }
}

/* Responsive */
@media (max-width: 600px) {
    .bdp-addon-group {
        padding: 12px;
    }
    
    .bdp-select-input,
    .bdp-slider-wrapper {
        max-width: 100%;
    }
    
    .bdp-addon-swatch-options {
        gap: 10px;
    }
}

/* ========================================
   Cart/Checkout addon display
   ======================================== */
.woocommerce-cart .bdp-cart-addon-group-title,
.woocommerce-checkout .bdp-cart-addon-group-title {
    display: block;
    margin: 8px 0 4px;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #666;
    font-weight: 600;
}

.woocommerce-cart .bdp-cart-repeater,
.woocommerce-checkout .bdp-cart-repeater {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin: 6px 0;
}

.woocommerce-cart .bdp-cart-repeater-title,
.woocommerce-checkout .bdp-cart-repeater-title {
    font-weight: 600;
    color: #222;
}

.woocommerce-cart .bdp-cart-repeater-meta,
.woocommerce-checkout .bdp-cart-repeater-meta {
    font-size: 0.85em;
    color: #666;
}

.woocommerce-cart .bdp-cart-repeater-price,
.woocommerce-checkout .bdp-cart-repeater-price {
    font-weight: 600;
    color: var(--bdp-price-accent, #1f2937);
}

.woocommerce-cart .bdp-cart-repeater-line,
.woocommerce-checkout .bdp-cart-repeater-line {
    font-size: 0.85em;
    color: #444;
}

.woocommerce-cart .bdp-cart-repeater-qty,
.woocommerce-checkout .bdp-cart-repeater-qty {
    font-weight: 600;
    color: #222;
}

.woocommerce-cart .bdp-cart-repeater-total,
.woocommerce-checkout .bdp-cart-repeater-total {
    color: var(--bdp-price-accent, #1f2937);
    font-weight: 600;
}

/* Product Selector child cart items */
.woocommerce-cart .bdp-cart-child-item,
.woocommerce-checkout .bdp-cart-child-item {
    background: #f8fafc;
}

.woocommerce-cart .bdp-cart-child-item td,
.woocommerce-checkout .bdp-cart-child-item td {
    padding-left: 24px;
}

.woocommerce-cart .bdp-cart-child-item td.product-name,
.woocommerce-checkout .bdp-cart-child-item td.product-name {
    position: relative;
}

.woocommerce-cart .bdp-cart-child-item td.product-name::before,
.woocommerce-checkout .bdp-cart-child-item td.product-name::before {
    content: '';
    position: absolute;
    left: 10px;
    top: 50%;
    width: 10px;
    height: 1px;
    background: #cbd5e1;
}

.woocommerce-cart .bdp-cart-child-label,
.woocommerce-checkout .bdp-cart-child-label {
    display: block;
    margin-top: 2px;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #64748b;
}

.woocommerce-cart .bdp-cart-child-qty,
.woocommerce-checkout .bdp-cart-child-qty {
    display: inline-block;
    padding: 0.1rem 0.4rem;
    border-radius: 999px;
    background: #e2e8f0;
    font-size: 0.8em;
}

/* Option Quantity Multipliers */
.bdp-option-qty--hidden {
    display: none !important;
}

.bdp-option-qty-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

.bdp-option-qty-label {
    font-size: 0.9em;
    font-weight: 500;
    color: #555;
    white-space: nowrap;
}

.bdp-option-qty-input {
    width: 70px;
    padding: 4px 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.9em;
    text-align: center;
}

.bdp-option-qty-input:focus {
    border-color: #2563eb;
    outline: none;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

.bdp-option-qty-inline {
    display: inline-flex;
    align-items: center;
    margin-left: 8px;
}

.bdp-option-qty-inline .bdp-option-qty-input {
    width: 60px;
    padding: 2px 6px;
    font-size: 0.85em;
}

.bdp-option-qty-block {
    margin-top: 8px;
}

.bdp-option-qty-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
}

.bdp-option-qty-row-label {
    font-size: 0.9em;
    color: #555;
    min-width: 80px;
}
