/* ============================================================
   ACFixMart acf-fit.css  (Nov 14)  -  loaded LAST (after acf-v3.css)
   1. Header that always fits: ONE row on every phone, cart can never be clipped on any width
   2. Accessibility: colour contrast (WCAG AA), tap-target size, carousel dots
   Rollback: remove the single <link ... acf-fit.css> line in public/_shared/brand-head.php
   (or restore brand-head.php.bak_nov14). No PHP logic is involved in this file.
   ============================================================ */

/* ───────── 1. HEADER — shared ───────── */
html body.acf-v2 header.acf-hdr .acf-hdr-in{
  position:relative;display:flex!important;flex-wrap:nowrap!important;align-items:center!important;
  height:auto!important;min-width:0!important;max-width:100%;box-sizing:border-box;overflow:visible!important}
html body.acf-v2 header.acf-hdr .acf-hdr-in>*{min-width:0}
html body.acf-v2 header.acf-hdr .acf-logo{flex:0 0 auto!important}
html body.acf-v2 header.acf-hdr .acf-search{display:flex!important;visibility:visible!important}
html body.acf-v2 header.acf-hdr .acf-actions>*{flex:0 0 auto}
html body.acf-v2 header.acf-hdr .acf-cart{flex:0 0 auto!important;white-space:nowrap!important;overflow:visible!important;margin-left:0!important}
html body.acf-v2 header.acf-hdr .acf-search-btn{min-width:44px}
/* language button: the v2 header is white, so it needs dark-on-light colours (brand.css makes it white-on-translucent) */
html body.acf-v2 header.acf-hdr .acf-lang>button{background:#eef3fb!important;color:#0a2a6b!important;border:1px solid #dde7f7!important;height:36px;min-width:36px;white-space:nowrap}
html body.acf-v2 header.acf-hdr .acf-lang>button:hover{background:#e0eafb!important}
html body.acf-v2 header.acf-hdr .acf-lang-menu{z-index:3000}
/* Dropdowns (language, account) must sit above the full-width nav row: live css gave the nav z-index:3 and the action buttons z-index:2,
   so on 769-1599px the nav covered the first menu item and "English" could not be clicked. */
html body.acf-v2 header.acf-hdr .acf-hdr-in .acf-v2-nav{z-index:1!important}
html body.acf-v2 header.acf-hdr .acf-hdr-in .acf-actions>*{position:relative;z-index:6!important}
html body.acf-v2 header.acf-hdr .acf-hdr-in .acf-actions>.acf-lang.open,html body.acf-v2 header.acf-hdr .acf-hdr-in .acf-actions>.acf-user.open,html body.acf-v2 header.acf-hdr .acf-hdr-in .acf-actions>.acf-user:focus-within{z-index:40!important}

/* ───────── 1a. PHONES (<=768px): everything on ONE row ─────────
   [logo] [search - grows, expands to full width when tapped] [language] [city] [account] [cart] */
@media(max-width:768px){
  html body.acf-v2 header.acf-hdr .acf-hdr-in{gap:6px!important;padding:6px 8px!important;min-height:54px}
  html body.acf-v2 header.acf-hdr .acf-logo{order:1!important;padding:3px 6px!important;width:auto!important;max-width:none!important}
  html body.acf-v2 header.acf-hdr .acf-logo img{height:24px!important;width:auto!important;max-width:none!important}
  html body.acf-v2 header.acf-hdr .acf-v2-nav{display:none!important}
  html body.acf-v2 header.acf-hdr .acf-search{order:2!important;flex:1 1 0!important;width:auto!important;min-width:0!important;max-width:none!important;height:40px!important;margin:0!important}
  html body.acf-v2 header.acf-hdr .acf-actions{order:3!important;display:flex!important;flex:0 0 auto!important;flex-wrap:nowrap!important;align-items:center!important;gap:2px!important;margin:0!important;width:auto!important;min-width:0!important}

  /* actions: icon-only, compact but still >=36px targets */
  html body.acf-v2 header.acf-hdr .acf-lang>button{min-width:36px!important;min-height:36px!important;height:36px!important;padding:0 8px!important;gap:0!important;justify-content:center}
  html body.acf-v2 header.acf-hdr .acf-lang .lg-label,
  html body.acf-v2 header.acf-hdr .acf-lang .lg-code,
  html body.acf-v2 header.acf-hdr .acf-lang>button>i:last-child{display:none!important}
  html body.acf-v2 header.acf-hdr .acf-actions>button.acf-act{min-width:36px!important;min-height:36px!important;padding:4px 6px!important;background:none!important;border:0!important;flex-direction:row!important}
  html body.acf-v2 header.acf-hdr .acf-actions>button.acf-act .city-name{display:none!important}
  html body.acf-v2 header.acf-hdr .acf-actions>a.acf-act[href*="wishlist"]{display:none!important}
  html body.acf-v2 header.acf-hdr .acf-actions>a.acf-act[href*="login"],
  html body.acf-v2 header.acf-hdr .acf-actions>.acf-user{
    width:36px!important;min-width:36px!important;height:36px!important;min-height:36px!important;padding:0!important;border-radius:50%!important;
    display:inline-flex!important;align-items:center!important;justify-content:center!important;flex-direction:row!important;gap:0!important}
  html body.acf-v2 header.acf-hdr .acf-actions>a.acf-act[href*="login"]>span{display:none!important}
  html body.acf-v2 header.acf-hdr .acf-actions>.acf-user .acf-user-name{font-size:0!important;gap:0!important}
  html body.acf-v2 header.acf-hdr .acf-actions>.acf-user .acf-user-name>i,
  html body.acf-v2 header.acf-hdr .acf-actions>.acf-user .prime-badge-sm{display:none!important}
  html body.acf-v2 header.acf-hdr .acf-cart{height:36px!important;min-height:36px!important;padding:0 9px!important;gap:4px!important;font-size:12.5px!important}
  html body.acf-v2 header.acf-hdr .acf-cart .cart-tx{display:none!important}
  html body.acf-v2 header.acf-hdr .acf-cart i{font-size:14px}

  /* compact search pill: magnifier + placeholder; category + button appear only when expanded */
  html body.acf-v2 header.acf-hdr .acf-search-cat,
  html body.acf-v2 header.acf-hdr .acf-search .acf-search-btn{display:none!important}
  html body.acf-v2 header.acf-hdr .acf-search input.acf-search-input{
    width:100%!important;min-width:0!important;padding:0 8px 0 30px!important;font-size:16px!important;height:100%!important;
    text-overflow:ellipsis;border-radius:999px!important}
  html body.acf-v2 header.acf-hdr .acf-search::before{
    content:"\f002";font-family:"Font Awesome 6 Free";font-weight:900;font-size:13px;color:#1a56db;
    position:absolute;left:11px;top:50%;transform:translateY(-50%);pointer-events:none;z-index:1}
  /* tapped: the search takes the whole row (overlay), with category + button */
  html body.acf-v2 header.acf-hdr .acf-search:focus-within{
    position:absolute!important;left:8px;right:8px;top:6px;width:auto!important;flex:none!important;height:44px!important;z-index:30;
    box-shadow:0 8px 26px rgba(10,31,82,.28)}
  html body.acf-v2 header.acf-hdr .acf-search:focus-within::before{display:none}
  html body.acf-v2 header.acf-hdr .acf-search:focus-within .acf-search-btn{display:grid!important;width:48px}
  html body.acf-v2 header.acf-hdr .acf-search:focus-within .acf-search-cat{display:block!important;flex:0 0 96px;width:96px;max-width:96px}
  html body.acf-v2 header.acf-hdr .acf-search:focus-within input.acf-search-input{padding-left:12px!important}
}
/* very narrow: smaller logo, placeholder hidden (magnifier only) */
@media(max-width:380px){
  html body.acf-v2 header.acf-hdr .acf-hdr-in{padding:6px!important;gap:4px!important}
  html body.acf-v2 header.acf-hdr .acf-logo{padding:2px 5px!important}
  html body.acf-v2 header.acf-hdr .acf-logo img{height:21px!important}
  html body.acf-v2 header.acf-hdr .acf-lang>button{min-width:32px!important;padding:0 6px!important}
  html body.acf-v2 header.acf-hdr .acf-actions>button.acf-act{min-width:32px!important;padding:4px 4px!important}
  html body.acf-v2 header.acf-hdr .acf-cart{padding:0 7px!important}
}
@media(max-width:350px){
  html body.acf-v2 header.acf-hdr .acf-search input.acf-search-input::placeholder{color:transparent}
  html body.acf-v2 header.acf-hdr .acf-search:focus-within input.acf-search-input::placeholder{color:#6b7280}
  html body.acf-v2 header.acf-hdr .acf-search input.acf-search-input{padding-left:8px!important}
}
/* wider phones: plenty of room, no expanding needed */
@media(min-width:521px) and (max-width:768px){
  html body.acf-v2 header.acf-hdr .acf-search:focus-within{position:relative!important;left:auto;right:auto;top:auto;box-shadow:none;height:40px!important;flex:1 1 0!important}
  html body.acf-v2 header.acf-hdr .acf-search:focus-within::before{display:block}
  html body.acf-v2 header.acf-hdr .acf-search:focus-within input.acf-search-input{padding-left:30px!important}
  html body.acf-v2 header.acf-hdr .acf-search:focus-within .acf-search-btn,
  html body.acf-v2 header.acf-hdr .acf-search:focus-within .acf-search-cat{display:none!important}
}

/* ───────── 1b. DESKTOP / TABLET (>=769px) ─────────
   <1600px : row 1 = logo, city, search, language, login, wishlist, cart   row 2 = main menu
   ≥1600px: everything on one row.  actions use display:contents so each item is ordered separately. */
@media(min-width:769px){
  html body.acf-v2 header.acf-hdr .acf-hdr-in{flex-wrap:wrap!important;gap:8px 12px!important;padding:8px 18px!important;min-height:64px}
  html body.acf-v2 header.acf-hdr .acf-actions{display:contents!important}
  html body.acf-v2 header.acf-hdr .acf-logo{order:1!important;width:auto!important;max-width:220px!important}
  html body.acf-v2 header.acf-hdr .acf-logo img{height:40px!important;width:auto!important;max-width:210px!important}
  html body.acf-v2 header.acf-hdr .acf-actions>button.acf-act{order:2!important;flex-direction:row!important;gap:8px!important;padding:8px 14px!important;min-height:40px;
    background:#eef3fb!important;border:1px solid #dde7f7!important;border-radius:999px!important;line-height:1}
  html body.acf-v2 header.acf-hdr .acf-actions .city-name{max-width:120px}
  html body.acf-v2 header.acf-hdr .acf-search{order:4!important;flex:1 1 220px!important;min-width:180px!important;max-width:440px!important;width:auto!important;height:42px!important;margin:0 auto 0 0!important}
  html body.acf-v2 header.acf-hdr .acf-search-cat{display:none!important}
  html body.acf-v2 header.acf-hdr .acf-actions>.acf-lang{order:5!important}
  html body.acf-v2 header.acf-hdr .acf-actions>a.acf-act[href*="login"],
  html body.acf-v2 header.acf-hdr .acf-actions>.acf-user{order:6!important}
  html body.acf-v2 header.acf-hdr .acf-actions>a.acf-act[href*="wishlist"]{order:7!important;flex-direction:column!important;gap:2px!important;padding:4px 10px!important;min-height:40px;min-width:40px}
  html body.acf-v2 header.acf-hdr .acf-cart{order:8!important;height:40px!important;padding:0 14px!important}
  /* menu: its own row, never hidden by the old fit script */
  html body.acf-v2 header.acf-hdr .acf-v2-nav,
  html body.acf-v2 header.acf-hdr .acf-hdr-in .acf-v2-nav{order:9!important;flex:0 0 100%!important;width:100%!important;display:flex!important;visibility:visible!important;opacity:1!important;
    justify-content:flex-start;gap:2px;flex-wrap:nowrap!important;overflow-x:auto;scrollbar-width:none;border-top:1px solid #e3ebf8;padding-top:6px;margin-top:0}
  html body.acf-v2 header.acf-hdr .acf-v2-nav::-webkit-scrollbar{display:none}
  html body.acf-v2 header.acf-hdr .acf-v2-nav a{padding:9px 12px!important;font-size:13px!important;min-height:36px}
  /* labels: only when there is room */
  html body.acf-v2 header.acf-hdr .acf-cart .cart-tx,
  html body.acf-v2 header.acf-hdr .acf-actions>a.acf-act[href*="wishlist"]>span,
  html body.acf-v2 header.acf-hdr .acf-lang .lg-label{display:none!important}
  html body.acf-v2 header.acf-hdr .acf-lang .lg-code{display:inline!important}
  html body.acf-v2 header.acf-hdr .acf-actions>a.acf-act[href*="login"]{flex-direction:row!important;gap:8px!important;padding:10px 16px!important;min-height:40px;line-height:1}
  /* signed-in user: one compact pill (icon + first name), never the tall stacked block */
  html body.acf-v2 header.acf-hdr .acf-actions>.acf-user{flex-direction:row!important;align-items:center!important;gap:8px!important;padding:0 14px!important;min-height:40px;height:40px;border-radius:999px!important;
    background:#eef3fb!important;border:1px solid #dde7f7!important;max-width:170px;box-sizing:border-box;line-height:1}
  html body.acf-v2 header.acf-hdr .acf-actions>.acf-user .acf-user-name{display:block!important;max-width:110px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:13px}
  html body.acf-v2 header.acf-hdr .acf-actions>.acf-user .acf-user-name>i,
  html body.acf-v2 header.acf-hdr .acf-actions>.acf-user .prime-badge-sm{display:none!important}
}
@media(min-width:1600px){
  html body.acf-v2 header.acf-hdr .acf-hdr-in{flex-wrap:nowrap!important;gap:14px!important;padding:8px 22px!important}
  html body.acf-v2 header.acf-hdr .acf-v2-nav,
  html body.acf-v2 header.acf-hdr .acf-hdr-in .acf-v2-nav{order:3!important;flex:0 0 auto!important;width:auto!important;min-width:max-content!important;border-top:0;padding-top:0;overflow:visible}
  html body.acf-v2 header.acf-hdr .acf-v2-nav a{padding:10px 12px!important}
  html body.acf-v2 header.acf-hdr .acf-search{flex:1 1 240px!important;max-width:420px!important}
}
@media(min-width:1700px){
  html body.acf-v2 header.acf-hdr .acf-actions>.acf-user .prime-badge-sm{display:inline-block!important}
  html body.acf-v2 header.acf-hdr .acf-cart .cart-tx,
  html body.acf-v2 header.acf-hdr .acf-actions>a.acf-act[href*="wishlist"]>span,
  html body.acf-v2 header.acf-hdr .acf-lang .lg-label{display:inline!important}
  html body.acf-v2 header.acf-hdr .acf-lang .lg-code{display:none!important}
  html body.acf-v2 header.acf-hdr .acf-actions>.acf-user{max-width:200px}
  html body.acf-v2 header.acf-hdr .acf-actions>.acf-user .acf-user-name{max-width:130px}
}

/* ───────── 2. ACCESSIBILITY ───────── */
/* 2a. announcement bar: contrast is fixed at runtime by acf-fit.js (keeps the admin-chosen colour, only darkens/lightens as much as needed) */

/* 2b. orange / green / grey that were below 4.5:1 */
html body .v2-btn.pri{background:#c2410c!important;color:#fff!important}
html body .v2-btn.pri:hover{background:#9a3412!important}
html body .v2-btn.grn{background:#15803d!important}
html body .v2-btn.grn:hover{background:#166534!important}
html body .v2-deal.d1{background:linear-gradient(135deg,#c2410c,#9a3412)!important}
html body .v2-deal.d3{background:linear-gradient(135deg,#15803d,#0b6b32)!important}
html body .v2-deal.d1 span,html body .v2-deal.d3 span,html body .v2-deal small{opacity:1}
html body .v2-pc .pr s{color:#596780!important}
html body .v2-panel.used .v2-ph{background:linear-gradient(100deg,#15803d,#0b6b32)!important}
html body .hp-btn-cart{background:#b45309!important;color:#fff!important}
html body .hp-btn-cart:hover{background:#92400e!important}
html body .hp-prod-disc{background:#d32f2f!important}
html body .hp-prod-rating .badge{background:#2e7d32!important}
html body .hp-prod-price .off,html body .hp-svc-price .disc{color:#2e7d32!important}
html body .hp-svc-cat,html body .hp-svc-price .old,html body .hp-prod-rating .cnt,html body .hp-prod-price .mrp,
html body .hp-prod-seller,html body .hp-used-cond,html body .hp-used-city{color:#5f6368!important}
html body .hp-join-seller .hp-join-btn{background:#1a5fd0!important}
html body .hp-join-franc .hp-join-btn{background:#bf360c!important}
html body .hp-section>a[href="/institutions"] span[style*="f97316"]{background:#c2410c!important}

/* 2c. tap targets >= 24px with spacing */
html body .hp-dots{gap:0!important;bottom:2px!important}
html body .hp-dot{width:24px!important;height:24px!important;border-radius:0!important;background:transparent!important;position:relative;padding:0!important}
html body .hp-dot::before{content:"";position:absolute;left:50%;top:50%;width:8px;height:8px;transform:translate(-50%,-50%);border-radius:50%;background:rgba(255,255,255,.7);box-shadow:0 0 0 1px rgba(0,0,0,.25)}
html body .hp-dot.on{width:34px!important}
html body .hp-dot.on::before{width:22px;border-radius:4px;background:#fff}
html body .v2-deals{gap:14px}
html body .v2-deal{min-height:132px}
html body .acf-ftr a,html body .acf-ftr-col a{display:inline-block;padding:4px 0;min-height:24px}

/* 2b. More contrast, found with an axe scan of the live home page (all pairs >= 4.5:1 on white) */
html body .hp-section-head .hp-see-all{color:#1a56c8!important}
html body .hp-section-head a[href$="/used-products/sell"]{color:#c2410c!important}
html body #usedGrid>p{color:#5f6368!important}
html body #usedGrid>p a{color:#1a56c8!important}
html body .city-divider>span{color:#64748b!important}
html body button[onclick="skipCityModal()"]:not([aria-label]){color:#64748b!important}

/* 3. <main> landmark added around page content: layout-neutral */
main#acf-main{display:contents}
