/* ===================================================
   Shop-Produkt Einbetten – Frontend-Styles
   Design: "Liquid Glass" (Apple-inspiriert)
   =================================================== */

a.spe-box,
div.spe-box {
    display: flex !important;
    flex-direction: row !important;
    align-items: stretch !important;
    position: relative !important;
    background: linear-gradient(135deg, rgba(255,255,255,0.612) 0%, rgba(255,255,255,0.3825) 100%);
    -webkit-backdrop-filter: blur(22px) saturate(180%);
    backdrop-filter: blur(22px) saturate(180%);
    /* GPU-Layer erzwingen → verhindert Flackern / Verschwinden beim Scrollen auf iOS */
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    will-change: transform;
    border: none;
    border-radius: 22px;
    margin: 16px 0;
    text-decoration: none;
    cursor: pointer;
    overflow: hidden !important;
    min-height: 155px !important;
    height: auto !important;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Segoe UI", Roboto, sans-serif;
    box-shadow:
        0 8px 24px rgba(0,0,0,0.10),
        0 1px 3px rgba(0,0,0,0.06);
    transition: box-shadow 0.25s ease, transform 0.25s ease;
    box-sizing: border-box !important;
}

/* Feiner Glanzstreifen oben — typisch für Liquid Glass */
a.spe-box::before,
div.spe-box::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(180deg, rgba(255,255,255,0.35) 0%, rgba(255,255,255,0) 100%);
    pointer-events: none;
    z-index: 1;
}


a.spe-box:hover {
    box-shadow:
        0 12px 32px rgba(0,0,0,0.14),
        0 2px 6px rgba(0,0,0,0.08);
    transform: translateY(-1px);
    text-decoration: none;
}

/* Schutz: kein Markieren, kein Ziehen */
a.spe-box,
div.spe-box {
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
}

.spe-box-bild img,
.spe-karussell-bild {
    pointer-events: none;
    -webkit-user-drag: none;
    user-drag: none;
}

/* Bild-Container — relativ, Bild darin absolut */
.spe-box-bild {
    flex-shrink: 0;
    align-self: stretch;
    width: 240px;
    position: relative;
    overflow: hidden;
    background: transparent;
    z-index: 0;
    border-radius: 22px 0 0 22px;
}

/* Alle img-Tags im Bild-Container absolut füllen
   !important verhindert Überschreibung durch Theme-Resets (z.B. img { height: auto }) */
.spe-box-bild img {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center !important;
    display: block !important;
    max-width: none !important;
    max-height: none !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    border-radius: 0 !important;
    float: none !important;
    box-shadow: none !important;
    vertical-align: top !important;
}

/* Karussell */
.spe-karussell-bild {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block !important;
    max-width: none !important;
    opacity: 0;
    transition: opacity 0.8s ease;
}

.spe-karussell-bild.spe-karussell-aktiv {
    opacity: 1;
}

/* Erstes Karussell-Bild gibt dem Container seine Höhe */
.spe-karussell-bild:first-child {
    position: relative;
    width: 100%;
    height: 100%;
}

/* Inhalt — dreizeilige Spalte: Name | Mitte | Versand */
.spe-box-inhalt {
    flex: 1 !important;
    min-width: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    padding: 12px 18px !important;
    background: transparent !important;
    z-index: 1 !important;
    gap: 5px !important;
}

/* Mittlere Zeile: Text links, Kaufen-Gruppe rechts */
.spe-box-midrow {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 12px !important;
    min-width: 0 !important;
    flex: 1 !important;
}

.spe-box-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

/* Name — immer einzeilig, zu langer Text wird mit … abgeschnitten */
.spe-box-name {
    font-size: 1.25em;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: #000000;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
}

.spe-box-name2 {
    font-size: 0.9em;
    font-weight: 400;
    color: #000000;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

/* Preiszeile — einzeilig */
.spe-box-preiszeile {
    display: flex;
    align-items: baseline;
    flex-wrap: nowrap;
    overflow: hidden;
    gap: 6px;
}

.spe-box-label    { font-size: 1.1em; color: #000000; white-space: nowrap; flex-shrink: 0; }
.spe-box-preis    { font-size: 1.1em; font-weight: 600; color: #000000; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.spe-box-aktpreis { font-size: 1.1em; font-weight: 700; color: #000000; white-space: nowrap; flex-shrink: 0; }
.spe-box-altpreis { font-size: 1.1em; color: #000000; text-decoration: line-through; white-space: nowrap; flex-shrink: 0; }
.spe-box-rabatt   { font-size: 1.0em; font-weight: 700; color: #cc0000; white-space: nowrap; flex-shrink: 0; }
.spe-box-versand  { font-size: 0.85em; color: #000000; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Jetzt kaufen + Bezahl-Logos — in normalem Flow, rechts im midrow */
.spe-box-kaufen-wrap {
    flex-shrink: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    height: auto !important;
    width: auto !important;
    max-width: 140px !important;
    margin: 0 !important;
    padding: 0 !important;
}

.spe-payment-logos {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 5px !important;
    margin: 0 !important;
    padding: 0 !important;
}

.spe-payment-logos img {
    display: block !important;
    width: auto !important;
    max-width: none !important;
    height: 25px !important;
    flex-shrink: 0 !important;
    pointer-events: none;
    -webkit-user-drag: none;
    margin: 0 !important;
    padding: 0 !important;
}

.spe-versand-text {
    font-size: 0.72em;
    color: #000000;
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1.3 !important;
}

/* "Jetzt kaufen" — flacher Button */
.spe-box-kaufen {
    display: inline-block;
    padding: 6px 16px;
    background: #0077ed;
    color: #ffffff;
    border: none;
    border-radius: 980px;
    font-size: 0.74em;
    font-weight: 600;
    letter-spacing: 0.01em;
    white-space: nowrap;
    cursor: pointer;
    box-shadow: none;
    transition: filter 0.2s ease;
}

a.spe-box:hover .spe-box-kaufen {
    filter: brightness(1.08);
}

/* Responsive — Mobile */
@media (max-width: 540px) {
    /* Box: Spalte — Bild oben, Inhalt unten */
    a.spe-box,
    div.spe-box {
        flex-direction: column !important;
        height: auto !important;
        max-height: none !important;
        min-height: 0 !important;
        border-radius: 20px;
    }

    /* Bild: volle Breite, feste Höhe — oben gerundet, unten eckig */
    .spe-box-bild {
        width: 100%;
        height: 180px;
        flex-shrink: 0;
        border-radius: 20px 20px 0 0 !important;
    }

    /* Karussell-Bilder bleiben absolut im Container */
    .spe-karussell-bild:first-child {
        position: absolute;
        width: 100%;
        height: 100%;
    }

    /* Inhalt: gleiche Spaltenstruktur wie Desktop, nur schmaleres Padding */
    .spe-box-inhalt {
        padding: 12px 14px !important;
        justify-content: flex-start !important;
    }

    /* Name: kleinere Schrift auf Mobile */
    .spe-box-name {
        font-size: 0.95em !important;
    }

    /* Untertitel + Preis: kleinere Schrift */
    .spe-box-name2 {
        font-size: 0.72em !important;
    }
    .spe-box-label,
    .spe-box-preis,
    .spe-box-aktpreis,
    .spe-box-altpreis {
        font-size: 0.85em !important;
    }
    .spe-box-rabatt {
        font-size: 0.8em !important;
    }
    .spe-box-versand {
        font-size: 0.68em !important;
    }
}
