/* =========================
   HEADER (Mobile-first)
========================= */

.site-header{
  position: sticky;
  top: 0;
  z-index: 1000;
  background:#fff;
  border-bottom: 1px solid rgba(0,0,0,0.08);

  /* UPDATED */
  transition:
    transform .26s cubic-bezier(.2,.8,.2,1),
    opacity   .18s ease;

  will-change: transform, opacity;
}


/* Auto-hide (JS toggles) */
.site-header.is-hidden{
  transform: translateY(-100%);
  opacity: 0;
  pointer-events: none;
}


/* Top row */
.header-inner{
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px 16px;
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 12px;
}

/* Buttons + icons */
.icon-btn{
  width:44px;
  height:44px;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,0.10);
  background:#fff;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
}

.ico{
  width:20px;
  height:20px;
  stroke:#0f172a;
  stroke-width:2;
  fill:none;
  stroke-linecap:round;
  stroke-linejoin:round;
}

/* Brand */
.brand{
  text-decoration:none;
  color:#0f172a;
  font-weight: 900;
  font-size: 18px;
  letter-spacing: -0.2px;
}
.brand-title{ display:inline-block; }

/* Right icons wrapper */
.header-icons{
  display:flex;
  align-items:center;
  gap:10px;
}

.icon-btn.cart{
  position:relative;
  text-decoration:none;
}

/* Cart badge */
.mfh-cart-badge{
  position: absolute;
  top: -6px;
  right: -8px;
  min-width: 18px;
  height: 18px;
  padding: 0 6px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  background: #ff3b30;
  color: #fff;
  line-height: 1;
}

/* =========================
   Location row
========================= */

.location-row{
  max-width: 1200px;
  margin: 0 auto;
  padding: 8px 16px 12px;
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 12px;
}

.loc-left{ min-width: 0; }

.loc-label{
  font-size: 12px;
  color: rgba(15,23,42,0.65);
  margin-bottom: 2px;
}

.loc-value{
  font-size: 14px;
  font-weight: 500; /* ✅ NOT bold */
  color:#0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 72vw;
}

.loc-empty{
  color: rgba(15,23,42,0.55);
}

/* Change / Select button */
.loc-change-btn{
  text-decoration:none;
  font-weight: 700;
  font-size: 13px;
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,0.10);
  color:#0f172a;
  background:#fff;
  flex: 0 0 auto;
}
.loc-change-btn:hover{
  background:#f8fafc;
}

/* =========================
   Search bar (toggle)
========================= */

.header-search{
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px 12px;
}

.search-wrap{
  border: 1px solid rgba(0,0,0,0.10);
  border-radius: 14px;
  overflow: hidden;
  display:flex;
  align-items:center;
  background:#fff;
}

.search-wrap input{
  border: none;
  outline:none;
  padding: 12px 12px;
  width: 100%;
  font-size: 16px; /* iPhone zoom fix */
}

.search-close{
  border:none;
  background: transparent;
  width: 48px;
  height: 48px;
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:center;
}

/* =========================
   Drawer (Mobile menu)
========================= */

.drawer{
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: none;
}

.drawer.is-open{ display:block; }

/* backdrop */
.drawer-backdrop{
  position:absolute;
  inset:0;
  background: rgba(0,0,0,0.45);
  opacity: 0;
  transition: opacity .24s ease;
}
.drawer.is-open .drawer-backdrop{
  opacity: 1;
}

/* panel */
.drawer-panel{
  position:absolute;
  top:0; left:0;
  width: 320px;
  max-width: 86vw;
  height: 100dvh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;

  background:#fff;
  padding: 16px 16px 22px;

  transform: translateX(-105%);
  transition: transform .28s cubic-bezier(.2,.9,.2,1);
  will-change: transform;
  box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

/* open */
.drawer.is-open .drawer-panel{
  transform: translateX(0);
  animation: drawerPop .26s cubic-bezier(.2,.9,.2,1);
}

@keyframes drawerPop{
  0%   { transform: translateX(-105%); }
  70%  { transform: translateX(6px); }
  100% { transform: translateX(0); }
}

/* drawer top */
.drawer-top{
  display:flex;
  align-items:flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.drawer-user{
  display:flex;
  gap: 10px;
  align-items:center;
}

.avatar{
  width:44px;
  height:44px;
  border-radius: 50%;
  background: #e5e7eb;
}

.drawer-hi{
  font-weight: 900;
  color:#0f172a;
}

.drawer-login{
  display:inline-block;
  margin-top: 2px;
  text-decoration:none;
  color:#0f172a;
  font-weight: 700;
  opacity: .75;
}

/* drawer links */
.drawer-links a{
  display:block;
  padding: 10px 4px;
  text-decoration:none;
  color:#0f172a;
  font-weight: 500;
  opacity: .85;
}
.drawer-links a:hover{ opacity: 1; }

.drawer-links hr{
  border:none;
  border-top:1px solid rgba(0,0,0,0.08);
  margin: 12px 0;
}

/* =========================
   BODY LOCK (JS toggles)
========================= */

body.mfh-lock{
  overflow: hidden !important;
  touch-action: none;
}

/* =========================
   Desktop polish (still mobile header)
========================= */

@media (min-width: 900px){
  .header-inner{ padding: 14px 18px; }
  .brand{ font-size: 20px; }
  .loc-value{ max-width: 760px; }
}
