/* ============================================================
   SHIV SHAKTI ENTERPRISES — HEADER-UPDATES.CSS
   Extends style.css — DO NOT MODIFY style.css
   Covers:
   1. Header alignment (Logo | Search | Actions)
   2. Hover dropdowns (Wishlist / Notifications / User)
   3. Hero banner padding fix
   4. Store Locator page styles
   ============================================================ */

/* ── 1. HEADER ALIGNMENT FIX ─────────────────────────────────
   Logo → LEFT (flex-shrink:0)
   Search → CENTER (flex:1, margin:auto)
   Actions → RIGHT (flex-shrink:0)
   ─────────────────────────────────────────────────────────── */
.header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 0;                    /* Override gap:24px — controlled per-zone */
}

.site-logo {
  flex-shrink: 0;
  margin-right: 20px;        /* Gap between logo and search */
}

.header-search {
  flex: 1;
  max-width: 480px;
  margin: 0 auto;            /* Push search to visual center */
}

.header-actions {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: 16px;         /* Gap between search and actions */
}

/* ── 2. HDR-BTN DROPDOWN WRAPPER ─────────────────────────────
   Wraps each icon + its dropdown panel.
   Uses :hover with pointer-events trick to prevent flicker.
   ─────────────────────────────────────────────────────────── */
.hdr-dropdown-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

/* The panel itself */
.hdr-dropdown-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 300px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 1200;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px);
  transition: opacity 0.22s ease, transform 0.22s ease;
  /* Small bridge so mouse can move from button to panel */
  padding-top: 0;
}

/* Invisible bridge gap between icon and panel */
.hdr-dropdown-panel::before {
  content: '';
  position: absolute;
  top: -14px;
  right: 0;
  left: 0;
  height: 14px;
}

/* Show on parent hover */
.hdr-dropdown-wrap:hover .hdr-dropdown-panel,
.hdr-dropdown-wrap.open .hdr-dropdown-panel {
  opacity: 1;
  pointer-events: all;
  transform: translateY(0);
}

/* Arrow tip */
.hdr-dropdown-panel::after {
  content: '';
  position: absolute;
  top: -7px;
  right: 14px;
  width: 14px;
  height: 14px;
  background: #fff;
  border-left: 1px solid var(--border);
  border-top: 1px solid var(--border);
  transform: rotate(45deg);
  border-radius: 2px 0 0 0;
}

/* Panel header bar */
.hdp-header {
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.hdp-header-title {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-dark);
}

.hdp-header-link {
  font-size: 0.76rem;
  color: var(--primary);
  font-weight: 500;
  text-decoration: none;
  transition: color var(--transition);
}
.hdp-header-link:hover { color: var(--primary-dark); }

/* Panel body */
.hdp-body {
  max-height: 300px;
  overflow-y: auto;
  padding: 6px 0;
}

.hdp-body::-webkit-scrollbar { width: 4px; }
.hdp-body::-webkit-scrollbar-thumb { background: var(--border-dark); border-radius: 99px; }

/* Empty state */
.hdp-empty {
  padding: 28px 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.hdp-empty i {
  display: block;
  font-size: 2rem;
  margin-bottom: 8px;
  color: var(--border-dark);
}

/* Panel footer */
.hdp-footer {
  padding: 10px 14px;
  border-top: 1px solid var(--border);
}

.hdp-footer-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 9px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-dark);
  font-size: 0.83rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
}
.hdp-footer-btn:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* ── 3. WISHLIST DROPDOWN ITEMS ──────────────────────────────  */
.wishlist-drop-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 14px;
  transition: background var(--transition);
  text-decoration: none;
  cursor: pointer;
}

.wishlist-drop-item:hover { background: var(--surface); }

.wdi-img {
  width: 46px;
  height: 46px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  border: 1px solid var(--border);
  flex-shrink: 0;
  background: var(--surface);
}

.wdi-info { flex: 1; min-width: 0; }

.wdi-name {
  font-size: 0.82rem;
  color: var(--text-dark);
  font-weight: 500;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.35;
  margin-bottom: 3px;
}

.wdi-brand {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.wdi-remove {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text-light);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all var(--transition);
  flex-shrink: 0;
}
.wdi-remove:hover { background: #FFF0F0; color: var(--primary); }

/* ── 4. NOTIFICATION DROPDOWN ITEMS ─────────────────────────  */
.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 11px 14px;
  transition: background var(--transition);
  cursor: pointer;
  position: relative;
}

.notif-item:hover { background: var(--surface); }

.notif-item.unread {
  background: rgba(181,21,27,0.03);
}

.notif-item.unread::before {
  content: '';
  position: absolute;
  left: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 6px;
  background: var(--primary);
  border-radius: 50%;
}

.notif-icon-wrap {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.88rem;
  flex-shrink: 0;
}

.notif-content { flex: 1; min-width: 0; }

.notif-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 2px;
  line-height: 1.3;
}

.notif-msg {
  font-size: 0.76rem;
  color: var(--text-muted);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.notif-time {
  font-size: 0.7rem;
  color: var(--text-light);
  white-space: nowrap;
  flex-shrink: 0;
  margin-top: 2px;
}

/* Unread dot badge on bell icon */
.notif-unread-badge {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 8px;
  height: 8px;
  background: var(--primary);
  border-radius: 50%;
  border: 2px solid #fff;
}

/* ── 5. USER / LOGIN DROPDOWN ────────────────────────────────  */
.user-drop-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  margin: 16px auto 10px;
}

.user-drop-name {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-dark);
  text-align: center;
  margin-bottom: 2px;
}

.user-drop-phone {
  font-size: 0.74rem;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 14px;
}

.user-drop-divider {
  height: 1px;
  background: var(--border);
  margin: 0;
}

.user-drop-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  font-size: 0.85rem;
  color: var(--text-body);
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
}

.user-drop-link i {
  width: 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.user-drop-link:hover {
  background: var(--surface);
  color: var(--primary);
}
.user-drop-link:hover i { color: var(--primary); }

.user-drop-link.logout-link {
  color: var(--primary);
  border-top: 1px solid var(--border);
  margin-top: 4px;
}

.user-drop-link.logout-link i { color: var(--primary); }

/* Wider panel for login prompt */
.hdr-dropdown-panel.login-panel {
  width: 260px;
}

.login-panel-body {
  padding: 20px 16px;
  text-align: center;
}

.login-panel-body p {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.login-panel-body .btn-brand {
  width: 100%;
  justify-content: center;
  margin-bottom: 8px;
}

.login-panel-body .btn-outline-brand {
  width: 100%;
  justify-content: center;
  font-size: 0.83rem;
}

/* btn-login active state when logged in */
.btn-login.logged-in {
  border-color: var(--primary);
  color: var(--primary);
}

/* ── 6. HERO BANNER PADDING FIX ──────────────────────────────
   Override the existing .hero-slide-inner with proper
   padding-left and mobile-safe settings
   ─────────────────────────────────────────────────────────── */
.hero-slide-inner {
  min-height: 520px;
  display: flex;
  align-items: center;
  padding: 60px 0 60px 60px;  /* top right bottom left */
}

/* Mobile: remove extra left padding to avoid overflow */
@media (max-width: 767px) {
  .hero-slide-inner {
    min-height: 300px;
    padding: 32px 16px;
  }
}

@media (max-width: 991px) and (min-width: 768px) {
  .hero-slide-inner {
    padding: 44px 24px;
  }
}

/* ── 7. STORE LOCATOR PAGE ───────────────────────────────────  */
.store-locator-search-box {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 28px 20px;
  box-shadow: var(--shadow-sm);
}

.sl-tab-group {
  display: flex;
  gap: 0;
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 4px;
  margin-bottom: 20px;
  width: fit-content;
}

.sl-tab {
  padding: 8px 20px;
  border-radius: calc(var(--radius-sm) - 2px);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  background: transparent;
  color: var(--text-muted);
  transition: all var(--transition);
}

.sl-tab.active {
  background: #fff;
  color: var(--primary);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

.store-result-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.store-result-card:hover {
  border-color: var(--primary-light);
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}

.store-result-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: var(--primary);
  border-radius: 0;
}

.store-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.69rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 99px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.store-badge.authorised {
  background: #D4EDDA;
  color: #155724;
}

.store-badge.partner {
  background: #D1ECF1;
  color: #0C5460;
}

.store-badge.nearest {
  background: rgba(181,21,27,0.08);
  color: var(--primary);
}

.store-name {
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: var(--text-dark);
  font-weight: 700;
  margin-bottom: 5px;
}

.store-address {
  font-size: 0.83rem;
  color: var(--text-body);
  line-height: 1.55;
  margin-bottom: 10px;
  display: flex;
  gap: 6px;
}

.store-address i { color: var(--primary); flex-shrink: 0; margin-top: 2px; }

.store-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 12px;
}

.store-tag {
  font-size: 0.71rem;
  padding: 3px 9px;
  border-radius: 99px;
  background: var(--surface);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.store-distance {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.79rem;
  color: var(--text-muted);
  font-weight: 500;
}

.store-distance i { color: var(--gold); }

.store-distance .dist-val {
  color: var(--text-dark);
  font-weight: 700;
}

/* Map placeholder */
.map-placeholder-box {
  background: var(--surface);
  border: 1.5px dashed var(--border-dark);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 20px;
  text-align: center;
  min-height: 360px;
  color: var(--text-muted);
}

.map-placeholder-box i {
  font-size: 3.5rem;
  color: var(--border-dark);
  display: block;
  margin-bottom: 12px;
}

/* ── 8. MOBILE OVERRIDES FOR DROPDOWNS ───────────────────────  */
@media (max-width: 767px) {
  /* On mobile, dropdowns convert to click-based overlays */
  .hdr-dropdown-panel {
    position: fixed;
    top: calc(var(--topbar-h) + var(--header-h)) !important;
    right: 8px !important;
    left: 8px !important;
    width: auto !important;
    max-height: 70vh;
    overflow-y: auto;
  }

  .hdr-dropdown-panel::after { display: none; }

  /* On mobile, hover doesn't work — only click (class 'open') */
  .hdr-dropdown-wrap:hover .hdr-dropdown-panel {
    opacity: 0;
    pointer-events: none;
    transform: translateY(-6px);
  }

  .hdr-dropdown-wrap.open .hdr-dropdown-panel {
    opacity: 1;
    pointer-events: all;
    transform: translateY(0);
  }

  .header-search { display: none; }
  .header-search.mobile-search-open {
    display: block;
    position: fixed;
    top: calc(var(--topbar-h) + var(--header-h));
    left: 0; right: 0;
    z-index: 1100;
    background: #fff;
    padding: 12px 16px;
    box-shadow: var(--shadow-md);
    max-width: 100%;
  }
}

/* ── 9. NAV — NEW ITEMS ──────────────────────────────────────  */
.nav-link.nav-store-locator {
  color: var(--gold-light) !important;
}

.nav-link.nav-register-product {
  background: rgba(201,168,76,0.18);
  color: var(--gold-light) !important;
  border-radius: var(--radius-sm);
  margin: 4px 4px;
}

.nav-link.nav-register-product:hover {
  background: rgba(201,168,76,0.3);
}
