/*
Theme Name: MedXdoor
Description: Pharmacy e-commerce theme for MedXdoor.
Version: 1.0.0
Text Domain: medxdoor
*/

/* ===========================================================================
   DESIGN TOKENS

   Two layers. The scale layer holds the raw ramps and is the only place a
   literal colour appears. The semantic layer names a role, and components
   only ever reference semantic tokens, so dark mode is a remap of this one
   block rather than an override scattered through the stylesheet.

   Brand colours are taken from the MedXdoor mark: deep clinical navy for
   authority, a single prescription green for action.
   =========================================================================== */

:root {
    /* --- scale: navy ------------------------------------------------- */
    --navy-50: #eef3fb;
    --navy-100: #d6e2f5;
    --navy-200: #adc3e8;
    --navy-300: #7b9bd6;
    --navy-400: #4a6fbd;
    --navy-500: #284e9e;
    --navy-600: #1a3b82;
    --navy-700: #122d68;
    --navy-800: #0d2150;
    --navy-900: #09183b;

    /* --- scale: green ------------------------------------------------- */
    --green-50: #f1f9ea;
    --green-100: #dcf0cb;
    --green-200: #bbe29c;
    --green-300: #95ce68;
    --green-400: #72b73e;
    --green-500: #589c26;
    --green-600: #447c1c;
    --green-700: #366218;
    --green-800: #2b4d16;
    --green-900: #1d3410;

    /* --- scale: neutral ----------------------------------------------- */
    --grey-0: #ffffff;
    --grey-25: #fbfcfb;
    --grey-50: #f5f7f6;
    --grey-100: #eceff0;
    --grey-200: #dde2e4;
    --grey-300: #c2cacd;
    --grey-400: #95a1a6;
    --grey-500: #6b787e;
    --grey-600: #4e5a60;
    --grey-700: #3a4449;
    --grey-800: #252c30;
    --grey-900: #141a1d;

    /* --- scale: status ------------------------------------------------ */
    --red-50: #fdeceC;
    --red-500: #b02a2a;
    --red-700: #6d1616;
    --amber-50: #fff7e8;
    --amber-600: #8c4a00;
    --sky-50: #eef4ff;
    --sky-700: #13315c;

    /* --- semantic: surfaces ------------------------------------------- */
    --surface: var(--grey-50);
    --surface-raised: var(--grey-0);
    --surface-sunken: var(--grey-100);
    --surface-brand: var(--navy-800);
    --surface-accent: var(--green-50);

    /* --- semantic: text ----------------------------------------------- */
    --text: var(--grey-900);
    --text-muted: var(--grey-600);
    --text-subtle: var(--grey-500);
    --text-on-brand: var(--grey-0);
    --text-brand: var(--navy-700);

    /* --- semantic: lines ---------------------------------------------- */
    --border: var(--grey-200);
    --border-strong: var(--grey-300);
    --border-brand: var(--navy-200);

    /* --- semantic: interactive ---------------------------------------- */
    --action: var(--green-600);
    --action-hover: var(--green-700);
    --action-text: var(--grey-0);
    --action-soft: var(--green-50);
    --link: var(--navy-600);
    --focus: var(--navy-500);

    /* --- semantic: status --------------------------------------------- */
    --info-bg: var(--sky-50);
    --info-tx: var(--sky-700);
    --error-bg: var(--red-50);
    --error-tx: var(--red-700);
    --error-bd: var(--red-500);
    --warn-tx: var(--amber-600);
    --rx-bg: var(--red-50);
    --rx-tx: var(--red-700);
    --ok-tx: var(--green-700);
    --warn-bg: var(--amber-50);

    /* --- semantic: accent chip ----------------------------------------
       The small green pills: category tags, the cart button, category
       icons. Named so dark mode can flip both halves together.         */
    --chip-bg: var(--green-50);
    --chip-tx: var(--green-800);
    --chip-bg-hover: var(--green-100);
    --chip-tx-hover: var(--green-900);
    --chip-icon: var(--green-700);

    /* --- semantic: hard badge ------------------------------------------ */
    --badge-bg: var(--grey-700);
    --badge-tx: var(--grey-0);

    /* --- legacy aliases ------------------------------------------------
       Earlier rules in this file reference these names. Mapping them onto
       the new system keeps one source of truth while the older rules live
       on, rather than forcing a risky find-and-replace across the file.  */
    --navy: var(--text-brand);
    --blue: var(--link);
    --green: var(--action);
    /* Was var(--green-50), a raw scale value that never changed in dark mode,
       which left the hero gradient washing from pale cream into near-black. */
    --gbg: var(--surface-accent);
    --bg: var(--surface);
    --card: var(--surface-raised);
    --tx: var(--text);
    --mut: var(--text-muted);
    --bd: var(--border);

    /* --- type --------------------------------------------------------- */
    --font-display: "Plus Jakarta Sans", "Segoe UI", system-ui, sans-serif;
    --font-body: Inter, "Segoe UI", system-ui, -apple-system, sans-serif;

    /* Fluid scale, 1.2 ratio at small widths opening to 1.25 at large. */
    --text-xs: 0.78rem;
    --text-sm: 0.875rem;
    --text-base: 1rem;
    --text-lg: clamp(1.06rem, 1.01rem + 0.22vw, 1.19rem);
    --text-xl: clamp(1.22rem, 1.13rem + 0.42vw, 1.5rem);
    --text-2xl: clamp(1.45rem, 1.28rem + 0.8vw, 2rem);
    --text-3xl: clamp(1.75rem, 1.43rem + 1.5vw, 2.75rem);
    --text-4xl: clamp(2.1rem, 1.55rem + 2.6vw, 3.6rem);

    --leading-tight: 1.12;
    --leading-snug: 1.3;
    --leading-normal: 1.6;
    --leading-relaxed: 1.75;

    --tracking-tight: -0.022em;
    --tracking-normal: 0;
    --tracking-wide: 0.08em;

    /* --- space -------------------------------------------------------- */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 24px;
    --space-6: 32px;
    --space-7: 40px;
    --space-8: 56px;
    --space-9: 72px;
    --space-10: 96px;
    --section-y: clamp(48px, 7vw, 96px);
    --gutter: clamp(16px, 4vw, 32px);
    --measure: 68ch;

    /* --- shape -------------------------------------------------------- */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-pill: 999px;

    /* Shadows stay shallow and neutral; depth comes from borders. */
    --shadow-sm: 0 1px 2px rgba(9, 24, 59, 0.06);
    --shadow-md: 0 2px 8px rgba(9, 24, 59, 0.07);
    --shadow-lg: 0 10px 30px rgba(9, 24, 59, 0.09);

    --transition: 160ms cubic-bezier(0.2, 0, 0.2, 1);

    color-scheme: light;
    box-sizing: border-box;
    scroll-padding-top: 96px;
}

/* Dark mode remaps the semantic layer only.
 *
 * CURRENTLY INACTIVE. The theme renders light for every visitor:
 * medxdoor_theme_force_light_scheme() in functions.php puts
 * data-theme="light" on <html>, which this block is gated against. Both
 * palettes are kept and audited, so re-enabling automatic dark mode is a
 * matter of removing that one filter. */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --surface: #0f1417;
        --surface-raised: #171e22;
        --surface-sunken: #11181b;
        --surface-brand: #0b1220;
        --surface-accent: #16271a;

        --text: #e7ecea;
        --text-muted: #a7b3b2;
        --text-subtle: #8a9897;
        --text-brand: #a9c4f5;

        --border: #2a3338;
        --border-strong: #3a464c;
        --border-brand: #27406b;

        --action: var(--green-400);
        --action-hover: var(--green-300);
        --action-text: #0b1410;
        --action-soft: #16271a;
        --link: #93b4f0;
        --focus: #7b9bd6;

        --info-bg: #15233a;
        --info-tx: #cfe0ff;
        --error-bg: #33191b;
        --error-tx: #ffcfcf;
        --error-bd: #e06464;
        --warn-tx: #f0bb77;
        --rx-bg: #3a1d1d;
        --rx-tx: #ffc9c9;
        --ok-tx: var(--green-300);
    --warn-bg: #2e2415;

    --chip-bg: #1b2f20;
    --chip-tx: #b9e59a;
    --chip-bg-hover: #26422c;
    --chip-tx-hover: #d6f3c2;
    --chip-icon: #8fd45f;

    --badge-bg: #e7ecea;
    --badge-tx: #141a1d;
        --warn-bg: #2e2415;

        --chip-bg: #1b2f20;
        --chip-tx: #b9e59a;
        --chip-bg-hover: #26422c;
        --chip-tx-hover: #d6f3c2;
        --chip-icon: #8fd45f;

        --badge-bg: #e7ecea;
        --badge-tx: #141a1d;


        --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
        --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.45);
        --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.5);

        color-scheme: dark;
    }
}

:root[data-theme="dark"] {
    --surface: #0f1417;
    --surface-raised: #171e22;
    --surface-sunken: #11181b;
    --surface-brand: #0b1220;
    --surface-accent: #16271a;

    --text: #e7ecea;
    --text-muted: #a7b3b2;
    --text-subtle: #8a9897;
    --text-brand: #a9c4f5;

    --border: #2a3338;
    --border-strong: #3a464c;
    --border-brand: #27406b;

    --action: var(--green-400);
    --action-hover: var(--green-300);
    --action-text: #0b1410;
    --action-soft: #16271a;
    --link: #93b4f0;
    --focus: #7b9bd6;

    --info-bg: #15233a;
    --info-tx: #cfe0ff;
    --error-bg: #33191b;
    --error-tx: #ffcfcf;
    --error-bd: #e06464;
    --warn-tx: #f0bb77;
    --rx-bg: #3a1d1d;
    --rx-tx: #ffc9c9;
    --ok-tx: var(--green-300);


    color-scheme: dark;
}

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

/* ===========================================================================
   TYPOGRAPHY

   Two families, each doing one job. Plus Jakarta Sans sets headings and
   anything that has to carry authority; Inter handles body copy, forms and
   product data, where it stays legible at 13-14px.
   =========================================================================== */

body {
    margin: 0;
    background: var(--surface);
    color: var(--text);
    font-family: var(--font-body);
    font-size: var(--text-base);
    line-height: var(--leading-normal);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

a {
    color: inherit;
    text-decoration: none;
}

p a:not(.btn),
.entry-content a:not(.btn) {
    color: var(--link);
    text-decoration: underline;
    text-underline-offset: 0.18em;
    text-decoration-thickness: 1px;
}

p a:not(.btn):hover,
.entry-content a:not(.btn):hover {
    text-decoration-thickness: 2px;
}

h1, h2, h3, h4, h5, h6 {
    margin: 0 0 0.5em;
    color: var(--text-brand);
    font-family: var(--font-display);
    font-weight: 700;
    line-height: var(--leading-tight);
    letter-spacing: var(--tracking-tight);
    text-wrap: balance;
}

h1 {
    font-size: var(--text-4xl);
    font-weight: 800;
}

h2 {
    font-size: var(--text-3xl);
}

h3 {
    font-size: var(--text-xl);
    line-height: var(--leading-snug);
}

h4 {
    font-size: var(--text-lg);
    line-height: var(--leading-snug);
}

h5, h6 {
    font-size: var(--text-base);
    letter-spacing: var(--tracking-normal);
}

p {
    text-wrap: pretty;
}

/* Long-form copy gets a comfortable measure and more air between elements. */
.entry-content {
    font-size: var(--text-lg);
    line-height: var(--leading-relaxed);
}

.entry-content > * {
    max-width: var(--measure);
}

.entry-content > * + * {
    margin-top: 1.1em;
}

.entry-content h2 {
    margin-top: 1.9em;
    font-size: var(--text-2xl);
}

.entry-content h3 {
    margin-top: 1.5em;
}

.entry-content ul,
.entry-content ol {
    padding-left: 1.3em;
}

.entry-content li + li {
    margin-top: 0.4em;
}

.entry-content strong {
    color: var(--text);
    font-weight: 600;
}

/* Numeric data lines up in tables and price columns. */
.price,
td,
.medxdoor-cart-totals dd {
    font-variant-numeric: tabular-nums;
}

:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
    outline: 3px solid var(--focus);
    outline-offset: 2px;
    border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

.w {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--gutter);
}

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 100;
    padding: 12px 18px;
    border-radius: 0 0 var(--radius-md) 0;
    background: var(--surface-brand);
    color: var(--text-on-brand);
    font-weight: 600;
}

.skip-link:focus {
    left: 0;
}

/* ===========================================================================
   HEADER

   Three zones on one row: brand, search, actions. The primary navigation sits
   on its own row beneath, so the search field keeps real width instead of
   competing with seven links.
   =========================================================================== */

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    border-bottom: 1px solid var(--border);
    background: var(--surface-raised);
}

.header-bar {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: var(--space-5);
    min-height: 76px;
    padding-top: var(--space-3);
    padding-bottom: var(--space-3);
}

.brand {
    display: inline-flex;
    align-items: center;
}

.brand img {
    display: block;
    width: auto;
    height: 42px;
}

/* --- search --------------------------------------------------------- */

.header-search {
    position: relative;
    display: flex;
    align-items: center;
    width: 40%;
    max-width: 480px;
    justify-self: center;
    border: 1.5px solid var(--border-strong);
    border-radius: var(--radius-pill);
    background: var(--surface);
    transition: border-color var(--transition), box-shadow var(--transition);
}

.header-search:focus-within {
    border-color: var(--action);
    box-shadow: 0 0 0 4px var(--action-soft);
}

.header-search-icon {
    position: absolute;
    left: 16px;
    color: var(--text-subtle);
    pointer-events: none;
}

.header-search input[type="search"] {
    flex: 1 1 auto;
    min-width: 0;
    padding: 11px 8px 11px 44px;
    border: 0;
    border-radius: var(--radius-pill);
    background: transparent;
    color: var(--text);
    font: inherit;
    font-size: var(--text-sm);
}

.header-search input[type="search"]:focus {
    outline: none;
}

.header-search-submit {
    flex: 0 0 auto;
    margin: 3px;
    padding: 8px 20px;
    border: 0;
    border-radius: var(--radius-pill);
    background: var(--action);
    color: var(--action-text);
    font: inherit;
    font-size: var(--text-sm);
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition);
}

.header-search-submit:hover {
    background: var(--action-hover);
}

/* --- actions -------------------------------------------------------- */

.header-actions {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.header-action {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 14px;
    border-radius: var(--radius-md);
    color: var(--text);
    font-size: var(--text-sm);
    font-weight: 600;
    white-space: nowrap;
    transition: color var(--transition);
}

.header-action:hover {
    background: transparent;
    color: var(--text-brand);
}

.header-cart {
    position: relative;
    padding: 9px 6px;
    background: transparent;
    color: var(--chip-tx);
}

.header-cart:hover {
    background: transparent;
    color: var(--chip-tx-hover);
}

.header-cart-count {
    position: absolute;
    top: -4px;
    right: -5px;
    display: inline-grid;
    place-items: center;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    border-radius: var(--radius-pill);
    background: var(--action);
    color: var(--action-text);
    font-size: 0.68rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.header-menu-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 1.5px solid var(--border-strong);
    border-radius: var(--radius-md);
    background: var(--surface-raised);
    color: var(--text);
    cursor: pointer;
}

/* --- primary navigation --------------------------------------------- */

.main-nav {
    border-top: 1px solid var(--border);
    background: var(--surface-raised);
}

.main-nav-list,
.footer-nav {
    display: flex;
    margin: 0;
    padding: 0;
    list-style: none;
}

.main-nav-list {
    flex-wrap: wrap;
    gap: 2px;
}

.main-nav-list > li {
    position: relative;
}

.main-nav-list a {
    display: block;
    padding: 13px 14px;
    border-bottom: 2px solid transparent;
    color: var(--text-muted);
    font-size: var(--text-sm);
    font-weight: 600;
    white-space: nowrap;
    transition: color var(--transition), border-color var(--transition);
}

.main-nav-list a:hover,
.main-nav-list a:focus-visible {
    color: var(--text-brand);
    border-bottom-color: var(--action);
}

.main-nav-list .current-menu-item > a,
.main-nav-list .current_page_item > a,
.main-nav-list [aria-current="page"] {
    color: var(--text-brand);
    border-bottom-color: var(--action);
}

.main-nav-list .sub-menu {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 20;
    display: none;
    min-width: 220px;
    margin: 0;
    padding: 6px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface-raised);
    box-shadow: var(--shadow-lg);
    list-style: none;
}

.main-nav-list .sub-menu a {
    padding: 9px 12px;
    border-bottom: 0;
    border-radius: var(--radius-sm);
}

.main-nav-list .sub-menu a:hover {
    background: var(--surface-sunken);
}

.main-nav-list .menu-item-has-children:hover > .sub-menu,
.main-nav-list .menu-item-has-children:focus-within > .sub-menu {
    display: block;
}

@media (max-width: 1080px) {
    .header-bar {
        grid-template-columns: auto 1fr auto;
        gap: var(--space-3);
    }

    .header-menu-toggle {
        display: inline-flex;
    }

    

    .header-action {
        padding: 9px 10px;
    }

    .header-search {
        order: 3;
        grid-column: 1 / -1;
        width: 100%;
        max-width: none;
    }

    .main-nav {
        display: none;
    }

    .main-nav.open {
        display: block;
    }

    .main-nav-list {
        flex-direction: column;
        gap: 0;
        padding: var(--space-2) 0;
    }

    .main-nav-list a {
        padding: 13px 4px;
        border-bottom: 1px solid var(--border);
        font-size: var(--text-base);
    }

    .main-nav-list .sub-menu {
        position: static;
        display: block;
        box-shadow: none;
        border: 0;
        padding-left: var(--space-4);
    }
}

@media (max-width: 560px) {
    .brand img {
        height: 34px;
    }

    .header-search-submit {
        padding: 8px 14px;
    }
}

/* ---------------------------------------------------------------- buttons */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 22px;
    border: 1.5px solid transparent;
    border-radius: var(--radius-md);
    background: var(--action);
    color: var(--action-text);
    font-family: var(--font-body);
    font-size: var(--text-base);
    font-weight: 600;
    line-height: 1.2;
    text-align: center;
    cursor: pointer;
    transition: background var(--transition), border-color var(--transition), color var(--transition);
}

.btn:hover {
    background: var(--action-hover);
}

/* Secondary: outlined, for the lower-priority choice beside a primary action. */
.btn.alt {
    border-color: var(--border-strong);
    background: var(--surface-raised);
    color: var(--text-brand);
}

.btn.alt:hover {
    border-color: var(--text-brand);
    background: var(--surface-sunken);
}

/* Tertiary: text-only, for a third option that should not compete. */
.btn.ghost {
    padding-left: 6px;
    padding-right: 6px;
    border-color: transparent;
    background: transparent;
    color: var(--link);
    text-decoration: underline;
    text-underline-offset: 0.2em;
}

.btn.ghost:hover {
    background: transparent;
    color: var(--text-brand);
}

.btn.small {
    padding: 8px 14px;
    font-size: var(--text-sm);
}

.btn.block {
    width: 100%;
}

.hero {
    border-bottom: 1px solid var(--bd);
    background: linear-gradient(120deg, var(--gbg), var(--card));
}

.hero .w {
    display: grid;
    grid-template-columns: 1.1fr .9fr;
    align-items: center;
    gap: 30px;
    padding-top: 56px;
    padding-bottom: 56px;
}

.hero p {
    max-width: 50ch;
    color: var(--mut);
    font-size: 1.15rem;
}

.hero .acts {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 22px;
}

.hero-art {
    display: block;
    width: 100%;
    height: auto;
    max-height: 340px;
}

.hero-image {
    display: block;
    width: 100%;
    height: auto;
    max-height: 340px;
    border-radius: 14px;
    aspect-ratio: 4 / 3;
    object-fit: cover;
}

.hero-slide[hidden] {
    display: none;
}

.hero-controls {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 10px;
}

.hero-controls button {
    width: 38px;
    height: 38px;
    border: 1px solid var(--bd);
    border-radius: 50%;
    background: var(--card);
    color: var(--navy);
    cursor: pointer;
}

.hero-dots {
    display: flex;
    align-items: center;
    gap: 7px;
}

.hero-dots button {
    width: 10px;
    height: 10px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: var(--bd);
}

.hero-dots button[aria-current="true"] {
    background: var(--green);
}

.notice {
    margin: 20px auto 0;
    padding: 12px 16px;
    border-left: 4px solid var(--green);
    border-radius: 8px;
    background: var(--gbg);
}

section {
    padding: 34px 0;
}

.feat {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    margin: 28px 0;
    border: 1px solid var(--bd);
    border-radius: 10px;
    background: var(--card);
}

.feat-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 20px;
    border-left: 1px solid var(--bd);
}

.feat-item:first-child {
    border: 0;
}

.feat-item svg {
    width: 40px;
    height: 40px;
    flex: none;
    fill: none;
    stroke: var(--green);
    stroke-width: 1.6;
}

.feat-item b,
.feat-item span {
    display: block;
}

.feat-item span {
    color: var(--mut);
    font-size: .93rem;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 18px;
}

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

.card-image {
    display: grid;
    min-height: 190px;
    place-items: center;
    overflow: hidden;
    background: var(--gbg);
}

.card-image img,
.card-image svg {
    display: block;
    width: 100%;
    height: 190px;
    object-fit: cover;
}

.card-image svg {
    width: 100px;
    height: 100px;
}

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

.cat {
    color: var(--mut);
    font-size: .82rem;
}

.price {
    color: var(--navy);
    font-size: 1.1rem;
    font-weight: 800;
}

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

.chip {
    padding: 7px 16px;
    border: 1.5px solid var(--bd);
    border-radius: 99px;
    background: var(--card);
    color: var(--tx);
    cursor: pointer;
    font-family: var(--font-body);
    font-size: var(--text-sm);
    font-weight: 500;
}

.chip.on {
    border-color: var(--action);
    background: var(--action);
    color: var(--action-text);
}

.rx {
    align-self: flex-start;
    padding: 2px 8px;
    border-radius: 6px;
    background: #fde8e8;
    color: #9b1c1c;
    font-size: .78rem;
}

.tile {
    display: block;
    padding: 22px;
    border: 1px solid var(--bd);
    border-radius: 12px;
    background: var(--card);
    color: var(--tx);
    text-align: left;
}

.tile:hover {
    border-color: var(--green);
}

.tile img {
    display: block;
    width: 100%;
    height: 140px;
    margin-bottom: 12px;
    border-radius: 8px;
    object-fit: cover;
}

.empty-state {
    padding: 18px;
    border: 1px dashed var(--bd);
    border-radius: 10px;
    color: var(--mut);
}

[hidden] {
    display: none !important;
}

.two {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: start;
    gap: 34px;
}

.panel {
    padding: 24px;
    border: 1px solid var(--bd);
    border-radius: 12px;
    background: var(--card);
}

.prose {
    max-width: 72ch;
}

.prose p,
.prose li {
    color: var(--mut);
}

/* ===========================================================================
   STANDING PAGES (about, contact, policies)
   =========================================================================== */

.page-main {
    padding: var(--space-7) 0 var(--section-y);
}

.page-content {
    max-width: 860px;
    padding: clamp(24px, 5vw, 64px);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    background: var(--surface-raised);
}

.page-header {
    margin-bottom: var(--space-6);
    padding-bottom: var(--space-5);
    border-bottom: 1px solid var(--border);
}

.page-header h1 {
    margin: 0;
    font-size: var(--text-3xl);
}

/* Opening paragraph, set larger to lead into the page. */
.entry-content .lede {
    margin-bottom: var(--space-6);
    color: var(--text-muted);
    font-size: var(--text-xl);
    line-height: var(--leading-snug);
}

/* Editorial note flagging something the business still has to confirm. */
.entry-content .page-note {
    max-width: none;
    margin: var(--space-6) 0;
    padding: var(--space-4) var(--space-5);
    border-left: 4px solid var(--warn-tx);
    border-radius: var(--radius-sm);
    background: var(--warn-bg);
    color: var(--text);
    font-size: var(--text-sm);
    line-height: var(--leading-normal);
}

.entry-content .page-note strong {
    color: var(--warn-tx);
}

/* --- FAQ accordion ---------------------------------------------------
   Built on <details>/<summary>, which is keyboard operable and announced
   correctly by screen readers without any JavaScript. */

.entry-content details.faq {
    max-width: none;
    margin: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface-raised);
    transition: border-color var(--transition);
}

.entry-content details.faq + details.faq {
    margin-top: 10px;
}

.entry-content details.faq[open] {
    border-color: var(--border-strong);
}

.entry-content details.faq > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    padding: var(--space-4) var(--space-5);
    color: var(--text-brand);
    font-family: var(--font-display);
    font-size: var(--text-base);
    font-weight: 700;
    line-height: var(--leading-snug);
    cursor: pointer;
    list-style: none;
}

.entry-content details.faq > summary::-webkit-details-marker {
    display: none;
}

/* Chevron drawn in CSS so there is no icon font or image to load. */
.entry-content details.faq > summary::after {
    content: "";
    flex: 0 0 auto;
    width: 9px;
    height: 9px;
    margin-right: 4px;
    border-right: 2px solid var(--text-subtle);
    border-bottom: 2px solid var(--text-subtle);
    transform: rotate(45deg) translate(-2px, -2px);
    transition: transform var(--transition);
}

.entry-content details.faq[open] > summary::after {
    transform: rotate(-135deg) translate(-2px, -2px);
}

.entry-content details.faq > summary:hover {
    background: var(--surface-sunken);
}

.entry-content details.faq > summary:hover::after {
    border-color: var(--text-brand);
}

.entry-content details.faq > *:not(summary) {
    max-width: none;
    margin: 0;
    padding: 0 var(--space-5) var(--space-5);
    color: var(--text-muted);
    font-size: var(--text-base);
    line-height: var(--leading-relaxed);
}

/* The h2 group labels between accordion blocks. */
.entry-content h2 + details.faq {
    margin-top: var(--space-4);
}

.page-featured-image {
    margin: 20px 0 28px;
}

.page-featured-image img,
.entry-content img {
    display: block;
    max-width: 100%;
    height: auto;
    border-radius: 12px;
}

.entry-content {
    min-width: 0;
    overflow-wrap: anywhere;
}

.entry-content table {
    display: block;
    max-width: 100%;
    overflow-x: auto;
}

.entry-content details {
    margin: 12px 0;
    padding: 14px 16px;
    border: 1px solid var(--bd);
    border-radius: 10px;
    background: var(--bg);
}

.entry-content summary {
    color: var(--navy);
    cursor: pointer;
    font-weight: 700;
}

.promotion-image,
.cta-image {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 10px;
}

/* ===========================================================================
   FOOTER
   =========================================================================== */

.site-footer {
    margin-top: var(--section-y);
    padding: var(--space-9) 0 var(--space-6);
    border-top: 1px solid var(--border);
    background: var(--surface-brand);
    color: #cdd7e4;
}

.footer-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) repeat(4, minmax(0, 1fr));
    gap: var(--space-7) var(--space-5);
}

.footer-brand .footer-logo {
    display: block;
    width: auto;
    max-width: 190px;
    height: auto;
    margin-bottom: var(--space-4);
}

.footer-description {
    max-width: 38ch;
    margin: 0 0 var(--space-4);
    color: #9fb0c4;
    font-size: var(--text-sm);
    line-height: var(--leading-normal);
}

.footer-heading {
    margin: 0 0 var(--space-4);
    color: #ffffff;
    font-family: var(--font-display);
    font-size: var(--text-sm);
    font-weight: 700;
    letter-spacing: var(--tracking-wide);
    text-transform: uppercase;
}

.footer-nav {
    flex-direction: column;
    gap: 0;
}

.footer-nav li + li {
    margin-top: 10px;
}

/* The global `p a:not(.btn)` link colour is navy, which is unreadable on the
   navy footer. These selectors are specific enough to win it back. */
.footer-nav a,
.site-footer p a:not(.btn),
.footer-contact-details a {
    color: #cdd7e4;
    font-size: var(--text-sm);
    text-decoration: none;
    transition: color var(--transition);
}

.footer-nav a:hover,
.footer-nav a:focus-visible,
.site-footer p a:not(.btn):hover,
.footer-contact-details a:hover {
    color: #ffffff;
    text-decoration: underline;
    text-underline-offset: 0.2em;
}

.footer-nav .sub-menu {
    margin: 10px 0 0;
    padding-left: var(--space-4);
    list-style: none;
}

.footer-contact-details p {
    margin: 0 0 10px;
    color: #9fb0c4;
    font-size: var(--text-sm);
    line-height: var(--leading-normal);
}

.footer-social-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.footer-social-links a {
    display: inline-block;
    padding: 6px 12px;
    border: 1px solid #2c3d57;
    border-radius: var(--radius-pill);
    color: #cdd7e4;
    font-size: var(--text-xs);
    font-weight: 600;
    transition: border-color var(--transition), color var(--transition);
}

.footer-social-links a:hover {
    border-color: #6f87a8;
    color: #ffffff;
}

.footer-notice-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-4);
    margin-top: var(--space-5);
}

.footer-notice-row .footer-disclaimer {
    flex: 1 1 520px;
    margin: 0;
}

.footer-base {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-4);
    align-items: center;
    justify-content: center;
    margin-top: var(--space-8);
    padding-top: var(--space-5);
    border-top: 1px solid #22314a;
}

.footer-copyright {
    width: 100%;
    margin: 0;
    color: #9fb0c4;
    font-size: var(--text-sm);
    text-align: center;
}

/* Only methods the store actually accepts are listed here. */
.footer-payments {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 0 auto;
    padding: 0;
    list-style: none;
}

.footer-payments li {
    padding: 6px 12px;
    border: 1px solid #2c3d57;
    border-radius: var(--radius-sm);
    color: #cdd7e4;
    font-size: var(--text-xs);
    font-weight: 600;
}

.footer-disclaimer {
    max-width: 90ch;
    margin: 0;
    color: #7f90a6;
    font-size: var(--text-xs);
    line-height: var(--leading-normal);
}

@media (max-width: 560px) {
    .footer-notice-row {
        align-items: stretch;
        flex-direction: column;
    }

    .footer-payments {
        justify-content: flex-end;
        margin-left: auto;
    }
}

@media (max-width: 1000px) {
    .footer-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .footer-brand {
        grid-column: 1 / -1;
    }
}

@media (max-width: 560px) {
    .footer-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: var(--space-6);
    }

    .footer-base {
        flex-direction: column;
        align-items: flex-start;
    }
}

.medxdoor-contact-form-wrap {
    margin-top: 18px;
}

.medxdoor-contact-form {
    display: grid;
    gap: 12px;
}

.medxdoor-contact-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.medxdoor-contact-form label {
    display: grid;
    gap: 5px;
    color: var(--tx);
    font-weight: 700;
}

.medxdoor-contact-form input,
.medxdoor-contact-form textarea {
    width: 100%;
    border: 1.5px solid var(--bd);
    border-radius: 8px;
    background: var(--card);
    color: var(--tx);
    font: inherit;
}

.medxdoor-contact-form input {
    min-height: 44px;
    padding: 8px 10px;
}

.medxdoor-contact-form textarea {
    min-height: 130px;
    padding: 10px;
    resize: vertical;
}

.medxdoor-contact-honeypot {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.medxdoor-contact-success,
.medxdoor-contact-error {
    margin-bottom: 12px;
    padding: 10px 12px;
    border-radius: 8px;
}

.medxdoor-contact-success {
    border: 1px solid #70a83a;
    background: var(--gbg);
    color: #2d5d12;
}

.medxdoor-contact-error {
    border: 1px solid #b42318;
    background: #fff1f0;
    color: #7a271a;
}

@media (max-width: 860px) {
    .hero .w,
    .two {
        grid-template-columns: 1fr;
    }

    .medxdoor-contact-fields {
        grid-template-columns: 1fr;
    }

    .feat {
        grid-template-columns: 1fr 1fr;
    }

    .feat-item:nth-child(3) {
        border-left: 0;
    }

    .feat-item:nth-child(n + 3) {
        border-top: 1px solid var(--bd);
    }

    .menu {
        display: block;
        margin-left: auto;
    }

    .main-nav {
        position: absolute;
        top: 68px;
        right: 0;
        left: 0;
        display: none;
        padding: 10px 20px;
        border-bottom: 1px solid var(--bd);
        background: var(--card);
    }

    .main-nav.open {
        display: block;
    }

    .main-nav-list {
        flex-direction: column;
        gap: 0;
    }

    .main-nav-list .sub-menu {
        position: static;
        min-width: 0;
        margin-left: 12px;
        border: 0;
        box-shadow: none;
    }

    .srch {
        display: none;
    }
}

@media (max-width: 520px) {
    .feat {
        grid-template-columns: 1fr;
    }

    .feat-item,
    .feat-item:nth-child(3) {
        border-top: 1px solid var(--bd);
        border-left: 0;
    }

    .feat-item:first-child {
        border-top: 0;
    }

    .page-content {
        padding: 22px;
    }
}

/* The hero headline previously faded in with animation-fill-mode: both. If the
   animation timeline never advanced the heading stayed at opacity 0, leaving
   the page's main message invisible. Content is not gated behind motion. */

.medxdoor-cart {
    border: 1px solid var(--bd);
    border-radius: 14px;
    background: var(--card);
    padding: clamp(20px, 5vw, 36px);
}

.medxdoor-cart-table {
    width: 100%;
    overflow-x: auto;
}

.medxdoor-cart-table table {
    width: 100%;
    border-collapse: collapse;
}

.medxdoor-cart-table th,
.medxdoor-cart-table td {
    padding: 12px 8px;
    border-bottom: 1px solid var(--bd);
    text-align: left;
}

.medxdoor-cart-row-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.medxdoor-cart-row-actions button {
    width: 32px;
    height: 32px;
    border: 1.5px solid var(--bd);
    border-radius: 8px;
    background: var(--card);
    color: var(--tx);
    cursor: pointer;
}

.medxdoor-cart-subtotal {
    text-align: right;
    font-size: 1.15rem;
}

.medxdoor-cart-note {
    color: var(--mut);
}

.blog-main {
    padding-top: 40px;
    padding-bottom: 56px;
}

.blog-heading {
    margin-bottom: 34px;
    padding: clamp(22px, 5vw, 44px);
    border: 1px solid var(--bd);
    border-radius: 14px;
    background: var(--card);
}

.blog-heading h1 {
    margin-bottom: 10px;
    font-size: clamp(2rem, 5vw, 3rem);
}

.blog-heading > p:not(.medxdoor-eyebrow) {
    color: var(--mut);
}

.medxdoor-eyebrow {
    margin: 0 0 8px;
    color: var(--green);
    font-size: .78rem;
    font-weight: 800;
    letter-spacing: .08em;
}

.blog-search {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
}

.blog-search label {
    width: 100%;
    color: var(--navy);
    font-weight: 700;
}

.blog-search input[type="search"] {
    flex: 1 1 240px;
    min-width: 0;
    padding: 11px 13px;
    border: 1px solid var(--bd);
    border-radius: 9px;
    background: var(--bg);
    color: var(--tx);
    font: inherit;
}

.blog-search .btn {
    border: 0;
}

.blog-featured,
.blog-articles,
.blog-related {
    margin-top: 34px;
}

.blog-featured > h2,
.blog-articles > h2,
.blog-related > h2 {
    margin-bottom: 18px;
    font-size: clamp(1.45rem, 3vw, 1.9rem);
}

.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 270px), 1fr));
    align-items: stretch;
    gap: 20px;
}

.blog-featured-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
}

.blog-card {
    overflow: hidden;
    border: 1px solid var(--bd);
    border-radius: 14px;
    background: var(--card);
}

.blog-card-image {
    display: block;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    background: var(--gbg);
}

.blog-card-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.blog-card-body {
    padding: 18px;
}

.blog-card-categories,
.article-tags,
.article-share,
.blog-category-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 0 0 12px;
    padding: 0;
    list-style: none;
}

.blog-card-categories a,
.article-tags a,
.blog-category-nav a {
    display: inline-block;
    padding: 4px 9px;
    border: 1px solid var(--bd);
    border-radius: 999px;
    background: var(--gbg);
    color: var(--navy);
    font-size: .85rem;
    font-weight: 700;
}

.blog-card-title {
    margin-bottom: 10px;
    font-size: 1.3rem;
}

.blog-card-title a:hover,
.blog-read-more:hover {
    color: var(--blue);
}

.blog-card-meta,
.article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    margin: 0 0 12px;
    color: var(--mut);
    font-size: .9rem;
}

.blog-card-excerpt,
.blog-archive-description {
    color: var(--mut);
}

.blog-card-excerpt p:last-child {
    margin-bottom: 0;
}

.blog-read-more {
    display: inline-block;
    margin-top: 12px;
    color: var(--navy);
    font-weight: 700;
}

.blog-category-nav {
    margin: 0 0 22px;
}

.blog-pagination .page-numbers,
.nav-links .page-numbers {
    display: inline-block;
    margin: 4px;
    padding: 8px 12px;
    border: 1px solid var(--bd);
    border-radius: 8px;
    background: var(--card);
}

.blog-pagination .current,
.nav-links .current {
    border-color: var(--action);
    background: var(--action);
    color: var(--action-text);
    font-weight: 700;
}

.article-main {
    max-width: 920px;
}

.article-content {
    overflow: hidden;
    padding: clamp(22px, 5vw, 56px);
    border: 1px solid var(--bd);
    border-radius: 14px;
    background: var(--card);
}

.article-header h1 {
    margin: 8px 0 14px;
    font-size: clamp(2rem, 5vw, 3.2rem);
}

.article-meta a {
    color: var(--navy);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.article-featured-image {
    margin: 0 0 28px;
    aspect-ratio: 16 / 9;
    background: var(--gbg);
}

.article-featured-image img {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 12px;
    object-fit: cover;
}

.article-body {
    font-size: 1.05rem;
}

.article-body h2,
.article-body h3 {
    margin-top: 1.5em;
}

.article-body blockquote {
    margin: 1.5em 0;
    padding: 12px 20px;
    border-left: 4px solid var(--green);
    background: var(--gbg);
    color: var(--mut);
}

.article-tags,
.article-share {
    margin-top: 26px;
}

.article-share a {
    color: var(--navy);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.product-specifications {
    margin-top: 26px;
}

.product-specifications dl {
    display: grid;
    grid-template-columns: minmax(120px, 0.35fr) minmax(0, 1fr);
    margin: 0;
    border: 1px solid var(--bd);
    border-radius: 10px;
    overflow: hidden;
}

.product-specifications dt,
.product-specifications dd {
    margin: 0;
    padding: 10px 12px;
    border-bottom: 1px solid var(--bd);
}

.product-specifications dt {
    background: var(--gbg);
    color: var(--navy);
    font-weight: 700;
}

.product-specifications dt:nth-last-child(2),
.product-specifications dd:last-child {
    border-bottom: 0;
}

.product-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-top: 26px;
}

.product-gallery img {
    display: block;
    width: 100%;
    height: auto;
    border: 1px solid var(--bd);
    border-radius: 10px;
}

@media (max-width: 520px) {
    .blog-main {
        padding-top: 22px;
    }

    .blog-heading,
    .article-content {
        padding: 20px;
    }

    .blog-search .btn {
        width: 100%;
    }
}

/* Visually hidden but available to assistive technology. */
.screen-reader-text {
    position: absolute !important;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    border: 0;
    white-space: nowrap;
}

/* ---------------------------------------------------------------- commerce */

.medxdoor-cart-loading {
    color: var(--mut);
    margin: 0;
}

.medxdoor-cart-notices {
    margin: 0 0 20px;
    padding: 14px 18px 14px 34px;
    border-left: 4px solid var(--blue);
    border-radius: 8px;
    background: var(--info-bg);
    color: var(--info-tx);
}

.medxdoor-cart-notices li + li {
    margin-top: 6px;
}

.medxdoor-cart-totals {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 6px 20px;
    margin: 20px 0 0;
    padding-top: 16px;
    border-top: 1px solid var(--bd);
}

.medxdoor-cart-totals dt {
    color: var(--mut);
}

.medxdoor-cart-totals dd {
    margin: 0;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.medxdoor-cart-totals dt.is-total,
.medxdoor-cart-totals dd.is-total {
    padding-top: 10px;
    border-top: 1px solid var(--bd);
    color: var(--tx);
    font-size: 1.2rem;
    font-weight: 800;
}

.medxdoor-cart-actions {
    margin: 24px 0 0;
    text-align: right;
}

.medxdoor-cart-minimum {
    margin: 16px 0 0;
    color: var(--warn-tx);
    font-weight: 600;
}

.medxdoor-rx-flag {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 999px;
    background: var(--rx-bg);
    color: var(--rx-tx);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    vertical-align: middle;
}

.btn.is-disabled,
.btn[disabled] {
    opacity: 0.55;
    cursor: not-allowed;
}

.medxdoor-product-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 22px 0 0;
}

/* Checkout */

.medxdoor-checkout-columns {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr);
    gap: 28px;
    align-items: start;
}

@media (max-width: 900px) {
    .medxdoor-checkout-columns {
        grid-template-columns: minmax(0, 1fr);
    }
}

.medxdoor-checkout-form fieldset {
    margin: 0 0 24px;
    padding: clamp(18px, 4vw, 28px);
    border: 1px solid var(--bd);
    border-radius: 14px;
    background: var(--card);
}

.medxdoor-checkout-form legend {
    padding: 0 8px;
    color: var(--navy);
    font-size: 1.05rem;
    font-weight: 800;
}

.medxdoor-field {
    margin: 0 0 18px;
}

.medxdoor-field > label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
}

.medxdoor-field .req {
    color: var(--error-bd);
}

.medxdoor-field input[type="text"],
.medxdoor-field input[type="tel"],
.medxdoor-field input[type="email"],
.medxdoor-field input[type="file"],
.medxdoor-field textarea {
    width: 100%;
    padding: 11px 13px;
    border: 1.5px solid var(--bd);
    border-radius: 10px;
    background: var(--card);
    color: var(--tx);
    font: inherit;
}

.medxdoor-field input:focus-visible,
.medxdoor-field textarea:focus-visible {
    outline: 3px solid var(--blue);
    outline-offset: 1px;
}

.medxdoor-field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 18px;
}

@media (max-width: 560px) {
    .medxdoor-field-row {
        grid-template-columns: 1fr;
    }
}

.medxdoor-hint {
    display: block;
    margin-top: 5px;
    color: var(--mut);
    font-size: 0.88rem;
    line-height: 1.45;
}

.medxdoor-payment-option > label {
    display: block;
    padding: 14px 16px;
    border: 1.5px solid var(--bd);
    border-radius: 12px;
    cursor: pointer;
}

.medxdoor-payment-option > label:hover,
.medxdoor-payment-option > label:focus-within {
    border-color: var(--green);
    background: var(--gbg);
}

.medxdoor-payment-option input {
    margin-right: 8px;
}

.medxdoor-bank-details {
    margin-top: 18px;
    padding: 16px 18px;
    border-radius: 12px;
    background: var(--bg);
    color: var(--tx);
}

.medxdoor-bank-details h2 {
    margin: 0 0 8px;
    font-size: 1rem;
}

.medxdoor-checkout-summary {
    position: sticky;
    top: 92px;
    padding: clamp(18px, 4vw, 26px);
    border: 1px solid var(--bd);
    border-radius: 14px;
    background: var(--card);
}

.medxdoor-checkout-summary h2 {
    margin: 0 0 16px;
    font-size: 1.1rem;
}

.medxdoor-checkout-summary .btn {
    width: 100%;
    margin-top: 20px;
    text-align: center;
}

.medxdoor-checkout-summary .medxdoor-cart-table th,
.medxdoor-checkout-summary .medxdoor-cart-table td {
    padding: 9px 4px;
    font-size: 0.92rem;
}

.medxdoor-checkout-errors {
    margin: 0 0 26px;
    padding: 16px 20px;
    border-left: 4px solid var(--error-bd);
    border-radius: 8px;
    background: var(--error-bg);
    color: var(--error-tx);
}

.medxdoor-checkout-errors ul {
    margin: 8px 0 0 18px;
    list-style: disc;
}

.medxdoor-checkout-errors li + li {
    margin-top: 4px;
}

/* Honeypot: off-screen rather than display:none, which some bots detect. */
.medxdoor-hp {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.medxdoor-order-meta {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 6px 18px;
    margin: 0 0 24px;
}

.medxdoor-order-meta dt {
    color: var(--mut);
    font-weight: 600;
}

.medxdoor-order-meta dd {
    margin: 0;
}

.medxdoor-order-address {
    line-height: 1.7;
}

/* ===========================================================================
   SECTIONS, CATEGORY CARDS AND PRODUCT CARDS

   One product card component is used by Explore, the homepage shelves and the
   product archive, so a card never looks different depending on where it is.
   =========================================================================== */

.section-main {
    padding: var(--space-7) 0 0;
}

.section-heading {
    max-width: 62ch;
    margin-bottom: var(--space-7);
}

.section-heading h1 {
    margin-bottom: var(--space-3);
}

.section-lede {
    margin: 0;
    color: var(--text-muted);
    font-size: var(--text-lg);
    line-height: var(--leading-normal);
}

.section-lede--tight {
    margin-bottom: var(--space-5);
    font-size: var(--text-base);
}

.medxdoor-eyebrow {
    margin: 0 0 var(--space-2);
    color: var(--action);
    font-family: var(--font-display);
    font-size: var(--text-xs);
    font-weight: 700;
    letter-spacing: var(--tracking-wide);
    text-transform: uppercase;
}

.explore-section {
    margin-bottom: var(--section-y);
}

.explore-section-head {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: var(--space-5);
}

.explore-section-head h2 {
    margin: 0;
    font-size: var(--text-2xl);
}

.section-link {
    color: var(--link);
    font-size: var(--text-sm);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 0.2em;
}

.section-link:hover {
    color: var(--text-brand);
}

.section-cta {
    margin: 0 0 var(--section-y);
    padding: clamp(28px, 5vw, 48px);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    background: var(--surface-accent);
    text-align: center;
}

.section-cta h2 {
    margin-bottom: var(--space-2);
    font-size: var(--text-2xl);
}

.section-cta p {
    max-width: 56ch;
    margin: 0 auto;
    color: var(--text-muted);
}

.section-cta-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
    justify-content: center;
    margin-top: var(--space-5);
}

/* --- search on the explore page -------------------------------------- */

.explore-search {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
    margin-top: var(--space-6);
}

.explore-search input[type="search"] {
    flex: 1 1 280px;
    min-width: 0;
    padding: 13px 18px;
    border: 1.5px solid var(--border-strong);
    border-radius: var(--radius-md);
    background: var(--surface-raised);
    color: var(--text);
    font: inherit;
}

.explore-search input[type="search"]:focus-visible {
    border-color: var(--action);
    outline: none;
    box-shadow: 0 0 0 4px var(--action-soft);
}

/* --- category cards --------------------------------------------------- */

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: var(--space-4);
    margin: 0 0 var(--section-y);
    padding: 0;
    list-style: none;
}

.category-grid.is-compact {
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    margin-bottom: 0;
}

.category-card {
    display: flex;
    gap: var(--space-4);
    height: 100%;
    padding: var(--space-5);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface-raised);
    transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}

.category-card:hover,
.category-card:focus-visible {
    border-color: var(--action);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.category-card-icon {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 46px;
    height: 46px;
    border-radius: var(--radius-md);
    background: var(--chip-bg);
    color: var(--chip-icon);
}

.category-card-body {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.category-card-name {
    color: var(--text-brand);
    font-family: var(--font-display);
    font-size: var(--text-base);
    font-weight: 700;
    line-height: var(--leading-snug);
}

.category-card-description {
    color: var(--text-muted);
    font-size: var(--text-sm);
    line-height: var(--leading-normal);
}

.category-card-count {
    color: var(--text-subtle);
    font-size: var(--text-xs);
    font-weight: 600;
}

/* --- product cards ---------------------------------------------------- */

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: var(--space-4);
    margin: 0;
    padding: 0;
    list-style: none;
}

.product-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface-raised);
    transition: border-color var(--transition), box-shadow var(--transition);
}

.product-card:hover {
    border-color: var(--border-strong);
    box-shadow: var(--shadow-md);
}

.product-card-media {
    position: relative;
    display: grid;
    place-items: center;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: var(--surface-sunken);
}

.product-card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-card-placeholder {
    color: var(--border-strong);
}

.product-card-flag {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 4px 10px;
    border-radius: var(--radius-pill);
    font-size: var(--text-xs);
    font-weight: 700;
}

.product-card-flag.is-out {
    background: var(--badge-bg);
    color: var(--badge-tx);
}

.product-card-flag.is-backorder {
    background: var(--warn-bg);
    color: var(--warn-tx);
}

.product-card-body {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 6px;
    padding: var(--space-4);
}

.product-card-category {
    margin: 0;
    color: var(--text-subtle);
    font-size: var(--text-xs);
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.product-card-title {
    margin: 0;
    font-size: var(--text-base);
    line-height: var(--leading-snug);
}

.product-card-title a:hover {
    color: var(--link);
}

.product-card-rx {
    margin: 0;
}

.product-card-price {
    margin: auto 0 0;
    padding-top: var(--space-2);
    color: var(--text);
    font-family: var(--font-display);
    font-size: var(--text-lg);
    font-weight: 800;
}

.product-card-actions {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: var(--space-2);
    margin-top: var(--space-3);
}

@media (max-width: 480px) {
    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    }

    .product-card-body {
        padding: var(--space-3);
    }

    .product-card-actions {
        grid-template-columns: 1fr;
    }
}

/* --- blog cards -------------------------------------------------------- */

.blog-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface-raised);
    transition: border-color var(--transition), box-shadow var(--transition);
}

.blog-card:hover {
    border-color: var(--border-strong);
    box-shadow: var(--shadow-md);
}

.blog-card-image {
    display: grid;
    place-items: center;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: var(--surface-sunken);
}

.blog-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.blog-card-placeholder {
    color: var(--border-strong);
}

.blog-card-body {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: var(--space-2);
    padding: var(--space-5);
}

.blog-card-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.blog-card-categories a {
    display: inline-block;
    padding: 3px 10px;
    border-radius: var(--radius-pill);
    background: var(--chip-bg);
    color: var(--chip-tx);
    font-size: var(--text-xs);
    font-weight: 600;
}

.blog-card-categories a:hover {
    background: var(--chip-bg-hover);
}

.blog-card-title {
    margin: 0;
    font-size: var(--text-xl);
    line-height: var(--leading-snug);
}

.blog-card-title a:hover {
    color: var(--link);
}

.blog-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    margin: 0;
    color: var(--text-subtle);
    font-size: var(--text-xs);
}

.blog-card-excerpt {
    color: var(--text-muted);
    font-size: var(--text-sm);
    line-height: var(--leading-normal);
}

.blog-card-excerpt p {
    margin: 0;
}

.blog-read-more {
    margin-top: auto;
    padding-top: var(--space-3);
    color: var(--link);
    font-size: var(--text-sm);
    font-weight: 600;
}

.blog-read-more:hover {
    text-decoration: underline;
    text-underline-offset: 0.2em;
}

.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--space-5);
}

/* The featured slot gets one wide card. */
.blog-featured-grid {
    grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 760px) {
    .blog-featured-grid .blog-card {
        flex-direction: row;
    }

    .blog-featured-grid .blog-card-image {
        flex: 0 0 44%;
        aspect-ratio: auto;
    }

    .blog-featured-grid .blog-card-body {
        padding: var(--space-6);
    }

    .blog-featured-grid .blog-card-title {
        font-size: var(--text-2xl);
    }
}

.blog-featured,
.blog-articles {
    margin-bottom: var(--section-y);
}

.blog-featured h2,
.blog-articles h2 {
    margin-bottom: var(--space-5);
    font-size: var(--text-2xl);
}

/* Disclaimer at the foot of an article. */
.entry-content .article-disclaimer {
    max-width: none;
    margin-top: var(--space-7);
    padding: var(--space-4) var(--space-5);
    border-left: 4px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background: var(--surface-sunken);
    color: var(--text-muted);
    font-size: var(--text-sm);
    line-height: var(--leading-normal);
}

/* --- product archive filter ------------------------------------------- */

.product-filter {
    display: grid;
    grid-template-columns: minmax(0, 2fr) repeat(2, minmax(0, 1fr)) auto;
    align-items: end;
    gap: var(--space-3);
    margin-bottom: var(--space-6);
    padding: var(--space-4);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface-raised);
}

.product-filter-field {
    display: grid;
    gap: 6px;
    min-width: 0;
}

.product-filter-field label {
    color: var(--text-muted);
    font-size: var(--text-xs);
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.product-filter-field input,
.product-filter-field select {
    width: 100%;
    min-width: 0;
    min-height: 44px;
    padding: 0 12px;
    border: 1.5px solid var(--border-strong);
    border-radius: var(--radius-md);
    background: var(--surface-raised);
    color: var(--text);
    font: inherit;
    font-size: var(--text-sm);
}

.product-filter-field input:focus-visible,
.product-filter-field select:focus-visible {
    border-color: var(--action);
    outline: none;
    box-shadow: 0 0 0 4px var(--action-soft);
}

.product-filter-actions {
    display: flex;
    gap: var(--space-2);
    align-items: center;
}

.product-result-count {
    margin: 0 0 var(--space-4);
    color: var(--text-muted);
    font-size: var(--text-sm);
}

@media (max-width: 880px) {
    .product-filter {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .product-filter-search {
        grid-column: 1 / -1;
    }

    .product-filter-actions {
        grid-column: 1 / -1;
    }

    .product-filter-actions .btn {
        flex: 1 1 auto;
    }
}

@media (max-width: 480px) {
    .product-filter {
        grid-template-columns: minmax(0, 1fr);
    }
}
