/* ============================================================
   BASE — typography fundamentals + cross-page utility classes.
   Inlined as critical CSS by layouts/default.inc.php (3.4 of doc).
   Keep small (~3 KB target). Page-specific styles → home/category/product.css.
   ============================================================ */

/* --- Base body type — MUST match mockup (body 15px / 1.55, Inter).
       Without this the browser default 16px made all text slightly larger/coarser than the mockup. --- */
body {
    margin: 0;
    font-family: var(--sans);
    font-size: 15px;
    line-height: 1.55;
    color: var(--ink);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* The [hidden] attribute MUST win over display rules. Without this, .prod-grid{display:grid}
   overrode it and the inactive "Nowości" tab panel (marked hidden) still rendered → home featured
   showed all 16 products (4 rows) instead of 8 (2 rows). */
[hidden] { display: none !important; }

/* --- Typography fundamentals (mockup) --- */
h1, h2, h3, h4 {
    margin: 0;
    font-family: var(--serif);
    font-weight: 500;
    letter-spacing: -0.01em;
    line-height: 1.1;
    color: var(--ink);
}

/* --- "Eyebrow" — uppercase mini-heading above section titles --- */
.eyebrow {
    display: inline-block;
    font-size: 11px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--accent);
    font-weight: 500;
    margin-bottom: 14px;
}
.eyebrow--light { color: var(--accent-2); }

/* --- Section title (BEM: .section-title) + legacy fallback (.section-head h2) --- */
.section-title,
.section-head h2 {
    font-family: var(--serif);
    font-size: clamp(28px, 3.4vw, 44px);
    line-height: 1.08;
    color: var(--ink);
    margin: 0;
    font-weight: 500;
}
.section-title em,
.section-head h2 em { font-style: italic; color: var(--accent); }
.section-title--light { color: #fff; }

/* --- Section header wrapper --- */
.section-head {
    text-align: center;
    margin-bottom: 40px;
}
.section-head--row {
    display: flex;
    align-items: end;
    justify-content: space-between;
    text-align: left;
    flex-wrap: wrap;
    gap: 20px;
}
.section-head--row .eyebrow { margin-bottom: 8px; }
.section-head .eyebrow { /* legacy var fallback */
    font-size: 11px;
    letter-spacing: 0.22em;
    color: var(--accent);
    margin-bottom: 14px;
}
.section-head p {
    color: var(--ink-soft);
    max-width: 560px;
    margin: 0 auto;
    font-size: 16px;
    line-height: 1.6;
}
.section-cta {
    text-align: center;
    margin-top: 56px;
}

/* --- Buttons (BEM: .btn--primary/.btn--ghost/.btn--accent/.btn--lg) --- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 13px 26px;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    transition: all var(--transition);
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
}
.btn--primary { background: var(--ink); color: #fff; }
.btn--primary:hover { background: var(--accent); opacity: 1; }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--line-2); }
.btn--ghost:hover { border-color: var(--ink); opacity: 1; }
.btn--accent { background: linear-gradient(135deg, var(--accent-2), var(--accent)); color: #fff; }
.btn--accent:hover { filter: brightness(1.07); opacity: 1; }
.btn--lg { padding: 16px 36px; font-size: 13px; }

/* --- LEGACY button class aliases (.btn-primary / .btn-outline / .btn-light)
       Kept until pages/index|category|product.inc.php get rewritten in
       phases 13–15 to use BEM names. Then these can be removed. --- */
.btn-primary { background: var(--ink); color: #fff; padding: 14px 28px; border-radius: var(--radius); font-size: 13px; font-weight: 500; letter-spacing: 0.05em; text-transform: uppercase; display: inline-flex; align-items: center; gap: 8px; transition: all var(--transition); }
.btn-primary:hover { background: var(--accent); opacity: 1; transform: translateY(-1px); }
.btn-outline { background: transparent; color: var(--white); border: 1px solid rgba(255,255,255,.6); padding: 14px 28px; border-radius: var(--radius); font-size: 13px; font-weight: 500; letter-spacing: 0.05em; text-transform: uppercase; display: inline-flex; align-items: center; gap: 8px; transition: all var(--transition); }
.btn-outline:hover { background: var(--white); color: var(--ink); opacity: 1; }
.btn-light { background: transparent; color: var(--ink); border: 1px solid var(--line-2); padding: 14px 28px; border-radius: var(--radius); font-size: 13px; font-weight: 500; letter-spacing: 0.05em; text-transform: uppercase; display: inline-flex; align-items: center; gap: 8px; transition: all var(--transition); }
.btn-light:hover { border-color: var(--ink); opacity: 1; }

/* --- Stars (reused: home reviews, product detail rating) --- */
.stars {
    color: var(--accent);
    letter-spacing: 0.1em;
    font-size: 16px;
}

/* Uwaga: BEZ globalnego "section { padding }" — makieta paddinguje każdą
   sekcję osobno (.cats, .products, .prod-tabs, ...). Globalna reguła
   rozlewała 100px na karty kasy (.ckblock), .product__main i koszyk. */

/* --- Responsive base --- */
@media (max-width: 720px) {
    .section-head { margin-bottom: 28px; }
    .section-head--row { flex-direction: column; align-items: flex-start; }
    .section-head p { font-size: 15px; }
}

/* ============================================================
   A11y: respect prefers-reduced-motion (system-wide preference).
   Kills animations + smooth scroll for sensitive users.
   ============================================================ */
@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;
    }
    ::view-transition-group(*),
    ::view-transition-old(*),
    ::view-transition-new(*) {
        animation: none !important;
    }
}

/* ============================================================
   View Transitions API — 200ms cross-fade between pages on
   browsers that support it (Chrome 126+, Edge 126+).
   Pairs with Speculation Rules prerender for instant + smooth nav.
   Falls back to no transition on Firefox/Safari.
   ============================================================ */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: 200ms cubic-bezier(0.4, 0, 1, 1) both fade-out; }
::view-transition-new(root) { animation: 250ms cubic-bezier(0, 0, 0.2, 1) both fade-in; }
@keyframes fade-out { to { opacity: 0; } }
@keyframes fade-in  { from { opacity: 0; } }
