/* =============================================================
   Consteia Codex Plugin — Frontend CSS
   Buttons en form-styling via /style/forms.css (.btn, .form-field etc.)
   ============================================================= */

/* ── Wrapper ─────────────────────────────────────────────────── */
.codex-plugin {
    margin: 0 0 32px;
}
.codex-plugin-heading {
    font-size: 22px;
    font-weight: 700;
    color: #01526e;
    margin: 0 0 20px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--c-grey-89, #dee2e6);
}

/* ── Product grid ────────────────────────────────────────────── */
.codex-product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 20px;
}
@media (max-width: 599.98px) {
    .codex-product-grid { grid-template-columns: 1fr; }
}

/* De kaarten in het rooster, de abonnementen en de productblokken hieronder zijn
   allemaal .form-card uit style/forms.css: zelfde vlak, ronding en schaduw, en de
   knoppen erin krijgen de schaduw die bij die ondergrond hoort. Waren eigen witte
   vlakken met een eigen rand. .form-card is bedoeld voor een formulier van hooguit
   600px en minstens 480px; een kaart in een rooster zet die maten hier terug. De
   dubbele klasse wint, welke van de twee stylesheets ook het laatst laadt. */
.codex-product-card.form-card,
.codex-plan-card.form-card {
    min-width: 0;
    max-width: none;
    margin: 0;
}
.codex-product-card.form-card { padding: 0; }
.codex-product-card {
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.2s, transform 0.2s;
}
.codex-product-card:hover {
    box-shadow: var(--sh-elev-3, 0 4px 16px rgba(86, 79, 69, 0.12));
    transform: translateY(-2px);
}
.codex-product-card .card-cover {
    width: 100%;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    background: #f0f2f5;
    display: block;
}
.codex-product-card .card-cover-placeholder {
    width: 100%;
    aspect-ratio: 3 / 4;
    background: linear-gradient(135deg, #f0f2f5 0%, var(--c-success-bg, #eef3e2) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    color: var(--c-grey-60, #999999);
}
.codex-product-card .card-body {
    padding: 14px 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.codex-product-card .card-type {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--c-grey-60, #999999);
    margin-bottom: 4px;
}
.codex-product-card .card-title {
    font-size: 15px;
    font-weight: 700;
    color: #222;
    margin: 0 0 6px;
    line-height: 1.3;
}
.codex-product-card .card-description {
    font-size: 12px;
    color: var(--c-grey-33, #555555);
    flex: 1;
    margin-bottom: 10px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.codex-product-card .card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: auto;
}
.codex-product-card .card-price {
    font-size: 16px;
    font-weight: 700;
    color: #01526e;
    white-space: nowrap;
}
.codex-product-card .card-price.pwyw {
    font-size: 13px;
    color: #6b2c9a;
}
.codex-product-card .card-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}
.codex-product-card .card-detail-link {
    font-size: 12px;
    color: #6b2c9a;
    text-decoration: none;
    white-space: nowrap;
}
.codex-product-card .card-detail-link:hover { text-decoration: underline; }

/* ── Featured book ───────────────────────────────────────────── */
/* Het vlak zelf (achtergrond, ronding, schaduw) is .form-card uit style/forms.css:
   hier staat een keuzeveld en een knop in, en de veldschaduw hoort bij die ondergrond.
   Was een eigen wit vlak met eigen rand. De dubbele klasse wint van .form-card,
   welke van de twee stylesheets ook het laatst laadt. */
.codex-featured-book {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 28px;
    align-items: start;
}
.codex-featured-book.form-card,
.codex-single-product.form-card { padding: 24px; }
@media (max-width: 767.98px) {
    .codex-featured-book { grid-template-columns: 1fr; }
    .codex-featured-book .featured-cover { max-width: 160px; }
    /* forms.css geeft een kaart op mobiel 1rem marge rondom; hier lijnt hij met de pagina. */
    .codex-featured-book.form-card,
    .codex-single-product.form-card { margin: 0 0 1rem; padding: 20px; }
}
.codex-featured-book .featured-cover {
    width: 100%;
    border-radius: 4px;
    box-shadow: 4px 4px 16px rgba(var(--c-shadow-rgb, 86, 79, 69), var(--a-12, 0.12));
    display: block;
}
.codex-featured-book .featured-cover-placeholder {
    width: 100%;
    aspect-ratio: 3 / 4;
    background: linear-gradient(135deg, #f0f2f5, var(--c-success-bg, #eef3e2));
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 56px;
}
.codex-featured-book .featured-type {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--c-grey-60, #999999);
    margin-bottom: 6px;
}
.codex-featured-book .featured-title {
    font-size: 24px;
    font-weight: 700;
    color: #01526e;
    margin: 0 0 10px;
    line-height: 1.2;
}
.codex-featured-book .featured-description {
    font-size: 14px;
    color: var(--c-grey-33, #555555);
    line-height: 1.65;
    margin-bottom: 18px;
}
.codex-featured-book .featured-price {
    font-size: 22px;
    font-weight: 700;
    color: #01526e;
    margin-bottom: 14px;
}
.codex-featured-book .featured-variants {
    margin-bottom: 16px;
}
.codex-featured-book .featured-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* ── Subscription plans ──────────────────────────────────────── */
.codex-plans-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 18px;
}
@media (max-width: 479.98px) {
    .codex-plans-grid { grid-template-columns: 1fr; }
}
.codex-plan-card.form-card { padding: 22px 20px; }
.codex-plan-card {
    /* De rand is er voor de uitgelichte kaart en de hover; anders onzichtbaar. */
    border: 2px solid transparent;
    display: flex;
    flex-direction: column;
    position: relative;
    transition: box-shadow 0.2s, border-color 0.2s;
}
.codex-plan-card:hover {
    box-shadow: var(--sh-elev-3, 0 4px 16px rgba(86, 79, 69, 0.12));
    border-color: #01526e;
}
.codex-plan-card.featured {
    border-color: #01526e;
    box-shadow: var(--sh-elev-3, 0 4px 16px rgba(86, 79, 69, 0.12));
}
.codex-plan-card .plan-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: #01526e;
    color: var(--c-white, #ffffff);
    font-size: 10px;
    font-weight: 700;
    padding: 3px 12px;
    border-radius: 10px;
    white-space: nowrap;
    letter-spacing: 0.4px;
    text-transform: uppercase;
}
.codex-plan-card .plan-name {
    font-size: 17px;
    font-weight: 700;
    color: #222;
    margin: 0 0 6px;
}
.codex-plan-card .plan-price {
    font-size: 28px;
    font-weight: 700;
    color: #01526e;
    line-height: 1;
    margin-bottom: 2px;
}
.codex-plan-card .plan-period {
    font-size: 12px;
    color: var(--c-grey-60, #999999);
    margin-bottom: 14px;
}
.codex-plan-card .plan-description {
    font-size: 12px;
    color: var(--c-grey-33, #555555);
    line-height: 1.55;
    flex: 1;
    margin-bottom: 16px;
}

/* ── Single product ──────────────────────────────────────────── */
.codex-single-product {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 28px;
    align-items: start;
}
@media (max-width: 599.98px) {
    .codex-single-product { grid-template-columns: 1fr; }
}
.codex-single-product .sp-cover {
    width: 100%;
    border-radius: 4px;
    box-shadow: 3px 3px 12px rgba(var(--c-shadow-rgb, 86, 79, 69), var(--a-12, 0.12));
}
.codex-single-product .sp-cover-placeholder {
    width: 100%;
    aspect-ratio: 3 / 4;
    background: linear-gradient(135deg, #f0f2f5, var(--c-success-bg, #eef3e2));
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
}
.codex-single-product .sp-title {
    font-size: 20px;
    font-weight: 700;
    color: #01526e;
    margin: 0 0 8px;
}
.codex-single-product .sp-description {
    font-size: 13px;
    color: var(--c-grey-33, #555555);
    line-height: 1.65;
    margin-bottom: 16px;
}
.codex-single-product .sp-price {
    font-size: 22px;
    font-weight: 700;
    color: #01526e;
    margin-bottom: 14px;
}
.codex-single-product .sp-variant-select {
    margin-bottom: 14px;
}

/* ── Cart feedback toast ──────────────────────────────────────── */
.codex-cart-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: #01526e;
    color: var(--c-white, #ffffff);
    padding: 12px 20px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    box-shadow: var(--sh-elev-4, 0 8px 24px rgba(86, 79, 69, 0.2));
    z-index: var(--z-toast, 500);
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.25s, transform 0.25s;
    pointer-events: none;
}
.codex-cart-toast.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* ── Donatie (view "donation") ─────────────────────────────────
   Stond als <style> in donation.twig; verhuisd voor de CSP (fase 7).
   Ongewijzigd overgenomen, dus zelfde selectors en specificiteit. */
/* form/input/button via /style/forms.css */
.form-intro {
    color: var(--c-grey-33, #555555);
    margin-bottom: 1.5rem;
}
/* De rij met vaste bedragen. Was een .form-group met display: flex !important;
   een .form-group is een veld met label, en dat is dit niet. */
.form-preset-row {
    display: flex;
    gap: .75rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}
.form-preset-btn {
    padding: .6rem 1.4rem;
    border: 1px solid rgba(var(--c-indigo-rgb, 75, 0, 130), var(--a-8, 0.08));
    background: rgba(var(--c-indigo-rgb, 75, 0, 130), var(--a-12, 0.12));
    color: rgba(var(--c-indigo-rgb, 75, 0, 130), var(--a-70, 0.7));
    border-radius: 20px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: .4rem;
    box-shadow: 4px 4px 8px #b0c4de,
        -4px -4px 8px ivory,
        inset 0px 0px 4px rgba(255,255,255,.5),
        inset 4px 4px 8px rgba(55,84,170,.2),
        inset -7px -7px 20px rgba(255,255,255,0.2);
    transition: background-color var(--form-transition), transform 0.3s ease, color 0.3s ease;
}
.form-preset-btn:hover,
.form-preset-btn.is-selected {
    background: rgba(var(--c-indigo-rgb, 75, 0, 130), var(--a-60, 0.6));
    color: ivory;
}
.form-popular-tag {
    font-size: .7rem;
    font-weight: 400;
    opacity: .85;
}
.form-custom-row {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin-bottom: 1.5rem;
}
.form-custom-label { font-size: .9rem; color: var(--c-grey-33, #555555); white-space: nowrap; }
.form-custom-input-wrap { display: flex; align-items: center; gap: .3rem; }
.form-euro-sign { font-size: 1.1rem; font-weight: 600; }
/* Labels boven het veld: de klasse .form-stacked uit style/forms.css, op het
   formulier in donation.twig. Hier alleen de ruimte tussen de velden. */
.codex-plugin--form .form-fields { display: flex; flex-direction: column; gap: 1rem; margin-bottom: 1.5rem; }
.form-submit-row { text-align: center; }
