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

/* Card wrapper */
.dcg-checkout-services-summary {
    margin-bottom: 20px;
}

/* 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;
}

/* Participant list */
.dcg-ssf-participants {
    margin-top: 4px;
}

.dcg-ssf-participant {
    display: flex;
    align-items: baseline;
    gap: 8px;
    font-size: 0.82rem;
    padding: 3px 0;
}

.dcg-ssf-pnum {
    color: #9ca3af;
    font-weight: 700;
    flex-shrink: 0;
    min-width: 22px;
}

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


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

.dcg-popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
}

.dcg-popup-modal {
    background: #fff;
    border-radius: 10px;
    width: 100%;
    max-width: 660px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.28);
    animation: dcgPopupIn 0.18s ease;
}

@keyframes dcgPopupIn {
    from { opacity: 0; transform: translateY(-12px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* 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-close {
    background: none;
    border: none;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    color: #9ca3af;
    padding: 0 2px;
    transition: color 0.15s;
    flex-shrink: 0;
}

.dcg-popup-close:hover { color: #111827; }

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

/* 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 */
.dcg-popup-field {
    margin-bottom: 16px;
}

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

.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: 10px;
    margin-top: 4px;
}

.dcg-popup-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    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;
}

/* Dynamic participant rows */
.dcg-popup-participant {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px 18px;
    margin-bottom: 14px;
}

.dcg-popup-participant:last-child { margin-bottom: 0; }

.dcg-popup-participant h5 {
    margin: 0 0 14px;
    font-size: 0.875rem;
    font-weight: 700;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.dcg-popup-participant-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* 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; }

/* Responsive */
@media (max-width: 600px) {
    .dcg-popup-modal {
        max-height: 95vh;
        border-radius: 8px;
    }

    .dcg-popup-header,
    .dcg-popup-body,
    .dcg-popup-footer {
        padding-left: 16px;
        padding-right: 16px;
    }

    .dcg-popup-participant-fields {
        grid-template-columns: 1fr;
    }

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

    .dcg-popup-footer .button {
        text-align: center;
    }
}

/* ==========================================================================
   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;
}

/* ==========================================================================
   Cart page: per-item popup view / edit
   ========================================================================== */

.dcg-cart-popup-block {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed #e5e7eb;
}

.dcg-cart-popup-summary {
    margin-bottom: 8px;
}

.dcg-cart-popup-empty {
    color: #9ca3af;
    font-size: 0.82rem;
}

.dcg-cart-popup-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 6px;
}

.dcg-cart-view-btn,
.dcg-cart-edit-btn {
    font-size: 0.8rem !important;
    padding: 5px 12px !important;
    border-radius: 6px !important;
    line-height: 1.2 !important;
}

/* View modal uses the read-only summary field styles inside the popup body. */
.dcg-view-fields {
    border-left: none;
    padding-left: 0;
}

/* The cart view/edit modals reuse .dcg-popup-overlay / .dcg-popup-modal styles. */
