/* ============================================================
   MinerCore — Global Font Scale Unification (v1)
   ─────────────────────────────────────────────────────────────
   PURPOSE: Fix inconsistent font sizes across ALL pages.
   • Product cards: title wraps cleanly on 2 lines with readable size
   • All page headings follow the token scale from 00-variables.css
   • Body/meta text stays calm and readable on every screen size
   • Hardcoded px font-sizes in product cards replaced with tokens
   • No color or layout changes — typography only
   ============================================================ */


/* ═══════════════════════════════════════════════════════════
   1. PRODUCT CARDS — miner-product-card (unified shop + home)
      Fix: title 16px hardcoded → fluid token, clean 2-line wrap
   ═══════════════════════════════════════════════════════════ */

/* Card title: replace hardcoded 16px with fluid clamp token */
.miner-product-card__title {
    font-size: clamp(0.8rem, 1.3vw, 0.92rem) !important;   /* ~12.8px → 14.7px */
    font-weight: var(--fw-semibold) !important;              /* 600 */
    line-height: 1.35 !important;
    min-height: auto !important;
    /* Allow clean 2-line truncation */
    display: -webkit-box !important;
    -webkit-box-orient: vertical !important;
    -webkit-line-clamp: 2 !important;
    overflow: hidden !important;
    white-space: normal !important;
}

/* Price: reduce from 15px hardcoded to fluid token */
.miner-product-card__price {
    font-size: clamp(0.82rem, 1.4vw, 0.95rem) !important;   /* ~13px → 15.2px */
    font-weight: var(--fw-semibold) !important;
}

.miner-product-card__price ins {
    font-size: clamp(0.88rem, 1.5vw, 1rem) !important;      /* ~14px → 16px */
    font-weight: var(--fw-semibold) !important;
}

.miner-product-card__price del {
    font-size: clamp(0.72rem, 1.1vw, 0.82rem) !important;   /* ~11.5px → 13px */
}

/* Chips row (hashrate/algo text) */
.miner-product-card__chips {
    font-size: clamp(0.56rem, 0.85vw, 0.65rem) !important;  /* tighter, consistent */
}

/* Spec labels inside cards */
.miner-product-card__specs strong {
    font-size: clamp(0.65rem, 1vw, 0.75rem) !important;
    font-weight: var(--fw-regular) !important;               /* 400 — calm */
}

/* Profit / ROI / signals */
.miner-product-card__daily-profit {
    font-size: clamp(0.65rem, 1vw, 0.72rem) !important;
}

.miner-product-card__roi {
    font-size: clamp(0.58rem, 0.9vw, 0.65rem) !important;
}

/* Rating text */
.miner-product-card__rating {
    font-size: clamp(0.58rem, 0.9vw, 0.65rem) !important;
}

/* Electricity note */
.miner-product-card__electricity-note {
    font-size: clamp(0.58rem, 0.9vw, 0.65rem) !important;
}

/* Action buttons on cards */
.miner-product-card__primary,
.miner-product-card__host {
    font-size: clamp(0.62rem, 0.95vw, 0.7rem) !important;
}

/* Badge pills */
.miner-product-badge,
.miner-product-card__discount,
.miner-product-card__saving {
    font-size: clamp(0.55rem, 0.85vw, 0.62rem) !important;
}


/* ═══════════════════════════════════════════════════════════
   2. CONNECTED-PRODUCT CARDS (IoT / SenseCAP style)
      These have their own is-connected-product class
   ═══════════════════════════════════════════════════════════ */

.miner-product-card.is-connected-product .miner-product-card__title {
    font-size: clamp(0.82rem, 1.3vw, 0.92rem) !important;
    white-space: nowrap !important;   /* connected cards use 1-line nowrap by design */
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

.miner-product-card.is-connected-product .miner-product-card__price {
    font-size: clamp(0.9rem, 1.5vw, 1.05rem) !important;
}

.miner-product-card.is-connected-product .miner-product-card__specs strong {
    font-size: clamp(0.62rem, 0.95vw, 0.7rem) !important;
    font-weight: var(--fw-semibold) !important;
}


/* ═══════════════════════════════════════════════════════════
   3. LEGACY MINER CARDS (miner-card — used in /miners archive)
      08-miner-archive.css has hardcoded text-xl / text-2xl for
      title and price — reduce to match unified scale
   ═══════════════════════════════════════════════════════════ */

.miner-card-title {
    font-size: clamp(0.88rem, 1.5vw, 1.05rem) !important;  /* was text-xl (~20px) */
    font-weight: var(--fw-semibold) !important;              /* 600 instead of 700 */
    white-space: normal !important;                          /* allow wrap */
    overflow: hidden !important;
    display: -webkit-box !important;
    -webkit-box-orient: vertical !important;
    -webkit-line-clamp: 2 !important;
    text-overflow: ellipsis !important;
}

.miner-card-price {
    font-size: clamp(1rem, 1.7vw, 1.2rem) !important;      /* was text-2xl (~24px) */
    font-weight: var(--fw-semibold) !important;              /* 600 instead of 700 */
}

.miner-card-brand {
    font-size: clamp(0.6rem, 0.9vw, 0.68rem) !important;   /* was text-sm */
}

.miner-card-meta span {
    font-size: clamp(0.65rem, 1vw, 0.75rem) !important;    /* was text-sm */
}

.miner-card-profitability {
    font-size: clamp(0.78rem, 1.2vw, 0.88rem) !important;  /* was text-base */
    font-weight: var(--fw-medium) !important;                /* 500 instead of 700 */
}

.miner-card-actions .btn {
    font-size: clamp(0.78rem, 1.2vw, 0.88rem) !important;  /* was text-base */
    font-weight: var(--fw-semibold) !important;              /* 600 instead of 700 */
}


/* ═══════════════════════════════════════════════════════════
   4. PAGE HEADINGS — UNIFIED SCALE (all pages)
      Prevent any stray hardcoded sizes from leaking through
   ═══════════════════════════════════════════════════════════ */

/* h1: page titles — firm upper ceiling */
h1:not(.hero-title):not(.site-title) {
    font-size: clamp(1.4rem, 2.5vw, 1.85rem) !important;
    font-weight: var(--fw-bold) !important;
    line-height: 1.25 !important;
}

/* h2: section titles */
h2:not(.hero-subtitle) {
    font-size: clamp(1.1rem, 2vw, 1.45rem) !important;
    font-weight: var(--fw-semibold) !important;
    line-height: 1.3 !important;
}

/* h3: card / subsection titles */
h3 {
    font-size: clamp(0.95rem, 1.6vw, 1.2rem) !important;
    font-weight: var(--fw-semibold) !important;
    line-height: 1.35 !important;
}

/* h4: sidebar / meta headings */
h4 {
    font-size: clamp(0.88rem, 1.3vw, 1rem) !important;
    font-weight: var(--fw-medium) !important;
}

/* h5, h6: labels / micro-headings */
h5, h6 {
    font-size: clamp(0.78rem, 1.1vw, 0.88rem) !important;
    font-weight: var(--fw-medium) !important;
}

/* ── Hero exception: keep home page hero bold and large ── */
.home .hero-title {
    font-size: clamp(1.75rem, 4.5vw, 2.75rem) !important;
    font-weight: var(--fw-extrabold) !important;  /* 800 — HOME HERO ONLY */
    line-height: 1.12 !important;
    letter-spacing: -0.04em !important;
}

/* Inner-page hero titles (shop, about, etc.) */
:not(.home) .hero-title,
.miner-product-hero__title {
    font-size: clamp(1.1rem, 2vw, 1.45rem) !important;
    font-weight: var(--fw-bold) !important;        /* 700 */
    line-height: 1.2 !important;
}

/* ── Archive hero (taxonomy / shop category) ── */
.miner-archive-hero h1,
.taxonomy-product-catalog .miner-archive-hero h1 {
    font-size: clamp(1.35rem, 3vw, 1.85rem) !important;
    font-weight: var(--fw-bold) !important;
    line-height: 1.15 !important;
}


/* ═══════════════════════════════════════════════════════════
   5. BODY TEXT — calm, consistent, readable
   ═══════════════════════════════════════════════════════════ */

body {
    font-size: clamp(0.85rem, 1.2vw, 0.9rem) !important;  /* ~13.6px → 14.4px */
    line-height: 1.65 !important;
}

p {
    font-size: clamp(0.84rem, 1.2vw, 0.9rem) !important;
    line-height: 1.7 !important;
}

/* Muted / description paragraphs */
.taxonomy-hero__description,
.shop-hero__description,
.hero-subtitle {
    font-size: clamp(0.82rem, 1.4vw, 0.95rem) !important;
    line-height: 1.7 !important;
    font-weight: var(--fw-regular) !important;
}


/* ═══════════════════════════════════════════════════════════
   6. NAVIGATION
   ═══════════════════════════════════════════════════════════ */

.main-navigation a {
    font-size: clamp(0.72rem, 1.05vw, 0.82rem) !important;
    font-weight: var(--fw-semibold) !important;
}

.main-navigation ul.sub-menu a {
    font-size: clamp(0.72rem, 1vw, 0.8rem) !important;
}


/* ═══════════════════════════════════════════════════════════
   7. HOME PAGE SECTIONS — section headings scale
   ═══════════════════════════════════════════════════════════ */

.home .home-featured h2,
.home .home-technology h2,
.home .home-logistics h2,
.home .home-quality h2,
.home .home-news h2,
.home .home-faq h2,
.home .home-factory h2,
.home-partners__title {
    font-size: clamp(1.25rem, 2.2vw, 1.6rem) !important;
    font-weight: var(--fw-semibold) !important;
    letter-spacing: -0.02em !important;
}

/* Home stat numbers */
.home .social-proof-bar .stat-item h3 {
    font-size: clamp(1.1rem, 2vw, 1.45rem) !important;
    font-weight: var(--fw-semibold) !important;
}


/* ═══════════════════════════════════════════════════════════
   8. WOOCOMMERCE SHOP LOOP
   ═══════════════════════════════════════════════════════════ */

.woocommerce ul.products li.product h2.woocommerce-loop-product__title {
    font-size: clamp(0.8rem, 1.3vw, 0.92rem) !important;
    font-weight: var(--fw-medium) !important;
    line-height: 1.4 !important;
}

.woocommerce ul.products li.product .price {
    font-size: clamp(0.88rem, 1.4vw, 1rem) !important;
    font-weight: var(--fw-semibold) !important;
}

/* Shop archive hero */
.shop-hero h1 {
    font-size: clamp(1.2rem, 2vw, 1.5rem) !important;
    font-weight: var(--fw-semibold) !important;
}


/* ═══════════════════════════════════════════════════════════
   9. PRODUCT SINGLE PAGE — buy box
   ═══════════════════════════════════════════════════════════ */

.asic-product-title {
    font-size: clamp(1rem, 1.8vw, 1.3rem) !important;
    font-weight: var(--fw-bold) !important;
    line-height: 1.25 !important;
}

.asic-price-block .price-amount {
    font-size: clamp(1.2rem, 2vw, 1.6rem) !important;
    font-weight: var(--fw-bold) !important;
}

.asic-price-block .price-currency {
    font-size: clamp(0.88rem, 1.4vw, 1rem) !important;
}


/* ═══════════════════════════════════════════════════════════
   10. FOOTER
   ═══════════════════════════════════════════════════════════ */

.site-footer h2,
.official-footer h2 {
    font-size: clamp(0.88rem, 1.3vw, 1rem) !important;
    font-weight: var(--fw-semibold) !important;
}

.site-footer h3,
.official-footer h3 {
    font-size: clamp(0.8rem, 1.1vw, 0.9rem) !important;
    font-weight: var(--fw-semibold) !important;
}


/* ═══════════════════════════════════════════════════════════
   11. FORMS & INPUTS — consistent label/input text
   ═══════════════════════════════════════════════════════════ */

label,
.form-label,
.cnt-label {
    font-size: clamp(0.72rem, 1.05vw, 0.8rem) !important;
    font-weight: var(--fw-medium) !important;
}


/* ═══════════════════════════════════════════════════════════
   12. BUTTONS — global size normalisation
   ═══════════════════════════════════════════════════════════ */

.btn,
button:not(.menu-toggle):not([class*="cookie"]) {
    font-size: clamp(0.72rem, 1.1vw, 0.82rem) !important;
    font-weight: var(--fw-semibold) !important;
}

/* Keep hero CTA buttons slightly larger */
.hero-actions-row .btn,
.hero-actions-row a.btn {
    font-size: clamp(0.82rem, 1.3vw, 0.92rem) !important;
}


/* ═══════════════════════════════════════════════════════════
   13. MOBILE OVERRIDES (≤ 640px)
       Ensure nothing is too small or too large on phones
   ═══════════════════════════════════════════════════════════ */

@media (max-width: 640px) {
    /* Cards: slightly larger on mobile for touch readability */
    .miner-product-card__title {
        font-size: 0.82rem !important;
    }

    .miner-product-card__price ins {
        font-size: 0.88rem !important;
    }

    .miner-card-title {
        font-size: 0.9rem !important;
        white-space: normal !important;
    }

    .miner-card-price {
        font-size: 1rem !important;
    }

    /* Page headings on mobile */
    h1:not(.hero-title):not(.site-title) {
        font-size: clamp(1.2rem, 5vw, 1.5rem) !important;
    }

    h2:not(.hero-subtitle) {
        font-size: clamp(1rem, 4.5vw, 1.25rem) !important;
    }

    h3 {
        font-size: clamp(0.88rem, 4vw, 1.05rem) !important;
    }

    /* Home hero on small phones */
    .home .hero-title {
        font-size: clamp(1.5rem, 7vw, 2rem) !important;
        letter-spacing: -0.03em !important;
    }

    /* Body stays readable */
    body, p {
        font-size: 0.875rem !important;
    }

    /* Nav stays compact */
    .main-navigation a {
        font-size: 0.82rem !important;
    }
}

/* ═══════════════════════════════════════════════════════════
   14. TABLET (641px – 1024px)
   ═══════════════════════════════════════════════════════════ */

@media (min-width: 641px) and (max-width: 1024px) {
    .miner-product-card__title {
        font-size: 0.85rem !important;
    }

    .miner-card-title {
        font-size: 0.95rem !important;
    }

    .home .hero-title {
        font-size: clamp(1.6rem, 5vw, 2.2rem) !important;
    }
}
