/* DML Shipping Calculator – Frontend (mobile responsive) */
.dml-shipping-calculator {
    max-width: 720px;
    margin: 1em 0;
    font-family: inherit;
}

.dml-shipping-form label {
    display: block;
    margin-bottom: 0.25em;
    font-weight: 600;
}

.dml-shipping-form input[type="text"],
.dml-shipping-form input[type="number"],
.dml-shipping-form select {
    width: 100%;
    max-width: 320px;
    padding: 0.5em 0.6em;
    border: 1px solid #8c8f94;
    border-radius: 3px;
    box-sizing: border-box;
}

/* Country autocomplete */
.dml-shipping-form p {
    position: relative;
}

.dml-autocomplete {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    max-width: 320px;
    background: #fff;
    border: 1px solid #c3c4c7;
    border-top: 0;
    z-index: 9999;
    box-sizing: border-box;
}

.dml-ac-list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 220px;
    overflow: auto;
}

.dml-ac-item {
    padding: 0.5em 0.6em;
    cursor: pointer;
}

.dml-ac-item:hover,
.dml-ac-item.active {
    background: #f0f0f1;
}

.dml-shipping-form p {
    margin-bottom: 1em;
}

.dml-required {
    color: #b00;
}

.dml-shipping-submit {
    padding: 0.6em 1.4em;
    cursor: pointer;
    background: #2271b1;
    color: #fff;
    border: none;
    border-radius: 3px;
    font-size: 1em;
}

.dml-shipping-submit:hover:not(:disabled) {
    background: #135e96;
}

.dml-shipping-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.dml-shipping-message {
    padding: 0.75em 1em;
    margin: 1em 0;
    border-left: 4px solid #d63638;
}

.dml-shipping-error {
    background: #fcf0f1;
    color: #3c434a;
}

.dml-shipping-loading {
    margin: 1em 0;
    padding: 1em;
    background: #f0f0f1;
    border-radius: 3px;
}

.dml-shipping-results {
    margin-top: 1.5em;
    padding-top: 1.5em;
    border-top: 1px solid #ddd;
}

.dml-results-title {
    margin-top: 0;
    margin-bottom: 0.5em;
}

.dml-results-meta {
    color: #50575e;
    margin-bottom: 1em;
    font-size: 0.95em;
}

/* Filter tabs */
.dml-filter-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5em;
    margin-bottom: 1em;
}

.dml-filter-tab {
    padding: 0.4em 0.8em;
    border: 1px solid #c3c4c7;
    background: #f6f7f7;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.95em;
}

.dml-filter-tab:hover,
.dml-filter-tab.active {
    background: #2271b1;
    color: #fff;
    border-color: #2271b1;
}

/* Result cards */
.dml-results-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1em;
}

.dml-result-card {
    position: relative;
    padding: 1em 1.2em;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    background: #fff;
    box-shadow: 0 1px 1px rgba(0,0,0,0.04);
}

.dml-badge-lowest {
    display: inline-block;
    padding: 0.2em 0.5em;
    margin-bottom: 0.5em;
    font-size: 0.8em;
    font-weight: 600;
    background: #00a32a;
    color: #fff;
    border-radius: 3px;
}

.dml-card-carrier {
    margin: 0 0 0.5em 0;
    font-size: 1.1em;
}

.dml-card-details {
    margin: 0;
    display: grid;
    gap: 0.4em;
}

.dml-detail-row {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) 10px minmax(72px, 1fr);
    gap: 6px;
    align-items: start;
    margin-bottom: 6px;
}

.dml-detail-label {
    font-weight: 600;
    min-width: 0;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: normal;
}

.dml-detail-separator {
    text-align: center;
}

.dml-detail-value {
    min-width: 0;
    white-space: normal;
    hyphens: none;
    word-break: normal;
    overflow-wrap: anywhere;
}

.dml-final-price {
    font-weight: 700;
    font-size: 1.1em;
}

.dml-detail-row-final {
    margin-top: 0.15em;
    padding-top: 0.35em;
    border-top: 1px solid #e2e4e7;
}

@media (max-width: 480px) {
    .dml-detail-row {
        grid-template-columns: minmax(0, 1.5fr) 8px minmax(68px, 1fr);
        gap: 4px;
    }
}

@media (min-width: 600px) {
    .dml-results-cards {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    }
}

@media (min-width: 1100px) {
    .dml-results-cards {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    }
}
