/*
 * Easy Bibles skin - overrides PlantZone's plant-shop green.
 *
 * Deep navy primary against the template's warm cream. Swap --primary and the
 * nine --rgba-primary-* values together if you want a different accent;
 * everything else in the theme reads from these.
 */

:root {

    /* Primary */
    --primary: #1B3B6F;
    --primary-hover: #142C53;
    --primary-dark: #0F2039;

    --secondary: #A67C34;
    --secondary-hover: #8C6529;
    --secondary-light: #E8D5AE;

    --title: #10151F;
    --bg-light: #FBF7F0;
    --light-dark: #DDE4F0;
    --theme-text-color: #10151F;
    --dark: #10151F;
    --dark-light: rgba(221, 228, 240, 1);

    /* Primary RGBA */
    --rgba-primary-1: rgba(27, 59, 111, 0.1);
    --rgba-primary-2: rgba(27, 59, 111, 0.2);
    --rgba-primary-3: rgba(27, 59, 111, 0.3);
    --rgba-primary-4: rgba(27, 59, 111, 0.4);
    --rgba-primary-5: rgba(27, 59, 111, 0.5);
    --rgba-primary-6: rgba(27, 59, 111, 0.6);
    --rgba-primary-7: rgba(27, 59, 111, 0.7);
    --rgba-primary-8: rgba(27, 59, 111, 0.8);
    --rgba-primary-9: rgba(27, 59, 111, 0.9);

    /* Gradient */
    --gradient1: linear-gradient(307deg, #F3E7CE 1.9%, #E7EDF7 67.57%);
    --gradient2: linear-gradient(307deg, #EFE3C6 1.9%, #DCE5F3 85.96%);
}

/* ---------------------------------------------------------------------------
   Store-specific adjustments on top of the theme
   --------------------------------------------------------------------------- */

/* Covers are drawn SVG, not photography - no zoom-on-hover, no crop. */
.shop-card .dz-media img {
    width: 100%;
    height: auto;
    object-fit: contain;
    background: #FBF7F0;
    transform: none !important;
}

.shop-card .dz-media {
    border-radius: var(--border-radius-base, 10px);
    overflow: hidden;
    background: #FBF7F0;
}

/* ---------------------------------------------------------------------------
   READABILITY
   ---------------------------------------------------------------------------
   The stock theme sets .text-muted to rgba(151,151,159,0.39) - 39% opacity,
   which lands around 1.5:1 contrast on our cream background. WCAG AA wants
   4.5:1 for body text, so the labels were effectively invisible to anyone with
   less than perfect eyesight.

   Everything below is solid colour (no opacity) and measured against both
   white and --bg-light:

     --store-ink    #3A4152  ~9.2:1   headings and strong body copy
     --store-body   #4A5162  ~7.8:1   default paragraph text
     --store-muted  #555D6E  ~6.5:1   labels, captions, secondary text

   Do not reintroduce alpha on text colours - that is what caused this.
   --------------------------------------------------------------------------- */

:root {
    --store-ink:   #3A4152;
    --store-body:  #4A5162;
    --store-muted: #555D6E;

    --bs-body-color: var(--store-body);
    --bs-secondary-color: var(--store-muted);
}

body,
p,
li,
td {
    color: var(--store-body);
}

/* The offender. Solid, and strong enough to beat the theme's !important. */
.text-muted,
.text-muted * {
    color: var(--store-muted) !important;
    opacity: 1 !important;
}

/* Small print was also being set at 12-12.5px. Nothing below 13px. */
.text-muted,
small,
.small,
figcaption {
    font-size: 14px;
}

/* Spec tables (product page): make the label column read as a label without
   dropping it into the invisible range. */
.table td,
.table th {
    color: var(--store-body);
    font-size: 15px;
    padding-top: .6rem;
    padding-bottom: .6rem;
}
.table td.text-muted {
    color: var(--store-muted) !important;
    font-weight: 500;
}

/* Hero feature ticks. */
.list-inline-item {
    font-size: 15px;
    color: var(--store-body);
}

/* Headings sit on the darkest token. */
h1, h2, h3, h4, h5, h6,
.title {
    color: var(--store-ink);
}

/* The theme ships a decorative dot + ring that trails the mouse. It adds
   nothing to a shop and reads as a rendering glitch in screenshots.
   Delete these three rules to bring it back. */
#pointer-dot,
#pointer-ring {
    display: none !important;
}

/* Language pill under each product title. */
.product-lang {
    display: inline-block;
    font-size: 13.5px;
    font-weight: 500;
    letter-spacing: .02em;
    color: var(--store-muted);
    margin-bottom: 2px;
}

/* Public-domain marker. */
.badge-pd {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 20px;
    background: rgba(27, 59, 111, .08);
    color: var(--primary);
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
    vertical-align: middle;
}

/* Cart badge should hide itself when the cart is empty. */
.cart-btn .badge[data-count="0"] {
    display: none;
}

/* The currency picker sits in the header utility row. */
.currency-select {
    background: transparent;
    border: 0;
    color: inherit;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    outline: none;
    padding-right: 4px;
}
.currency-select option {
    color: #10151F;
}

/* "Add to cart" confirmation state. */
.btn.in-cart,
.shop-card .dz-carticon.in-cart {
    background-color: var(--secondary) !important;
    border-color: var(--secondary) !important;
    color: #fff !important;
}

/* ---------------------------------------------------------------------------
   Recent-purchase notification
   --------------------------------------------------------------------------- */

.purchase-pop {
    position: fixed;
    left: 20px;
    bottom: 20px;

    /* .site-header is z-index 9999, and on mobile it turns .extra-nav into a
       fixed bottom bar - at 1070 this card rendered behind that bar. Sits above
       the header but below the theme's modal layers (99999+). */
    z-index: 9998;

    display: flex;
    align-items: center;
    gap: 11px;
    width: 290px;
    max-width: calc(100vw - 32px);
    padding: 10px 12px;
    background: #fff;
    border: 1px solid #E4E8F0;
    border-radius: 10px;
    box-shadow: 0 10px 26px rgba(16, 21, 31, .15);

    /* Hidden until JS has something to say. */
    opacity: 0;
    visibility: hidden;
    transform: translateY(18px);
    transition: opacity .32s ease, transform .32s cubic-bezier(.2, .8, .3, 1), visibility .32s;
}

.purchase-pop.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.purchase-pop-media {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border-radius: 6px;
    object-fit: contain;
    background: var(--bg-light);
}

.purchase-pop-body {
    min-width: 0;
    line-height: 1.4;
}

.purchase-pop-eyebrow {
    display: block;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--primary);
    opacity: .85;
}

.purchase-pop-name {
    display: block;
    font-size: 13px;
    line-height: 1.3;
    color: var(--store-ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.purchase-pop-meta {
    display: block;
    font-size: 11.5px;
    color: var(--store-muted);
}

.purchase-pop-close {
    position: absolute;
    top: 3px;
    right: 7px;
    border: 0;
    background: none;
    padding: 4px;
    line-height: 1;
    font-size: 15px;
    color: #A9B0BF;
    cursor: pointer;
}
.purchase-pop-close:hover { color: var(--store-ink); }

/* Below 767px the theme pins .extra-nav as a fixed 50px bar along the bottom,
   so the card has to clear it or it lands underneath. Matches the theme's own
   breakpoint - keep the two in step if the theme is ever updated. */
@media (max-width: 767px) {
    .purchase-pop {
        left: 12px;
        right: 12px;
        bottom: 68px;
        width: auto;
        max-width: none;
    }
}

/* Someone who has asked for less motion gets the card without the slide. */
@media (prefers-reduced-motion: reduce) {
    .purchase-pop { transition: opacity .2s ease, visibility .2s; transform: none; }
    .purchase-pop.is-visible { transform: none; }
}

/* ---------------------------------------------------------------------------
   BUTTON COLOURS
   ---------------------------------------------------------------------------
   The theme does NOT build buttons from var(--primary). It hardcodes the
   plant-shop green (#0D775E) straight into Bootstrap's --bs-btn-* variables in
   36 places, so changing --primary recoloured the headings and links but left
   every button green.

   Overriding the --bs-btn-* set is the correct fix: Bootstrap 5 buttons read
   these, so states (hover, active, focus, disabled) all follow without having
   to restate background-color for each one.
   --------------------------------------------------------------------------- */

.btn-primary {
    --bs-btn-color: #ffffff;
    --bs-btn-bg: var(--primary);
    --bs-btn-border-color: var(--primary);
    --bs-btn-hover-color: #ffffff;
    --bs-btn-hover-bg: var(--primary-hover);
    --bs-btn-hover-border-color: var(--primary-hover);
    --bs-btn-focus-shadow-rgb: 27, 59, 111;
    --bs-btn-active-color: #ffffff;
    --bs-btn-active-bg: var(--primary-dark);
    --bs-btn-active-border-color: var(--primary-dark);
    --bs-btn-disabled-color: #ffffff;
    --bs-btn-disabled-bg: var(--primary);
    --bs-btn-disabled-border-color: var(--primary);
}

.btn-outline-primary {
    --bs-btn-color: var(--primary);
    --bs-btn-border-color: var(--primary);
    --bs-btn-hover-color: #ffffff;
    --bs-btn-hover-bg: var(--primary);
    --bs-btn-hover-border-color: var(--primary);
    --bs-btn-focus-shadow-rgb: 27, 59, 111;
    --bs-btn-active-color: #ffffff;
    --bs-btn-active-bg: var(--primary);
    --bs-btn-active-border-color: var(--primary);
    --bs-btn-disabled-color: var(--primary);
    --bs-btn-disabled-border-color: var(--primary);
}

.btn-secondary {
    --bs-btn-color: #ffffff;
    --bs-btn-bg: var(--secondary);
    --bs-btn-border-color: var(--secondary);
    --bs-btn-hover-color: #ffffff;
    --bs-btn-hover-bg: var(--secondary-hover);
    --bs-btn-hover-border-color: var(--secondary-hover);
    --bs-btn-active-color: #ffffff;
    --bs-btn-active-bg: var(--secondary-hover);
    --bs-btn-active-border-color: var(--secondary-hover);
}

/* ---------------------------------------------------------------------------
   Ratings and live viewers
   --------------------------------------------------------------------------- */

.rating-row {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 14.5px;
    color: var(--store-body);
    flex-wrap: wrap;
}

.rating-row .stars {
    display: inline-flex;
    gap: 1px;
    color: #E8A33D;      /* amber reads as a rating everywhere; navy would not */
    font-size: 14px;
}

.rating-row.rating-sm {
    font-size: 12.5px;
    gap: 5px;
    margin-top: 4px;
}
.rating-row.rating-sm .stars { font-size: 12px; }

.viewing-now {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14.5px;
    color: var(--store-body);
}

.viewing-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #2FA84F;
    flex-shrink: 0;
    box-shadow: 0 0 0 0 rgba(47, 168, 79, .55);
    animation: viewingPulse 2.2s infinite;
}

@keyframes viewingPulse {
    0%   { box-shadow: 0 0 0 0 rgba(47, 168, 79, .55); }
    70%  { box-shadow: 0 0 0 7px rgba(47, 168, 79, 0); }
    100% { box-shadow: 0 0 0 0 rgba(47, 168, 79, 0); }
}

/* Brief highlight when the count changes, so it reads as live rather than as a
   number that quietly swapped itself when nobody was looking. */
.viewing-bump strong {
    animation: viewingBump .5s ease;
    display: inline-block;
}

@keyframes viewingBump {
    0%   { transform: translateY(0);     color: var(--store-body); }
    35%  { transform: translateY(-3px);  color: #2FA84F; }
    100% { transform: translateY(0);     color: var(--store-body); }
}

/* Both the pulse and the bump are decoration; honour a request for less motion. */
@media (prefers-reduced-motion: reduce) {
    .viewing-dot { animation: none; }
    .viewing-bump strong { animation: none; }
}

/* ---------------------------------------------------------------------------
   Star rating input
   ---------------------------------------------------------------------------
   Radios are rendered 5..1 so the CSS sibling selector can light up the chosen
   star and everything before it. row-reverse puts them back in visual order.
   The real inputs stay in the DOM (keyboard and screen readers still work),
   they are just not painted.
   --------------------------------------------------------------------------- */

.star-input {
    display: inline-flex;
    flex-direction: row-reverse;
    gap: 4px;
    font-size: 26px;
}

.star-input input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.star-input label {
    color: #D8DDE6;
    cursor: pointer;
    transition: color .12s, transform .12s;
    line-height: 1;
}

.star-input label:hover,
.star-input label:hover ~ label,
.star-input input:checked ~ label {
    color: #E8A33D;
}

.star-input label:hover { transform: scale(1.12); }

.star-input input:focus-visible + label {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
    border-radius: 4px;
}

/* ---------------------------------------------------------------------------
   Newsletter popup
   --------------------------------------------------------------------------- */

#newsletterModal .modal-dialog {
    max-width: 420px;
}

#newsletterModal .modal-content {
    max-height: 88vh;
    overflow-y: auto;
}

#newsletterModal h3 {
    font-size: 24px;
    line-height: 1.25;
    padding-right: 28px; /* clear of the close button */
}

@media (max-width: 575px) {
    /* On a phone the card was filling the viewport top to bottom. Trim the
       padding, the type and the captcha so it reads as a prompt, not a page. */
    #newsletterModal .modal-dialog {
        margin: 0 12px;
    }
    #newsletterModal .p-4,
    #newsletterModal .p-lg-5 {
        padding: 20px !important;
    }
    #newsletterModal h3 {
        font-size: 19px;
    }
    #newsletterModal p {
        font-size: 14px;
        margin-bottom: 16px !important;
    }
    #newsletterModal .form-label {
        font-size: 13.5px;
        margin-bottom: 4px;
    }
    #newsletterModal .form-control {
        height: 44px;
        font-size: 14px;
    }
    #newsletterModal .captcha-img {
        height: 46px;
        width: 154px;
    }
    #newsletterModal .captcha-refresh {
        width: 34px;
        height: 34px;
    }
    #newsletterModal .btn-lg {
        height: 46px;
        font-size: 15px;
        padding: 0 16px;
    }
    #newsletterModal .mb-3 {
        margin-bottom: 12px !important;
    }
}

/* ---------------------------------------------------------------------------
   Security code
   --------------------------------------------------------------------------- */

.captcha-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.captcha-img {
    display: block;
    height: 56px;
    width: 186px;
    border: 1px solid #E2E6EE;
    border-radius: 8px;
    user-select: none;
    -webkit-user-select: none;
}

.captcha-refresh {
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    border: 1px solid #E2E6EE;
    border-radius: 8px;
    background: #fff;
    color: var(--store-muted);
    cursor: pointer;
    transition: border-color .15s, color .15s;
}
.captcha-refresh:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* Search + filter toolbar above the grid. */
.shop-toolbar {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 28px;
}
.shop-toolbar .form-control,
.shop-toolbar .form-select {
    height: 48px;
    border-radius: 8px;
    border: 1px solid #E2E6EE;
}
.shop-toolbar .search-col {
    flex: 1;
    min-width: 260px;
}

/* Empty-results panel. */
.no-results {
    padding: 64px 24px;
    text-align: center;
    border: 1px dashed #C4CCDA;
    border-radius: 12px;
    color: var(--store-muted);
}
.no-results h5 {
    color: var(--title);
    margin-bottom: 6px;
}

/* ---------------------------------------------------------------------------
   MOBILE BOTTOM NAV - "liquid glass"
   ---------------------------------------------------------------------------
   Phone only. Hidden on desktop, where the real header already does the job.

   The glass is four effects stacked, and it only convinces with all four:
     1. backdrop-filter blur + saturate - bends and enriches what is behind it
     2. a translucent fill, so there is something for the blur to show through
     3. inset highlights: a bright top edge plus a softer bottom caustic, which
        is what reads as thickness instead of a flat blurred rectangle
     4. a curved ::before-style gradient over the top half - the "wet" look

   backdrop-filter is only worth having if something passes behind it, which is
   why the bar floats clear of the screen edges rather than sitting flush.
   --------------------------------------------------------------------------- */

.liquid-nav {
    display: none;              /* switched on in the mobile query below */
}

@media (max-width: 767px) {

    /* The theme pins .extra-nav as a flat white strip along the bottom on
       mobile. This replaces it, so send it away. */
    .site-header .extra-nav {
        display: none !important;
    }

    .liquid-nav {
        position: fixed;
        left: 12px;
        right: 12px;
        bottom: calc(12px + env(safe-area-inset-bottom, 0px));
        z-index: 9997;

        display: flex;
        align-items: stretch;
        gap: 2px;
        padding: 6px;
        border-radius: 99px;

        /* 0.18 was too transparent: over a busy light page the text behind
           bleeds through and the bar reads as muddy rather than frosted. A
           heavier fill plus a stronger blur keeps the glass look while making
           the labels legible over anything. */
        background: rgba(255, 255, 255, 0.82);
        backdrop-filter: blur(34px) saturate(180%);
        -webkit-backdrop-filter: blur(34px) saturate(180%);

        /* Shadow kept deliberately light. A 40px spread at 30% black smears a
           grey halo across the page behind the bar, which on a white background
           reads as a dirty smudge rather than lift. A tight, faint shadow plus
           a hairline edge separates the bar without staining anything.
           If it ever needs more presence, raise the hairline, not the blur. */
        box-shadow:
            0 6px 18px -6px rgba(16, 21, 31, .13),
            0 2px 5px -2px rgba(16, 21, 31, .09),
            0 0 0 1px rgba(16, 21, 31, .06),
            inset 0 2px 3px -1px rgba(255, 255, 255, .95),
            inset 0 -2px 4px -1px rgba(255, 255, 255, .40);

        overflow: hidden;
    }

    /* The curved reflection across the top - the detail that makes it read as
       liquid rather than as a blurred panel. */
    .liquid-sheen {
        position: absolute;
        top: 1px;
        left: 1px;
        right: 1px;
        height: 46%;
        border-radius: 99px 99px 24px 24px / 99px 99px 12px 12px;
        background: linear-gradient(180deg, rgba(255,255,255,.55) 0%, rgba(255,255,255,0) 100%);
        pointer-events: none;
        z-index: 1;
    }

    .liquid-item {
        position: relative;
        z-index: 2;
        flex: 1;
        min-width: 0;

        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;

        height: 50px;
        border-radius: 99px;
        text-decoration: none;

        font-size: 10.5px;
        font-weight: 600;
        color: rgba(16, 21, 31, .58);

        -webkit-tap-highlight-color: transparent;
        transition: color .3s ease, background .35s ease,
                    transform .2s cubic-bezier(.32,.72,0,1);
    }

    .liquid-item i {
        font-size: 16px;
        line-height: 1;
    }

    .liquid-item span:last-child {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100%;
    }

    /* Apple's small physical push on press. */
    .liquid-item:active {
        transform: scale(.93);
    }

    /* The lit tab sits on its own inner pill. */
    .liquid-item.is-active {
        color: var(--primary);
        /* Solid, not translucent: sitting on an already-frosted bar, a
           see-through pill just muddies twice. */
        background: #ffffff;
        box-shadow:
            0 2px 6px rgba(16, 21, 31, .10),
            0 0 0 1px rgba(16, 21, 31, .05);
    }

    .liquid-icon-wrap {
        position: relative;
        display: inline-flex;
        line-height: 1;
    }

    .liquid-badge {
        position: absolute;
        top: -6px;
        right: -10px;
        min-width: 16px;
        height: 16px;
        padding: 0 4px;
        border-radius: 99px;
        background: var(--primary);
        color: #fff;
        font-size: 10px;
        font-weight: 700;
        line-height: 16px;
        text-align: center;
        box-shadow: 0 1px 3px rgba(0,0,0,.25);
    }

    /* Keep the floating bar from covering the end of the page. */
    body {
        padding-bottom: 86px;
    }

    /* The purchase toast has to clear it too. */
    .purchase-pop {
        bottom: calc(86px + env(safe-area-inset-bottom, 0px));
    }

    /* Without backdrop-filter, fall back to a solid bar rather than an
       unreadable transparent one. */
    @supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
        .liquid-nav {
            background: rgba(255, 255, 255, .95);
        }
    }
}

/* Motion here is decoration too. */
@media (prefers-reduced-motion: reduce) {
    .liquid-item { transition: color .2s ease; }
    .liquid-item:active { transform: none; }
}

/* ---------------------------------------------------------------------------
   Fly-to-cart
   ---------------------------------------------------------------------------
   The ghost is a detached clone on top of everything, animated with transform
   and opacity only - both composited, so the flight stays smooth on a phone
   even while the page is still settling.
   --------------------------------------------------------------------------- */

.cart-ghost {
    position: fixed;
    z-index: 99998;
    pointer-events: none;
    border-radius: 8px;
    object-fit: contain;
    background: var(--bg-light);
    box-shadow: 0 12px 28px rgba(16, 21, 31, .28);
    transition: transform .7s cubic-bezier(.55, -0.2, .35, 1),
                opacity .7s ease-in;
    will-change: transform, opacity;
}

/* The little knock the cart gives when the item lands. */
.cart-bump {
    animation: cartBump .45s cubic-bezier(.34, 1.4, .64, 1);
}

@keyframes cartBump {
    0%   { transform: scale(1); }
    35%  { transform: scale(1.28); }
    100% { transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
    .cart-ghost { display: none; }
    .cart-bump  { animation: none; }
}

/* ---------------------------------------------------------------------------
   Language picker
   ---------------------------------------------------------------------------
   A custom dropdown rather than a <select>, because a native select cannot
   render an SVG flag inside an <option> on any browser.
   --------------------------------------------------------------------------- */

.lang-picker {
    position: relative;
}

.lang-flag {
    display: block;
    border-radius: 2px;
    box-shadow: 0 0 0 1px rgba(16, 21, 31, .12);
    flex-shrink: 0;
}

.lang-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 34px;
    padding: 0 10px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: inherit;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background .15s, border-color .15s;
}
.lang-btn:hover {
    background: rgba(16, 21, 31, .04);
    border-color: #E2E6EE;
}
.lang-btn svg:last-child { opacity: .5; }

.lang-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    z-index: 1000;
    display: none;

    width: 200px;
    max-height: 320px;
    overflow-y: auto;
    padding: 6px;

    background: #fff;
    border: 1px solid #E4E8F0;
    border-radius: 10px;
    box-shadow: 0 16px 40px rgba(16, 21, 31, .16);
}
.lang-menu.open { display: block; }

.lang-option {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px 10px;
    border: 0;
    border-radius: 7px;
    background: none;
    color: var(--store-body);
    font-family: inherit;
    font-size: 14px;
    text-align: left;
    cursor: pointer;
    transition: background .12s, color .12s;
}
.lang-option:hover {
    background: var(--bg-light);
    color: var(--store-ink);
}
.lang-option.is-current {
    color: var(--primary);
    font-weight: 600;
}

/* On a phone the menu would overflow the viewport pinned to the right. */
@media (max-width: 575px) {
    .lang-btn span:nth-child(2) { display: none; }   /* flag only */
    .lang-menu { right: auto; left: 0; width: 190px; }
}

/* The theme repaints header SVGs (.site-header ... svg rect { fill: var(--title) }).
   Flags carry inline styles so they win, but pin the geometry here so nothing
   in the theme can stretch or float them either. */
.lang-flag {
    display: block;
    width: 22px !important;
    height: 17px !important;
    flex: 0 0 22px;
    border-radius: 2px;
    overflow: hidden;
    box-shadow: 0 0 0 1px rgba(16, 21, 31, .14);
    vertical-align: middle;
}
.lang-btn .lang-flag,
.lang-option .lang-flag { position: static !important; }

/* ---------------------------------------------------------------------------
   Admin dashboard
   --------------------------------------------------------------------------- */

.stat-tile {
    display: block;
    padding: 16px 18px;
    height: 100%;
    background: #fff;
    border: 1px solid #E4E8F0;
    border-radius: 12px;
    text-decoration: none;
    transition: border-color .15s, transform .15s;
}
.stat-tile:hover {
    border-color: var(--primary);
    transform: translateY(-1px);
}
.stat-value {
    display: block;
    font-size: 26px;
    font-weight: 700;
    line-height: 1.1;
    color: var(--store-ink);
    font-variant-numeric: tabular-nums;
}
.stat-label {
    display: block;
    margin-top: 2px;
    font-size: 13px;
    color: var(--store-muted);
}

.admin-table th {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--store-muted);
    background: var(--bg-light);
    white-space: nowrap;
}
.admin-table td { font-size: 14px; vertical-align: middle; }

/* Long review bodies get two lines in the table, not twenty. */
.admin-clamp {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 13.5px;
}

.chip {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 20px;
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: .03em;
    text-transform: uppercase;
}
.chip-grey { background: #EEF1F6; color: #5A6273; }
.chip-blue { background: rgba(27,59,111,.09); color: var(--primary); }
.chip-warn { background: #FDF0DC; color: #96631C; }

.pagination .page-link {
    color: var(--primary);
    border-color: #E4E8F0;
}
.pagination .active .page-link {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

/* ---------------------------------------------------------------------------
   Ticket threads
   --------------------------------------------------------------------------- */

.ticket-thread {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.ticket-msg {
    padding: 14px 16px;
    border-radius: 12px;
    font-size: 14.5px;
    line-height: 1.6;
    max-width: 88%;
}

/* Their message: plain, left. */
.ticket-msg.from-admin {
    background: var(--bg-light);
    border: 1px solid #EDE7DA;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

/* Ours: tinted, right - so a long thread is readable at a glance. */
.ticket-msg.from-me {
    background: rgba(27, 59, 111, .06);
    border: 1px solid rgba(27, 59, 111, .14);
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.ticket-msg-who {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 5px;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--store-ink);
}
.ticket-msg-who span {
    font-weight: 400;
    color: var(--store-muted);
    font-size: 12px;
}

@media (max-width: 575px) {
    .ticket-msg { max-width: 100%; }
}

/* ---------------------------------------------------------------------------
   Language picker - undo the theme's header-button rules
   ---------------------------------------------------------------------------
   The theme applies this to EVERY button inside a header <li>:

       .site-header .extra-nav .extra-cell ul li button {
           min-width: 40px; padding: 0 15px;
           display: flex; justify-content: center;
       }

   Centring each row meant flag+label were centred as a pair, so rows with
   different label lengths put their flags at different x positions - the
   staircase. These overrides are scoped and !important because the theme
   selector is four levels deep and would otherwise win.
   --------------------------------------------------------------------------- */

.site-header .extra-nav .extra-cell ul li .lang-btn,
.site-header .extra-nav .extra-cell ul li .lang-option {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    min-width: 0 !important;
    text-align: left !important;
    position: relative !important;
    line-height: 1.3 !important;
}

.site-header .extra-nav .extra-cell ul li .lang-btn {
    gap: 8px !important;
    padding: 0 10px !important;
    height: 34px !important;
}

.site-header .extra-nav .extra-cell ul li .lang-option {
    gap: 10px !important;
    padding: 9px 12px !important;
    height: auto !important;
    width: 100% !important;
}

/* The menu itself must not inherit the li's flex centring either. */
.site-header .extra-nav .extra-cell ul li .lang-menu {
    display: none;
    text-align: left;
}
.site-header .extra-nav .extra-cell ul li .lang-menu.open {
    display: block !important;
}

/* Keep every flag the same box, whatever the theme does to header SVGs. */
.site-header .lang-flag,
.lang-flag {
    position: static !important;
    display: block !important;
    width: 22px !important;
    height: 17px !important;
    min-width: 22px !important;
    flex: 0 0 22px !important;
    margin: 0 !important;
    top: auto !important;
    left: auto !important;
    transform: none !important;
}

/* The label takes the rest of the row. */
.lang-option > span,
.lang-btn > span:not(#langBtnFlag) {
    flex: 1 1 auto;
    text-align: left;
    white-space: nowrap;
}

/* ---------------------------------------------------------------------------
   RADIOS AND CHECKBOXES
   ---------------------------------------------------------------------------
   The theme sets appearance:none on .form-check-input and then never paints a
   replacement, so every radio and checkbox rendered as nothing at all - the
   payment gateway picker looked like three plain labels you could not choose
   between.

   These are drawn explicitly: a visible box, a visible checked state, and the
   whole row laid out as flex so the control cannot drift away from its label.
   Bootstrap's switch styling is left alone; it does paint itself.
   --------------------------------------------------------------------------- */

.form-check:not(.form-switch) {
    display: flex;
    align-items: center;
    gap: 9px;
    padding-left: 0;
    min-height: 0;
    margin-bottom: 10px;
}

.form-check:not(.form-switch) .form-check-input {
    appearance: none;
    -webkit-appearance: none;
    float: none;
    flex: 0 0 19px;
    width: 19px;
    height: 19px;
    margin: 0;
    padding: 0;
    background-color: #fff;
    background-image: none;
    border: 2px solid #A8B0BF;
    border-radius: 4px;
    cursor: pointer;
    transition: border-color .15s, background-color .15s;
}

.form-check:not(.form-switch) .form-check-input[type="radio"] {
    border-radius: 50%;
}

.form-check:not(.form-switch) .form-check-input:hover {
    border-color: var(--primary);
}

.form-check:not(.form-switch) .form-check-input:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Checked: filled in the brand colour. */
.form-check:not(.form-switch) .form-check-input:checked {
    background-color: var(--primary);
    border-color: var(--primary);
}

/* Radio gets a white centre; checkbox gets a tick. */
.form-check:not(.form-switch) .form-check-input[type="radio"]:checked {
    box-shadow: inset 0 0 0 3.5px #fff;
}

.form-check:not(.form-switch) .form-check-input[type="checkbox"]:checked {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='3.5' d='M5 10.5 8.5 14l6.5-7'/%3E%3C/svg%3E");
    background-size: 15px;
    background-position: center;
    background-repeat: no-repeat;
}

.form-check-label {
    margin-bottom: 0;
    cursor: pointer;
    line-height: 1.4;
}

/* ---------------------------------------------------------------------------
   Admin tables - make the rows visibly clickable
   ---------------------------------------------------------------------------
   The theme renders links in the body colour, so a customer name read as plain
   text and nobody realised it opened the record.
   --------------------------------------------------------------------------- */

.admin-table td a {
    color: var(--primary);
    text-decoration: none;
}
.admin-table td a:hover {
    text-decoration: underline;
}

.admin-table tbody tr:hover {
    background: var(--bg-light);
}

/* A explicit affordance at the end of each row. */
.row-open {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 11px;
    border: 1px solid #E2E6EE;
    border-radius: 7px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--primary);
    white-space: nowrap;
}
.row-open:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    text-decoration: none !important;
}

/* ---------------------------------------------------------------------------
   Gateway picker
   ---------------------------------------------------------------------------
   Whole card is the label, so clicking anywhere on it selects - a bare radio is
   a small target and gives no sense that these are alternatives.
   --------------------------------------------------------------------------- */

.gateway-picker {
    display: grid;
    gap: 10px;
}

.gateway-option {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border: 2px solid #E4E8F0;
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    transition: border-color .15s, background .15s;
    margin: 0;
}

.gateway-option:hover {
    border-color: #B9C4D8;
    background: var(--bg-light);
}

.gateway-option.is-selected,
.gateway-option:has(input:checked) {
    border-color: var(--primary);
    background: rgba(27, 59, 111, .04);
}

.gateway-option .form-check-input {
    appearance: none;
    -webkit-appearance: none;
    flex: 0 0 19px;
    width: 19px;
    height: 19px;
    margin: 2px 0 0 0;
    float: none;
    border: 2px solid #A8B0BF;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
}

.gateway-option .form-check-input:checked {
    background-color: var(--primary);
    border-color: var(--primary);
    box-shadow: inset 0 0 0 3.5px #fff;
}

.gateway-body {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.gateway-name {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    font-weight: 600;
    color: var(--store-ink);
}

.gateway-blurb {
    font-size: 13px;
    color: var(--store-muted);
}

/* ---------------------------------------------------------------------------
   TOGGLE SWITCHES
   ---------------------------------------------------------------------------
   Two earlier attempts styled Bootstrap's .form-switch directly and both failed
   on the live site while looking fine in the file:

     1. Bootstrap's switch is an <input> painted by appearance:none plus a
        background image. The theme overrides the geometry, so it collapsed to a
        small invisible square.
     2. Repainting that same <input> put the whole control at the mercy of every
        .form-check-input rule in a 3,000-line vendor stylesheet, plus whatever
        a browser decides to do with pseudo-elements on a replaced element.

   So the input no longer draws anything. It is moved off-screen (still focusable,
   still submitted, still read by screen readers) and the visible switch is a
   plain <span> next to it, driven by the sibling selector. A <span> is not a
   replaced element, and no rule in the theme targets .switch-track - there is
   nothing left to lose a specificity fight with.

   Markup this expects:

       <label class="switch-row" for="x">
           <input type="checkbox" class="switch-input" id="x" name="x" value="1">
           <span class="switch-track" aria-hidden="true"></span>
           <span class="switch-text">Label</span>
       </label>
   --------------------------------------------------------------------------- */

.switch-row {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    margin: 0;
    cursor: pointer;
    user-select: none;
}

/* Off-screen rather than display:none - a hidden input is not focusable and
   drops out of the tab order. */
.switch-input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    margin: 0;
    pointer-events: none;
}

.switch-track {
    position: relative;
    display: block;
    flex: 0 0 46px;
    width: 46px;
    height: 26px;
    border-radius: 99px;
    background: #C3CAD8;
    transition: background-color .2s ease;
}

/* The knob. */
.switch-track::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(16, 21, 31, .3);
    transition: transform .2s cubic-bezier(.34, 1.3, .64, 1);
}

.switch-input:checked + .switch-track {
    background: var(--primary);
}

.switch-input:checked + .switch-track::after {
    transform: translateX(20px);
}

/* Keyboard users get the focus ring on the track, since the input is invisible. */
.switch-input:focus-visible + .switch-track {
    outline: 2px solid var(--primary);
    outline-offset: 3px;
}

.switch-text {
    line-height: 1.4;
    color: var(--store-ink);
}

@media (prefers-reduced-motion: reduce) {
    .switch-track,
    .switch-track::after { transition: none; }
}
