/*
Theme Name: Woodmart Child
Description: Woodmart Child Theme — Brusnytsia Redesign (Тепла класика)
Author: BRUSNYTSIA
Template: woodmart
Version: 2.0.0
Text Domain: woodmart
*/

/* ==========================================================================
   TOKENS — Brusnytsia "Тепла класика"
   ========================================================================== */
:root {
    --brs-bg: #f0eee9;
    --brs-surface: #faf6f0;
    --brs-surface-2: #fff9f5;
    --brs-white: #ffffff;

    --brs-ink: #3d2c22;
    --brs-ink-2: #6f5b4d;
    --brs-muted: #8a7563;
    --brs-muted-2: #a5837a;

    --brs-brand: #5c4033;
    --brs-brand-hover: #6d5142;
    --brs-brand-fg: #f7efe6;

    --brs-wine: #8e2437;
    --brs-wine-2: #c0304a;

    --brs-border: #e8ddd1;
    --brs-border-2: #eee3d6;
    --brs-chip-border: #ddccbb;

    --brs-ok: #3f7d4e;
    --brs-warn: #a9822e;

    --brs-radius-sm: 6px;
    --brs-radius: 12px;
    --brs-radius-lg: 14px;
    --brs-pill: 999px;

    --brs-serif: 'Cormorant Garamond', Georgia, serif;
    --brs-sans: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

    --brs-pad-x: 48px;
}

/* ==========================================================================
   BASE
   ========================================================================== */
body.brs-redesign,
body.brs-redesign #wrapper {
    background: var(--brs-bg);
    color: var(--brs-ink);
    font-family: var(--brs-sans);
    font-size: 15px;
    line-height: 1.55;
}
body.brs-redesign a { color: var(--brs-brand); text-decoration: none; }
body.brs-redesign a:hover { color: var(--brs-wine); }

/* Приховуємо стандартний WoodMart header/footer коли активний наш редизайн */
body.brs-redesign > .website-wrapper > .whb-header,
body.brs-redesign > .website-wrapper > footer.footer-container {
    display: none !important;
}

/* ==========================================================================
   HEADER — topbar + main
   ========================================================================== */
.brs-topbar {
    background: var(--brs-brand);
    color: var(--brs-brand-fg);
    font-size: 12.5px;
    letter-spacing: 0.02em;
    padding: 8px var(--brs-pad-x);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
}
.brs-topbar__right { display: flex; gap: 24px; flex-wrap: wrap; }
.brs-topbar a { color: var(--brs-brand-fg); }

.brs-header {
    background: var(--brs-surface);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 22px var(--brs-pad-x);
    border-bottom: 1px solid var(--brs-border);
    gap: 32px;
}
.brs-header__brand {
    font-family: var(--brs-serif);
    font-size: 27px;
    font-weight: 600;
    letter-spacing: 0.14em;
    color: var(--brs-brand);
    text-decoration: none;
    white-space: nowrap;
}
.brs-header__nav {
    display: flex;
    gap: 32px;
    font-size: 14.5px;
    font-weight: 500;
    flex-wrap: wrap;
    justify-content: center;
    flex: 1;
}
.brs-header__nav a { color: var(--brs-ink); }
.brs-header__nav a:hover,
.brs-header__nav a.current-menu-item,
.brs-header__nav .current-menu-item > a {
    color: var(--brs-wine);
    font-weight: 600;
}
.brs-header__actions {
    display: flex;
    gap: 22px;
    align-items: center;
    font-size: 14px;
    white-space: nowrap;
}
.brs-header__actions a { color: var(--brs-ink); }
.brs-header__cart {
    background: var(--brs-brand);
    color: var(--brs-brand-fg) !important;
    border-radius: var(--brs-pill);
    padding: 8px 16px;
    font-weight: 600;
}
.brs-header__cart:hover { background: var(--brs-brand-hover); color: var(--brs-brand-fg) !important; }

/* ==========================================================================
   HOMEPAGE — HERO
   ========================================================================== */
.brs-home { background: var(--brs-surface); color: var(--brs-ink); }

.brs-hero {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    align-items: stretch;
}
.brs-hero__text {
    padding: 72px var(--brs-pad-x) 64px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 26px;
}
.brs-hero__kicker {
    font-size: 12.5px;
    font-weight: 700;
    letter-spacing: 0.22em;
    color: var(--brs-wine);
    text-transform: uppercase;
}
.brs-hero__title {
    margin: 0;
    font-family: var(--brs-serif);
    font-size: 62px;
    line-height: 1.05;
    font-weight: 500;
    color: var(--brs-ink);
    text-wrap: balance;
}
.brs-hero__title em {
    font-style: italic;
    color: var(--brs-wine);
}
.brs-hero__lead {
    margin: 0;
    font-size: 16.5px;
    line-height: 1.6;
    color: var(--brs-ink-2);
    max-width: 44ch;
}
.brs-hero__cta { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.brs-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 15px 30px;
    border-radius: var(--brs-pill);
    font-weight: 700;
    font-size: 15px;
    font-family: var(--brs-sans);
    text-decoration: none;
    cursor: pointer;
    border: 1.5px solid transparent;
    transition: all 0.18s ease;
    line-height: 1;
}
.brs-btn--primary { background: var(--brs-brand); color: var(--brs-brand-fg); }
.brs-btn--primary:hover { background: var(--brs-brand-hover); color: var(--brs-brand-fg); }
.brs-btn--outline {
    background: transparent;
    border-color: var(--brs-chip-border);
    color: var(--brs-brand);
    padding: 14px 28px;
    font-weight: 600;
}
.brs-btn--outline:hover { border-color: var(--brs-brand); color: var(--brs-brand); }
.brs-btn--sm { padding: 8px 16px; font-size: 13px; }

.brs-intents { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 4px; align-items: center; }
.brs-intents__label { font-size: 13px; color: var(--brs-muted); }
.brs-chip {
    border: 1px solid var(--brs-chip-border);
    background: var(--brs-white);
    border-radius: var(--brs-pill);
    padding: 7px 15px;
    font-size: 13.5px;
    color: var(--brs-ink);
    text-decoration: none;
    display: inline-block;
}
.brs-chip:hover { border-color: var(--brs-brand); color: var(--brs-brand); }

.brs-hero__visual {
    position: relative;
    min-height: 560px;
    background:
        linear-gradient(135deg, rgba(142,36,55,0.10), rgba(92,64,51,0.15)),
        repeating-linear-gradient(45deg, #f0e0da 0 14px, #e9d4cc 14px 28px);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.brs-hero__visual img {
    width: 100%; height: 100%;
    object-fit: cover;
    position: absolute; inset: 0;
}
.brs-hero__ph {
    font: 12px ui-monospace, monospace;
    color: var(--brs-muted-2);
    background: var(--brs-surface-2);
    padding: 6px 12px;
    border-radius: 6px;
}
.brs-hero__badge {
    position: absolute;
    left: 28px; bottom: 28px;
    background: #fffdfa;
    border-radius: var(--brs-radius-lg);
    padding: 14px 18px;
    box-shadow: 0 8px 30px rgba(60,40,25,0.14);
    display: flex; gap: 12px; align-items: center;
    max-width: calc(100% - 56px);
}
.brs-hero__badge-thumb {
    width: 44px; height: 44px; border-radius: 50%;
    background: repeating-linear-gradient(45deg, #eadfce 0 8px, #e0d1bc 8px 16px);
    flex-shrink: 0;
}
.brs-hero__badge-title { font-weight: 700; font-size: 14px; color: var(--brs-ink); }
.brs-hero__badge-meta { font-size: 13px; color: var(--brs-muted); margin-top: 2px; }

/* ==========================================================================
   SECTION — базовий блок
   ========================================================================== */
.brs-section { padding: 56px var(--brs-pad-x); }
.brs-section--tight { padding-bottom: 8px; }
.brs-section__head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 24px;
    margin-bottom: 26px;
    flex-wrap: wrap;
}
.brs-section__title {
    margin: 0;
    font-family: var(--brs-serif);
    font-size: 36px;
    font-weight: 500;
    color: var(--brs-ink);
    line-height: 1.15;
}
.brs-section__link {
    font-size: 14px;
    font-weight: 600;
    color: var(--brs-wine);
    white-space: nowrap;
}
.brs-section__link:hover { color: var(--brs-wine-2); }

/* ==========================================================================
   CATEGORIES GRID (5 cols)
   ========================================================================== */
.brs-cats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 18px; }
.brs-cat { display: flex; flex-direction: column; gap: 10px; text-decoration: none; }
.brs-cat__img {
    aspect-ratio: 4/5;
    border-radius: var(--brs-radius);
    background: repeating-linear-gradient(45deg, #f0e0da 0 12px, #e9d4cc 12px 24px);
    display: flex; align-items: end; justify-content: center;
    padding-bottom: 10px;
    overflow: hidden;
    position: relative;
}
.brs-cat__img img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.brs-cat__ph { font: 10.5px ui-monospace, monospace; color: var(--brs-muted-2); position: relative; z-index: 1; }
.brs-cat:nth-child(2) .brs-cat__img { background: repeating-linear-gradient(45deg, #efe3d2 0 12px, #e7d7c1 12px 24px); }
.brs-cat:nth-child(3) .brs-cat__img { background: repeating-linear-gradient(45deg, #f2dede 0 12px, #ecd2d2 12px 24px); }
.brs-cat:nth-child(4) .brs-cat__img { background: repeating-linear-gradient(45deg, #ece7dc 0 12px, #e3dccb 12px 24px); }
.brs-cat:nth-child(5) .brs-cat__img { background: repeating-linear-gradient(45deg, #efe0e6 0 12px, #e8d3dc 12px 24px); }
.brs-cat__name {
    font-weight: 600;
    font-size: 15px;
    text-align: center;
    color: var(--brs-ink);
}
.brs-cat:hover .brs-cat__name { color: var(--brs-wine); }

/* ==========================================================================
   PRODUCT CARDS (4 cols)
   ========================================================================== */
.brs-products { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.brs-pcard {
    background: var(--brs-white);
    border-radius: var(--brs-radius-lg);
    overflow: hidden;
    border: 1px solid var(--brs-border-2);
    display: flex; flex-direction: column;
    text-decoration: none;
}
.brs-pcard__img {
    aspect-ratio: 1;
    background: repeating-linear-gradient(45deg, #f0e0da 0 13px, #e9d4cc 13px 26px);
    display: flex; align-items: center; justify-content: center;
    position: relative;
    overflow: hidden;
}
.brs-pcard__img img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.brs-pcard__ph { font: 10.5px ui-monospace, monospace; color: var(--brs-muted-2); position: relative; z-index: 1; }
.brs-pcard:nth-child(2) .brs-pcard__img { background: repeating-linear-gradient(45deg, #efe3d2 0 13px, #e7d7c1 13px 26px); }
.brs-pcard:nth-child(3) .brs-pcard__img { background: repeating-linear-gradient(45deg, #f2dede 0 13px, #ecd2d2 13px 26px); }
.brs-pcard:nth-child(4) .brs-pcard__img { background: repeating-linear-gradient(45deg, #ece7dc 0 13px, #e3dccb 13px 26px); }

.brs-badge {
    position: absolute;
    top: 12px; left: 12px;
    color: #fff;
    font-size: 11.5px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: var(--brs-pill);
    z-index: 2;
}
.brs-badge--ok    { background: var(--brs-ok); }
.brs-badge--warn  { background: var(--brs-warn); }
.brs-badge--wine  { background: var(--brs-wine); }

.brs-pcard__body {
    padding: 16px 18px 18px;
    display: flex; flex-direction: column;
    gap: 8px;
    flex: 1;
}
.brs-pcard__title { font-weight: 600; font-size: 15.5px; color: var(--brs-ink); }
.brs-pcard__row { display: flex; justify-content: space-between; align-items: center; margin-top: auto; }
.brs-pcard__price { font-weight: 800; font-size: 17px; color: var(--brs-ink); }
.brs-pcard__cta {
    background: var(--brs-brand);
    color: var(--brs-brand-fg);
    border-radius: var(--brs-pill);
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    border: 0;
    cursor: pointer;
}
.brs-pcard__cta:hover { background: var(--brs-brand-hover); color: var(--brs-brand-fg); }

/* ==========================================================================
   USP ROW
   ========================================================================== */
.brs-usp {
    margin: 0 var(--brs-pad-x);
    border-top: 1px solid var(--brs-border);
    border-bottom: 1px solid var(--brs-border);
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 32px;
    padding: 36px 0;
}
.brs-usp__num {
    font-family: var(--brs-serif);
    font-size: 26px;
    color: var(--brs-wine);
    line-height: 1;
}
.brs-usp__title { font-weight: 700; margin-top: 6px; color: var(--brs-ink); }
.brs-usp__body {
    font-size: 13.5px;
    color: var(--brs-muted);
    margin-top: 4px;
    line-height: 1.5;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.brs-footer {
    background: var(--brs-surface);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 30px var(--brs-pad-x);
    color: var(--brs-muted);
    font-size: 13.5px;
    gap: 24px;
    flex-wrap: wrap;
    border-top: 1px solid var(--brs-border);
}
.brs-footer__brand {
    font-family: var(--brs-serif);
    font-size: 19px;
    letter-spacing: 0.14em;
    color: var(--brs-brand);
}
.brs-footer__socials { display: flex; gap: 18px; }
.brs-footer__socials a { color: var(--brs-muted); }
.brs-footer__socials a:hover { color: var(--brs-brand); }

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 1080px) {
    .brs-products { grid-template-columns: repeat(3, 1fr); }
    .brs-cats { grid-template-columns: repeat(3, 1fr); }
    .brs-usp { grid-template-columns: repeat(2, 1fr); }
    .brs-hero__title { font-size: 48px; }
}
@media (max-width: 780px) {
    :root { --brs-pad-x: 20px; }
    .brs-topbar { font-size: 11.5px; }
    .brs-header { flex-wrap: wrap; gap: 16px; padding: 16px var(--brs-pad-x); }
    .brs-header__nav { order: 3; width: 100%; justify-content: flex-start; gap: 20px; font-size: 13.5px; overflow-x: auto; }
    .brs-hero { grid-template-columns: 1fr; }
    .brs-hero__text { padding: 40px var(--brs-pad-x); }
    .brs-hero__title { font-size: 36px; }
    .brs-hero__visual { min-height: 320px; }
    .brs-section { padding: 40px var(--brs-pad-x); }
    .brs-section__title { font-size: 28px; }
    .brs-products, .brs-cats { grid-template-columns: repeat(2, 1fr); gap: 14px; }
    .brs-usp { grid-template-columns: 1fr; gap: 20px; padding: 24px 0; }
    .brs-footer { flex-direction: column; text-align: center; }
}

/* ===== Global mobile/brand hardening (анти-капс + iOS zoom) ===== */

/* 1) Анти-капс: кнопки НІКОЛИ не капсом (глушить WoodMart text-transform: uppercase).
   Свідомі капс-лейбли (kicker у div/span) не зачіпаються — тут тільки кнопкові селектори. */
html body button,
html body .button,
html body .btn,
html body input[type="submit"],
html body input[type="button"],
html body .woocommerce a.button,
html body .woocommerce button.button {
    text-transform: none !important;
    letter-spacing: 0 !important;
}

/* 2) Головні CTA (#720000): на hover фон #8f0000, текст ЗАЛИШАЄТЬСЯ #fff
   (глушить WoodMart hover-колір, через який текст темнів).
   Secondary/ghost-кнопки (.brs-btn--outline, .wl-*) не чіпаємо. */
html body .button.alt:hover,
html body .woocommerce a.button.alt:hover,
html body .woocommerce button.button.alt:hover,
html body .single_add_to_cart_button:hover,
html body .checkout-button:hover,
html body #place_order:hover,
html body .woocommerce a.button:hover,
html body .woocommerce button.button:hover {
    color: #fff !important;
    background: #8f0000 !important;
}

/* 3) iOS-зум: усі текстові поля >=16px на мобілці, інакше Safari зумить при фокусі */
@media (max-width: 780px) {
    html body input[type="text"],
    html body input[type="email"],
    html body input[type="tel"],
    html body input[type="password"],
    html body input[type="search"],
    html body input[type="number"],
    html body input[type="date"],
    html body select,
    html body textarea,
    html body .input-text {
        font-size: 16px !important;
    }
}

/* 4) Тап-цілі на мобілці */
@media (max-width: 780px) {
    /* Пігулки/чіпи/таби/фільтри — мінімум 40px висоти, padding пропорційно більший */
    html body .brs-co-pill,
    html body .wl-chip,
    html body .wl-tab,
    html body .brs-dash__filter {
        min-height: 40px !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        padding: 8px 18px !important;
    }

    /* Видалення товару в кошику — тап-зона мін. 40x40, хрестик по центру
       (brs-cart-checkout.php задає width/height 30px !important, але не min-* і не display —
       min-width/min-height перемагають height за правилами CSS sizing без війни специфічності) */
    html body td.product-remove a.remove {
        min-width: 40px !important;
        min-height: 40px !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    /* Крапки hero-каруселі (.brs-hero__dot у .brs-hero__dots, home-redesign.php):
       12px візуально. width НЕ чіпаємо — ним керує JS inline (8px неактивна / 24px активна),
       min-width розширює тільки неактивні крапки, активна пігулка 24px зберігається. */
    html body .brs-hero__dots { gap: 12px !important; }
    html body .brs-hero__dots .brs-hero__dot {
        min-width: 12px !important;
        height: 12px !important;
        position: relative !important;
    }
    /* Невидимий розширювач тап-області до >=24x24 (псевдоелемент бере участь у hit-test) */
    html body .brs-hero__dots .brs-hero__dot::after {
        content: "";
        position: absolute;
        top: -6px;
        right: -6px;
        bottom: -6px;
        left: -6px;
    }
}
