/* ==========================================================================
   Template styles
   
   
   ========================================================================== */

/* ----- Tokens ----- */
:root {
    /* Brand */
    --md-primary: #3a5f95;
    --md-primary-hover: #2e4d7a;
    --md-primary-dark: #243a5c;
    --md-primary-rgb: 58, 95, 149;

    /* Accent color (fixed across sites) */
    --md-orange: #ff9500;
    --md-orange-hover: #f08400;

    /* Ink + text */
    --md-ink: #0a1a3d;
    --md-ink-soft: #2a3a5d;
    --md-text: #1a1f2c;
    --md-text-soft: #4a5063;
    --md-text-mute: #8a8f9e;
    --md-text-inverse: #ffffff;

    /* Surfaces */
    --md-page-bg: #fcfcfc;
    --md-card-bg: #ffffff;
    --md-grey-frame: #ececec;
    --md-soft-bg: #fafbfc;
    --md-card-border: #d1d5db;
    --md-rule: #cbd1d9;
    --md-bar-track: #eef2f7;

    /* States */
    --md-success: #16a34a;
    --md-error: #dc2626;
    --md-warn: #b54708;
    --md-star: #fbbf24;

    /* Shape */
    --md-radius-sm: 4px;
    --md-radius-md: 8px;
    --md-radius-lg: 12px;
    --md-radius-full: 9999px;

    /* Motion */
    --md-transition-fast: 0.15s ease;
    --md-transition-normal: 0.25s ease;

    /* Layout */
    --md-header-height: 56px;
    --md-container-narrow: 930px;
    --md-container-wide: 1200px;

    /* Type */
    --md-font: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
}

/* ==========================================================================
   1. RESET + BASE
   ========================================================================== */
body.mod-template *,
body.mod-template *::before,
body.mod-template *::after {
    box-sizing: border-box;
}

body.mod-template {
    margin: 0;
    padding: 0;
    background: var(--md-page-bg);
    color: var(--md-text);
    font-family: var(--md-font);
    font-size: 17px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body.mod-template a {
    color: var(--md-primary);
    text-decoration: none;
}

body.mod-template a:hover { text-decoration: underline; }

body.mod-template h1,
body.mod-template h2,
body.mod-template h3,
body.mod-template h4 {
    margin: 0;
    color: var(--md-ink);
    font-weight: 700;
    line-height: 1.25;
}

body.mod-template p { margin: 0 0 12px; }

body.mod-template ul,
body.mod-template ol {
    margin: 0;
    padding: 0;
    list-style: none;
}

body.mod-template img { max-width: 100%; height: auto; }

/* ==========================================================================
   2. HEADER
   ========================================================================== */
.md-header {
    background: #ffffff;
    border-bottom: 1px solid var(--md-rule);
}

.md-header-inner {
    max-width: var(--md-container-narrow);
    margin: 0 auto;
    height: var(--md-header-height);
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.md-logo {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}

/* Height is fixed rather than capped so it is determinate before the file loads;
   with the width/height attributes on the tag that pins the box from first paint.
   Width stays auto, so the mark keeps its own aspect ratio. */
body.mod-template .md-logo-img {
    height: 32px;
    width: auto;
    display: block;
}

.md-nav-menu {
    display: flex;
    gap: 8px;
    align-items: center;
}

.md-nav-link {
    display: block;
    padding: 10px 14px;
    color: var(--md-text-soft);
    font-size: 15px;
    font-weight: 500;
    text-decoration: none;
    border-radius: var(--md-radius-sm);
    transition: color var(--md-transition-fast), background-color var(--md-transition-fast);
}

.md-nav-link:hover {
    color: var(--md-primary);
    background-color: var(--md-soft-bg);
    text-decoration: none;
}

.md-menu-toggle {
    display: none;
    background: transparent;
    border: none;
    padding: 8px;
    cursor: pointer;
    width: 40px;
    height: 40px;
}

.md-menu-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--md-ink);
    margin: 4px auto;
    transition: transform var(--md-transition-fast), opacity var(--md-transition-fast);
}

.md-menu-toggle.active span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.md-menu-toggle.active span:nth-child(2) { opacity: 0; }
.md-menu-toggle.active span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 768px) {
    .md-header-inner { height: 48px; }
    body.mod-template .md-logo-img { height: 28px; }
    .md-menu-toggle { display: block; }
    .md-nav {
        position: absolute;
        top: 48px;
        left: 0;
        right: 0;
        background: #ffffff;
        border-bottom: 1px solid var(--md-rule);
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.25s ease;
    }
    .md-nav.open { max-height: 400px; }
    .md-nav-menu {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 8px 0;
    }
    .md-nav-menu li { border-top: 1px solid var(--md-rule); }
    .md-nav-menu li:first-child { border-top: none; }
    .md-nav-link {
        display: block;
        padding: 12px 20px;
        border-radius: 0;
    }
}

@media (max-width: 544px) {
    .md-header-inner { height: 44px; padding: 0 12px; }
    body.mod-template .md-logo-img { height: 26px; }
    .md-nav { top: 44px; }
}

/* ==========================================================================
   3. ARTICLE SHELL
   ========================================================================== */
.md-article {
    padding: 0 0 64px;
}

.md-container {
    max-width: var(--md-container-narrow);
    margin: 0 auto;
    padding: 0 20px;
}

/* ==========================================================================
   4. HEADLINE + INTRO
   ========================================================================== */
.md-lede {
    text-align: center;
    margin-bottom: 28px;
    padding-top: 20px;
}

.md-hero-image {
    margin: 22px 0 0;
    border-radius: 10px;
    overflow: hidden;
    background: var(--md-grey-frame);
}

.md-hero-image img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 420px;
    object-fit: cover;
}

@media (max-width: 600px) {
    .md-hero-image { margin-top: 18px; border-radius: 8px; }
    .md-hero-image img { max-height: 280px; }
}

.md-disclosure-top {
    font-size: 12px;
    line-height: 1.5;
    color: #555;
    font-weight: 400;
    margin: 0 0 14px;
    text-align: center;
}

.md-disclosure-top a {
    color: #555;
    text-decoration: underline;
    text-underline-offset: 2px;
    font-size: 12px;
}

.md-disclosure-top a:hover { color: #111; }

.md-headline {
    font-size: 38px;
    line-height: 1.18;
    font-weight: 700;
    color: var(--md-ink);
    letter-spacing: -0.01em;
    margin: 0;
}

@media (max-width: 600px) {
    .md-headline { font-size: 28px; }
}

.md-intro { margin: 0 0 32px; }

.md-intro > p {
    margin: 0 0 16px;
    font-size: 17px;
    color: var(--md-text);
}

.md-criteria {
    margin: 22px 0;
    border-top: 1px solid var(--md-rule);
    border-bottom: 1px solid var(--md-rule);
    padding: 18px 0;
}

.md-criterion {
    margin: 0 0 10px;
    font-size: 16px;
    color: var(--md-text);
}

.md-criterion:last-child { margin-bottom: 0; }

.md-criterion strong { color: var(--md-ink); }

.md-intro-kicker {
    margin: 18px 0 0;
    font-size: 17px;
    color: var(--md-text);
}

.md-intro-kicker strong { color: var(--md-ink); }

/* ==========================================================================
   5. AUTHOR BYLINE
   ========================================================================== */
.md-author-box {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    padding: 18px;
    margin: 0 0 32px;
    background: var(--md-card-bg);
    border: 1px solid var(--md-card-border);
    border-radius: 10px;
}

.md-author-avatar {
    flex: 0 0 64px;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--md-grey-frame);
    display: flex;
    align-items: center;
    justify-content: center;
}

.md-author-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.md-author-initials {
    font-weight: 700;
    font-size: 22px;
    color: var(--md-ink);
}

.md-author-body { flex: 1; min-width: 0; }

.md-author-name {
    font-size: 17px;
    font-weight: 700;
    color: var(--md-ink);
}

.md-author-byline {
    margin: 4px 0 0;
    font-size: 14.5px;
    font-style: italic;
    color: var(--md-text-soft);
    line-height: 1.5;
}

.md-author-bio {
    margin: 8px 0 0;
    font-size: 14.5px;
    color: var(--md-text-soft);
    line-height: 1.6;
}

.md-author-box-bottom { margin-top: 32px; }

/* ==========================================================================
   6. PRODUCT CARDS
   ========================================================================== */
.md-products { margin: 0 0 24px; }

.md-card {
    background: var(--md-grey-frame);
    padding: 12px;
    border-radius: 12px;
    margin: 0 0 18px;
}

.md-card-winner {
    box-shadow: 0 0 0 1px rgba(var(--md-primary-rgb), 0.18), 0 6px 18px rgba(10, 26, 61, 0.06);
    position: relative;
    overflow: visible;
}

/* Ribbon — pinned to the top-right corner of the first card.
   right:0 keeps the ribbon's vertical edge flush with the card border, then
   transform-origin: top right makes the 2deg tilt pivot off that same corner
   so the right-edge alignment survives the rotation. */
.md-editors-choice {
    position: absolute;
    top: -10px;
    right: 3px;
    z-index: 3;
    background: var(--md-primary);
    color: #ffffff;
    padding: 8px 14px 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-radius: 6px;
    box-shadow: 0 4px 10px rgba(var(--md-primary-rgb), 0.30);
    line-height: 1;
    transform: rotate(2deg);
    transform-origin: top right;
}
.md-editors-choice::before {
    content: '';
    position: absolute;
    bottom: -6px;
    right: 0;
    border-top: 6px solid var(--md-primary-dark);
    border-right: 8px solid transparent;
    filter: brightness(0.8);
}
.md-editors-choice-star {
    color: #fbbf24;
    font-size: 22px;
    line-height: 1;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.20);
}
.md-editors-choice-text {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    text-align: left;
    line-height: 1.15;
}
.md-editors-choice-year {
    font-size: 12px;
    color: #fde68a;
}

@media (max-width: 600px) {
    .md-editors-choice {
        top: -8px;
        right: -3px;
        padding: 6px 10px 8px;
        gap: 6px;
    }
    .md-editors-choice-star { font-size: 18px; }
    .md-editors-choice-text { font-size: 9px; }
    .md-editors-choice-year { font-size: 11px; }
}

.md-card-inner {
    background: var(--md-card-bg);
    border: 1px solid var(--md-card-border);
    border-radius: 8px;
    padding: 24px;
}

.md-card-head {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin: 0 0 6px;
}

.md-rank {
    font-size: 26px;
    font-weight: 700;
    color: var(--md-primary);
    line-height: 1;
}

.md-card-title { flex: 1; min-width: 0; }

.md-card-title h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--md-ink);
    line-height: 1.2;
}

.md-card-title h2 a { color: inherit; }
.md-card-title h2 a:hover { color: var(--md-primary); text-decoration: none; }

.md-card-sublabel {
    font-size: 15px;
    color: var(--md-text-soft);
    margin-top: 2px;
}

.md-card-hero {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr;
    gap: 20px;
    align-items: stretch;
    padding: 6px 0 20px;
    margin-bottom: 20px;
}

.md-card-col {
    position: relative;
    text-align: center;
    min-width: 0;
}

.md-col-image {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 3-row grid — both columns share the SAME row sizes, so labels align at top,
   values (A+ / 9.9) center on the same Y, and the bottom slot (stars / empty) sits at bottom */
.md-col-grade,
.md-col-rating {
    display: grid;
    grid-template-rows: auto 1fr 38px;
    align-items: center;
    justify-items: center;
}

.md-col-bottom { width: 100%; }

/* Vertical divider lines — fixed height, centered relative to the row, identical on both columns.
   Hidden when columns stack vertically on mobile. */
.md-col-grade::before,
.md-col-rating::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 1px;
    height: 130px;
    background: var(--md-rule);
}

@media (max-width: 600px) {
    .md-col-grade::before,
    .md-col-rating::before { display: none; }
}

.md-card-img {
    display: block;
    text-align: center;
}

.md-card-img img {
    max-width: 100%;
    max-height: 200px;
    object-fit: contain;
    margin: 0 auto;
}

/* Slot whose image has no intrinsic size at render time (remote host, or a file
   that could not be measured). The box is held at the cap height so the row is
   sized before the file arrives and nothing moves when it lands.
   scale-down, not contain: it draws the image at whichever of natural size or
   contain is SMALLER, so a file smaller than the box is painted at its own size
   rather than blown up to fill it. Height must be set, not min-height — the
   replaced-element constraint table re-derives width when it clamps height, which
   scales the box up. Mirrors the cap at every breakpoint. */
.md-col-image-reserve .md-card-img img {
    height: 200px;
    object-fit: scale-down;
}

.md-grade-label {
    font-size: 18px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--md-ink);
    font-weight: 700;
    margin: 0 0 10px;
}

@media (max-width: 600px) {
    .md-grade-label { font-size: 16px; }
}

.md-grade-letter {
    font-size: 84px;
    font-weight: 500;
    line-height: 0.95;
    color: var(--md-primary);
    letter-spacing: -0.02em;
    margin: 0;
}

.md-card-winner .md-grade-letter {
    font-size: 92px;
    font-weight: 600;
}

.md-rating-line {
    display: inline-flex;
    align-items: baseline;
    gap: 3px;
    color: var(--md-ink);
    margin: 0;
}

.md-rating-num { font-size: 52px; font-weight: 700; line-height: 1; }
.md-rating-of { font-size: 24px; color: var(--md-text-soft); }

/* Proportional star fill via linear-gradient + background-clip: text.
   --star-fill is set per-card (0-100%) and the gradient hard-splits gold/gray
   at that exact x-position, then we clip the gradient to the glyph shapes.
   Works across letter-spacing because the gradient is over the whole element,
   not per-character. */
.md-stars {
    margin: 0;
    font-size: 30px;
    letter-spacing: 3px;
    line-height: 1;
    display: inline-block;
    /* Clamp to text width — .md-col-bottom (which is also applied) sets
       width: 100% and would stretch the gradient bar past the glyphs,
       making every star sit in the gold half of the gradient. */
    width: max-content;
    max-width: 100%;
    background-image: linear-gradient(
        to right,
        var(--md-star) var(--star-fill, 100%),
        #d1d5db var(--star-fill, 100%)
    );
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
}

/* Tablet — keep 3-col hero but tighten grade/rating typography */
@media (max-width: 900px) {
    .md-card-hero {
        grid-template-columns: 1.3fr 1fr 1fr;
        gap: 14px;
    }
    .md-grade-letter { font-size: 72px; }
    .md-card-winner .md-grade-letter { font-size: 78px; }
    .md-rating-num { font-size: 42px; }
    .md-rating-of { font-size: 20px; }
    .md-stars { font-size: 26px; letter-spacing: 2px; }
    .md-card-img img { max-height: 170px; }
    .md-col-image-reserve .md-card-img img { height: 170px; }
}

/* Mobile — stack hero to single column */
@media (max-width: 600px) {
    .md-card-hero {
        grid-template-columns: 1fr;
        gap: 16px;
        padding-bottom: 16px;
    }
    .md-col-grade,
    .md-col-rating {
        border-left: none;
        border-top: 1px solid var(--md-rule);
        padding: 16px 0 0;
    }
    .md-grade-letter { font-size: 78px; }
    .md-card-winner .md-grade-letter { font-size: 84px; }
    .md-rating-num { font-size: 46px; }
    .md-rating-of { font-size: 22px; }
    .md-stars { font-size: 28px; letter-spacing: 3px; }
    .md-card-img img { max-height: 200px; }
    .md-col-image-reserve .md-card-img img { height: 200px; }
    .md-card-inner { padding: 14px; }
    .md-card { padding: 6px; margin: 0 0 14px; }
    .md-card-title h2 { font-size: 21px; }
}

.md-section-label {
    font-size: 15px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #475569;
    margin: 0 0 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--md-rule);
}

.md-card-analysis { margin: 0 0 20px; }

.md-card-analysis p {
    margin: 0 0 12px;
    color: var(--md-text);
    font-size: 16px;
    line-height: 1.65;
}

.md-card-analysis p:last-child { margin-bottom: 0; }
.md-card-analysis strong { color: var(--md-ink); font-weight: 700; }

/* ----- CTA pill ----- */
.md-card-cta { text-align: center; margin: 18px 0; }
.md-cta-mid { margin: 18px 0 24px; }
.md-cta-bottom { margin: 20px 0 0; }

.md-cta-pill {
    display: inline-block;
    background: var(--md-orange);
    color: #fff !important;
    font-weight: 700;
    font-size: 17px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 14px 56px;
    border-radius: 4px;
    text-decoration: none !important;
    box-shadow: 0 2px 0 rgba(0, 0, 0, 0.06);
    transition: background var(--md-transition-fast), transform var(--md-transition-fast);
    border: none;
}

.md-cta-pill:hover {
    background: var(--md-orange-hover);
    transform: translateY(-1px);
}

.md-cta-pill.amazon { background: #ff9900; }

/* Trust strip — below the bottom CTA on the #1 card */
.md-trust-strip {
    list-style: none;
    margin: 14px 0 0;
    padding: 0;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px 22px;
    font-size: 13px;
    color: var(--md-text-soft);
}
.md-trust-strip li {
    position: relative;
    padding-left: 18px;
    line-height: 1.4;
    white-space: nowrap;
}
.md-trust-strip li::before {
    content: "✓";
    position: absolute;
    left: 0;
    top: 0;
    color: var(--md-success);
    font-weight: 700;
}
@media (max-width: 480px) {
    .md-trust-strip { flex-direction: column; align-items: center; gap: 4px; }
    .md-trust-strip li { padding-left: 16px; }
}

@media (max-width: 600px) {
    .md-cta-pill { padding: 14px 36px; font-size: 16px; width: 100%; }
}

/* ----- Metric bars (labels inside the bar) ----- */
.md-metrics {
    margin: 0 0 22px;
    padding: 18px;
    background: rgba(var(--md-primary-rgb), 0.08);
    border-radius: 8px;
}

.md-metric-row {
    margin: 0 0 10px;
}

.md-metric-row:last-child { margin-bottom: 0; }

.md-metric-bar {
    position: relative;
    height: 42px;
    /* Darker track so the unfilled remainder is clearly visible against the tinted card bg */
    background: #d1d5db;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    align-items: center;
}

.md-metric-fill {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 0;
    background: var(--md-primary);
    border-radius: 8px;
    /* easeOutExpo timing on the bar fill */
    transition: width 2.4s cubic-bezier(0.19, 1, 0.22, 1);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
    .md-metric-fill { transition: none; }
}

.md-metric-label {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    font-size: 15px;
    font-weight: 700;
    color: #ffffff;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.18);
    letter-spacing: 0.01em;
    white-space: nowrap;
    pointer-events: none;
}

.md-metric-percent {
    padding-right: 14px;
    font-size: 15px;
    font-weight: 700;
    color: #ffffff;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.18);
    white-space: nowrap;
    flex-shrink: 0;
}

.md-metric-total {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
    padding: 14px 4px 0;
    margin-top: 12px;
    border-top: 1px solid #9ca3af;
}

.md-metric-total-label {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--md-ink);
}

.md-metric-total-value {
    font-size: 26px;
    font-weight: 800;
    color: var(--md-primary);
    line-height: 1;
}

@media (max-width: 600px) {
    .md-metric-bar { height: 38px; }
    .md-metric-label { font-size: 13.5px; left: 12px; }
    .md-metric-percent { font-size: 13.5px; padding-right: 10px; }
    .md-metric-total-value { font-size: 22px; }
}

/* ----- Pros & Cons ----- */
.md-proscons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin: 0 0 20px;
}

@media (max-width: 600px) {
    .md-proscons { grid-template-columns: 1fr; gap: 18px; }
}

.md-pros li,
.md-cons li {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 6px 0;
    font-size: 15.5px;
    line-height: 1.5;
    color: var(--md-text);
}

.md-icon {
    flex: 0 0 20px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 2px;
}

.md-icon svg {
    width: 14px;
    height: 14px;
    display: block;
}

.md-icon-check { background: var(--md-success); }
.md-icon-cross { background: var(--md-error); }

/* ----- Bottom Line (#1 card) — same section-label style as other blocks ----- */
.md-bottom-line {
    margin: 22px 0 0;
}

.md-bottom-line-body {
    font-size: 16px;
    line-height: 1.65;
    color: var(--md-text);
}

.md-bottom-line-body p {
    margin: 0 0 10px;
}

.md-bottom-line-body p:last-child { margin-bottom: 0; }
.md-bottom-line-body strong { color: var(--md-ink); }

/* ----- Wrap-up ----- */
.md-wrapup {
    margin: 22px 0 0;
    padding: 16px 18px;
    background: rgba(var(--md-primary-rgb), 0.04);
    border-left: 3px solid var(--md-primary);
    border-radius: 4px;
}

.md-wrapup p {
    margin: 0;
    color: var(--md-text);
    font-size: 16px;
    line-height: 1.6;
}

/* ==========================================================================
   7. BUYING-GUIDE SECTIONS
   Scannable, value-first hierarchy.
   ========================================================================== */
.md-guide {
    margin: 40px 0;
    padding: 28px 0 0;
    border-top: 1px solid var(--md-rule);
}

/* Single container holding all buying-guide sections — reads like a unified guide document */
.md-buying-guide-wrap {
    background: var(--md-card-bg);
    border: 1px solid var(--md-card-border);
    border-radius: 12px;
    padding: 36px 40px;
    margin: 36px 0;
    box-shadow: 0 1px 2px rgba(10, 26, 61, 0.04);
}

/* Color-coded section accents — 4px left rail on the CONTENT block (not the heading) */
.md-buying-guide-wrap .md-guide-definition .md-guide-body,
.md-buying-guide-wrap .md-guide-benefits   .md-benefits-list,
.md-buying-guide-wrap .md-guide-consider   .md-guide-items,
.md-buying-guide-wrap .md-guide-avoid      .md-guide-items,
.md-buying-guide-wrap .md-guide-faq        .md-faq-items {
    border-left: 4px solid var(--md-rule);
    border-radius: 2px;
    padding-left: 18px;
    padding-top: 6px;
    padding-bottom: 16px;
}

.md-buying-guide-wrap .md-guide-definition .md-guide-body { border-left-color: var(--md-primary); }
.md-buying-guide-wrap .md-guide-benefits   .md-benefits-list { border-left-color: var(--md-success); }
.md-buying-guide-wrap .md-guide-consider   .md-guide-items   { border-left-color: var(--md-primary); }
.md-buying-guide-wrap .md-guide-avoid      .md-guide-items   { border-left-color: var(--md-warn); }
.md-buying-guide-wrap .md-guide-faq        .md-faq-items     { border-left-color: #8b5cf6; }

@media (max-width: 600px) {
    .md-buying-guide-wrap .md-guide-definition .md-guide-body,
    .md-buying-guide-wrap .md-guide-benefits   .md-benefits-list,
    .md-buying-guide-wrap .md-guide-consider   .md-guide-items,
    .md-buying-guide-wrap .md-guide-avoid      .md-guide-items,
    .md-buying-guide-wrap .md-guide-faq        .md-faq-items {
        padding-left: 14px;
    }
}

/* First section inside the wrap shouldn't have a top rule (wrap border handles it) */
.md-buying-guide-wrap .md-guide:first-child {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

/* Last section inside the wrap shouldn't have its own trailing margin */
.md-buying-guide-wrap .md-guide:last-child {
    margin-bottom: 0;
}

@media (max-width: 600px) {
    .md-buying-guide-wrap {
        padding: 24px 20px;
        margin: 24px 0;
        border-radius: 10px;
    }
}

body.mod-template .md-guide-heading {
    font-size: 24px;
    font-weight: 800;
    color: var(--md-ink);
    margin: 0 0 24px;
    line-height: 1.25;
    letter-spacing: -0.01em;
}

/* ==========================================================================
   BUYING GUIDE — numbered headings + body text, hairline rules between
   items, no tinted cards, no rounded boxes.
   ========================================================================== */

/* Definition — plain paragraph with subtle font weight/size to feel like a lead */
.md-guide-definition .md-guide-body p {
    margin: 0 0 10px;
    color: var(--md-text);
    font-size: 17px;
    line-height: 1.7;
}
.md-guide-definition .md-guide-body p:last-child { margin-bottom: 0; }
.md-guide-definition .md-guide-body p:first-child {
    font-size: 18.5px;
    line-height: 1.55;
    color: var(--md-ink-soft);
}
.md-guide-definition .md-guide-body strong { color: var(--md-ink); font-weight: 700; }

/* Benefits — plain vertical list, no cards, no bold first text, simple check + line */
.md-benefits-list {
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.md-benefits-list li {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding: 12px 0;
    border-bottom: 1px solid var(--md-rule);
    font-size: 16px;
    line-height: 1.55;
    color: var(--md-text);
    font-weight: 400;
}
.md-benefits-list li:last-child { border-bottom: none; }
.md-benefits-list li > span:last-child {
    flex: 1;
    font-weight: 400;
    color: var(--md-text);
}

.md-benefits-list .md-icon-check {
    flex: 0 0 22px;
    width: 22px;
    height: 22px;
    background: var(--md-success);
    color: #fff;
    margin-top: 2px;
}
.md-benefits-list .md-icon-check svg { width: 14px; height: 14px; }

/* Things to Consider — numbered sub-sections with hairline rules between */
.md-guide-consider .md-guide-items {
    display: flex;
    flex-direction: column;
    gap: 0;
    counter-reset: md-consider;
}

.md-guide-consider .md-guide-item {
    position: relative;
    padding: 20px 0 22px 50px;
    border-bottom: 1px solid var(--md-rule);
    counter-increment: md-consider;
}
.md-guide-consider .md-guide-item:last-child { border-bottom: none; padding-bottom: 4px; }
.md-guide-consider .md-guide-item:first-child { padding-top: 8px; }

.md-guide-consider .md-guide-item::before {
    content: counter(md-consider) ".";
    position: absolute;
    top: 18px;
    left: 0;
    width: 38px;
    font-size: 24px;
    font-weight: 700;
    color: var(--md-primary);
    line-height: 1;
    letter-spacing: -0.01em;
}
.md-guide-consider .md-guide-item:first-child::before { top: 6px; }

.md-guide-consider .md-guide-item h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--md-ink);
    margin: 0 0 6px;
    line-height: 1.3;
}

.md-guide-consider .md-guide-item p {
    margin: 0;
    font-size: 16px;
    color: var(--md-text);
    line-height: 1.6;
}

/* What to Avoid — same list pattern with amber warning prefix */
.md-guide-avoid .md-guide-items {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.md-guide-avoid .md-guide-item-warn {
    position: relative;
    padding: 20px 0 22px 38px;
    border-bottom: 1px solid var(--md-rule);
}
.md-guide-avoid .md-guide-item-warn:last-child { border-bottom: none; padding-bottom: 4px; }
.md-guide-avoid .md-guide-item-warn:first-child { padding-top: 8px; }

.md-guide-avoid .md-guide-item-warn::before {
    content: "⚠";
    position: absolute;
    top: 19px;
    left: 0;
    font-size: 22px;
    color: var(--md-warn);
    line-height: 1;
}
.md-guide-avoid .md-guide-item-warn:first-child::before { top: 7px; }

.md-guide-avoid .md-guide-item-warn h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--md-warn);
    margin: 0 0 6px;
    line-height: 1.3;
}
.md-guide-avoid .md-guide-item-warn h3::before { content: none; }

.md-guide-avoid .md-guide-item-warn p {
    margin: 0;
    font-size: 16px;
    color: var(--md-text);
    line-height: 1.6;
}

/* Mobile tightening */
@media (max-width: 600px) {
    .md-guide { margin: 28px 0; padding-top: 20px; }
    body.mod-template .md-guide-heading { font-size: 22px; margin-bottom: 18px; }
    .md-guide-definition .md-guide-body p:first-child { font-size: 16.5px; }
    .md-benefits-list li { font-size: 15.5px; padding: 10px 0; }
    .md-guide-consider .md-guide-item { padding: 16px 0 18px 42px; }
    .md-guide-consider .md-guide-item::before { font-size: 20px; width: 34px; }
    .md-guide-consider .md-guide-item h3 { font-size: 17px; }
    .md-guide-avoid .md-guide-item-warn { padding: 16px 0 18px 32px; }
    .md-guide-avoid .md-guide-item-warn::before { font-size: 18px; }
    .md-guide-avoid .md-guide-item-warn h3 { font-size: 17px; }
}

/* ----- Found Deals & Discounts — list at the bottom of the page ----- */
.md-deals {
    background: var(--md-card-bg);
    border: 1px solid var(--md-card-border);
    border-radius: 12px;
    padding: 26px 28px 28px;
    margin: 36px 0;
    box-shadow: 0 1px 2px rgba(10, 26, 61, 0.04);
}

.md-deals-heading {
    font-size: 22px;
    font-weight: 800;
    color: var(--md-ink);
    margin: 0 0 4px;
    line-height: 1.25;
    letter-spacing: -0.01em;
}

.md-deals-sub {
    font-size: 13.5px;
    color: var(--md-text-soft);
    margin: 0 0 20px;
}

.md-deal-row {
    display: grid;
    grid-template-columns: 64px 1fr auto auto;
    align-items: center;
    gap: 18px;
    padding: 14px 18px;
    margin: 0 0 10px;
    border: 1px dashed #c5cad3;
    border-radius: 10px;
    text-decoration: none;
    color: var(--md-text);
    background: #ffffff;
    transition: box-shadow var(--md-transition-fast), transform var(--md-transition-fast), border-color var(--md-transition-fast);
}
.md-deal-row:last-child { margin-bottom: 0; }
/* no-image deal-row fix: drop the empty 64px image column so the product
   name is not squeezed to one word per line when an offer has no shot. */
.md-deal-row:not(:has(.md-deal-img)) { grid-template-columns: 1fr auto auto; }
.md-deal-row:hover {
    box-shadow: 0 8px 18px rgba(10, 26, 61, 0.10);
    transform: translateY(-1px);
    border-color: var(--md-primary);
    text-decoration: none;
}

.md-deal-row-featured {
    border: 2px dashed var(--md-primary);
    background: rgba(var(--md-primary-rgb), 0.04);
    box-shadow: 0 2px 6px rgba(var(--md-primary-rgb), 0.10);
}

.md-deal-img {
    width: 64px;
    height: 64px;
    border-radius: 8px;
    overflow: hidden;
    background: var(--md-soft-bg);
    display: flex;
    align-items: center;
    justify-content: center;
}
.md-deal-img img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
}

.md-deal-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    gap: 4px;
}
.md-deal-name {
    font-size: 16.5px;
    font-weight: 700;
    color: var(--md-ink);
    line-height: 1.25;
}
.md-deal-badge {
    align-self: flex-start;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--md-text-soft);
    background: var(--md-soft-bg);
    border: 1px solid var(--md-rule);
    padding: 3px 8px;
    border-radius: 999px;
}
.md-deal-badge-featured {
    color: #ffffff;
    background: var(--md-primary);
    border-color: var(--md-primary);
}

.md-deal-price {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    line-height: 1.1;
}
.md-deal-retail {
    font-size: 13px;
    color: var(--md-text-mute);
    text-decoration: line-through;
}
.md-deal-sale {
    font-size: 20px;
    font-weight: 800;
    color: var(--md-ink);
    letter-spacing: -0.01em;
}
.md-deal-pct {
    font-size: 11px;
    font-weight: 700;
    color: var(--md-orange);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: rgba(255, 149, 0, 0.12);
    padding: 2px 7px;
    border-radius: 4px;
    margin-top: 2px;
}

.md-deal-cta {
    font-size: 15px;
    font-weight: 700;
    color: var(--md-primary);
    white-space: nowrap;
}

.md-deal-nodeal {
    font-size: 12.5px;
    font-style: italic;
    color: var(--md-text-mute);
    text-align: right;
}

@media (max-width: 600px) {
    .md-deals { padding: 22px 18px 24px; margin: 24px 0; }
    .md-deals-heading { font-size: 19px; }
    .md-deals-sub { font-size: 12.5px; margin-bottom: 14px; }
    .md-deal-row {
        grid-template-columns: 56px 1fr auto;
        grid-template-rows: auto auto;
        gap: 12px;
        padding: 12px 14px;
    }
    .md-deal-img { width: 56px; height: 56px; grid-row: 1 / 3; }
    /* no-image deal-row fix (mobile) */
    .md-deal-row:not(:has(.md-deal-img)) { grid-template-columns: 1fr auto; }
    .md-deal-row:not(:has(.md-deal-img)) .md-deal-info { grid-column: 1 / 2; }
    .md-deal-row:not(:has(.md-deal-img)) .md-deal-price { grid-column: 2 / 3; }
    .md-deal-row:not(:has(.md-deal-img)) .md-deal-cta { grid-column: 1 / 3; }
    .md-deal-info { grid-column: 2 / 3; }
    .md-deal-price { grid-column: 3 / 4; align-items: flex-end; }
    .md-deal-cta {
        grid-column: 2 / 4;
        grid-row: 2 / 3;
        font-size: 13.5px;
        text-align: right;
    }
    .md-deal-name { font-size: 15px; }
    .md-deal-sale { font-size: 17px; }
}

/* ----- FAQ (collapsible Q&A) ----- */
.md-guide-faq .md-faq-items {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.md-faq-item {
    background: var(--md-card-bg);
    border: 1px solid var(--md-card-border);
    border-radius: var(--md-radius-md);
    padding: 0;
    overflow: hidden;
    transition: border-color var(--md-transition-fast), box-shadow var(--md-transition-fast);
}

.md-faq-item[open] {
    border-color: var(--md-primary);
    box-shadow: 0 1px 3px rgba(var(--md-primary-rgb), 0.08);
}

.md-faq-q {
    list-style: none;
    cursor: pointer;
    padding: 14px 44px 14px 18px;
    font-size: 16px;
    font-weight: 600;
    color: var(--md-ink);
    line-height: 1.4;
    position: relative;
    user-select: none;
}

/* Hide the native disclosure arrow across engines */
.md-faq-q::-webkit-details-marker { display: none; }
.md-faq-q::marker { content: ""; }

/* Custom chevron — rotates open */
.md-faq-q::after {
    content: "";
    position: absolute;
    top: 50%;
    right: 18px;
    width: 10px;
    height: 10px;
    border-right: 2px solid var(--md-text-soft);
    border-bottom: 2px solid var(--md-text-soft);
    transform: translateY(-75%) rotate(45deg);
    transition: transform var(--md-transition-fast);
}

.md-faq-item[open] .md-faq-q::after {
    transform: translateY(-25%) rotate(-135deg);
    border-color: var(--md-primary);
}

.md-faq-q:hover {
    color: var(--md-primary);
}

.md-faq-a {
    padding: 0 18px 16px;
    font-size: 15.5px;
    color: var(--md-text-soft);
    line-height: 1.6;
}

@media (max-width: 640px) {
    .md-faq-q {
        font-size: 15px;
        padding: 12px 40px 12px 14px;
    }
    .md-faq-q::after { right: 14px; }
    .md-faq-a {
        padding: 0 14px 14px;
        font-size: 15px;
    }
}

/* ==========================================================================
   8. FOOTER DISCLOSURE (in-article)
   ========================================================================== */
.md-footer-disclosure {
    margin: 32px 0 0;
    padding: 22px 0 0;
    border-top: 1px solid var(--md-rule);
}

.md-footer-disclosure p {
    margin: 0 0 10px;
    font-size: 12.5px;
    color: var(--md-text-mute);
    line-height: 1.5;
}

.md-footer-disclosure a {
    color: var(--md-text-soft);
    text-decoration: underline;
}

/* ==========================================================================
   9. SITE FOOTER
   ========================================================================== */
.md-footer {
    background: #ffffff;
    border-top: 1px solid var(--md-rule);
    margin-top: 40px;
}

.md-footer-inner {
    max-width: var(--md-container-wide);
    margin: 0 auto;
    padding: 32px 20px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    text-align: center;
}

body.mod-template .md-footer-logo-img {
    height: 32px;
    width: auto;
    display: block;
}

.md-footer-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 20px 24px;
    justify-content: center;
}

.md-footer-nav a {
    color: var(--md-text-soft);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: color var(--md-transition-fast);
}

.md-footer-nav a:hover { color: var(--md-primary); }

.md-copyright {
    margin: 0;
    font-size: 13px;
    color: var(--md-text-mute);
}

/* ==========================================================================
   10. SCROLL-TO-TOP BUTTON
   ========================================================================== */
.md-scroll-top {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 44px;
    height: 44px;
    border: none;
    background: var(--md-primary);
    color: #ffffff;
    border-radius: 50%;
    cursor: pointer;
    opacity: 0;
    transform: translateY(8px);
    pointer-events: none;
    transition: opacity var(--md-transition-fast), transform var(--md-transition-fast), background var(--md-transition-fast);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(10, 26, 61, 0.18);
    z-index: 50;
}

.md-scroll-top.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.md-scroll-top:hover { background: var(--md-primary-hover); }

/* Suppress transitions during the initial JS init pass so the button
   doesn't flash in/out when the page loads scrolled past the threshold
   (browser back/forward, anchor jumps). Class is added in footer.php,
   removed after two requestAnimationFrame ticks. */
.md-scroll-top.md-no-transition {
    transition: none !important;
}
