/*
 * Delivery cost calculator page-specific styles.
 *
 * Design: Option Y (map + two-column card). Follows LDR brand palette
 * (#729813 green, #151711 text) already used elsewhere on the storefront.
 *
 * Tokens stay local to this file — the site doesn't have a central design
 * token sheet yet. Extract to a shared stylesheet once >1 page reuses them.
 */

:root {
    --dc-text-primary: #151711;
    --dc-text-muted: #5a5a5a;
    --dc-text-subtle: #858585;
    --dc-surface: #ffffff;
    --dc-surface-elevated: #fafafa;
    --dc-border: #e5e5e5;
    --dc-divider: #d5d5d5;
    --dc-accent: #729813;
    --dc-accent-hover: #56700e;
    --dc-warn-accent: #d97706;
    --dc-warn-surface: #fffbeb;
    --dc-shadow: 0 1px 3px rgba(21, 23, 17, 0.06), 0 1px 2px rgba(21, 23, 17, 0.04);
    --dc-radius-md: 8px;
    --dc-radius-lg: 12px;
    --dc-duration: 200ms;
    --dc-ease: cubic-bezier(0.2, 0, 0, 1);
}

/* ---------- Map ---------- */

.delivery-cost-map {
    width: 100%;
    aspect-ratio: 4 / 3;
    min-height: 280px;
    max-height: 520px;
    margin: 1.5rem 0;
    border-radius: var(--dc-radius-md);
    overflow: hidden;
    background: #eef2f5;
    box-shadow: var(--dc-shadow);
}

@media (min-width: 768px) {
    .delivery-cost-map {
        aspect-ratio: 16 / 9;
        min-height: 360px;
    }
}

/* ---------- Result card — success ---------- */

.delivery-cost-result {
    background: var(--dc-surface-elevated);
    border: 1px solid var(--dc-border);
    border-radius: var(--dc-radius-md);
    padding: 2.25rem 2rem;
    margin-top: 1.5rem;
    animation: dc-result-enter var(--dc-duration) var(--dc-ease) both;
}

.delivery-cost-result--success {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 2rem;
    align-items: center;
}

.delivery-cost-result__cell {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.delivery-cost-result__distance {
    text-align: right;
}

.delivery-cost-result__price {
    text-align: left;
}

.delivery-cost-result__divider {
    width: 1px;
    height: 5.5rem;
    background: var(--dc-divider);
}

.delivery-cost-result__label {
    font-family: 'Roboto', sans-serif;
    font-size: 22px;
    font-weight: 600;
    color: var(--dc-text-muted);
}

.delivery-cost-result__value {
    font-family: 'Bree Serif', 'Roboto', serif;
    font-size: 38px;
    font-weight: 400;
    color: var(--dc-text-primary);
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}

.delivery-cost-result__price .delivery-cost-result__value {
    font-size: 44px;
    font-weight: 400;
    color: var(--dc-accent);
}

.delivery-cost-result__caption {
    font-family: 'Roboto', sans-serif;
    font-size: 18px;
    line-height: 1.5;
    color: var(--dc-text-muted);
}

/* ---------- Result card — responsive ---------- */

@media (max-width: 599px) {
    .delivery-cost-result--success {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    .delivery-cost-result__distance,
    .delivery-cost-result__price {
        text-align: center;
    }
    .delivery-cost-result__divider {
        width: 100%;
        height: 1px;
    }
    .delivery-cost-result__price .delivery-cost-result__value {
        font-size: 3rem;
    }
}

/* ---------- Fallback card ---------- */

.delivery-cost-result--fallback {
    border-left: 4px solid var(--dc-warn-accent);
    background: var(--dc-warn-surface);
    padding-left: 1.25rem;
}

.delivery-cost-result__fallback-heading {
    font-family: 'Bree Serif', serif;
    margin: 0 0 0.5rem;
    font-size: 1.25rem;
    font-weight: 400;
    color: var(--dc-text-primary);
}

.delivery-cost-result__fallback-message {
    font-family: 'Roboto', sans-serif;
    margin: 0 0 1.25rem;
    color: var(--dc-text-muted);
    line-height: 1.55;
}

.delivery-cost-result__fallback-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 2.75rem;
    padding: 0.75rem 1.25rem;
    border-radius: 0.5rem;
    background: var(--dc-accent);
    color: #fff;
    font-family: 'Roboto', sans-serif;
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    transition: background-color var(--dc-duration) var(--dc-ease);
}

.delivery-cost-result__fallback-cta:hover {
    background: var(--dc-accent-hover);
    color: #fff;
}

.delivery-cost-result__fallback-cta:focus-visible {
    outline: 3px solid var(--dc-warn-accent);
    outline-offset: 2px;
}

/* ---------- Motion ---------- */

@keyframes dc-result-enter {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
    .delivery-cost-result {
        animation: none;
    }
    .delivery-cost-result__fallback-cta {
        transition: none;
    }
}
