/*
 * Plugin-Shop – Aussehen im Frontend
 *
 * Farben kommen aus dem Theme (siehe docs/PLUGIN-API.md, Abschnitt
 * „Farben: das Plugin folgt dem Theme"). Fest sind nur neutrale Grautöne
 * mit Durchsicht – die wirken auf hellem wie auf dunklem Grund.
 */

/* Die Farben gelten für jedes Element des Shops – gleich, in welchem
   Teil der Seite es steht. Früher hingen sie an einzelnen Behältern;
   was außerhalb davon lag (Warenkorb, Kategorieleiste), bekam keine
   Farbe und sah aus wie ein nackter Verweis. */
[class^="sh-"],
[class*=" sh-"] {
    --sh-line: rgba(128, 128, 128, .28);
    --sh-soft: rgba(128, 128, 128, .08);
    --sh-accent: var(--rs-accent, var(--accent, #2563eb));
}

.sh-intro { margin: 0 0 18px; }
.sh-empty { margin: 0 0 16px; opacity: .8; }
.sh-back { margin: 0 0 14px; font-size: .92em; }
.sh-h3 { margin: 26px 0 12px; font-size: 1.05em; }
.sh-dim { opacity: .72; }
.sh-right { text-align: right; }

/* ------------------------------------------------------------ Katalog */

.sh-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 18px;
    margin: 0 0 22px;
}

.sh-card {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--sh-line);
    border-radius: 12px;
    overflow: hidden;
    background: var(--sh-soft);
}

.sh-card-image { display: block; }
.sh-card-image img { display: block; width: 100%; height: auto; }

.sh-card-body {
    display: flex;
    flex-direction: column;
    gap: 7px;
    padding: 14px 16px 16px;
    flex: 1 1 auto;
}

.sh-badge {
    align-self: flex-start;
    padding: 2px 9px;
    border-radius: 999px;
    background: var(--sh-accent);
    color: #fff;
    font-size: .74em;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.sh-card-title { margin: 0; font-size: 1.05em; }
.sh-card-title a { text-decoration: none; }
.sh-card-sub { margin: 0; font-size: .92em; opacity: .85; }
.sh-card-meta { margin: 0; font-size: .82em; opacity: .7; }

.sh-card-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: auto;
    padding-top: 10px;
}

.sh-price { font-weight: 700; }
.sh-price-big { font-size: 1.5em; }
.sh-owned { font-size: .88em; opacity: .8; }

/* -------------------------------------------------------- Einzelansicht */

.sh-detail {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 22px;
}

@media (min-width: 780px) {
    .sh-detail { grid-template-columns: 300px minmax(0, 1fr); }
}

.sh-detail-image img {
    width: 100%;
    height: auto;
    border-radius: 12px;
    border: 1px solid var(--sh-line);
}

.sh-lead { margin: 0 0 14px; font-size: 1.08em; }
.sh-text { line-height: 1.6; }
.sh-req, .sh-links { margin: 12px 0 0; font-size: .92em; }

.sh-buybox {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
    margin: 20px 0 0;
    padding: 14px 16px;
    border: 1px solid var(--sh-line);
    border-radius: 12px;
    background: var(--sh-soft);
}

.sh-versions { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }

.sh-versions li {
    padding: 10px 12px;
    border: 1px solid var(--sh-line);
    border-radius: 10px;
}

.sh-changelog { margin-top: 6px; font-size: .9em; opacity: .85; }

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

.sh-scroll { overflow-x: auto; }

.sh-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0 0 18px;
}

.sh-table th,
.sh-table td {
    padding: 9px 12px;
    text-align: left;
    border-bottom: 1px solid var(--sh-line);
}

.sh-table thead th { font-size: .86em; letter-spacing: .03em; text-transform: uppercase; opacity: .75; }
.sh-table tfoot th { border-bottom: 0; }

/* ------------------------------------------------------------ Kasse */

.sh-checkout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
}

@media (min-width: 880px) {
    .sh-checkout { grid-template-columns: minmax(0, 1fr) 300px; }
    .sh-checkout-sum { order: 2; }
    .sh-form { order: 1; }
}

.sh-checkout-sum {
    align-self: start;
    padding: 4px 16px 16px;
    border: 1px solid var(--sh-line);
    border-radius: 12px;
    background: var(--sh-soft);
}

.sh-sumlist { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }

.sh-sumlist li {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: .95em;
}

.sh-sumtotal {
    margin-top: 6px;
    padding-top: 10px;
    border-top: 1px solid var(--sh-line);
    font-weight: 700;
}

.sh-fields {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 12px;
}

.sh-field { display: grid; gap: 5px; margin: 0 0 12px; }
.sh-field label { font-size: .88em; opacity: .85; }

.sh-field input,
.sh-field select,
.sh-field textarea {
    width: 100%;
    padding: 9px 11px;
    border: 1px solid var(--sh-line);
    border-radius: 8px;
    background: var(--rs-surface-2, var(--surface-2, rgba(128, 128, 128, .08)));
    color: inherit;
    font: inherit;
}

/* Knopf und Hinweis stehen nebeneinander auf einer Linie – der Knopf
   bricht nicht um, der Hinweis darf es. */
.sh-field-btn { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; }
.sh-field-btn > .sh-btn { flex: 0 0 auto; white-space: nowrap; min-height: 42px; }
.sh-field-btn > .sh-dim { flex: 1 1 auto; min-width: 0; line-height: 1.35; font-size: .9em; }

.sh-pay { display: grid; gap: 8px; margin: 0 0 16px; }
.sh-radio, .sh-check { display: flex; align-items: flex-start; gap: 9px; }
.sh-check { margin: 0 0 16px; }
.sh-radio input, .sh-check input { margin-top: 3px; accent-color: var(--sh-accent); }

/* ------------------------------------------------------------ Konto */

.sh-license {
    margin: 0 0 16px;
    padding: 14px 16px;
    border: 1px solid var(--sh-line);
    border-radius: 12px;
}

.sh-license-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 6px;
}

.sh-key {
    padding: 3px 10px;
    border-radius: 8px;
    background: var(--sh-soft);
    letter-spacing: .08em;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.sh-domain {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    align-items: end;
    margin-top: 10px;
}

.sh-download { margin: 12px 0 0; }

.sh-license-blocked {
    border-color: rgba(224, 49, 49, .45);
    background: rgba(224, 49, 49, .06);
}

.sh-renew {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--sh-line);
}

.sh-renew-line {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.sh-renew-line > span { flex: 1 1 220px; }

.sh-renew select {
    padding: 8px 10px;
    border: 1px solid var(--sh-line);
    border-radius: 9px;
    background: var(--sh-soft);
    color: inherit;
    font: inherit;
}

.sh-renew .sh-dim { margin: 8px 0 0; }

.sh-form-address { margin-top: 8px; }

/* ------------------------------------------------------ Kategorien */

.sh-cats {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 20px;
}

.sh-cat {
    padding: 8px 15px;
    border: 1px solid var(--sh-line);
    border-radius: 999px;
    background: var(--sh-soft);
    text-decoration: none;
    font-weight: 600;
    font-size: .96em;
}

.sh-cat:hover { border-color: var(--sh-accent); color: var(--sh-accent); }
.sh-cat.is-active { background: var(--sh-accent); border-color: var(--sh-accent); color: #fff; }

.sh-cat-head { margin: 0 0 18px; }
.sh-cat-image { display: block; width: 100%; max-height: 220px; object-fit: cover; border-radius: 12px; margin-bottom: 12px; }
.sh-cat-head .sh-h3 { margin: 0 0 6px; }
.sh-cat-head .sh-h3 a { color: inherit; text-decoration: none; }
.sh-cat-head .sh-h3 a:hover { color: var(--sh-accent); }

.sh-group { margin: 0 0 34px; }
.sh-group + .sh-group { padding-top: 26px; border-top: 1px solid var(--sh-line); }
.sh-group .sh-cat-image { max-height: 160px; }

.sh-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }

.sh-chip-edition { background: var(--sh-accent); color: #fff; }

.sh-chip {
    padding: 4px 11px;
    border-radius: 999px;
    background: var(--sh-soft);
    font-size: .88em;
    font-weight: 600;
}

.sh-chip-link { text-decoration: none; }
.sh-chip-link:hover { color: var(--sh-accent); }

.sh-account-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 18px;
}

.sh-account-nav a {
    padding: 7px 13px;
    border: 1px solid var(--sh-line);
    border-radius: 999px;
    background: var(--sh-soft);
    text-decoration: none;
    font-size: .95em;
}

.sh-account-nav a:hover { border-color: var(--sh-accent); color: var(--sh-accent); }

.sh-h3 { scroll-margin-top: 90px; }

/* ----------------------------------------------------------- Knöpfe */

.sh-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 9px 16px;
    border: 0;
    border-radius: 9px;
    background: var(--sh-accent);
    color: #fff;
    font: inherit;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}

.sh-btn:hover { filter: brightness(1.08); color: #fff; }
.sh-btn-big { padding: 12px 22px; font-size: 1.02em; }

.sh-btn-quiet {
    background: transparent;
    border: 1px solid var(--sh-line);
    color: inherit;
}

.sh-btn-quiet:hover { background: var(--sh-soft); color: inherit; }

/* Themes färben Verweise und Knöpfe oft selbst ein. Die doppelte Klasse
   wiegt schwerer als eine Themeregel – sonst stand schon einmal weiße
   Schrift auf weißem Grund, oder der Knopftext verschwand im Blau. */
.sh-btn.sh-btn {
    background: var(--sh-accent);
    color: #fff;
    text-decoration: none;
}

.sh-btn.sh-btn:hover { color: #fff; text-decoration: none; }

.sh-btn-quiet.sh-btn-quiet,
.sh-btn-quiet.sh-btn-quiet:hover {
    background: transparent;
    color: inherit;
    border: 1px solid var(--sh-line);
}

.sh-btn-quiet.sh-btn-quiet:hover { background: var(--sh-soft); }

.sh-link.sh-link {
    background: none;
    border: 0;
    padding: 0;
    color: var(--rs-link, var(--sh-accent));
    font: inherit;
    font-weight: inherit;
}

.sh-link {
    border: 0;
    background: none;
    padding: 0;
    color: var(--rs-link, var(--sh-accent));
    font: inherit;
    cursor: pointer;
    text-decoration: underline;
}

.sh-inline { display: inline; }
/* Knöpfe nebeneinander sind gleich hoch und stehen auf einer Linie,
   auch wenn der eine größer gesetzt ist als der andere. */
.sh-actions {
    margin: 18px 0 0;
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 10px;
}

.sh-actions > .sh-btn,
.sh-actions > form > .sh-btn { min-height: 44px; }

/* --------------------------------------------------------- Meldungen */

.sh-note {
    margin: 0 0 16px;
    padding: 11px 14px;
    border-radius: 10px;
    border: 1px solid var(--sh-line);
    background: var(--sh-soft);
}

.sh-note-ok { border-color: rgba(47, 158, 68, .5); background: rgba(47, 158, 68, .10); }
.sh-note-fehler { border-color: rgba(224, 49, 49, .5); background: rgba(224, 49, 49, .10); }

/* -------------------------------------------------------------- Box */

.sh-boxlist { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }

.sh-boxlist li {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding-bottom: 7px;
    border-bottom: 1px solid var(--sh-line);
}

.sh-boxlist li:last-child { border-bottom: 0; padding-bottom: 0; }

/* Hinweis bei einem Produkt, das schon gekauft wurde */
.sh-hint-own {
    flex: 1 1 100%;
    margin: 8px 0 0;
    font-size: 13.5px;
    opacity: .78;
}
