/* ==========================================================================
   DCG Checkout — Selected Services Summary
   ========================================================================== */

/* Card wrapper */
.dcg-checkout-services-summary {
    margin-bottom: 20px;
    display:none !important;
    visibility:hidden !important;
}

/* Strip default card-body padding so rows can go edge-to-edge */
.dcg-services-summary-body {
    padding: 0;
}

/* One row per service */
.dcg-service-summary-row {
    padding: 16px 20px;
    border-bottom: 1px solid #f3f4f6;
}

.dcg-service-summary-row:last-of-type {
    border-bottom: none;
}

/* Service name + price header */
.dcg-service-summary-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.dcg-service-summary-name {
    font-weight: 700;
    color: #111827;
    font-size: 0.95rem;
    display: block;
}

.dcg-service-summary-sub {
    display: block;
    font-size: 0.8rem;
    color: #6b7280;
    font-weight: 400;
    margin-top: 2px;
}

.dcg-service-summary-dot {
    display: inline-block;
    margin-top: 4px;
    padding: 2px 8px;
    background: #eef2ff;
    color: #3730a3;
    font-size: 0.72rem;
    font-weight: 600;
    border-radius: 4px;
    letter-spacing: 0.02em;
}

.dcg-service-summary-price {
    font-weight: 700;
    color: #111827;
    font-size: 0.95rem;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Compliance field rows */
.dcg-service-summary-fields {
    padding-left: 12px;
    border-left: 3px solid #e5e7eb;
    margin-left: 2px;
}

.dcg-ssf-row {
    display: flex;
    gap: 8px;
    font-size: 0.82rem;
    padding: 3px 0;
    line-height: 1.4;
}

.dcg-ssf-label {
    color: #9ca3af;
    font-weight: 600;
    flex-shrink: 0;
    min-width: 110px;
}

.dcg-ssf-value {
    color: #374151;
}



/* ==========================================================================
   DCG Product Popup Modal
   ========================================================================== */

/* Backdrop: dims the page; the panel docks to the LEFT edge.
   Smoothness comes from CSS transitions toggled by the .dcg-open class
   (set by JS), not from jQuery fade or keyframes — this gives a clean
   slide+fade on BOTH open and close, like Claude's file-preview panel. */
.dcg-popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99999;
    display: flex;
    align-items: stretch;            /* full height */
    justify-content: flex-start;     /* dock to the left */
    padding: 0;
    box-sizing: border-box;
    opacity: 0;
    transition: opacity 0.3s ease;
    will-change: opacity;
}

.dcg-popup-overlay.dcg-open {
    opacity: 1;
}

/* Side panel: full-height drawer that slides in from the left,
   mirroring Claude's file-preview panel (which docks on the right). */
.dcg-popup-modal {
    background: #fff;
    width: 100%;
    max-width: 520px;
    height: 100vh;
    max-height: 100vh;
    display: flex;
    flex-direction: column;
    border-radius: 0;                /* flush against the viewport edge */
    box-shadow: 8px 0 40px rgba(0, 0, 0, 0.25);
    transform: translateX(-100%);
    transition: transform 0.32s cubic-bezier(0.32, 0.72, 0, 1);
    will-change: transform;
}

/* UCR per-year trucks/buses blocks */
.dcg-ucr-year-fields {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 18px;
}

.dcg-ucr-year-block {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 14px 16px;
}

.dcg-ucr-year-block-head {
    font-size: 13px;
    font-weight: 700;
    color: #3E7C85;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 12px;
}

.dcg-popup-overlay.dcg-open .dcg-popup-modal {
    transform: translateX(0);
}

/* Product popup: dock to the RIGHT and slide in from the right edge. */
#dcg-product-popup {
    justify-content: flex-end;
}

#dcg-product-popup .dcg-popup-modal {
    transform: translateX(100%);
    box-shadow: -8px 0 40px rgba(0, 0, 0, 0.25);
}

#dcg-product-popup.dcg-open .dcg-popup-modal {
    transform: translateX(0);
}

/* Header */
.dcg-popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 16px;
    border-bottom: 1px solid #e5e7eb;
    flex-shrink: 0;
}

.dcg-popup-header h3 {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
    color: #111827;
    line-height: 1.3;
}

.dcg-popup-header button.dcg-popup-close,
.dcg-popup-close {
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    font-size: 24px !important;
    line-height: 1 !important;
    cursor: pointer;
    color: #6b7280 !important;
    width: 32px !important;
    height: 32px !important;
    min-width: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    border-radius: 6px !important;
    transition: color 0.15s, background 0.15s;
    flex-shrink: 0;
}

.dcg-popup-header button.dcg-popup-close:hover,
.dcg-popup-close:hover {
    color: #111827 !important;
    background: rgba(0, 0, 0, 0.06) !important;
}

/* Body */
.dcg-popup-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1 1 auto;
}

/* Inline product-page fields (non-UCR groups moved out of the modal).
   These are relocated into .dcg-fields-section (see style.css) which owns the
   single border, so the inline block itself stays borderless. */
.dcg-inline-fields {
    margin: 0;
    padding: 0;
    background: transparent;
    border: 0;
}

.dcg-inline-fields .dcg-popup-error-banner {
    margin: 0 0 16px;
    padding: 10px 14px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    color: #b91c1c;
    font-size: 0.875rem;
}

/* Field groups */
.dcg-popup-group {
    margin-bottom: 28px;
    padding-bottom: 24px;
    border-bottom: 1px solid #f3f4f6;
}

.dcg-popup-group:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.dcg-popup-group-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #374151;
    margin: 0 0 18px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e5e7eb;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* Individual fields — neutralise WooCommerce/theme .form-row float+width
   rules so popup fields always stack full-width regardless of screen size. */
.dcg-popup-field,
.dcg-popup-modal .dcg-popup-field.form-row {
    float: none !important;
    clear: both !important;
    width: 100% !important;
    margin: 0 0 16px !important;
    padding: 0 !important;
    box-sizing: border-box;
}

.dcg-popup-field:last-child { margin-bottom: 0 !important; }

.dcg-popup-field label {
    display: block;
    font-weight: 600;
    font-size: 0.875rem;
    color: #374151;
    margin-bottom: 6px;
}

.dcg-popup-field .required {
    color: #dc2626;
    margin-left: 2px;
}

.dcg-popup-field input[type="text"],
.dcg-popup-field input[type="number"],
.dcg-popup-field input[type="tel"],
.dcg-popup-field input[type="email"],
.dcg-popup-field select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.9rem;
    color: #111827;
    background: #fff;
    box-sizing: border-box;
    transition: border-color 0.15s, box-shadow 0.15s;
    appearance: auto;
}

.dcg-popup-field input:focus,
.dcg-popup-field select:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

/* Error state — use !important throughout to override WC .form-row rules */
.dcg-popup-field--error input,
.dcg-popup-field--error select {
    border-color: #dc2626 !important;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12) !important;
}

/* Valid / ok state */
.dcg-popup-field--ok input,
.dcg-popup-field--ok select {
    border-color: #16a34a !important;
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.10) !important;
}

/* Checkboxes */
.dcg-popup-checkboxes {
    display: flex;
    flex-direction: column;
    gap: 4px;          /* consistent vertical spacing between checkboxes */
    margin-top: 8px;
}

.dcg-popup-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 0;          /* rely solely on the group gap for even spacing */
    padding: 0;
    font-size: 0.875rem;
    font-weight: 400;
    color: #374151;
    cursor: pointer;
    line-height: 1.45;
}

.dcg-popup-checkbox-label input[type="checkbox"] {
    margin-top: 2px;
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #2563eb;
}

/* Error messages — force visibility; WC .form-row must not hide these */
.dcg-popup-field-error {
    display: block !important;
    visibility: visible !important;
    color: #dc2626 !important;
    font-size: 0.8rem !important;
    font-weight: 500;
    margin-top: 6px !important;
    line-height: 1.4;
}

/* Error banner shown at the top of the popup body on submit */
.dcg-popup-error-banner {
    background: #fef2f2;
    border: 1px solid #fca5a5;
    color: #991b1b;
    border-radius: 6px;
    padding: 10px 14px;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 16px;
}

/* Footer */
.dcg-popup-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px 20px;
    border-top: 1px solid #e5e7eb;
    flex-shrink: 0;
}

/* Prevent page scroll while popup is open */
body.dcg-popup-open { overflow: hidden; }

@media (max-width: 600px) {
    .dcg-popup-overlay {
        padding: 0;
    }

    /* Full-width drawer on small screens. */
    .dcg-popup-modal {
        max-width: 100%;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
    }

    .dcg-popup-header {
        padding: 16px 16px 12px;
    }

    .dcg-popup-header h3 {
        font-size: 1rem;
    }

    .dcg-popup-body {
        padding: 16px;
    }

    .dcg-popup-footer {
        padding: 12px 16px 16px;
        flex-direction: column-reverse;
        align-items: stretch;
    }

    .dcg-popup-footer .button {
        width: 100%;
        text-align: center;
        margin: 0;
    }

    .dcg-popup-group-title {
        font-size: 0.875rem;
        margin-bottom: 14px;
    }

    /* Stop iOS zooming on focus by keeping inputs ≥16px. */
    .dcg-popup-field input,
    .dcg-popup-field select {
        font-size: 16px;
    }

    .dcg-popup-checkbox-label,
    .dcg-popup-checkboxes {
        font-size: 0.85rem;
    }
}

/* ==========================================================================
   Summary: list-style field rows (Hazmat categories)
   ========================================================================== */

.dcg-ssf-row--list {
    flex-direction: column;
    gap: 4px;
}

.dcg-ssf-list {
    margin: 2px 0 0;
    padding-left: 18px;
    list-style: disc;
}

.dcg-ssf-list li {
    font-size: 0.8rem;
    color: #374151;
    line-height: 1.4;
    margin-bottom: 3px;
}

