/* ==========================================================================
   Biomag — design system catalog (standalone).
   Variabilele --brand-* sunt injectate din admin (branding) în <head>.
   Acest fișier e auto-suficient: nu depinde de alt CSS.
   ========================================================================== */
:root {
    --brand-primary: #00a651;
    --brand-secondary: #0c7a3c;
    --brand-accent: #f6a800;
    --brand-bg: #ffffff;
    --brand-surface: #f6f6f6;
    --brand-text: #333333;
    --brand-font-heading: 'Inter', system-ui, sans-serif;
    --brand-font-body: 'Inter', system-ui, sans-serif;

    /* Tokeni (suprascriși de brand-head din admin; aici fallback-uri). */
    --bm-page-bg: #f5f5f5;
    --bm-line: #e6e6e6;
    --bm-border: #e6e6e6;
    --bm-muted: #777;
    --bm-text-muted: #6b7280;
    --bm-radius: 12px;
    --bm-radius-sm: 8px;
    --bm-radius-pill: 999px;
    --bm-shadow-soft: 0 2px 8px rgba(0, 0, 0, .04);
    --bm-shadow: 0 10px 28px rgba(0, 0, 0, .10);
    --bm-shadow-hover: 0 14px 34px rgba(0, 0, 0, .14);
    --bm-transition: .18s ease-out;
    --bm-hover-lift: translateY(-2px);
    --bm-price: #e30613;
    --bm-green: var(--brand-primary);
    --bm-green-dark: var(--brand-secondary);
    --bm-container: 1415px;

    /* Paleta verde biomag — TOATE verdurile din CSS-urile temei trec prin aceste
       variabile (cu fallback identic la punctul de folosire). O temă copil le
       suprascrie din brand-head (vezi pasiune) fără să copieze fișierele CSS. */
    --bm-green-deep: #0b7e33;        /* text pe chip-uri deschise */
    --bm-green-bright: #00b34a;      /* accente vii (contor coș etc.) */
    --bm-green-soft: #f6f9f6;        /* fundal pal iconițe/beneficii/secțiuni (valoare din tema originală biomag) */
    --bm-flag-bio: #2e7d32;          /* stegulețul BIO (semantic) */
    --bm-chip-bg: #e4f6e4;           /* fundal chip deschis */
    --bm-chip-bg-hover: #d4ebd4;
    --bm-soft-bg: #e6f8ee;           /* benzi/fundaluri pale */
    --bm-cart-green: #1f8a5b;        /* sistemul cart drawer */
    --bm-cart-green-dark: #0f6b44;
    --bm-cart-panel-bg: #eef6f2;
    --bm-hero-btn-bg: rgba(122, 203, 90, 0.92);       /* butoane overlay hero */
    --bm-hero-btn-bg-hover: rgba(110, 185, 80, 0.95);
    --bm-price-card: #e62929;        /* prețul de pe cardul de produs */

    --bm-green-mid: #6ab548;         /* hover buton newsletter */
    --bm-green-emphasis: #004122;    /* bs primary-text-emphasis */
    --bm-green-bg-subtle: #e3f7eb;   /* bs primary-bg-subtle */
    --bm-green-border-subtle: #b9e7cd;
    --bm-success: #06b26a;           /* bs success + gradienți modal */
    --bm-success-bg-subtle: #d1e7dd;
    --bm-success-border-subtle: #a3cfbb;
    --bm-success-text-emphasis: #0a3622;
    --bm-chip-alt-bg: #d9f2e3;       /* chip-uri hover (add produs, search footer) */
    --bm-chip-alt-fg: #00a241;
    --bm-thumb-accent: #46b354;      /* thumb activ galerie produs */
    --bm-thumb-bg: #f2fbf4;
    --bm-thumb-more-a: #e8f5e9;      /* gradientul „+N" din galerii */
    --bm-thumb-more-b: #c8e6c9;
    --bm-card-hover-border: #7ec25a;
    --bm-card-hover-border-soft: #9fd29f;
    --bm-badge-grad-a: #0ab735;      /* gradienți badge-uri (nou/redus) */
    --bm-badge-grad-b: #4fd771;
    --bm-badge-grad-c: #44c27f;
    --bm-menu-green: #00a651;        /* scopul #categmenu (megamenu) */
    --bm-menu-green-dark: #009143;
    --bm-pill-green: #008000;        /* scopul pill-urilor din theme.min */
    --bm-pill-green-dark: #006800;
    --bm-pill-green-soft: #f6f9f6;
    --bm-whatsapp: #25d366;          /* butonul flotant WhatsApp */
    --bm-whatsapp-dark: #075E54;
    --bm-teal: #20c997;              /* bs teal */
    --bm-footer-bg: #1f2a24;         /* footerul dark (bm-footer) */
    --bm-footer-fg: #cfe8d8;
}

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

html, body { margin: 0; padding: 0; }

body {
    font-family: var(--brand-font-body);
    color: var(--brand-text);
    background: var(--bm-page-bg);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { font-family: var(--brand-font-heading); line-height: 1.2; margin: 0 0 .5em; }

a { color: var(--brand-secondary); text-decoration: none; }
a:hover { color: var(--brand-primary); }

img { max-width: 100%; height: auto; display: block; }

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

/* ---------- Butoane ---------- */
.bm-btn {
    display: inline-flex; align-items: center; gap: .45rem;
    background: var(--brand-primary); color: #fff;
    border: 0; border-radius: var(--bm-radius);
    padding: .7rem 1.25rem; font-weight: 600; font-size: .95rem;
    cursor: pointer; transition: background .15s, transform .05s;
}
.bm-btn:hover { background: var(--brand-secondary); color: #fff; }
.bm-btn:active { transform: translateY(1px); }
.bm-btn--ghost { background: transparent; color: var(--brand-primary); border: 1px solid var(--brand-primary); }
.bm-btn--ghost:hover { background: var(--brand-primary); color: #fff; }
.bm-btn--accent { background: var(--brand-accent); color: #1a1a1a; }

/* ---------- Header ---------- */
.bm-header { background: #fff; border-bottom: 1px solid var(--bm-line); position: sticky; top: 0; z-index: 50; }
.bm-header__top { display: flex; align-items: center; gap: 24px; padding: 14px 0; }
.bm-logo { font-family: var(--brand-font-heading); font-weight: 800; font-size: 1.5rem; color: var(--brand-primary); white-space: nowrap; }
.bm-logo img { max-height: 44px; width: auto; }
.bm-search { flex: 1; display: flex; }
.bm-search input {
    flex: 1; border: 1px solid var(--bm-line); border-right: 0;
    border-radius: var(--bm-radius) 0 0 var(--bm-radius);
    padding: .65rem .9rem; font-size: .95rem; outline: none;
}
.bm-search input:focus { border-color: var(--brand-primary); }
.bm-search button {
    background: var(--brand-primary); color: #fff; border: 0;
    border-radius: 0 var(--bm-radius) var(--bm-radius) 0; padding: 0 1.1rem; cursor: pointer;
}
.bm-header__actions { display: flex; align-items: center; gap: 18px; white-space: nowrap; }
.bm-iconlink { color: var(--brand-text); font-weight: 500; display: inline-flex; align-items: center; gap: .4rem; }
.bm-iconlink:hover { color: var(--brand-primary); }
.bm-cart-count { background: var(--brand-accent); color: #1a1a1a; border-radius: 999px; font-size: .72rem; font-weight: 700; padding: .05rem .45rem; }

/* nav categorii */
.bm-nav { border-top: 1px solid var(--bm-line); }
.bm-nav ul { list-style: none; display: flex; flex-wrap: wrap; gap: 4px; margin: 0; padding: 0; }
.bm-nav a { display: block; padding: .7rem 1rem; color: var(--brand-text); font-weight: 600; font-size: .92rem; }
.bm-nav a:hover { color: var(--brand-primary); }

/* ---------- Hero ---------- */
.bm-hero { background: linear-gradient(120deg, var(--brand-primary), var(--brand-secondary)); color: #fff; padding: 56px 0; }
.bm-hero h1 { color: #fff; font-size: 2.4rem; max-width: 18ch; }
.bm-hero p { font-size: 1.1rem; opacity: .95; max-width: 52ch; }
.bm-hero .bm-btn { background: #fff; color: var(--brand-secondary); margin-top: 1rem; }
.bm-hero .bm-btn:hover { background: var(--brand-accent); color: #1a1a1a; }

/* ---------- Secțiuni ---------- */
.bm-section { padding: 44px 0; }
.bm-section__head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 22px; }
.bm-section__head h2 { font-size: 1.6rem; }
.bm-section__head a { font-weight: 600; }

/* grid categorii */
.bm-cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; }
.bm-cat-card {
    background: var(--brand-surface); border: 1px solid var(--bm-line); border-radius: var(--bm-radius);
    padding: 22px 16px; text-align: center; font-weight: 600; color: var(--brand-text);
    transition: border-color .15s, transform .1s, box-shadow .15s;
}
.bm-cat-card:hover { border-color: var(--brand-primary); color: var(--brand-primary); transform: var(--bm-hover-lift); box-shadow: var(--bm-shadow-hover); }

/* grid produse */
.bm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; }
.bm-card {
    background: #fff; border: 1px solid var(--bm-line); border-radius: var(--bm-radius);
    overflow: hidden; display: flex; flex-direction: column; transition: box-shadow var(--bm-transition), transform var(--bm-transition);
}
.bm-card:hover { box-shadow: var(--bm-shadow-hover); transform: var(--bm-hover-lift); }
.bm-card__img { aspect-ratio: 1; background: var(--brand-surface); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.bm-card__img img { width: 100%; height: 100%; object-fit: contain; }
.bm-card__body { padding: 12px 14px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.bm-card__name { font-weight: 600; font-size: .95rem; color: var(--brand-text); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.7em; }
.bm-card__name:hover { color: var(--brand-primary); }
.bm-card__price { font-weight: 800; font-size: 1.15rem; color: var(--brand-primary); margin-top: auto; }
.bm-card__old { text-decoration: line-through; color: var(--bm-muted); font-weight: 500; font-size: .9rem; margin-left: .4rem; }
.bm-badge { align-self: flex-start; background: var(--brand-accent); color: #1a1a1a; font-size: .72rem; font-weight: 700; padding: .1rem .5rem; border-radius: 6px; }

/* ---------- Conținut generic (pagini legale etc.) ---------- */
.bm-content { max-width: 880px; margin: 0 auto; padding: 40px 20px; }
.bm-content h1 { font-size: 2rem; }

/* ---------- Footer ---------- */
.bm-footer { background: var(--bm-footer-bg, #1f2a24); color: var(--bm-footer-fg, #cfe8d8); margin-top: 48px; padding: 40px 0 24px; }
.bm-footer a { color: var(--bm-footer-fg, #cfe8d8); }
.bm-footer a:hover { color: #fff; }
.bm-footer__cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 28px; }
.bm-footer h4 { color: #fff; font-size: 1rem; margin-bottom: 12px; }
.bm-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: .92rem; }
.bm-footer__bottom { border-top: 1px solid rgba(255,255,255,.12); margin-top: 28px; padding-top: 18px; font-size: .85rem; opacity: .8; text-align: center; }

/* ---------- Empty state ---------- */
.bm-empty { text-align: center; padding: 48px 20px; color: var(--bm-muted); background: var(--brand-surface); border-radius: var(--bm-radius); }

@media (max-width: 720px) {
    .bm-header__top { flex-wrap: wrap; }
    .bm-search { order: 3; flex-basis: 100%; }
    .bm-hero h1 { font-size: 1.8rem; }
}

/* ---------- Rând produse home (grilă 5/rând + cutie card) ---------- */
.bm-prod-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; align-items: stretch; }
.bm-prod-row .biomag-card {
    max-width: none; margin: 0;
    background: #fff;
    border: 1px solid var(--bm-border);
    border-radius: var(--bm-radius);
    overflow: hidden;
    box-shadow: var(--bm-shadow-soft);
    transition: box-shadow var(--bm-transition), transform var(--bm-transition), border-color var(--bm-transition);
}
.bm-prod-row .biomag-card:hover {
    border-color: var(--bm-green);
    box-shadow: var(--bm-shadow);
    transform: var(--bm-hover-lift);
}
@media (max-width: 1200px) { .bm-prod-row { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 992px)  { .bm-prod-row { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 576px)  { .bm-prod-row { grid-template-columns: repeat(2, 1fr); gap: 10px; } }
