/* Grid-Container */
.msr_grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    grid-auto-rows: 200px;
    grid-auto-flow: dense;
    gap: 10px;
}

/* Produktkarte */
.msr_card {
    border-radius: 10px;
    border: 1px solid #ddd;
    overflow: hidden;
    box-sizing: border-box;
    display: flex;
    padding: 10px;
    width: 100%;      /* wichtig */
    height: 100%;     /* füllt die Grid-Zelle */
    min-width: 0;     /* Flex-Overflow verhindern */
}

/* Horizontal (Bild links) */
.msr_card--horizontal {
    background: #ffffff;
    grid-column: span 2;
    grid-row: span 1;

    /* statt Flex jetzt Grid */
    display: grid;
    grid-template-columns: 200px minmax(0, 1fr);  /* links Bild, rechts Inhalt */
    grid-template-rows: auto 1fr auto;            /* Titel / Text / Footer */
    column-gap: 10px;
}

/* Vertikal (Bild oben) */
.msr_card--vertical {
    background: #ffffff;
    grid-column: span 1;
    grid-row: span 2;
    flex-direction: column;
}

/* Link */
.msr_card__link {
    display: flex;
    flex: 1 1 auto;
    text-decoration: none;
    color: inherit;
    min-width: 0;
}

.msr_card__body {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;         /* wichtig, damit nichts „rechts raus“ rutscht */
}


/* Bildcontainer */
.msr_card__media {
    flex-shrink: 0;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.msr_card--horizontal .msr_card__media {
    grid-column: 1;
    grid-row: 1 / 4;   /* über alle drei Zeilen (Titel, Text, Footer) */
}

.msr_card--vertical .msr_card__media {
    width: 100%;
    margin: 0 auto 10px auto;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Bild */
.msr_card__media img {
    max-width: 200px;
    max-height: 200px;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    border-radius: 8px;
}

/* Textbereich */
.msr_card__body {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.msr_card--vertical .msr_card__body {
    width: 100%;
    min-width: 0;
}

.msr_card__title {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 6px 0;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

.msr_card__excerpt {
    font-size: 14px;
    line-height: 1.6;
    margin: 0 0 4px 0;
    overflow: hidden;

    /* „Fake“-Mehrzeilenbegrenzung: 4 Zeilen à 1.6 line-height */
    max-height: calc(1.6em * 4);
}

/* Hover Effekt */
.msr_card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
    transform: translateY(-1px);
    transition: all .15s ease-out;
}

.msr_card__footer {
    margin-top: auto;
    text-align: right;
    font-size: 16px;
    font-weight: 600;
    padding-top: 6px;

    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.msr_card__price {
    white-space: nowrap;
}

/* IN DEN WARENKORB-Button */
.msr_card__cart-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 999px;
    background: var(--bg-dark);
    color: #ffffff;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
}

.msr_card__cart-btn-oos {
    background: #f2f2f2;
    color: #606060;
}

.msr_card__cart-btn i {
    font-size: 12px;
}

.msr_card__cart-btn:hover {
    background: #f57c00;
}

/* Vertikal: Bild oben, Text + Preis darunter */
.msr_card--vertical .msr_card__link {
    flex-direction: column;
}

/* Body in horizontalen Karten: restliche Breite voll nutzen */
.msr_card--horizontal .msr_card__body {
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
}

/* HORIZONTALE KARTEN: Link als Grid, damit Footer unter dem Text sitzt */
.msr_card--horizontal .msr_card__link {
    display: contents;
    text-decoration: none;
    color: inherit;
}

/* Bild links über die gesamte Höhe */
.msr_card--horizontal .msr_card__media {
    grid-column: 1;
    grid-row: 1 / 4; /* spannt alle drei Zeilen */
}

/* Body (Titel + Text) rechts oben / Mitte */
.msr_card--horizontal .msr_card__body {
    grid-column: 2;
    grid-row: 1 / 3;          /* Titel + Text */
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* Footer (Preis + Button) rechts unten */
.msr_card--horizontal .msr_card__footer {
    grid-column: 2;
    grid-row: 3;              /* unter dem Text */
    align-items: flex-end;    /* rechtsbündig wie bisher */
}

/* Body in horizontalen Karten: rechts, oben + Mitte */
.msr_card--horizontal .msr_card__body {
    grid-column: 2;
    grid-row: 1 / 3;   /* Titel + Text */
}

/* Footer in horizontalen Karten: rechts unten */
.msr_card--horizontal .msr_card__footer {
    grid-column: 2;
    grid-row: 3;       /* unter dem Text */
    align-items: flex-end;
}

