/**
 * 2026 DOIT FURNITURE
 * Dynamic Product Configurator - Front-Office Stylesheet
 */

:root {
    --dpc-primary: #2563eb;
    --dpc-primary-hover: #1d4ed8;
    --dpc-primary-light: #eff6ff;
    --dpc-border: #e2e8f0;
    --dpc-border-focus: #3b82f6;
    --dpc-text-main: #1e293b;
    --dpc-text-muted: #64748b;
    --dpc-bg-subtle: #f8fafc;
    --dpc-success: #10b981;
    --dpc-danger: #ef4444;
    --dpc-radius: 10px;
    --dpc-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
    --dpc-shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.dpc-configurator-box {
    margin: 24px 0;
    padding: 24px;
    background: #ffffff;
    border: 1px solid var(--dpc-border);
    border-radius: var(--dpc-radius);
    box-shadow: var(--dpc-shadow-sm);
    font-family: inherit;
}

.dpc-configurator-header {
    margin-bottom: 20px;
    border-bottom: 2px solid var(--dpc-bg-subtle);
    padding-bottom: 12px;
}

.dpc-configurator-header h3 {
    margin: 0 0 6px 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--dpc-text-main);
    display: flex;
    align-items: center;
    gap: 8px;
}

.dpc-configurator-header p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--dpc-text-muted);
}

/* Option Sets Container & Boxes (Accordion Style) */
.dpc-option-sets-container {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 24px;
}

.dpc-option-set-box {
    background: #ffffff;
    border: 1px solid var(--dpc-border);
    border-radius: var(--dpc-radius, 10px);
    padding: 14px 18px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, padding 0.2s ease;
    overflow: hidden;
}

.dpc-option-set-box:hover {
    border-color: #cbd5e1;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.06);
}

.dpc-option-set-box.dpc-open {
    border-color: #cbd5e1;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.07);
    padding: 16px 20px 18px 20px;
}

/* Accordion Header */
.dpc-option-set-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    border-radius: 6px;
    transition: background-color 0.15s ease;
    margin-bottom: 0;
    gap: 12px;
}

.dpc-option-set-header:focus-visible {
    outline: 2px solid var(--dpc-primary);
    outline-offset: 4px;
}

.dpc-accordion-title-wrap {
    flex: 1;
    min-width: 0;
}

.dpc-set-title,
.dpc-group-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--dpc-text-main);
    margin: 0;
    padding-left: 10px;
    border-left: 4px solid var(--dpc-primary);
    line-height: 1.35;
    transition: color 0.2s ease;
}

.dpc-option-set-header:hover .dpc-set-title {
    color: var(--dpc-primary);
}

.dpc-set-desc {
    font-size: 0.85rem;
    color: var(--dpc-text-muted);
    margin: 4px 0 0 14px;
    line-height: 1.4;
}

/* Accordion Indicator (Chevron) */
.dpc-accordion-indicator {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: var(--dpc-bg-subtle, #f8fafc);
    color: var(--dpc-text-muted, #64748b);
    flex-shrink: 0;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                background-color 0.2s ease,
                color 0.2s ease;
}

.dpc-option-set-header:hover .dpc-accordion-indicator {
    background-color: var(--dpc-primary-light, #eff6ff);
    color: var(--dpc-primary, #2563eb);
}

.dpc-chevron-icon {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: block;
}

.dpc-option-set-box.dpc-open .dpc-chevron-icon {
    transform: rotate(180deg);
}

.dpc-option-set-box.dpc-open .dpc-accordion-indicator {
    background-color: var(--dpc-primary-light, #eff6ff);
    color: var(--dpc-primary, #2563eb);
}

/* Accordion Content / Fields Container */
.dpc-set-fields {
    border-top: 1px solid var(--dpc-border, #e2e8f0);
    margin-top: 14px;
    padding-top: 18px;
}

.dpc-set-fields .dpc-field-wrapper:last-child {
    margin-bottom: 4px;
}

.dpc-option-set-box:not(.dpc-open):not(.dpc-closing) .dpc-set-fields {
    display: none;
}

/* Field Wrapper */
.dpc-field-wrapper {
    margin-bottom: 18px;
    transition: all 0.25s ease-in-out;
}

.dpc-field-wrapper.dpc-fade-in {
    animation: dpcFadeIn 0.3s ease-out;
}

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

.dpc-field-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.dpc-field-label {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--dpc-text-main);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.dpc-required-star {
    color: var(--dpc-danger);
    font-weight: bold;
}

.dpc-field-price-tag {
    font-size: 0.85rem;
    font-weight: 600;
    background: var(--dpc-primary-light);
    color: var(--dpc-primary);
    padding: 2px 8px;
    border-radius: 12px;
}

.dpc-field-desc {
    font-size: 0.82rem;
    color: var(--dpc-text-muted);
    margin-top: 4px;
    margin-bottom: 6px;
}

/* Inputs & Textareas */
.dpc-input-text,
.dpc-textarea,
.dpc-select,
.dpc-input-number,
.dpc-input-date {
    width: 100%;
    padding: 10px 14px;
    font-size: 0.95rem;
    color: var(--dpc-text-main);
    background: #ffffff;
    border: 1.5px solid var(--dpc-border);
    border-radius: 8px;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
    box-sizing: border-box;
}

.dpc-input-text:focus,
.dpc-textarea:focus,
.dpc-select:focus,
.dpc-input-number:focus,
.dpc-input-date:focus {
    border-color: var(--dpc-border-focus);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.dpc-char-count {
    display: block;
    text-align: right;
    font-size: 0.78rem;
    color: var(--dpc-text-muted);
    margin-top: 4px;
}

.dpc-field-helper-range {
    display: block;
    font-size: 0.8rem;
    color: var(--dpc-text-muted);
    margin-top: 5px;
    font-style: normal;
}

/* Swatches / Cards (Radio & Checkbox) */
.dpc-swatches-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 12px;
    margin-top: 6px;
}

.dpc-swatch-card,
.dpc-checkbox-card {
    position: relative;
    border: 2px solid var(--dpc-border);
    border-radius: 8px;
    padding: 10px;
    text-align: center;
    cursor: pointer;
    background: #ffffff;
    transition: all 0.2s ease-in-out;
    user-select: none;
    overflow: hidden;
}

.dpc-swatch-card input,
.dpc-checkbox-card input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.dpc-swatch-card:hover,
.dpc-checkbox-card:hover {
    border-color: #cbd5e1;
    transform: translateY(-2px);
    box-shadow: var(--dpc-shadow-sm);
}

.dpc-swatch-card.active,
.dpc-checkbox-card.active {
    border-color: var(--dpc-primary);
    background: var(--dpc-primary-light);
    box-shadow: 0 0 0 1px var(--dpc-primary);
}

.dpc-swatch-thumb {
    width: 100%;
    height: 75px;
    object-fit: cover;
    border-radius: 6px;
    margin-bottom: 8px;
    background: #f1f5f9;
}

.dpc-swatch-label {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--dpc-text-main);
    display: block;
    margin-bottom: 4px;
}

.dpc-swatch-price {
    font-size: 0.8rem;
    color: var(--dpc-primary);
    font-weight: 500;
    display: block;
}

/* Color Circles */
.dpc-colors-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 6px;
}

.dpc-color-swatch-item {
    position: relative;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid #ffffff;
    box-shadow: 0 0 0 1.5px var(--dpc-border);
    transition: transform 0.2s, box-shadow 0.2s;
}

.dpc-color-swatch-item input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.dpc-color-swatch-item:hover {
    transform: scale(1.1);
    box-shadow: 0 0 0 2px var(--dpc-primary);
}

.dpc-color-swatch-item.active {
    transform: scale(1.15);
    box-shadow: 0 0 0 3px var(--dpc-primary);
}

.dpc-color-swatch-item.active::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #ffffff;
    font-size: 14px;
    font-weight: bold;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}

/* File Dropzone */
.dpc-file-dropzone {
    border: 2px dashed var(--dpc-border);
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    background: var(--dpc-bg-subtle);
    cursor: pointer;
    transition: border-color 0.2s, background-color 0.2s;
    position: relative;
}

.dpc-file-dropzone:hover,
.dpc-file-dropzone.dpc-drag-over {
    border-color: var(--dpc-primary);
    background: var(--dpc-primary-light);
}

.dpc-file-dropzone input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.dpc-dropzone-icon {
    font-size: 28px;
    color: var(--dpc-primary);
    margin-bottom: 6px;
    display: block;
}

.dpc-dropzone-text {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--dpc-text-main);
}

.dpc-dropzone-hint {
    font-size: 0.78rem;
    color: var(--dpc-text-muted);
    margin-top: 4px;
}

.dpc-file-preview {
    display: none;
    margin-top: 10px;
    justify-content: center;
}

.dpc-file-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #ffffff;
    border: 1px solid var(--dpc-border);
    padding: 6px 12px;
    border-radius: 20px;
    box-shadow: var(--dpc-shadow-sm);
    font-size: 0.85rem;
}

.dpc-remove-file {
    background: none;
    border: none;
    color: var(--dpc-danger);
    font-size: 18px;
    cursor: pointer;
    line-height: 1;
    padding: 0 4px;
}

/* Live Pricing Summary Widget */
.dpc-live-summary-widget {
    margin-top: 24px;
    padding: 18px 20px;
    background: linear-gradient(135deg, #f8fafc 0%, #edf2f7 100%);
    border: 1.5px solid #cbd5e1;
    border-radius: var(--dpc-radius);
    box-shadow: var(--dpc-shadow-sm);
}

.dpc-summary-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--dpc-text-main);
    margin: 0 0 12px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dpc-summary-items {
    list-style: none;
    padding: 0;
    margin: 0 0 14px 0;
    font-size: 0.88rem;
}

.dpc-summary-item-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
    border-bottom: 1px dashed #e2e8f0;
}

.dpc-summary-item-row:last-child {
    border-bottom: none;
}

.dpc-item-label {
    color: var(--dpc-text-muted);
}

.dpc-item-cost {
    font-weight: 600;
    color: var(--dpc-text-main);
}

.dpc-empty-items {
    color: var(--dpc-text-muted);
    font-style: italic;
    font-size: 0.85rem;
}

.dpc-summary-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 10px;
    border-top: 2px solid #cbd5e1;
}

.dpc-total-label {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--dpc-text-main);
}

.dpc-final-total-val {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--dpc-primary);
}

/* Error States */
.dpc-field-wrapper.dpc-has-error .dpc-input-text,
.dpc-field-wrapper.dpc-has-error .dpc-textarea,
.dpc-field-wrapper.dpc-has-error .dpc-select,
.dpc-field-wrapper.dpc-has-error .dpc-input-number {
    border-color: var(--dpc-danger);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

.dpc-field-error {
    color: var(--dpc-danger);
    font-size: 0.82rem;
    font-weight: 500;
    margin-top: 4px;
    display: none;
}

/* Spinners */
.dpc-loading-spinner,
.dpc-btn-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-left-color: var(--dpc-primary);
    border-radius: 50%;
    animation: dpcSpin 0.8s linear infinite;
    vertical-align: middle;
}

@keyframes dpcSpin {
    to {
        transform: rotate(360deg);
    }
}

/* ==========================================================================
   CART PRODUCT CUSTOMIZATION MODAL & BADGE ENHANCEMENTS
   ========================================================================== */
.product-customization-modal__content .modal-content {
    border-radius: 14px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.product-customization-modal__content .modal-header {
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    padding: 16px 22px;
}

.product-customization-modal__content .modal-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.dpc-modal-title-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: #eff6ff;
    color: var(--dpc-primary);
}

.product-customization-modal__content .modal-body {
    padding: 20px 22px;
    background: #ffffff;
}

.product-customization-modal__line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    margin-bottom: 8px;
    background: #f8fafc;
    border: 1px solid #edf2f7;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.product-customization-modal__line:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.product-customization-modal__label {
    font-weight: 600;
    color: #334155;
    margin: 0;
    font-size: 0.925rem;
}

.product-customization-modal__text {
    font-weight: 600;
    color: #0f172a;
    font-size: 0.95rem;
    text-align: right;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
}

/* Green pill badge for price additions */
.dpc-modal-price-pill {
    display: inline-flex;
    align-items: center;
    background: #dcfce7;
    color: #15803d;
    border: 1px solid #bbf7d0;
    border-radius: 9999px;
    padding: 2px 8px;
    font-size: 0.8rem;
    font-weight: 700;
    margin-left: 6px;
    letter-spacing: -0.01em;
}

/* Highlight line for Custom Options Subtotal & Configured Unit Total */
.product-customization-modal__line.dpc-modal-total-line {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    margin-top: 14px;
    padding: 13px 16px;
}

.product-customization-modal__line.dpc-modal-total-line .product-customization-modal__label {
    color: #166534;
    font-weight: 700;
}

.product-customization-modal__line.dpc-modal-total-line .product-customization-modal__text {
    color: #15803d;
    font-weight: 700;
    font-size: 1.05rem;
}

.product-customization-modal__line.dpc-modal-unit-total {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    margin-top: 8px;
    padding: 14px 16px;
}

.product-customization-modal__line.dpc-modal-unit-total .product-customization-modal__label {
    color: #1e40af;
    font-weight: 700;
}

.product-customization-modal__line.dpc-modal-unit-total .product-customization-modal__text {
    color: #1d4ed8;
    font-weight: 800;
    font-size: 1.15rem;
}

/* Customized button on cart line */
.dpc-customized-badge-btn,
button[data-bs-target^="#product-customization-modal"] {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.825rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

