/* ═══════════════════════════════════════════════════════
   ANATOMIKO.GR — HEADER & MOBILE NAV PATCH
   Isolated: touches ONLY #site-header, nav, mobile overlay
   ═══════════════════════════════════════════════════════ */

/* ── HIDE OLD TOP BAR ── */
#top { display: none !important; }

/* ── SITE HEADER ── */
#site-header {
  display: flex;
  align-items: center;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid rgba(0,0,0,.07);
  padding: 5px 24px 0;
  position: sticky;
  top: 0;
  z-index: 1000;
  min-height: 64px;
  transition: min-height .3s ease, box-shadow .3s ease;
}

#site-header.scrolled {
  min-height: 54px;
  box-shadow: 0 1px 24px rgba(0,0,0,.08);
  background: rgba(255,255,255,.97);
}

#site-header #logo {
  flex: 0 0 auto;
  padding: 10px 24px 10px 0;
  float: none;
  margin: 0;
  line-height: 1;
}

#site-header #logo img { max-height: 56px; width: auto; height: auto !important; display: block; }

@media (min-width: 768px) {
  #site-header #logo img { max-height: 76px; }
}

/* ── HEADER MENU WRAPPER ── */
#header-menu {
  flex: 1 1 auto;
  display: flex;
  align-items: stretch;
  min-width: 0;
  overflow: visible;
}

#header-menu > .container {
  max-width: none !important;
  width: 100% !important;
  padding: 0 !important;
  margin: 0 !important;
  display: flex !important;
  align-items: stretch !important;
}

#header-menu #menu {
  background: transparent !important;
  background-image: none !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  margin: 0 !important;
  min-height: 0 !important;
  flex: 1;
  display: flex;
  align-items: stretch;
}

/* ── NAV NUCLEAR RESET ── */
#header-menu nav li a,
#header-menu nav li a:link,
#header-menu nav li a:visited,
#header-menu nav li a:hover,
#header-menu nav li a:focus,
#header-menu nav li a:active,
#header-menu .navbar-nav > li > a,
#header-menu .navbar-nav > li.active > a,
#header-menu .navbar-nav > li.active > a:hover,
#header-menu .navbar-nav > li.active > a:focus,
#header-menu .navbar-nav > li.open > a,
#header-menu .navbar-nav > li.open > a:hover,
#header-menu .navbar-nav > li.open > a:focus,
.navbar-default #header-menu .navbar-nav > li.active > a,
.navbar-default #header-menu .navbar-nav > li.active > a:hover,
.navbar-default #header-menu .navbar-nav > li.active > a:focus,
.navbar-default #header-menu .navbar-nav > li.open > a,
.navbar-default #header-menu .navbar-nav > li.open > a:hover,
.navbar-default #header-menu .navbar-nav > li.open > a:focus {
  background: transparent !important;
  background-color: transparent !important;
  box-shadow: none !important;
  border: none !important;
  color: #1D1D1F !important;
}

/* ── DESKTOP NAV ── */
@media (min-width: 768px) {
  #header-menu { order: 2; }
  #header-actions { order: 3; }

  #header-menu .navbar-header { display: none !important; }

  #header-menu .navbar-collapse {
    display: flex !important;
    flex: 1;
    align-items: stretch;
    padding: 0 !important;
    border: none !important;
    box-shadow: none !important;
    background: transparent !important;
    height: auto !important;
    overflow: visible !important;
  }

  #header-menu .nav.navbar-nav {
    display: flex !important;
    flex-direction: row;
    align-items: stretch;
    float: none !important;
    margin: 0 !important;
  }

  #header-menu .navbar-nav > li {
    float: none !important;
    display: flex;
    align-items: center;
  }

  #header-menu .navbar-nav > li > a {
    display: flex;
    align-items: center;
    padding: 7px 14px !important;
    font-size: 14px;
    font-weight: 500;
    color: #1D1D1F !important;
    text-transform: none;
    letter-spacing: 0;
    text-shadow: none !important;
    background: transparent !important;
    border-radius: 8px;
    white-space: nowrap;
    transition: color .22s ease, background .22s ease;
  }

  #header-menu .navbar-nav > li > a:hover {
    color: #0066CC !important;
    background: rgba(0,102,204,.08) !important;
    box-shadow: none !important;
  }

  #header-menu .navbar-nav > li.open > a,
  #header-menu .navbar-nav > li.open > a:hover,
  #header-menu .navbar-nav > li.open > a:focus,
  #header-menu .navbar-nav > li.active > a,
  #header-menu .navbar-nav > li.active > a:hover,
  #header-menu .navbar-nav > li.active > a:focus {
    color: #0066CC !important;
    background: transparent !important;
    box-shadow: none !important;
  }

  #header-menu .navbar-nav > li.dropdown > a .caret { display: none; }

  #header-menu .dropdown-menu {
    z-index: 1031;
    border-radius: 16px !important;
    box-shadow: 0 16px 48px rgba(0,0,0,.18) !important;
    border: 1px solid rgba(255,255,255,.55) !important;
    background: rgba(255,255,255,.88) !important;
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    margin-top: 6px;
    padding: 8px !important;
  }

  #header-menu .dropdown-inner a {
    color: #1D1D1F !important;
    padding: 8px 12px !important;
    border-radius: 6px;
    font-size: 14px;
    min-width: 160px;
    display: block;
    line-height: 1.5;
  }

  #header-menu .dropdown-inner li a:hover {
    background: #F5F5F7 !important;
    color: #0066CC !important;
  }

  #header-menu .see-all {
    display: block;
    border-top: 1px solid #D2D2D7;
    padding: 8px 12px;
    font-size: 13px;
    border-radius: 0 0 10px 10px;
  }

  #header-menu .see-all:hover {
    background: #F5F5F7 !important;
    color: #0066CC !important;
  }

  #header-menu .dropdown-inner { display: table; }
  #header-menu .dropdown-inner ul { display: table-cell; }

  #mobile-burger { display: none !important; }
  #mobile-nav-overlay { display: none !important; }
}

/* ── HEADER ACTIONS (right side) ── */
#header-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  padding-left: 12px;
}

.header-icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #1D1D1F;
  font-size: 17px;
  background: transparent;
  border: none;
  transition: background .15s ease, color .15s ease;
  text-decoration: none;
}

.header-icon-btn:hover, .header-icon-btn:focus {
  background: #F5F5F7;
  color: #0066CC;
  text-decoration: none;
}

/* ── SEARCH — icon button, expands on click ── */
#header-search {
  position: relative;
  display: flex;
  align-items: center;
  align-self: center; /* keeps it level with sibling icons in #header-actions */
}

/* Force flexbox on the Bootstrap input-group so table-cell layout doesn't block width animation */
#header-search #search.input-group,
#header-search .input-group {
  display: flex !important;
  align-items: center !important;
  border-collapse: separate;
  flex-direction: row-reverse; /* button on right, input grows left */
  margin-bottom: 0 !important; /* Bootstrap adds 15px bottom margin to .input-group */
  margin-top: 0 !important;
}

#header-search .input-group-btn,
#header-search .input-group > .input-group-btn {
  display: flex !important;
  align-items: center !important;
  width: auto !important;
  vertical-align: middle;
  white-space: nowrap;
  flex-shrink: 0;
}

#header-search .input-group-btn > .btn,
#header-search .input-group > .input-group-btn > .btn {
  width: 40px !important; height: 40px !important;
  padding: 0 !important; border-radius: 50% !important;
  background: transparent !important; background-image: none !important;
  border: none !important; color: #1D1D1F !important;
  font-size: 17px !important; display: flex !important;
  align-items: center !important; justify-content: center !important;
  box-shadow: none !important; text-shadow: none !important;
  transition: background .15s ease, color .15s ease;
  position: relative; z-index: 2;
}
#header-search .input-group-btn > .btn:hover,
#header-search .input-group > .input-group-btn > .btn:hover {
  background: #F5F5F7 !important; color: #0066CC !important;
}

/* Input: controlled entirely by inline JS styles — CSS just sets the transition */
#header-search input[type="text"],
#header-search input.form-control {
  min-width: 0 !important;
  flex-shrink: 1 !important;
  border-radius: 20px !important;
  box-shadow: none !important;
  outline: none !important;
  /* transition is set inline by JS */
}

#header-search input::placeholder { color: #86868B; font-size: 13px; }

/* Desktop cart — icon button */
@media (min-width: 768px) {
  #header-cart { flex: 0 0 auto; margin-left: 4px; }
  #header-cart > div { margin: 0 !important; }

  #header-cart #cart > .btn {
    height: 36px !important; width: 36px !important;
    padding: 0 !important; border-radius: 50% !important;
    font-size: 0 !important;
    background: #1D1D1F !important; background-image: none !important;
    border-color: #1D1D1F !important; color: #fff !important;
    display: flex !important; align-items: center !important; justify-content: center !important;
    line-height: 1 !important; transition: background .2s ease;
    box-shadow: none !important; text-shadow: none !important;
  }

  #header-cart #cart .btn i { font-size: 16px !important; color: #fff !important; }
  #header-cart #cart .btn #cart-total { display: inline !important; }

  #header-cart #cart > .btn:hover,
  #header-cart #cart.open > .btn {
    background: #0066CC !important; border-color: #0066CC !important;
  }
}

/* ── MOBILE HEADER ── */
@media (max-width: 767px) {

  #site-header {
    flex-wrap: nowrap;
    padding: 5px 16px 0;
    min-height: 56px;
    z-index: 9999;
  }

  #site-header #logo { flex: 1 1 auto; padding: 8px 0; }

  #header-actions { flex: 0 0 auto; gap: 0; display: flex !important; align-items: center; }

  #header-search,
  #wishlist-total,
  #header-actions .header-icon-btn.dropdown { display: none !important; }

  #header-cart { display: flex !important; align-items: center; margin-left: 0; }
  #header-cart #cart { width: auto !important; display: block; }
  #header-cart #cart > .btn,
  #header-cart #cart > button {
    width: 40px !important; height: 40px !important;
    padding: 0 !important; border-radius: 50% !important;
    background: transparent !important; background-color: transparent !important;
    background-image: none !important; border: none !important;
    box-shadow: none !important; display: flex !important;
    align-items: center !important; justify-content: center !important;
    min-width: 0 !important; line-height: 1 !important;
    text-shadow: none !important; color: #1D1D1F !important;
    font-size: 0 !important;
  }
  #header-cart #cart .btn #cart-total,
  #header-cart #cart button #cart-total { display: inline !important; }
  #header-cart #cart .btn i,
  #header-cart #cart button i {
    font-size: 22px !important; color: #1D1D1F !important;
    display: inline !important; margin: 0 !important; line-height: 1;
  }
  #header-cart #cart.open .btn i,
  #header-cart #cart.open button i { color: #0066CC !important; }

  #header-cart #cart .dropdown-menu {
    position: fixed !important;
    top: 56px !important; left: 0 !important; right: 0 !important;
    width: 100% !important; max-height: 65vh; overflow-y: auto;
    border-radius: 0 0 16px 16px !important;
    box-shadow: 0 12px 40px rgba(0,0,0,.18) !important;
    z-index: 9990;
  }

  #header-menu { display: none !important; }

  #mobile-burger {
    flex: 0 0 auto; width: 40px; height: 40px;
    display: flex !important; align-items: center; justify-content: center;
    background: transparent; background-image: none;
    border: 1.5px solid #D2D2D7; border-radius: 10px;
    color: #1D1D1F; font-size: 17px; cursor: pointer;
    padding: 0; box-shadow: none; margin-left: 4px;
    transition: background .15s, border-color .15s, color .15s;
  }
  #mobile-burger.open { background: #F5F5F7; border-color: #00B5C8; color: #00B5C8; }
}

/* ── MOBILE NAV OVERLAY ── */
#mobile-nav-overlay {
  display: none;
  position: fixed;
  top: 56px; left: 0; right: 0; bottom: 0;
  z-index: 10000;
  background: #ffffff;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 32px 28px 80px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
}
#mobile-nav-overlay.open { display: block; }

/* ── CART BADGE ── */
#header-cart { position: relative; }

#cart-badge {
  position: absolute;
  top: 1px; right: 1px;
  min-width: 17px; height: 17px;
  background: #FF3B30;
  color: #fff !important;
  font-size: 10px !important;
  font-weight: 700;
  border-radius: 9px;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  line-height: 1;
  pointer-events: none;
  border: 1.5px solid #fff;
  z-index: 10;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ── SEARCH AUTOCOMPLETE DROPDOWN ── */
#search-dropdown {
  display: none;
  position: fixed;
  width: 320px;
  background: rgba(255,255,255,.97);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 16px;
  box-shadow: 0 16px 48px rgba(0,0,0,.15);
  z-index: 10000;
  overflow: hidden;
  padding: 6px;
}

#search-dropdown .srch-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 10px;
  border-radius: 10px;
  text-decoration: none;
  color: #1D1D1F;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.3;
  transition: background .12s ease;
}

#search-dropdown .srch-item:hover {
  background: #F5F5F7;
  color: #0066CC;
  text-decoration: none;
}

#search-dropdown .srch-item img {
  width: 40px; height: 40px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
}

#search-dropdown .srch-item span {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
