/* =========================================================
   CH Luxury — Widget Estimation Livraison (front-end)
   Adapté au design system du thème chluxury
   ========================================================= */

.ch-delivery-widget {
    margin: 20px 0;
    padding: 20px 24px;
    background: var(--color-surface, #F9F9F9);
    border: 1px solid var(--color-border, #E5E5E5);
    border-radius: 0.25rem;
    font-family: var(--font-family-sans, 'Montserrat', ui-sans-serif, system-ui, sans-serif);
    color: var(--color-default, #374151);
}

/* En-tête : icône + date */
.ch-delivery-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.ch-delivery-icon {
    font-size: 22px;
    line-height: 1;
    opacity: 0.85;
    flex-shrink: 0;
}

.ch-delivery-label {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-muted, #9CA3AF);
}

.ch-delivery-label::after {
    content: ' :';
}

.ch-delivery-date {
    font-size: 0.875rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--color-emphasis, #111827);
}

/* Timeline */
.ch-delivery-timeline {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 16px;
}

.ch-delivery-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    flex: 0 0 auto;
    max-width: 72px;
}

.ch-delivery-dot {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--color-default, #374151);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
    flex-shrink: 0;
}

.ch-delivery-dot span {
    color: var(--color-background, #FFFFFF);
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0;
    line-height: 1;
}

.ch-delivery-step-label {
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--color-default, #374151);
    line-height: 1.4;
    margin-bottom: 3px;
}

.ch-delivery-step-days {
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--color-muted, #9CA3AF);
    letter-spacing: 0;
}

/* Ligne entre les étapes */
.ch-delivery-line {
    flex: 1;
    height: 1px;
    background: var(--color-border, #E5E5E5);
    margin-top: 13px;
    min-width: 10px;
}

/* Total en bas */
.ch-delivery-total {
    font-size: 0.75rem;
    font-weight: 400;
    letter-spacing: 0.05em;
    color: var(--color-muted, #9CA3AF);
    text-align: right;
    border-top: 1px solid var(--color-border, #E5E5E5);
    padding-top: 12px;
    margin-top: 4px;
}

/* =========================================================
   Espace client — intégration au style woocommerce-MyAccount-content
   ========================================================= */

.woocommerce-MyAccount-content .ch-delivery-widget {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    margin: 2em 0 0;
}

/* Header → style h3 du thème (weight 300, uppercase, letter-spacing, border-bottom) */
.woocommerce-MyAccount-content .ch-delivery-header {
    align-items: baseline;
    gap: 0.75em;
    margin-bottom: 1.5em;
    padding-bottom: 0.75em;
    border-bottom: 1px solid var(--color-border, #E5E5E5);
}

.woocommerce-MyAccount-content .ch-delivery-icon {
    display: none;
}

.woocommerce-MyAccount-content .ch-delivery-label {
    font-size: 0.82rem;
    font-weight: 300;
    letter-spacing: 0.2em;
    color: var(--color-emphasis, #111827);
}

/* Retire le deux-points auto */
.woocommerce-MyAccount-content .ch-delivery-label::after {
    content: '';
}

.woocommerce-MyAccount-content .ch-delivery-date {
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: var(--color-muted, #9CA3AF);
}

/* Timeline — ajustement densité */
.woocommerce-MyAccount-content .ch-delivery-timeline {
    margin-bottom: 12px;
}

/* Total — aligné à gauche comme le reste my-account */
.woocommerce-MyAccount-content .ch-delivery-total {
    text-align: left;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    padding-top: 0.75em;
}

/* =========================================================
   États de progression (page commande espace client)
   ========================================================= */

/* Étape terminée */
.ch-delivery-dot--done {
    background: var(--color-emphasis, #111827);
}
.ch-delivery-dot--done span {
    font-size: 0.8125rem;
}

/* Étape en cours */
.ch-delivery-dot--active {
    background: var(--color-emphasis, #111827);
    box-shadow: 0 0 0 4px rgba(17, 24, 39, 0.12);
}

/* Étape à venir */
.ch-delivery-dot--pending {
    background: var(--color-border, #E5E5E5);
}
.ch-delivery-dot--pending span {
    color: var(--color-muted, #9CA3AF);
}

/* Labels des étapes selon état */
.ch-delivery-step--pending .ch-delivery-step-label,
.ch-delivery-step--pending .ch-delivery-step-days {
    color: var(--color-border, #D1D5DB);
}

.ch-delivery-step--active .ch-delivery-step-label {
    color: var(--color-emphasis, #111827);
    font-weight: 700;
}

/* Ligne — état terminé */
.ch-delivery-line--done {
    background: var(--color-emphasis, #111827);
}

/* Ligne — étape en cours (progression partielle) */
.ch-delivery-line--active {
    background: linear-gradient(
        to right,
        var(--color-emphasis, #111827) var(--ch-line-progress, 0%),
        var(--color-border, #E5E5E5) var(--ch-line-progress, 0%)
    );
}

/* =========================================================
   Responsive — mobile
   ========================================================= */
@media (max-width: 480px) {
    .ch-delivery-timeline {
        flex-direction: column;
        align-items: flex-start;
        gap: 0;
    }

    .ch-delivery-step {
        flex-direction: row;
        align-items: center;
        text-align: left;
        max-width: none;
        gap: 12px;
    }

    .ch-delivery-dot {
        margin-bottom: 0;
        flex-shrink: 0;
    }

    .ch-delivery-step-label,
    .ch-delivery-step-days {
        margin-bottom: 0;
    }

    .ch-delivery-step-days {
        margin-left: 6px;
    }

    .ch-delivery-line {
        width: 1px;
        height: 14px;
        margin: 2px 0 2px 13px;
        flex: none;
    }
}
