/**
 * jtl_maiwell_versand — Versandkosten-Seite im Child-Design (Beere & Rosa).
 * Lädt shopweit über die Plugin-Installation; ohne #mwVersandPage greift nichts.
 * Palette: Beere #a23b53 / Rosa #ca506e / dunkle Beere #8c2e43,
 * Flächen #fdf0f2, #f0dfea, #f6e7ea, Text #4f4b4a (siehe custom.css des Childs).
 */

.mw-versand {
    margin-bottom: 2.5rem;
}

/* ------------------------------------------------------------------ Intro */

.mw-versand-intro {
    max-width: 60ch;
    margin: 0 0 1.5rem;
    color: #4f4b4a;
}

/* ------------------------------------------------- Mini-Rechner („erlebbar") */

.mw-calc {
    background: #fdf0f2;
    border: 1px solid #f0dfea;
    border-left: 4px solid #ca506e;
    border-radius: 12px;
    padding: 1.25rem 1.25rem 1.5rem;
    margin: 0 0 2.25rem;
}

.mw-calc-title {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: 1.25rem;
    font-weight: 600;
    color: #8c2e43;
    margin: 0 0 .25rem;
}

.mw-calc-icon {
    color: #ca506e;
    flex: 0 0 auto;
}

.mw-calc-hint {
    margin: 0 0 1rem;
    font-size: .9rem;
    color: #4f4b4a;
}

.mw-calc-fields {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem 1rem;
    margin: 0 0 1rem;
}

.mw-calc-field {
    display: flex;
    flex-direction: column;
    gap: .25rem;
    flex: 1 1 11rem;
    max-width: 15rem;
    margin: 0;
}

.mw-calc-field-zip {
    flex: 1 1 8rem;
    max-width: 10rem;
}

.mw-calc-label {
    font-size: .8rem;
    font-weight: 600;
    color: #a23b53;
}

.mw-calc-input,
.mw-calc-country,
.mw-calc-zip {
    height: 44px;
    border-color: #f0dfea;
    border-radius: 8px;
    background-color: #fff;
}

.mw-calc-input:focus,
.mw-calc-country:focus,
.mw-calc-zip:focus {
    border-color: #ca506e;
    box-shadow: 0 0 0 3px rgba(202, 80, 110, .15);
}

.mw-calc-actions {
    display: flex;
    align-items: center;
    gap: .75rem;
    flex-wrap: wrap;
}

.mw-calc-submit {
    background-color: #a23b53;
    border-color: #a23b53;
    color: #fff;
    min-height: 44px;
    font-weight: 600;
    border-radius: 8px;
    padding: .5rem 1.25rem;
}

.mw-calc-submit:hover,
.mw-calc-submit:focus {
    background-color: #8c2e43;
    border-color: #8c2e43;
    color: #fff;
}

.mw-calc-reset {
    color: #a23b53;
}

.mw-calc-result {
    margin-top: 1rem;
}

.mw-calc-result:empty {
    display: none;
}

.mw-calc-msg {
    margin: 0;
    padding: .75rem 1rem;
    background: #fff;
    border: 1px dashed #f0dfea;
    border-radius: 8px;
    color: #4f4b4a;
    font-size: .9rem;
}

.mw-calc-rows {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: .5rem;
}

.mw-calc-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    flex-wrap: wrap;
    background: #fff;
    border: 1px solid #f0dfea;
    border-radius: 10px;
    padding: .6rem .9rem;
}

.mw-calc-row.is-cheapest {
    border-color: #ca506e;
    box-shadow: 0 2px 8px rgba(76, 35, 45, .08);
}

.mw-calc-row-name {
    font-weight: 600;
    color: #4f4b4a;
    display: flex;
    align-items: center;
    gap: .5rem;
    flex-wrap: wrap;
}

.mw-calc-row-price {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    flex-wrap: wrap;
    justify-content: flex-end;
    font-weight: 600;
    color: #a23b53;
    white-space: nowrap;
}

.mw-calc-row-price.is-free {
    color: #2e6b3a;
}

.mw-calc-note {
    font-size: .78rem;
    color: #4f4b4a;
    background: #f6e7ea;
    border-radius: 999px;
    padding: .1rem .55rem;
    white-space: nowrap;
}

.mw-calc-freehint {
    margin: .6rem 0 0;
    font-size: .85rem;
    color: #a23b53;
}

.mw-calc-nojs {
    margin: .75rem 0 0;
    font-size: .85rem;
    color: #4f4b4a;
}

/* ------------------------------------------------------------ Länder-Filter */

.mw-versand-filter {
    display: flex;
    align-items: center;
    gap: .6rem 1rem;
    flex-wrap: wrap;
    margin: 0 0 1.25rem;
    padding: .6rem .75rem;
    background: #fdf0f2;
    border-radius: 10px;
}

.mw-versand-filter-label {
    font-weight: 600;
    font-size: .85rem;
    color: #8c2e43;
}

.mw-versand-chips {
    display: flex;
    align-items: center;
    gap: .35rem;
    flex-wrap: wrap;
}

.mw-chip {
    display: inline-block;
    border: 1px solid #f0dfea;
    background: #fff;
    color: #4f4b4a;
    border-radius: 999px;
    padding: .18rem .65rem;
    font-size: .8rem;
    line-height: 1.5;
    min-height: 28px;
    cursor: pointer;
    transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}

.mw-chip:hover {
    border-color: #ca506e;
    color: #a23b53;
}

.mw-chip.is-active {
    background: #ca506e;
    border-color: #ca506e;
    color: #fff;
}

.mw-versand-count {
    margin-left: auto;
    font-size: .8rem;
    color: #a23b53;
    font-weight: 600;
}

/* ---------------------------------------------------------- Methoden-Karten */

.mw-va {
    background: #fff;
    border: 1px solid #f0dfea;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(76, 35, 45, .04);
    padding: 1rem 1.1rem .9rem;
    margin: 0 0 1rem;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.mw-va:hover {
    border-color: #dfa0a0;
    box-shadow: 0 4px 12px rgba(76, 35, 45, .07);
}

.mw-va-head {
    display: flex;
    align-items: flex-start;
    gap: .85rem;
}

.mw-va-img {
    border-radius: 8px;
    border: 1px solid #f0dfea;
    object-fit: contain;
    background: #fdf0f2;
    flex: 0 0 auto;
}

.mw-va-title {
    flex: 1 1 auto;
    min-width: 0;
}

.mw-va-name {
    font-size: 1.05rem;
    font-weight: 600;
    margin: 0 0 .35rem;
    color: #3c3a39;
}

.mw-va-badges {
    display: flex;
    flex-wrap: wrap;
    gap: .3rem .4rem;
}

.mw-badge {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    font-size: .74rem;
    font-weight: 600;
    line-height: 1.4;
    border-radius: 999px;
    padding: .1rem .6rem;
    background: #f6e7ea;
    color: #a23b53;
}

.mw-badge-basis {
    background: #f0dfea;
    color: #8c2e43;
}

.mw-badge-delivery {
    background: #f6f6f6;
    color: #4f4b4a;
    font-weight: 500;
}

.mw-badge-free {
    background: #eaf4ec;
    color: #2e6b3a;
}

.mw-badge-warn {
    background: #fff4e5;
    color: #a8631b;
}

.mw-badge-restrict {
    background: #fff;
    border: 1px dashed #dfa0a0;
    color: #a23b53;
    font-weight: 500;
}

.mw-va-price {
    flex: 0 0 auto;
    font-size: 1.15rem;
    font-weight: 600;
    color: #a23b53;
    white-space: nowrap;
    margin-left: .5rem;
}

.mw-va-price .mw-va-price-from {
    font-size: .78rem;
    font-weight: 500;
    color: #4f4b4a;
    margin-right: .25rem;
}

.mw-va-hint {
    margin: .6rem 0 0;
    font-size: .88rem;
    color: #4f4b4a;
}

/* ---------------------------------------------------- Details (Aufklappbar) */

.mw-va-details {
    margin-top: .65rem;
}

.mw-va-details > summary {
    display: flex;
    align-items: center;
    gap: .4rem;
    list-style: none;
    cursor: pointer;
    font-size: .85rem;
    font-weight: 600;
    color: #a23b53;
    padding: .35rem 0;
    border-top: 1px solid #f0dfea;
    margin-top: .5rem;
}

.mw-va-details > summary::-webkit-details-marker {
    display: none;
}

.mw-va-details[open] > summary .mw-va-chevron {
    transform: rotate(180deg);
}

.mw-va-chevron {
    transition: transform .15s ease;
    color: #ca506e;
    flex: 0 0 auto;
}

.mw-va-body {
    padding-top: .35rem;
}

.mw-va-section {
    margin: .9rem 0 0;
}

.mw-va-subhead {
    font-size: .85rem;
    font-weight: 600;
    color: #8c2e43;
    margin: 0 0 .4rem;
    display: flex;
    flex-wrap: wrap;
    gap: .35rem .75rem;
    align-items: baseline;
}

.mw-va-note {
    font-size: .75rem;
    font-weight: 500;
    color: #4f4b4a;
    background: #f6f6f6;
    border-radius: 999px;
    padding: .05rem .55rem;
}

/* ---------------------------------------------------------------- Tabellen */

.mw-table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.mw-table {
    margin: 0;
    font-size: .9rem;
    border: 1px solid #f0dfea;
    border-radius: 8px;
    overflow: hidden;
    border-collapse: separate;
    border-spacing: 0;
    min-width: 320px;
    width: 100%;
    max-width: 42rem;
}

.mw-table thead th {
    background: #fdf0f2;
    color: #8c2e43;
    font-size: .76rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .02em;
    border-bottom: 1px solid #f0dfea;
    padding: .45rem .7rem;
    white-space: nowrap;
}

.mw-table tbody td {
    border-bottom: 1px solid #f6e7ea;
    padding: .42rem .7rem;
    color: #4f4b4a;
}

.mw-table tbody tr:last-child td {
    border-bottom: none;
}

.mw-table .mw-price-col {
    text-align: right;
    font-weight: 600;
    color: #a23b53;
    white-space: nowrap;
}

/* -------------------------------------------------- Zahlungsarten & Länder */

.mw-payments {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
    margin: 0;
    padding: 0;
}

.mw-payment {
    background: #f6f6f6;
    color: #4f4b4a;
    border-radius: 999px;
    font-size: .78rem;
    padding: .12rem .6rem;
}

.mw-country-list {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: .3rem .6rem;
    margin: 0;
    padding: 0;
}

.mw-country {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    font-size: .8rem;
    color: #4f4b4a;
}

.mw-country-iso {
    display: inline-block;
    min-width: 2.1em;
    text-align: center;
    background: #f0dfea;
    color: #8c2e43;
    font-weight: 600;
    border-radius: 4px;
    font-size: .72rem;
    padding: .05rem .2rem;
}

/* -------------------------------------------------------------- Verpackungen */

.mw-packaging {
    margin-top: 2.25rem;
}

.mw-packaging-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #8c2e43;
    margin: 0 0 .75rem;
    padding-bottom: .35rem;
    border-bottom: 2px solid #f0dfea;
}

.mw-pack-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: .5rem;
}

.mw-pack {
    display: flex;
    align-items: baseline;
    gap: .75rem;
    flex-wrap: wrap;
    background: #fff;
    border: 1px solid #f0dfea;
    border-radius: 10px;
    padding: .55rem .9rem;
}

.mw-pack-name {
    font-weight: 600;
    color: #3c3a39;
}

.mw-pack-meta {
    font-size: .8rem;
    color: #4f4b4a;
}

.mw-pack-price {
    margin-left: auto;
    font-weight: 600;
    color: #a23b53;
    white-space: nowrap;
}

/* ----------------------------------------------------------------- Fußnote */

.mw-versand-foot {
    margin-top: 2rem;
    padding-top: .9rem;
    border-top: 1px solid #f0dfea;
}

.mw-versand-foot p {
    font-size: .78rem;
    color: #4f4b4a;
    margin: 0 0 .3rem;
}

/* --------------------------------------------------------------- Zustände */

.mw-versand-error,
.mw-versand-empty {
    margin-top: 1.5rem;
}

.mw-versand-debug {
    margin: .6rem 0 0;
}

.mw-versand-debug code {
    display: block;
    font-size: .78rem;
    color: #8c2e43;
    background: #fdf0f2;
    border: 1px dashed #dfa0a0;
    border-radius: 6px;
    padding: .35rem .55rem;
    word-break: break-word;
}

/* ------------------------------------------------------ Eigener Inhalt (Admin) */

.mw-versand-custom {
    margin: 0 0 2rem;
    color: #4f4b4a;
}

.mw-versand-custom > *:first-child {
    margin-top: 0;
}

.mw-versand-custom > *:last-child {
    margin-bottom: 0;
}

.mw-versand-custom h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #8c2e43;
    margin: 1.75rem 0 .75rem;
    padding-bottom: .35rem;
    border-bottom: 2px solid #f0dfea;
}

.mw-versand-custom h3 {
    font-size: 1.05rem;
    font-weight: 600;
    color: #3c3a39;
    margin: 1.5rem 0 .5rem;
}

.mw-versand-custom img {
    max-width: 100%;
    height: auto;
}

.mw-versand-custom ul {
    padding-left: 1.25rem;
}

/* ------------------------------------------------------------------ Mobil */

@media (max-width: 575.98px) {
    .mw-calc-fields {
        flex-direction: column;
        gap: .6rem;
    }

    .mw-calc-field,
    .mw-calc-field-zip {
        max-width: none;
        flex: 1 1 auto;
        width: 100%;
    }

    .mw-va-head {
        flex-wrap: wrap;
    }

    .mw-va-price {
        width: 100%;
        margin-left: 0;
        text-align: right;
    }

    .mw-versand-count {
        margin-left: 0;
        width: 100%;
    }
}

@media (min-width: 576px) and (max-width: 991.98px) {
    .mw-calc-field {
        flex: 1 1 calc(50% - .5rem);
    }
}
