/* Modell-Nachfolger - Hinweiskaesten auf der Artikelseite und Badge in der Uebersicht.
   Bewusst zurueckhaltend gehalten: die Kacheln und die Artikelseite sollen ihrem
   bisherigen Design entsprechen, die Zusaetze sind Information, keine Werbeflaeche. */

/* --- Position: Panel hinter die Ueberschrift --------------------------------

   Der Kasten steht im Quelltext VOR der <h1>, und das laesst sich per Template nicht
   aendern: KlarnaOSM ueberschreibt den Titel-Block mit "prepend", und Smarty gibt den
   Elterninhalt eines prepend-Blocks - also die <h1> des Kern-Templates - grundsaetzlich
   erst nach dem kompletten Kindbaum aus.

   Deshalb wird das Formular nur auf Artikelseiten mit Zuordnung (:has) zu einem
   Flex-Container und die Reihenfolge ueber `order` gesetzt. Alle uebrigen Kinder
   behalten mit order:3 ihre Dokumentreihenfolge untereinander. Ohne :has-Unterstuetzung
   bleibt die bisherige Darstellung - der Kasten steht dann ueber dem Namen, nichts
   bricht. */

.js-product-form.product-info:has(> .am-mn-panel) {
    display: flex;
    flex-direction: column;
}

/* flex-shrink: 0, weil die Detailbox eine min-height von 450px hat und Flex-Kinder
   sonst unter ihre Inhaltshoehe gestaucht werden koennten. */
.js-product-form.product-info:has(> .am-mn-panel) > * {
    order: 3;
    flex-shrink: 0;
}

/* Das Theme zieht die Datenliste mit `margin-top: -44px` nach oben, als Ausgleich fuer
   den grossen Abstand unter der Ueberschrift (main.css:
   `.product-info .product-info-details dl, … fieldset`). Vorher stand dort nichts;
   liegt der Hinweiskasten dazwischen, schiebt sich die Liste darueber und verdeckt den
   Button. Der Ausgleich wird deshalb aufgehoben - den Abstand setzt hier der Kasten. */
.js-product-form.product-info:has(> .am-mn-panel) > dl:first-of-type,
.js-product-form.product-info:has(> .am-mn-panel) > fieldset:first-of-type {
    margin-top: 0;
}

.js-product-form.product-info:has(> .am-mn-panel) > .ribbon-spacing {
    order: 0;
}

/* Der Titel bringt aus Amparex-CSS (margin) und dem StyleEdit-Custom-CSS (padding)
   zusammen ueber 50 px Abstand mit. Das war gedacht fuer den direkt folgenden
   Datenblock - vor dem Hinweiskasten ist es zu viel. */
.js-product-form.product-info:has(> .am-mn-panel) > h1 {
    order: 1;
    margin-bottom: 0;
    padding-bottom: 12px;
}

.js-product-form.product-info:has(> .am-mn-panel) > .am-mn-panel {
    order: 2;
}

/* Den Abstand nach oben gibt allein das padding-bottom der Ueberschrift vor - in einem
   Flex-Container fallen Aussenabstaende nicht mehr zusammen, ein zusaetzlicher
   margin-top des ersten Kindes wuerde sich also addieren. */
.am-mn-panel {
    margin-bottom: 16px;
}

.am-mn-panel > :first-child {
    margin-top: 0;
}

/* --- MPG-Bezeichnungen unter dem Artikelnamen ------------------------------- */

.am-mn-codes {
    display: flex;
    flex-wrap: wrap;
    gap: 1px;
    margin: 12px 0 0;
    background: #dfe3e8;
    border: 1px solid #dfe3e8;
    border-radius: 4px;
    overflow: hidden;
}

.am-mn-code {
    flex: 1 1 120px;
    padding: 8px 12px;
    background: #fff;
    text-align: center;
}

.am-mn-code-label {
    display: block;
    font-size: 12px;
    line-height: 1.3;
    color: #6b7280;
}

.am-mn-code-value {
    display: block;
    margin-top: 2px;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.3;
    color: #1f2933;
}

.am-mn-hint {
    margin: 8px 0 0;
    padding: 6px 10px;
    background: #eef4fb;
    border-radius: 4px;
    font-size: 12px;
    line-height: 1.4;
    color: #33495f;
}

/* --- Hinweiskaesten --------------------------------------------------------- */

.am-mn-notice {
    margin: 12px 0 0;
    padding: 12px 14px;
    border: 1px solid #dfe3e8;
    border-left-width: 4px;
    border-radius: 4px;
    background: #fafbfc;
}

.am-mn-notice-legacy {
    border-left-color: #2f80ed;
}

.am-mn-notice-current {
    border-left-color: #b0782a;
}

.am-mn-notice-title {
    margin: 0 0 4px;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.3;
    color: #1f2933;
}

.am-mn-notice-text {
    margin: 0;
    font-size: 13px;
    line-height: 1.5;
    color: #3d4852;
}

.am-mn-notice-button {
    display: inline-block;
    margin-top: 10px;
    padding: 7px 14px;
    border: 1px solid #2f80ed;
    border-radius: 3px;
    background: #2f80ed;
    color: #fff;
    font-size: 13px;
    line-height: 1.2;
    text-decoration: none;
}

.am-mn-notice-button:hover,
.am-mn-notice-button:focus {
    background: #1d6ad4;
    border-color: #1d6ad4;
    color: #fff;
    text-decoration: none;
}

.am-mn-notice-footnote {
    margin: 8px 0 0;
    font-size: 12px;
    line-height: 1.4;
    color: #6b7280;
}

/* --- Badge in der Produktuebersicht ----------------------------------------- */

.am-mn-badge {
    display: inline-block;
    margin-top: 4px;
    padding: 2px 7px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .04em;
    line-height: 1.5;
    text-transform: uppercase;
    white-space: nowrap;
}

.am-mn-badge-legacy {
    background: #f3e6cd;
    color: #7a5410;
}

.am-mn-badge-current {
    background: #dcecfb;
    color: #1c5aa8;
}
