/* TRIKON Multi-Stock — Produktseiten-Boxen.
 * Farben nach TRIKON DESIGN.md: Workshop Teal #04697e / Dark #0a2a33,
 * Verfügbar-Grün #1e7e34 (trikona11y AA), Signal-Amber #8a6500.
 * Raster: Radius 6, Padding 14, Gap 8. Motion: nur Farbe/Opacity. */

.pronesis_order_timer.tms-on > p {
    display: none !important;
}
.tms-hidden {
    display: none !important;
}

.tms-wrap {
    margin: 0.5em 0 0.75em;
}
.tms-heading {
    font-size: 1.2em;
    font-weight: 600;
    margin: 0.5em 0 0.5em;
}
.tms-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.tms-box {
    flex: 1 1 220px;
    min-width: 220px;
    max-width: 340px;
    border: 1px solid #ccc;
    border-radius: 6px;
    padding: 14px;
}
.tms-box p {
    margin: 0;
}
.tms-local { border-color: #1e7e34; }
.tms-supplier { border-color: #04697e; }
.tms-arrival { border-color: #8a6500; }
.tms-unavail { border-color: #b3261e; }

.tms-head {
    font-size: 15px;
    font-weight: 700;
}
.tms-local .tms-head { color: #1e7e34; }
.tms-supplier .tms-head { color: #04697e; }
.tms-arrival .tms-head { color: #8a6500; }
.tms-unavail .tms-head { color: #b3261e; }

.tms-label {
    font-size: 13px;
    color: #555;
    margin-top: 8px !important;
}
.tms-date {
    font-size: 18px;
    font-weight: 700;
    color: #0a2a33;
    line-height: 1.3;
}
.tms-countdown {
    font-size: 12.5px;
    color: #8a6500;
    margin-top: 4px !important;
}
.tms-countdown b {
    font-weight: 700;
}
.tms-pillrow {
    margin-top: 10px !important;
}
.tms-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 4px;
    padding: 4px 10px;
}
.tms-pill .fa {
    font-size: 13px;
}
.tms-pill-on {
    background: #1e7e34;
    color: #fff;
}
.tms-pill-off {
    background: #eee;
    color: #666;
}

@media (max-width: 480px) {
    .tms-box {
        flex-basis: 100%;
        max-width: none;
    }
}

/* Pronesis-Badges (Gratis Versand / Same-Day-Pickup) überall — Produkt-
 * karten, Sidebar, Produktseite — ans neue Pill-Design angleichen.
 * Vorher: bg #1e7e34, radius 12. Jetzt: Raster-konform radius 4. */
.product-freeshipping {
    display: inline-flex !important;
    align-items: center;
    gap: 5px;
    background: #1e7e34 !important;
    color: #fff !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    border-radius: 4px !important;
    padding: 4px 10px !important;
    line-height: 1.3;
}
.product-freeshipping .fa {
    font-size: 13px;
}
/* Muss NACH dem Badge-Restyle stehen und doppelt-spezifisch sein: das
 * display:inline-flex !important oben würde .tms-hidden sonst überstimmen
 * (gleiche Spezifität, spätere Regel gewinnt) → der ersetzte Timer-Badge
 * käme unter den Boxen wieder hervor. */
.product-freeshipping.tms-hidden {
    display: none !important;
}

/* Badges unter den Boxen (z.B. "Spedizione gratuita") bündig mit dem
 * Pickup-Pill IN der Box ausrichten: Box-Border 1px + Padding 14px. */
.pronesis_order_timer.tms-on > .product-freeshipping {
    margin-left: 15px;
}
@media (max-width: 767px) {
    .pronesis_order_timer.tms-on > .product-freeshipping {
        margin-left: 13px; /* Mobile-Box-Padding 12px + 1px Border */
    }
}

/* Checkout: Termin-Zeilen unter den Versandoptionen (v0.3.0). */
.tms-carrier-note {
    margin: 4px 0 0;
    font-size: 13px;
    color: #555;
}
.tms-carrier-note b {
    color: #0a2a33;
}
.tms-carrier-split {
    color: #8a6500;
}
.tms-carrier-split b {
    color: #8a6500;
}

/* v0.5.5: Theme-Carrier-Zeilen sind teils flex-nowrap (Mobile) — ohne
 * wrap quetschen unsere Karten den Carrier-Namen buchstabenweise zusammen.
 * Nur Zeilen mit unseren Unteroptionen anfassen. */
.delivery-option:has(.tms-sub),
.delivery-option.tms-has-sub {
    flex-wrap: wrap !important;
}
/* Haupt-Radio klickbar halten: Karten nie über den Radio-Bereich legen */
.tms-has-sub > input[type=radio],
.delivery-option input[type=radio][name^="delivery_option"] {
    position: relative;
    z-index: 6;
    pointer-events: auto !important;
    min-width: 20px;
    min-height: 20px;
}

/* v0.7.2: HeyLight-Banner scrollte UNTER unsere Termin-Karte —
 * Banner explizit über unsere Elemente heben. */
[class*="heylight" i], [id*="heylight" i], [class*="HeyLight"] {
    position: relative;
    z-index: 20;
}

/* v0.6.7: Radios eingeklappt, wenn andere Versandart aktiv (Akkordeon) */
.tms-sub.tms-collapsed {
    display: none !important;
}

/* v0.4.2: Unica/Separata als Karten-Optionen (theme-getreu: Teal-Auswahl
 * mit Akzentkante, Preis rechts) + Pickup-Info-Karte. */
.tms-sub {
    margin: 8px 14px 10px 48px;
    text-align: left;
    /* Theme-Carrier-Zeilen sind Flex/Grid-Container — ohne diese Angaben
     * wird die erste Karte auf Restbreite zusammengequetscht (live gesehen:
     * Unica-Option als schmaler Streifen am rechten Rand). Breite MINUS
     * Margins, sonst ragen die Karten rechts raus (Pills abgeschnitten). */
    flex: 0 0 calc(100% - 62px) !important;
    width: calc(100% - 62px) !important;
    max-width: calc(100% - 62px);
    box-sizing: border-box;
    clear: both;
    order: 99;
}
.tms-subopt {
    display: block;
    border: 1px solid #d9dfe2;
    border-radius: 6px;
    padding: 12px 14px;
    margin: 0 0 8px;
    background: #fff;
    cursor: pointer;
    transition: border-color .15s, background-color .15s;
    text-align: left;
    width: 100%;
    box-sizing: border-box;
}
.tms-so-title {
    min-width: 0;
    white-space: normal;
}
.tms-subopt:last-child {
    margin-bottom: 0;
}
.tms-subopt.tms-sel {
    border-color: #04697e;
    background: #f2f8fa;
    box-shadow: inset 3px 0 0 #04697e;
}
.tms-so-head {
    display: flex;
    align-items: center;
    gap: 10px;
}
.tms-so-head input {
    accent-color: #04697e;
    width: 16px;
    height: 16px;
    flex: none;
    margin: 0;
    /* rein optisch — der Tap-Handler sitzt auf der Karte (iOS-Fix) */
    pointer-events: none;
}
.tms-sub {
    position: relative;
    z-index: 5;
    pointer-events: auto;
}
.tms-so-title {
    flex: 1;
    color: #0a2a33;
    font-size: 14px;
    font-weight: 700;
}
.tms-so-pill {
    flex: none;
    font-size: 12px;
    font-weight: 700;
    border-radius: 4px;
    padding: 3px 10px;
    white-space: nowrap;
}
.tms-pill-free {
    background: #1e7e34;
    color: #fff;
}
.tms-pill-fee {
    background: #fff;
    color: #04697e;
    border: 1px solid #04697e;
}
.tms-so-lines {
    display: block;
    margin: 8px 0 0 26px;
}
.tms-so-line {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 13px;
    color: #444;
    line-height: 1.7;
}
.tms-so-line .fa {
    width: 16px;
    text-align: center;
}
.tms-so-line .tms-i-fast { color: #1e7e34; }
.tms-so-line .tms-i-late { color: #04697e; }
.tms-so-line b.tms-q { color: #1e7e34; }
.tms-so-line b.tms-q2 { color: #04697e; }
.tms-so-line b.tms-d { color: #0a2a33; }
.tms-pickuprow {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #333;
    margin: 0;
    padding: 10px 14px;
    border: 1px solid #d9dfe2;
    border-radius: 6px;
    background: #fff;
    text-align: left;
}
.tms-pickuprow .fa {
    color: #1e7e34;
    flex: none;
}
.tms-pickuprow b.tms-d {
    color: #0a2a33;
}
.tms-lines p {
    margin: 0;
    font-size: 14px;
}
.tms-lines b {
    font-weight: 700;
}

/* Anti-Flacker: rohe Pronesis-/a11y-Termin-Boxen unsichtbar halten, bis
 * unser JS sie umgebaut hat (data-tms-alert). Fallback: nach 1,2s werden
 * sie automatisch sichtbar, falls das JS nicht greift (stale/kein Row) —
 * es geht also nie Information verloren, es flackert nur nicht mehr. */
.cart-grid-body .alert.alert-info:not([data-tms-alert]),
#js-checkout-summary .alert.alert-info:not([data-tms-alert]),
.trikon-a11y-delivery-estimate:not([data-tms-alert]),
.cart-delivery-information:not([data-tms-alert]),
.delivery-information:not([data-tms-alert]),
.estimated-delivery:not([data-tms-alert]) {
    visibility: hidden;
    animation: tms-reveal 0s 1.2s forwards;
}
@keyframes tms-reveal {
    to { visibility: visible; }
}

/* Cart/Checkout-Termin-Karte (Variante A, 17.08): weiße Karte im Stil der
 * Produktseiten-Boxen — überschreibt die Theme-Alert-Optik. */
.tms-cartbox {
    background: #fff !important;
    border: 1px solid #1e7e34 !important;
    border-radius: 6px !important;
    padding: 12px 14px !important;
    color: #333 !important;
}
.tms-cartbox p {
    margin: 0;
    font-size: 14px;
    color: #333;
    line-height: 1.6;
}
.tms-cartbox p + p {
    margin-top: 6px;
    padding-top: 6px;
    border-top: 0.5px solid #e5ede7;
}
.tms-cartbox .fa {
    width: 18px;
    text-align: center;
    margin-right: 4px;
}
.tms-cartbox .tms-i-fast { color: #1e7e34; }
.tms-cartbox .tms-i-late { color: #04697e; }
.tms-cartbox .tms-q { color: #1e7e34; }
.tms-cartbox .tms-q2 { color: #04697e; }
.tms-cartbox .tms-d { color: #0a2a33; }

/* Mobile: Unteroptionen ohne tiefe Einrückung (Checkout-Spalte schmal),
 * Touch-Targets größer, Zeilen kompakter. */
@media (max-width: 767px) {
    .tms-sub {
        margin: 8px 6px 10px 10px;
        flex-basis: calc(100% - 16px) !important;
        width: calc(100% - 16px) !important;
        max-width: calc(100% - 16px);
    }
    .tms-subopt {
        padding: 12px;   /* ≥44px Touch-Fläche */
        gap: 8px;
    }
    .tms-so-head input {
        width: 18px;
        height: 18px;
    }
    .tms-so-lines {
        margin-left: 4px;
    }
    .tms-so-pill {
        font-size: 11.5px;
    }
    .tms-lines p {
        font-size: 13.5px;
        line-height: 1.5;
    }
}

/* Mobile: Boxen volle Breite, kompakteres Raster, Datum leicht reduziert —
 * bleibt aber die dominante Zeile. */
@media (max-width: 767px) {
    .tms-box {
        flex-basis: 100%;
        max-width: none;
        padding: 12px 14px;
    }
    .tms-date {
        font-size: 17px;
    }
    .tms-grid {
        gap: 6px;
    }
}
