/*
 * Wisext Shop: shop pages (site view shop) and shop articles ({wxshop} tags,
 * plg_content_wisextshop) - first look copied from www_wisext_tools/bss/shop.css.
 *
 * This file owns the layout. Every colour, the font and the radii are the
 * --wsx-* variables below, each one fed by the site template's --wx-shop-*
 * variable when it sets one (tpl_wisext: Wisext templates > Shop, option ->
 * variable map in its includes/design.php), else by the value after the
 * comma here. A shop page's "Custom CSS" option can still override one
 * variable for that page only (e.g. #wisext-shop { --wsx-cta: #e67e22; }).
 */
#wisext-shop {
    /* Page */
    --wsx-bg: var(--wx-shop-bg, #333333);                 /* panel background */
    --wsx-fg: var(--wx-shop-fg, #e6eefc);                 /* titles, prices */
    --wsx-muted: var(--wx-shop-muted, #94a3b8);           /* lead, descriptions, notes */
    --wsx-link: var(--wx-shop-link, #4da3ff);
    --wsx-link-hover: var(--wx-shop-link-hover, #82c7ff);
    --wsx-font: var(--wx-shop-font, system-ui, "Segoe UI", Roboto, Inter, Arial, sans-serif);

    /* Cards */
    --wsx-card: var(--wx-shop-card, linear-gradient(180deg, #101725 0%, #0f1521 100%));
    --wsx-border: var(--wx-shop-border, #223048);
    --wsx-feature: var(--wx-shop-feature, #c6d3ea);       /* feature lines, info texts */
    --wsx-check: var(--wx-shop-check, #10b981);           /* ✓ before a feature */
    --wsx-infinite: var(--wx-shop-infinite, greenyellow); /* ♾ before an unlimited feature */
    --wsx-featured: var(--wx-shop-featured, #3757ff);     /* border of the featured card */
    --wsx-featured-glow: var(--wx-shop-featured-glow, rgba(45, 107, 243, .25));
    --wsx-radius: var(--wx-shop-radius, 14px);            /* cards */
    --wsx-badge-bg: var(--wx-shop-badge-bg, #1a2aff);
    --wsx-badge-border: var(--wx-shop-badge-border, #6e8aff);
    --wsx-badge-fg: var(--wx-shop-badge-fg, #fff);

    /* Billing toggle, currency selector */
    --wsx-brand: var(--wx-shop-brand, #5aa0ff);           /* chosen period, discount banner edge */
    --wsx-brand-fg: var(--wx-shop-brand-fg, #041225);     /* text on --wsx-brand */
    --wsx-control-bg: var(--wx-shop-control-bg, #0e1420);
    --wsx-control-border: var(--wx-shop-control-border, #203048);
    --wsx-saving: var(--wx-shop-saving, #9ae6b4);         /* "-16%" */
    --wsx-saving-on: var(--wx-shop-saving-on, #0b5d2a);   /* "-16%" on the chosen period */

    /* Buttons */
    --wsx-brand-600: var(--wx-shop-cta, #2d6bf3);         /* main buttons (historical name) */
    --wsx-cta-fg: var(--wx-shop-cta-fg, #fff);
    --wsx-cta-radius: var(--wx-shop-cta-radius, 10px);
    --wsx-highlight: var(--wx-shop-highlight, linear-gradient(135deg, #f7d774 0%, #d7a528 50%, #ac7f1a 100%)); /* discount code */
    --wsx-highlight-fg: var(--wx-shop-highlight-fg, #1b1300);

    /* Dialogs (checkout steps, purchase flows) */
    --wsx-dialog-bg: var(--wx-shop-dialog-bg, #fff);
    --wsx-dialog-fg: var(--wx-shop-dialog-fg, #1f2328);
    --wsx-dialog-link: var(--wx-shop-dialog-link, #1d5fd1);
    --wsx-dialog-border: var(--wx-shop-dialog-border, #ddd);
    --wsx-btn-bg: var(--wx-shop-btn-bg, #fff);            /* secondary buttons */
    --wsx-btn-fg: var(--wx-shop-btn-fg, #111827);
    --wsx-btn-border: var(--wx-shop-btn-border, #d1d5db);
    --wsx-btn-hover: var(--wx-shop-btn-hover, #f5f6f8);
    --wsx-error: var(--wx-shop-error, #c0392b);           /* a flow step's message */
    --wsx-error-bg: var(--wx-shop-error-bg, #fdf1f0);
    --wsx-ok: var(--wx-shop-ok, #2e7d32);
    --wsx-ok-bg: var(--wx-shop-ok-bg, #eef7ee);

    box-sizing: border-box;
    background: var(--wsx-bg);
    color: var(--wsx-fg);
    font: 16px/1.5 var(--wsx-font);
}

#wisext-shop *,
#wisext-shop *::before,
#wisext-shop *::after {
    box-sizing: inherit;
}

#wisext-shop .wsx-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 32px 20px 64px;
}

#wisext-shop h1 {
    font-size: clamp(1.6rem, 2.4vw, 2.2rem);
    margin: 0 0 8px;
    color: var(--wsx-fg);
}

#wisext-shop .wsx-lead {
    color: var(--wsx-muted);
    margin: 0 0 24px;
}

#wisext-shop a {
    color: var(--wsx-link);
}

#wisext-shop a:hover,
#wisext-shop a:focus {
    color: var(--wsx-link-hover);
}

#wisext-shop .wsx-preview {
    background: #7a5b00;
    color: #fff;
    padding: 6px 12px;
    border-radius: 8px;
    margin-bottom: 16px;
}

/* Controls */
#wisext-shop .wsx-controls {
    display: flex;
    gap: 16px;
    align-items: center;
    flex-wrap: wrap;
    margin: 12px 0 24px;
}

#wisext-shop .wsx-toggle {
    display: inline-grid;
    grid-auto-flow: column;
    border: 1px solid var(--wsx-control-border);
    border-radius: 9px;
    overflow: hidden;
}

#wisext-shop .wsx-toggle button {
    appearance: none;
    background: transparent;
    color: var(--wsx-fg);
    border: 0;
    padding: 10px 14px;
    cursor: pointer;
}

#wisext-shop .wsx-toggle button[aria-pressed="true"] {
    background: var(--wsx-brand);
    color: var(--wsx-brand-fg);
}

#wisext-shop .wsx-saving {
    color: var(--wsx-saving);
    font-weight: 700;
}

#wisext-shop .wsx-toggle button[aria-pressed="true"] .wsx-saving {
    color: var(--wsx-saving-on);
}

#wisext-shop .wsx-currency {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--wsx-muted);
    font-size: .95rem;
}

#wisext-shop .wsx-currency select {
    background: var(--wsx-control-bg);
    color: var(--wsx-fg);
    border: 1px solid var(--wsx-control-border);
    border-radius: 8px;
    padding: 8px 10px;
}

/* Cards */
#wisext-shop .wsx-grid {
    display: grid;
    gap: 18px;
    grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 760px) {
    #wisext-shop .wsx-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

#wisext-shop .wsx-card {
    background: var(--wsx-card);
    border: 1px solid var(--wsx-border);
    border-radius: var(--wsx-radius);
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 22px;
}

#wisext-shop .wsx-card.is-featured {
    border-color: var(--wsx-featured);
    box-shadow: 0 6px 30px var(--wsx-featured-glow);
}

#wisext-shop .wsx-card h2 {
    margin: 0 0 8px;
    /* Bootstrap's responsive h2 size (2rem from 1200px) */
    font-size: calc(1.325rem + .9vw);
    color: var(--wsx-fg);
    padding-right: 120px;
}

#wisext-shop .wsx-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: var(--wsx-badge-bg);
    border: 1px solid var(--wsx-badge-border);
    color: var(--wsx-badge-fg);
    font-size: .75rem;
    padding: 4px 8px;
    border-radius: 999px;
}

#wisext-shop .wsx-desc {
    color: var(--wsx-muted);
    font-size: .95rem;
    margin: 0 0 14px;
}

#wisext-shop .wsx-price {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin: 8px 0 4px;
}

#wisext-shop .wsx-amount {
    font-weight: 700;
    font-size: 1.8rem;
    letter-spacing: .2px;
}

#wisext-shop .wsx-period,
#wisext-shop .wsx-price-note {
    color: var(--wsx-muted);
}

#wisext-shop .wsx-vat {
    color: var(--wsx-muted);
    font-size: .8rem;
    margin: 2px 0 12px;
}

#wisext-shop .wsx-features {
    list-style: none;
    padding: 0;
    margin: 12px 0 16px;
    color: var(--wsx-feature);
}

#wisext-shop .wsx-features li {
    display: flex;
    gap: 8px;
    margin: 6px 0;
}

#wisext-shop .wsx-features li::before {
    content: "✓";
    color: var(--wsx-check);
}

#wisext-shop .wsx-features li.is-plus::before {
    content: "✅";
}

#wisext-shop .wsx-cta {
    margin-top: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--wsx-brand-600);
    color: var(--wsx-cta-fg);
    border: 0;
    border-radius: var(--wsx-cta-radius);
    padding: 12px 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
}

#wisext-shop .wsx-cta:hover {
    filter: brightness(1.06);
    color: var(--wsx-cta-fg);
}

#wisext-shop .wsx-cta[disabled] {
    opacity: .6;
    cursor: not-allowed;
}

#wisext-shop .wsx-cta--compact {
    margin-top: 10px;
    padding: 8px 12px;
    width: auto;
}

/* Full-width messages (info cards, discount) */
#wisext-shop .wsx-inline {
    grid-column: 1 / -1;
}

/* Outside the grid (an article's info cards under the price grid): spaced like the grid. */
#wisext-shop .wsx-container > .wsx-card.wsx-inline {
    margin-top: 24px;
}

#wisext-shop .wsx-inline__inner {
    display: grid;
    grid-template-columns: 56px 1fr;
    gap: 14px;
    align-items: start;
}

#wisext-shop .wsx-inline__inner.no-icon {
    grid-template-columns: 1fr;
}

#wisext-shop .wsx-inline__icon {
    display: grid;
    place-items: center;
    width: 56px;
    height: 56px;
    font-size: 32px;
}

#wisext-shop .wsx-inline__title {
    margin: 0 0 4px;
    font-size: 1.15rem;
    color: var(--wsx-fg);
}

#wisext-shop .wsx-text {
    color: var(--wsx-feature);
    margin: 6px 0 0;
}

#wisext-shop .wsx-promo {
    border-left: 6px solid var(--wsx-brand);
    margin-bottom: 24px;
    box-shadow: 0 6px 30px rgba(45, 107, 243, .35), inset 0 0 0 1px rgba(110, 138, 255, .25);
}

#wisext-shop .wsx-promo .wsx-text {
    font-size: clamp(1.05rem, 1.8vw, 1.2rem);
    color: var(--wsx-fg);
}

#wisext-shop .wsx-muted {
    color: var(--wsx-muted);
    font-size: .95rem;
}

#wisext-shop .wsx-highlight {
    display: inline-block;
    padding: 2px 8px;
    margin: 0 4px;
    border-radius: 6px;
    font-weight: 800;
    color: var(--wsx-highlight-fg);
    background: var(--wsx-highlight);
}

#wisext-shop .wsx-footnote {
    margin-top: 24px;
    color: var(--wsx-muted);
    font-size: .9rem;
}

@media (max-width: 640px) {
    #wisext-shop .wsx-inline__inner {
        grid-template-columns: 1fr;
    }

    #wisext-shop .wsx-card h2 {
        padding-right: 0;
        margin-top: 18px;
    }
}

/* Dialogs */
#wisext-shop .wsx-dialog {
    width: min(560px, 92vw);
    max-height: 90vh;
    overflow: auto;
    border: 0;
    border-radius: 12px;
    padding: 20px 24px 8px;
    background: var(--wsx-dialog-bg);
    color: var(--wsx-dialog-fg);
    box-shadow: 0 20px 50px rgba(0, 0, 0, .18);
}

#wisext-shop .wsx-dialog--wide {
    width: min(900px, 92vw);
}

#wisext-shop .wsx-dialog::backdrop {
    background: rgba(9, 11, 18, .55);
}

#wisext-shop .wsx-dialog h2 {
    color: var(--wsx-dialog-fg);
    font-size: 1.35rem;
    margin: 0 0 12px;
}

#wisext-shop .wsx-dialog a {
    color: var(--wsx-dialog-link);
}

#wisext-shop .wsx-dialog__content img {
    max-width: 100%;
    height: auto;
}

#wisext-shop .wsx-terms {
    border: 1px solid var(--wsx-dialog-border);
    border-radius: 6px;
    overflow: hidden;
}

#wisext-shop .wsx-terms iframe {
    display: block;
    width: 100%;
    height: min(60vh, 600px);
    border: 0;
}

#wisext-shop .wsx-accept {
    display: flex;
    gap: .5rem;
    align-items: flex-start;
    margin-top: 12px;
}

#wisext-shop .wsx-actions {
    display: flex;
    gap: .5rem;
    justify-content: flex-end;
    flex-wrap: wrap;
    padding: 12px 0;
    margin: 0;
}

#wisext-shop .wsx-actions .wsx-cta--compact {
    margin-top: 0;
}

#wisext-shop .wsx-btn {
    display: inline-flex;
    align-items: center;
    background: var(--wsx-btn-bg);
    color: var(--wsx-btn-fg);
    border: 1px solid var(--wsx-btn-border);
    border-radius: var(--wsx-cta-radius);
    padding: 8px 12px;
    cursor: pointer;
    text-decoration: none;
}

#wisext-shop .wsx-btn:hover {
    background: var(--wsx-btn-hover);
    color: var(--wsx-btn-fg);
}

/* Purchase flows (shop-flow.js): the server's message in a step's dialog. */
#wisext-shop .wsx-flow-message {
    margin: 12px 0 0;
    padding: 8px 12px;
    border-left: 3px solid var(--wsx-error);
    background: var(--wsx-error-bg);
}

#wisext-shop .wsx-flow-message--info {
    border-left-color: var(--wsx-ok);
    background: var(--wsx-ok-bg);
}

/* Shop articles ({wxshop} tags, plg_content_wisextshop): the article's own
   headings and paragraphs on the shop's colours, the price of a tag. */
#wisext-shop.wsx-article h2,
#wisext-shop.wsx-article h3,
#wisext-shop.wsx-article h4 {
    color: var(--wsx-fg);
}

/* ...except in the dialogs (light page, dark dialog text): their own text
   colour, like bss/shop.php. After the rule above, same specificity. */
#wisext-shop .wsx-dialog :is(h1, h2, h3, h4, h5, h6) {
    color: var(--wsx-dialog-fg);
}

/* A flex column, like a card: the price's and the VAT line's margins add up (no collapsing). */
#wisext-shop .wsx-price-tag {
    display: flex;
    flex-direction: column;
}

#wisext-shop .wsx-price-tag .wsx-vat {
    display: block;
}

#wisext-shop .wsx-tag-error {
    color: var(--wsx-error);
    font-size: .85rem;
}

/* A small button as a card's own child (shop articles) keeps its width. */
#wisext-shop .wsx-card > .wsx-cta--compact {
    align-self: flex-start;
}

/* {wxshop button|dialog style=link}: a button that looks like a link. */
#wisext-shop .wsx-link {
    background: none;
    border: 0;
    padding: 0;
    font: inherit;
    color: var(--wsx-link);
    text-decoration: underline;
    cursor: pointer;
}

#wisext-shop .wsx-link:hover {
    color: var(--wsx-link-hover);
}

/* Feature marks: li ✓ (default), li.is-check ✔, li.is-plus ✅, li.is-infinite ♾. */
#wisext-shop .wsx-features li.is-check::before {
    content: "✔";
}

#wisext-shop .wsx-features li.is-infinite::before {
    content: "♾";
    color: var(--wsx-infinite);
}

/* A second, light price line (e.g. « ✏ Create your account » under « Free »). */
#wisext-shop .wsx-amount--light {
    font-weight: 100;
}

/* A row of small buttons in a card (shop articles). */
#wisext-shop .wsx-card-actions {
    margin-top: 10px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

#wisext-shop .wsx-card-actions .wsx-cta {
    margin-top: 0;
}

/* Purchase-flow dialogs: a link button with the « pill » look (Shop\DialogButtons). */
#wisext-shop .wsx-pill-row {
    margin: 0;
}

#wisext-shop .wsx-pill {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    margin: .35rem 0 .65rem;
    padding: .5rem .75rem;
    font-size: 1rem;
    font-weight: 700;
    color: var(--wsx-link);
    text-decoration: none;
    background: linear-gradient(180deg,
        color-mix(in oklab, var(--wsx-brand) 18%, #0b1220) 0%,
        color-mix(in oklab, var(--wsx-brand-600) 22%, #0b1220) 100%);
    border: 1px solid color-mix(in oklab, var(--wsx-brand) 55%, #1b2a44);
    border-radius: 999px;
    box-shadow: 0 1px 0 rgba(255, 255, 255, .06) inset, 0 6px 22px rgba(45, 107, 243, .22);
    transition: transform .15s ease, box-shadow .15s ease;
}

#wisext-shop .wsx-pill::after {
    content: "↗";
    font-size: .95em;
    line-height: 1;
    opacity: .95;
    transform: translateY(-1px);
}

#wisext-shop .wsx-dialog a.wsx-pill {
    color: var(--wsx-link);
}

/* A dialog focuses its first link when it opens (bss/shop.php: a:focus colour). */
#wisext-shop .wsx-dialog a.wsx-pill:hover,
#wisext-shop .wsx-dialog a.wsx-pill:focus {
    color: var(--wsx-link-hover);
}

#wisext-shop .wsx-pill:hover,
#wisext-shop .wsx-pill:focus-visible {
    color: var(--wsx-link-hover);
    transform: translateY(-1px);
    box-shadow: 0 1px 0 rgba(255, 255, 255, .08) inset, 0 10px 28px rgba(45, 107, 243, .30);
}

#wisext-shop .wsx-pill--large {
    font-size: 20px;
}

@media (prefers-reduced-motion: reduce) {
    #wisext-shop .wsx-pill {
        transition: none;
    }

    #wisext-shop .wsx-pill:hover {
        transform: none;
    }
}

@media (min-width: 1200px) {
    #wisext-shop .wsx-card h2 {
        font-size: 2rem;
    }
}
