/* =====================================================================
   SUPwest — Site Header CSS
   All rules scoped to .sw-header — no clash with WP/Elementor/WC.
   ===================================================================== */

.sw-header,.sw-header *{box-sizing:border-box}
/* ── Kill ALL pink tap/focus highlights — WP, Hello Elementor, WooCommerce ── */
.sw-header *{-webkit-tap-highlight-color:rgba(0,0,0,0) !important}
.sw-header button,.sw-header input,.sw-header a{outline-color:#006ac8}
.sw-header button:active,.sw-header button:focus,
.sw-header input:active,.sw-header input:focus,
.sw-header a:active,.sw-header a:focus{
  background-color:transparent !important;
  box-shadow:none !important;
  color:inherit !important;
}
.sw-header button:focus-visible,.sw-header a:focus-visible{outline:2px solid #006ac8;outline-offset:2px}
/* Icon buttons specifically */
.sw-header .sw-icon-btn:active,.sw-header .sw-icon-btn:focus,
.sw-header .sw-icon-btn:hover{
  background:transparent !important;
  border-color:#006ac8 !important;
  color:#1d1e22 !important;
  box-shadow:none !important;
}
/* Search toggle */
.sw-header .sw-search-toggle:active,.sw-header .sw-search-toggle:focus{
  background:transparent !important;color:#006ac8 !important;box-shadow:none !important;
}
.sw-header{
  --sw-red:#006ac8;--sw-red-dark:#0056a8;--sw-ink:#0d0d0f;--sw-ink-2:#17181b;
  --sw-line:#2a2c33;--sw-text:#f5f5f6;--sw-muted:#b8bac2;
  font-family:"Barlow",system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;
  color:var(--sw-text);position:sticky;top:0;z-index:1000;
  background:#fff;
}
/* Prevent Elementor section/column wrappers from showing through */
.elementor-template-header .elementor-section,
.elementor-template-header .elementor-column,
.elementor-template-header .elementor-widget-wrap,
.elementor-template-header .elementor-widget{
  background:transparent !important;
}
.sw-wrap{max-width:1240px;margin:0 auto;padding:0 20px}
.sw-header a{color:inherit;text-decoration:none}
.sw-skip{position:absolute;left:-9999px;top:0;background:#fff;color:#000;padding:10px 14px;z-index:2000;font-weight:700}
.sw-skip:focus{left:10px;top:10px}

/* ---------- Top bar ---------- */
.sw-topbar{background:var(--sw-red);font-size:14px;font-weight:600}
.sw-topbar .sw-wrap{display:flex;justify-content:space-between;align-items:center;gap:12px;min-height:36px;flex-wrap:wrap;padding-top:4px;padding-bottom:4px}
.sw-topbar svg{width:16px;height:16px;vertical-align:-3px;margin-right:6px}
.sw-topbar .sw-tb-right{display:flex;gap:20px;align-items:center}
.sw-topbar .sw-tb-hours{opacity:.85;font-weight:500}
.sw-topbar a:hover{text-decoration:underline}

/* ---------- Brand row ---------- */
.sw-brand{background:#fff}
.sw-brand .sw-wrap{
  display:grid !important;
  grid-template-columns:auto 1fr auto;
  align-items:center;gap:16px;min-height:78px;padding:0 20px;max-width:1240px;
}

/* Logo image */
.sw-logo{display:flex !important;align-items:center;flex:none}
.sw-logo img{height:68px !important;width:auto !important;max-height:68px !important;display:block !important}

/* ── Inline search bar — force flex so Elementor can't override ── */
.sw-search-bar{
  width:100%;max-width:560px;margin:0 auto;position:relative;
  display:flex !important;flex-direction:row !important;
  flex-wrap:nowrap !important;align-items:stretch !important;
  min-width:0;max-width:560px;
}
.sw-search-bar .sw-search-input{
  flex:1 1 auto !important;display:block !important;
  height:44px;background:#f5f7fa;
  border:1px solid #d0dce8;border-right:none !important;
  border-radius:6px 0 0 6px;
  color:#1d1e22 !important;font:500 15px "Barlow",system-ui,sans-serif;
  padding:0 14px;outline:none;min-width:0;width:100%;
  -webkit-text-fill-color:#1d1e22 !important;
}
.sw-search-bar .sw-search-input:focus{border-color:var(--sw-red)}
.sw-search-bar .sw-search-input::placeholder{color:#888}
.sw-search-bar .sw-search-submit{
  flex:0 0 auto !important;display:flex !important;
  align-items:center;justify-content:center;
  width:46px;height:44px;
  background:var(--sw-red);border:1px solid var(--sw-red);
  border-radius:0 6px 6px 0;color:#fff;cursor:pointer;
  transition:background .15s;padding:0;
}
.sw-search-bar .sw-search-submit:hover{background:var(--sw-red-dark);border-color:var(--sw-red-dark)}
.sw-search-bar .sw-search-submit svg{width:18px;height:18px;flex:none}

/* AJAX results dropdown */
.sw-search-results{
  position:absolute;top:calc(100% + 6px);left:0;right:0;
  background:#f5f7fa;border:1px solid #d0dce8;border-radius:6px;
  box-shadow:0 8px 24px rgba(0,0,0,.12);
  display:none;z-index:200;
  max-height:420px;overflow-y:auto;
}
.sw-search-results:not(:empty){display:block}
.sw-search-item{
  display:flex !important;align-items:center;gap:12px;
  padding:8px 12px;color:#1d1e22;text-decoration:none;transition:background .12s
}
.sw-search-item:hover{background:#e8f0f8}
.sw-search-img{width:52px;height:52px;object-fit:cover;border-radius:4px;flex:none;background:#dde6ef}
.sw-search-img-ph{width:52px;height:52px;border-radius:4px;flex:none;background:#dde6ef;display:grid;place-items:center}
.sw-search-img-ph svg{width:22px;height:22px;color:#7a8ea0}
.sw-search-info{flex:1;min-width:0}
.sw-search-title{font-weight:600;font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:#1d1e22}
.sw-search-price{font-size:13px;color:#555;margin-top:2px}
.sw-search-price del{opacity:.6;margin-right:4px}
.sw-search-status{padding:10px 14px;color:#666;font-size:14px}
.sw-search-all{display:block;padding:10px 14px;border-top:1px solid #e0eaf3;color:#006ac8;font-weight:600;font-size:14px;text-decoration:none}
.sw-search-all:hover{color:#0056a8}

/* ---------- Action buttons ---------- */
.sw-actions{display:flex !important;align-items:center;gap:12px;flex:none;margin-left:auto}
.sw-icon-btn{position:relative;display:flex;align-items:center !important;justify-content:center !important;width:46px;height:46px;border-radius:6px;border:1px solid #d0dce8;background:transparent;color:#1d1e22;cursor:pointer;overflow:visible;padding:0;line-height:1}
.sw-icon-btn:hover{border-color:#006ac8}
.sw-icon-btn svg{width:22px;height:22px}
.sw-count{position:absolute;top:-8px;right:-8px;min-width:20px;height:20px;padding:0 5px;border-radius:10px;background:var(--sw-red);color:#fff;font-size:11px;font-weight:700;line-height:1;display:grid;place-items:center;pointer-events:none;z-index:1}
.sw-count:empty{display:none}
.sw-call{display:inline-flex !important;align-items:center;gap:10px;background:var(--sw-red);color:#fff;border-radius:6px;padding:10px 18px;font-weight:700;line-height:1.15;transition:background .15s}
.sw-call:hover{background:var(--sw-red-dark)}
.sw-call svg{width:22px;height:22px;flex:none}
.sw-call small{display:block;font-size:11px;font-weight:600;letter-spacing:.08em;text-transform:uppercase;opacity:.85}
.sw-call span{font-size:18px}
.sw-burger{display:none;cursor:pointer;touch-action:manipulation;-webkit-tap-highlight-color:transparent}
.sw-search-toggle{display:none;cursor:pointer;touch-action:manipulation;-webkit-tap-highlight-color:transparent} /* shown only on mobile */

/* ---------- Nav row ---------- */
.sw-nav{background:#006ac8;border-top:none;border-bottom:3px solid #0056a8}
.sw-menu{display:flex !important;justify-content:space-between;list-style:none;margin:0 auto;padding:0 20px;max-width:1240px}
.sw-menu > li{position:relative}
.sw-menu > li > a,.sw-menu > li > button{
  display:flex !important;align-items:center;justify-content:center;gap:4px;height:50px;padding:0 8px;
  font:600 14px/1 "Barlow",system-ui,sans-serif;color:#fff;
  background:none;border:0;cursor:pointer;white-space:nowrap;position:relative;width:100%;
}
.sw-menu > li > a::after,.sw-menu > li > button::after{content:"";position:absolute;left:8px;right:8px;bottom:-3px;height:3px;background:#fff;transform:scaleX(0);transition:transform .2s}
.sw-menu > li > a:hover::after,.sw-menu > li > button:hover::after,
.sw-menu > li > a[aria-current="page"]::after{transform:scaleX(1)}
.sw-menu > li > a[aria-current="page"]{color:#fff}
.sw-menu .sw-caret{width:12px;height:12px;transition:transform .2s;color:#fff}
.sw-has-sub[data-open="true"] .sw-caret{transform:rotate(180deg)}

/* Dropdown */
.sw-sub{position:absolute;top:100%;left:-16px;min-width:300px;margin-top:3px;background:#fff;color:#1d1e22;border-radius:0 0 6px 6px;box-shadow:0 18px 40px rgba(0,0,0,.28);padding:10px 0;list-style:none;opacity:0;visibility:hidden;transform:translateY(6px);transition:opacity .15s,transform .15s,visibility .15s}
.sw-has-sub:hover .sw-sub,.sw-has-sub:focus-within .sw-sub,.sw-has-sub[data-open="true"] .sw-sub{opacity:1;visibility:visible;transform:none}
.sw-sub a{display:block;padding:10px 20px;font-weight:600;font-size:15px;color:#1d1e22}
.sw-sub a:hover,.sw-sub a:focus{background:#f3f3f4;color:var(--sw-red)}
.sw-sub .sw-sub-label{padding:10px 20px 4px;font-size:12px;font-weight:700;letter-spacing:.1em;text-transform:uppercase;color:#8a8d96;border-top:1px solid #e6e6e9;margin-top:6px}
.sw-sub .sw-sub-all a{color:var(--sw-red);border-top:1px solid #e6e6e9;margin-top:6px}

/* ---------- Nav hover — #65D3FF underline (desktop) ---------- */
.sw-menu > li > a:hover,.sw-menu > li > button:hover{color:#fff !important;background:rgba(255,255,255,.12) !important}
.sw-menu > li > a::after,.sw-menu > li > button::after{background:#65D3FF !important}

/* ---------- Responsive ---------- */
@media (max-width:1080px){
  .sw-search-bar{max-width:380px}
}
@media (max-width:980px){
  .sw-burger{display:grid;place-items:center;width:44px;height:44px;border:1.5px solid #d0dce8;border-radius:8px;background:#fff;color:#1d1e22;transition:border-color .15s,color .15s}
  .sw-burger:hover{border-color:#006ac8;color:#006ac8}
  .sw-search-toggle{display:grid;place-items:center}
  /* Phone button — solid blue, fully visible on mobile */
  .sw-call{background:#006ac8 !important;border:none !important;border-radius:8px;padding:0;width:44px;height:44px;gap:0;justify-content:center;color:#fff !important}
  .sw-call:hover{background:#0056a8 !important}
  .sw-call svg{width:20px;height:20px;flex:none;color:#fff !important;stroke:#fff !important}
  .sw-call div,.sw-call small,.sw-call span{display:none !important}
  /* Search bar — hidden by default, expands below logo row on toggle */
  .sw-search-bar{display:none !important;max-width:none;width:100%;grid-column:1/-1}
  .sw-header[data-search="open"] .sw-search-bar{display:flex !important}
  .sw-brand .sw-wrap{
    grid-template-columns:auto 1fr;
    grid-template-rows:auto auto;
    padding-bottom:0;
  }
  .sw-logo{grid-column:1;grid-row:1}
  .sw-actions{grid-column:2;grid-row:1;justify-self:end}
  .sw-search-bar{grid-column:1/-1;grid-row:2}
  .sw-header[data-search="open"] .sw-brand .sw-wrap{padding-bottom:12px}

  /* ── Mobile nav — full-screen backdrop + right-side drawer ── */
  .sw-nav{
    display:none;position:fixed;inset:0;
    z-index:8000;background:rgba(0,0,0,.48);
    border:none;overflow:hidden;
    backdrop-filter:blur(2px);-webkit-backdrop-filter:blur(2px);
  }
  .sw-header[data-menu="open"] .sw-nav{display:block}

  /* The actual panel — slides in from RIGHT */
  .sw-menu{
    position:absolute;top:0;right:0;bottom:auto;left:auto;
    width:min(300px,82vw);height:100vh;
    flex-direction:column !important;justify-content:flex-start !important;
    align-items:stretch !important;gap:0 !important;
    padding:0;list-style:none;
    background:#fff;
    box-shadow:-6px 0 40px rgba(0,0,0,.22);
    overflow-y:auto;overflow-x:hidden;
    transform:translateX(100%);
    transition:transform .32s cubic-bezier(.22,1,.36,1);
  }
  .sw-header[data-menu="open"] .sw-menu{transform:translateX(0)}

  /* Panel top strip */
  .sw-menu::before{
    content:"NAVIGATION";
    display:block;flex:none;
    padding:18px 20px 14px;
    background:#006ac8;color:#fff;
    font:700 11px/1 "Barlow",system-ui,sans-serif;
    letter-spacing:.15em;
  }
  /* Hard-reset WP/theme list margins — use .sw-nav prefix for max specificity */
  .sw-nav .sw-menu{margin:0 !important;padding:0 !important}
  .sw-nav .sw-menu > li,
  .sw-nav .sw-menu li{
    border-bottom:1px solid #eef0f3;
    margin:0 !important;padding:0 !important;
    float:none !important;width:100% !important;
    list-style:none !important;
  }
  .sw-nav .sw-menu > li:last-child{border-bottom:0}
  .sw-nav .sw-menu > li > a,
  .sw-nav .sw-menu > li > button{
    display:flex !important;
    height:auto !important;min-height:0 !important;max-height:none !important;
    width:100% !important;
    justify-content:space-between !important;
    padding:14px 18px !important;margin:0 !important;
    font-size:15px !important;line-height:1.3 !important;
    color:#1a1a2e !important;background:transparent !important;
    text-align:left;transition:background .12s,color .12s;
    box-sizing:border-box !important;
  }
  .sw-nav .sw-menu > li > a:hover,.sw-nav .sw-menu > li > button:hover{
    background:#f0f6ff !important;color:#006ac8 !important
  }
  .sw-nav .sw-menu > li > a::after,.sw-nav .sw-menu > li > button::after{display:none !important}
  .sw-nav .sw-menu > li > a[aria-current="page"]{color:#006ac8 !important;background:#e8f3ff !important}
  .sw-nav .sw-menu .sw-caret{color:#aaa;width:14px;height:14px;flex:none}

  /* Sub-menus inside drawer */
  .sw-sub{
    position:static !important;opacity:1 !important;visibility:visible !important;
    transform:none !important;box-shadow:none !important;border-radius:0 !important;
    background:#f8fafc !important;margin:0;padding:4px 0 8px;display:none;min-width:0;
    border-top:1px solid #eef0f3;
  }
  .sw-has-sub:hover .sw-sub,.sw-has-sub:focus-within .sw-sub{display:none}
  .sw-has-sub[data-open="true"] .sw-sub{display:block}
  .sw-sub a{color:#333 !important;padding:11px 18px 11px 32px !important;font-weight:500 !important;font-size:14px !important}
  .sw-sub a:hover,.sw-sub a:focus{background:#e8f0fb !important;color:#006ac8 !important}
  .sw-sub .sw-sub-label{color:#aaa !important;border-top-color:#eef0f3 !important;padding-left:32px !important;font-size:10px !important}
  .sw-sub .sw-sub-all a{border-top-color:#eef0f3 !important;color:#006ac8 !important}
}

@media (max-width:600px){
  /* Topbar — one clean line: badge left, phone right */
  .sw-topbar{font-size:12px;line-height:1}
  .sw-topbar .sw-wrap{
    flex-direction:row;flex-wrap:nowrap;
    align-items:center;justify-content:space-between;
    gap:8px;padding-top:7px;padding-bottom:7px;min-height:auto;
  }
  /* Left: show only "WA OWNED & OPERATED", clip the rest */
  .sw-topbar .sw-tb-left{
    white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
    max-width:60%;font-size:12px;
  }
  /* Hide "VISIT OUR MALAGA SHOWROOM · address" on mobile — keep badge only */
  .sw-topbar .sw-tb-showroom{display:none !important}
  /* Right: phone only, hide hours */
  .sw-topbar .sw-tb-right{gap:0;font-size:12px}
  .sw-topbar .sw-tb-hours{display:none}
  /* Logo bigger on mobile */
  .sw-brand .sw-wrap{min-height:70px;gap:10px}
  .sw-logo img{height:58px !important;max-height:58px !important}
  .sw-actions{gap:8px}
  .sw-search-bar .sw-search-input{font-size:16px}
}
@media (prefers-reduced-motion:reduce){.sw-header *{transition:none!important}}

/* ── iPhone notch / Dynamic Island safe-area ─────────────────────────
   Extends the red topbar background behind the status bar and pushes
   its text content below the notch. Only activates when the <meta
   viewport> tag includes viewport-fit=cover.                          */
@supports (padding-top:env(safe-area-inset-top)){
  .sw-topbar{padding-top:env(safe-area-inset-top,0px)}
}

/* ══ Cart slide-up drawer ══════════════════════════════════════════════ */
/* Targets both the CSS class (.sw-cart-drawer) and the Elementor HTML id (#ppe-cart-drawer) */
.sw-cart-drawer,#ppe-cart-drawer{
  position:fixed;inset:0;z-index:9000;
  pointer-events:none;
}
.sw-cart-drawer[aria-hidden="false"],#ppe-cart-drawer[aria-hidden="false"]{pointer-events:auto}

/* Backdrop */
.sw-cart-backdrop,#ppe-cart-backdrop{
  position:absolute;inset:0;
  background:rgba(0,0,0,.55);
  opacity:0;transition:opacity .28s ease;
}
.sw-cart-drawer[aria-hidden="false"] .sw-cart-backdrop,
#ppe-cart-drawer[aria-hidden="false"] #ppe-cart-backdrop{opacity:1}

/* Panel slides up from bottom */
.sw-cart-panel,#ppe-cart-panel{
  position:absolute;left:0;right:0;bottom:0;
  background:#fff;
  border-top:3px solid #006ac8;
  border-radius:14px 14px 0 0;
  max-height:85vh;
  display:flex;flex-direction:column;
  transform:translateY(100%);
  transition:transform .32s cubic-bezier(.22,1,.36,1);
}
.sw-cart-drawer[aria-hidden="false"] .sw-cart-panel,
#ppe-cart-drawer[aria-hidden="false"] #ppe-cart-panel{transform:translateY(0)}

/* Panel header */
.sw-cart-panel-head,#ppe-cart-panel-head{
  display:flex;align-items:center;justify-content:space-between;
  padding:18px 20px 14px;
  border-bottom:1px solid #e8e8eb;
  flex:none;
}
.sw-cart-panel-title,#ppe-cart-panel-title{
  font:700 18px/1 "Barlow",system-ui,sans-serif;
  color:#1d1e22;letter-spacing:.02em;
}
.sw-cart-panel-close,#ppe-cart-close{
  display:flex;align-items:center;justify-content:center;width:36px;height:36px;
  border:1px solid #e0e0e4;border-radius:6px;
  background:transparent;color:#1d1e22;cursor:pointer;padding:0;line-height:1;
}
.sw-cart-panel-close:hover,#ppe-cart-close:hover{border-color:#9a9ca8}
.sw-cart-panel-close svg,#ppe-cart-close svg{width:18px;height:18px}

/* Panel body — scrollable */
.sw-cart-panel-body,#ppe-cart-panel-body{
  flex:1;overflow-y:auto;padding:16px 20px 24px;
  color:#1d1e22;
}

/* ── SW cart drawer — JS-rendered items (Allied pattern) ────────────
   PHP returns JSON; JS builds this HTML; we own every element.
   No WooCommerce CSS to fight. No !important needed.
   ------------------------------------------------------------------ */
.sw-cart-loading,.sw-cart-empty{color:#9a9ca8;font-size:14px;text-align:center;padding:28px 0;margin:0}

/* List */
.sw-cart-items{list-style:none;margin:0;padding:0}

/* Each item row */
.sw-cart-item{display:flex;align-items:center;gap:12px;padding:14px 0;border-bottom:1px solid #e8e8eb}
.sw-cart-item:last-child{border-bottom:0}

/* Thumbnail wrapper — fixed 60×60 square */
.sw-cart-item-img-wrap{flex:none;display:block;width:60px;height:60px;border-radius:6px;overflow:hidden;background:#f0f0f3}
.sw-cart-item-img-wrap img{width:60px;height:60px;object-fit:cover;display:block}
.sw-cart-item-img-ph{width:60px;height:60px;background:#f0f0f3;border-radius:6px}

/* Info column */
.sw-cart-item-info{flex:1;min-width:0}
.sw-cart-item-name{display:block;color:#1d1e22;font-weight:600;font-size:14px;line-height:1.4;text-decoration:none;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.sw-cart-item-name:hover{color:#006ac8}
.sw-cart-item-qty{display:block;font-size:13px;color:#6b6d76;margin-top:3px}

/* Remove × button */
.sw-cart-item-remove{flex:none;display:grid;place-items:center;width:28px;height:28px;border-radius:5px;border:none;background:transparent;color:#9a9ca8;cursor:pointer;padding:0;transition:color .15s,background .15s}
.sw-cart-item-remove:hover{color:#006ac8;background:#f0f0f3}

/* Subtotal row */
.sw-cart-subtotal{display:flex;justify-content:space-between;align-items:center;padding:16px 0 4px;font-weight:700;font-size:16px;color:#1d1e22;border-top:1px solid #e8e8eb;margin-top:4px}

/* Checkout buttons */
.sw-cart-buttons{display:flex;flex-direction:column;gap:10px;margin-top:14px}
.sw-cart-btn-view{display:block;text-align:center;padding:13px 20px;border-radius:6px;font-weight:700;font-size:15px;text-decoration:none;background:#f0f0f3;color:#1d1e22;border:1px solid #e0e0e4}
.sw-cart-btn-view:hover{background:#e4e4e8;color:#1d1e22}
.sw-cart-btn-checkout{display:block;text-align:center;padding:13px 20px;border-radius:6px;font-weight:700;font-size:15px;text-decoration:none;background:#006ac8;color:#fff;border:1px solid #006ac8}
.sw-cart-btn-checkout:hover{background:#0056a8}
