.delhivery-estimator {
    grid-column: 1 / -1;
    margin: 1rem 0 0;
    padding: clamp(1rem, 2.4vw, 1.5rem);
    border: 1px solid var(--border-color, #dfe3eb);
    border-radius: 14px;
    background: var(--surface-color, #fff);
}
.delhivery-estimator h2 {
    margin: 0 0 .4rem;
    font-size: clamp(1.1rem, 2.5vw, 1.45rem);
    line-height: 1.3;
}
.delhivery-estimator-intro,
.delhivery-estimator-help,
.delhivery-estimator-disclaimer {
    color: var(--text-muted, #596579);
    font-size: .9rem;
    line-height: 1.5;
}
.delhivery-estimator-pin-group {
    max-width: 440px;
    margin: 1rem 0 0;
}
.delhivery-estimator .form-group { min-width: 0; margin: 0; }
.delhivery-estimator .form-group label {
    display: block;
    margin-bottom: .35rem;
    font-size: .87rem;
    font-weight: 600;
}
.delhivery-estimator .form-group input {
    box-sizing: border-box;
    width: 100%;
    min-height: 44px;
    padding: .65rem .75rem;
    border: 1px solid var(--border-color, #dfe3eb);
    border-radius: 8px;
    background: var(--input-background, #fff);
    color: var(--text-color, #172033);
    font: inherit;
}
.delhivery-estimator-help { margin: .6rem 0 1rem; }
.delhivery-estimator-result {
    margin-top: 1rem;
    padding: .9rem 1rem;
    border-radius: 10px;
    background: var(--muted-background, #f5f7fa);
    overflow-wrap: anywhere;
}
.delhivery-cart-estimate-help { margin-top: .5rem; margin-bottom: 0; }
.delhivery-cart-estimate-result { margin-top: .75rem; }
.delhivery-estimator-result p { margin: .4rem 0; }
.delhivery-estimator-metric {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: .5rem 1rem;
    padding: .55rem 0;
    border-bottom: 1px solid var(--border-color, #dfe3eb);
}
.delhivery-estimator-metric strong { font-size: 1.05rem; }
.delhivery-estimator-success { font-weight: 600; }
.delhivery-estimator-disclaimer { margin-bottom: 0 !important; }
@media (max-width: 520px) {
    .delhivery-estimator { padding: 1rem; }
    .delhivery-estimator-result { padding: .8rem; }
}
/* Product-page PIN checker: keep it in the details column beside the gallery. */
.delhivery-product-estimator {
    grid-column: auto;
    margin: .85rem 0 1.1rem;
    padding: 1rem;
}
.delhivery-product-estimator h2 {
    margin: 0 0 .45rem;
    font-size: 1.05rem;
}
.delhivery-product-estimator .delhivery-estimator-intro {
    margin: 0;
}
.delhivery-product-estimator .delhivery-estimator-form {
    margin-top: .8rem;
}
.delhivery-product-estimator .delhivery-estimator-pin-group {
    max-width: none;
    margin: 0;
}
.delhivery-estimator-pin-controls {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: stretch;
    gap: .5rem;
}
.delhivery-estimator-pin-controls button {
    min-height: 44px;
    white-space: nowrap;
}
.delhivery-product-estimator .delhivery-estimator-result {
    margin-top: .85rem;
}
.delhivery-estimator-error {
    border: 1px solid #e7b4b4;
    color: var(--text-color, #172033);
}
.delhivery-estimator-error:focus {
    outline-color: #a82020;
}
@media (max-width: 520px) {
    .delhivery-estimator-pin-controls {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* Successful product-page lookup collapses to one compact delivery row. */
.delhivery-product-estimator.has-estimate {
    margin: .25rem 0 .6rem;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
}
.delhivery-product-estimator.has-estimate .delhivery-estimator-result {
    margin: 0;
    padding: .55rem .75rem;
    border: 0;
    border-radius: 8px;
    background: var(--muted-background, #f5f7fa);
}
.delhivery-estimator-compact-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem .9rem;
}
.delhivery-estimator-compact-copy {
    margin: 0 !important;
    font-size: .94rem;
    line-height: 1.4;
}
.delhivery-estimator-change-pin {
    flex: 0 0 auto;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: #16803c;
    font: inherit;
    font-size: .9rem;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
    cursor: pointer;
    white-space: nowrap;
}
.delhivery-estimator-change-pin:hover { color: #0d652d; }
.delhivery-estimator-change-pin:focus-visible {
    outline: 2px solid #16803c;
    outline-offset: 3px;
    border-radius: 2px;
}
@media (max-width: 520px) {
    .delhivery-product-estimator.has-estimate .delhivery-estimator-result {
        padding: .55rem .65rem;
    }
    .delhivery-estimator-compact-row {
        gap: .5rem;
    }
    .delhivery-estimator-compact-copy { font-size: .9rem; }
    .delhivery-estimator-change-pin { font-size: .86rem; }
}

/* Keep the section name available to assistive technology in compact mode. */
.delhivery-product-estimator.has-estimate #product-delivery-estimator-title {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    clip-path: inset(50%);
    white-space: nowrap !important;
    border: 0 !important;
}
