/* ============================================================
   header.css — utility bar, masthead (logo · search · account),
   category strip, mobile drawer
   ============================================================ */

/* ---------- Static utility top bar ---------- */
.utilbar { background: var(--ink); color: #fff; font-size: .82rem; }
.utilbar__inner {
    max-width: var(--maxw); margin-inline: auto; padding: .5rem var(--gap);
    display: flex; align-items: center; justify-content: center; gap: .7rem; flex-wrap: wrap;
    letter-spacing: .02em;
}
.utilbar__phone { font-weight: 700; }
.utilbar__phone:hover { color: #fff; text-decoration: underline; }
.utilbar__dot { color: var(--accent); }

/* ---------- Masthead ---------- */
.masthead {
    position: sticky; top: 0; z-index: 100;
    background: #fff; border-bottom: 1px solid var(--line);
    transition: box-shadow .3s var(--ease);
}
.masthead.is-stuck { box-shadow: 0 6px 24px -16px rgba(0,0,0,.4); }
.masthead__inner {
    max-width: var(--maxw); margin-inline: auto; padding: .7rem var(--gap);
    display: grid; grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas: "brand search account";
    align-items: center; gap: clamp(1rem, 3vw, 2.5rem);
}

/* Brand / logo */
.brand { grid-area: brand; display: inline-flex; align-items: center; }
.brand__logo { width: auto; height: 60px; display: block; transition: transform .35s var(--ease); }
.brand:hover .brand__logo { transform: scale(1.03); }

/* Center search */
.search {
    grid-area: search; justify-self: center; width: 100%; max-width: 760px;
    display: flex; align-items: center;
    background: #fff; border: 1.6px solid var(--ink); border-radius: 100px; overflow: hidden;
    transition: box-shadow .2s;
}
.search:focus-within { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent); }
.search__input { flex: 1; border: 0; background: none; font: inherit; font-size: .95rem; padding: .7rem 1.2rem; outline: none; }
.search__btn { display: grid; place-items: center; width: 52px; align-self: stretch; background: var(--accent); color: #fff; transition: background .2s; }
.search__btn:hover { background: var(--accent-dark); }

/* Account + cart */
.account { grid-area: account; display: flex; align-items: center; gap: 1.3rem; }
.account__phone,
.account__link { display: inline-flex; align-items: center; gap: .45rem; font-weight: 600; font-size: .92rem; color: var(--ink); transition: color .2s; white-space: nowrap; }
.account__phone:hover,
.account__link:hover { color: var(--accent); }
.account__phone svg { color: var(--accent); }

/* Account dropdown */
.account__menu { position: relative; }
.account__link--menu { cursor: pointer; }
.account__caret { transition: transform .2s; opacity: .7; }
.account__menu.is-open .account__caret { transform: rotate(180deg); }
.account__dropdown {
    position: absolute; top: calc(100% + 10px); right: 0; min-width: 184px; z-index: 60;
    background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: .4rem;
    box-shadow: 0 14px 38px rgba(0, 0, 0, .14); display: none; }
.account__menu.is-open .account__dropdown,
.account__menu:focus-within .account__dropdown { display: block; }
.account__dropdown a {
    display: block; padding: .6rem .75rem; border-radius: 8px; font-size: .9rem; font-weight: 600;
    color: var(--ink); white-space: nowrap; transition: background .15s, color .15s; }
.account__dropdown a:hover { background: var(--paper-2); color: var(--accent); }
.account__signout { border-top: 1px solid var(--line); margin-top: .3rem; padding-top: .7rem !important; color: #c0392b !important; }
.account__signout:hover { background: #fdecea !important; }
.account__cart { position: relative; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; color: var(--ink); transition: background .2s, color .2s; }
.account__cart:hover { background: var(--paper-2); color: var(--accent); }
.account__badge {
    position: absolute; top: -2px; right: -2px; min-width: 19px; height: 19px; padding: 0 4px;
    background: var(--accent); color: #fff; font-size: .68rem; font-weight: 700;
    border-radius: 100px; display: grid; place-items: center; line-height: 1;
}

/* ---------- Search suggestions (typeahead) ---------- */
.search-suggest {
    position: absolute; z-index: 200; background: #fff;
    border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg);
    padding: .4rem; max-height: 70vh; overflow-y: auto;
    opacity: 0; visibility: hidden; transform: translateY(-6px);
    transition: opacity .18s var(--ease), transform .18s var(--ease), visibility .18s;
}
.search-suggest.is-open { opacity: 1; visibility: visible; transform: none; }
.ss-group { font-size: .68rem; text-transform: uppercase; letter-spacing: .14em; font-weight: 700;
    color: var(--sage); padding: .6rem .7rem .3rem; }
.ss-item { display: flex; align-items: center; gap: .7rem; padding: .5rem .7rem; border-radius: 10px; color: var(--ink); }
.ss-item:hover, .ss-item.is-active { background: var(--paper-2); }
.ss-thumb { flex: 0 0 auto; width: 42px; height: 42px; border-radius: 8px; overflow: hidden; background: var(--paper-2);
    display: grid; place-items: center; }
.ss-thumb img { width: 100%; height: 100%; object-fit: cover; }
.ss-noimg { color: var(--blush); font-size: 1.1rem; }
.ss-name { flex: 1; font-weight: 600; font-size: .92rem; }
.ss-price { color: var(--forest); font-weight: 700; font-size: .88rem; white-space: nowrap; }
.ss-item--cat { padding-left: .7rem; }
.ss-item--cat .ss-name { font-weight: 500; color: var(--accent); }
.ss-empty { padding: .9rem .8rem; color: var(--sage); font-size: .9rem; }

/* ---------- Category strip ---------- */
.catnav { background: #fff; border-bottom: 1px solid var(--line); }
.catnav__list {
    max-width: var(--maxw); margin-inline: auto; padding: 0 var(--gap);
    display: flex; align-items: center; gap: .3rem; flex-wrap: wrap;
}
.catnav__link {
    display: inline-block; padding: .85rem 1rem; font-weight: 600; font-size: .92rem; color: var(--ink);
    border-bottom: 2px solid transparent; transition: color .2s, border-color .2s;
}
.catnav__link:hover, .catnav__link.is-active { color: var(--accent); border-bottom-color: var(--accent); }

/* ---------- Mobile menu toggle (hidden on desktop) ---------- */
.nav-toggle { grid-area: toggle; display: none; flex-direction: column; gap: 5px; width: 40px; height: 40px; padding: 11px 8px; }
.nav-toggle span { display: block; height: 2px; background: var(--ink); border-radius: 2px; transition: transform .3s var(--ease), opacity .3s var(--ease); }
.nav-toggle.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.is-open span:nth-child(2) { opacity: 0; }
.nav-toggle.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Mobile drawer (full category list) ---------- */
.drawer {
    position: fixed; inset: 0 auto 0 0; width: min(330px, 86vw);
    background: #fff; box-shadow: var(--shadow-lg); z-index: 130;
    transform: translateX(-100%); transition: transform .35s var(--ease);
    padding: 1.2rem 1.3rem 2rem; overflow-y: auto;
}
.drawer.is-open { transform: translateX(0); }
.drawer__head { display: flex; align-items: center; justify-content: space-between; font-weight: 700; font-size: 1.1rem; margin-bottom: 1rem; }
.drawer__close { font-size: 1.8rem; line-height: 1; color: var(--ink); }
.drawer__signin { display: block; background: var(--accent); color: #fff; text-align: center; font-weight: 600; padding: .75rem; border-radius: 100px; margin-bottom: 1.4rem; }
.drawer__label { text-transform: uppercase; letter-spacing: .1em; font-size: .72rem; font-weight: 700; color: var(--sage); margin-bottom: .5rem; }
.drawer__list li a { display: block; padding: .7rem .2rem; border-bottom: 1px solid var(--line); font-weight: 500; color: var(--ink); }
.drawer__list li a:hover { color: var(--accent); }

/* Collapsible parent → child category groups in the mobile drawer */
.drawer__list .drawer__group { border-bottom: 1px solid var(--line); }
.drawer__list .drawer__row { display: flex; align-items: center; }
.drawer__list .drawer__row > a { flex: 1; border-bottom: none; }
.drawer__toggle { flex: none; width: 42px; height: 42px; display: grid; place-items: center;
    color: var(--sage); border-radius: 8px; }
.drawer__toggle svg { transition: transform .2s ease; }
.drawer__group.is-open > .drawer__row .drawer__toggle svg { transform: rotate(180deg); }
.drawer__sub { display: none; padding-left: .9rem; }
.drawer__group.is-open > .drawer__sub { display: block; }
.drawer__list .drawer__sub li a { padding: .55rem .2rem; font-weight: 400; opacity: .85; }
.drawer__list .drawer__sub li:last-child a { border-bottom: none; }

/* Wishlist icon in the header */
.account__wish { position: relative; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; color: var(--ink); transition: background .2s, color .2s; }
.account__wish:hover { background: var(--paper-2); color: var(--accent); }
.account__badge--wish { background: var(--blush, #e0556b); }
.account__badge--wish[hidden] { display: none; }
