/* ================= NAVBAR (GLOBAL) ================= */

nav,
header,
.navbar {
  opacity: 1 !important;
  visibility: visible !important;
}

.nav,
.nav * {
  box-sizing: border-box;
}

.nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 9999;

  background: rgba(255,255,255,.92);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);

  border-bottom: 1px solid #e5e7eb;
  padding: 16px 40px;

  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* RESPONSIVE NAVBAR */
@media (max-width: 1024px) {
  .nav {
    padding: 12px 20px;
  }
}

@media (max-width: 768px) {
  .nav {
    padding: 12px 16px;
  }
  
  .nav__menu {
    display: none;
  }
}

/* LEFT SIDE */

.nav__left{
  display:flex;
  align-items:center;
  gap:30px;
  min-width:0;
}

@media (max-width: 768px) {
  .nav__left {
    gap: 20px;
  }
}

@media (max-width: 480px) {
  .nav__left {
    gap: 12px;
  }
}

/* RIGHT SIDE ICONS */

.nav__right{
  margin-left:auto;
  display:flex;
  align-items:center;
  justify-content:flex-end;

  /* REDUCED ICON SPACING */
  gap:8px;
}

@media (max-width: 480px) {
  .nav__right {
    gap: 6px;
  }
}

/* LOGO */

.logo{
  font-size:25px;
  font-weight:800;
  text-decoration:none;
  color:#111827;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial;
  line-height:1;
  white-space:nowrap;
  margin-top:-8px;
  position:relative;
}

@media (max-width: 768px) {
  .logo {
    font-size: 18px;
  }
}

@media (max-width: 480px) {
  .logo {
    font-size: 16px;
  }
}

/* MENU */

.nav__menu{
  display:flex;
  align-items:center;
  gap:28px;
}

.nav__link{
  text-decoration:none;
  color:#111827;
  font-size:18px;
  font-weight:500;
  padding:6px 4px;
  transition:transform .2s ease, opacity .2s ease;
  white-space:nowrap;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial;
  position:relative;
}

.nav__link:hover{
  transform:translateY(-1px);
  opacity:.9;
}

/* ================= SEARCH ================= */

.search{
  position:relative;
  display:flex;
  align-items:center;
  gap:0;
}

.icon-btn{
  background:transparent !important;
  border:none !important;
  outline:none;
  box-shadow:none !important;
  padding:0;
  margin:0;
  cursor:pointer;

  display:flex;
  align-items:center;
  justify-content:center;

  appearance:none;
  -webkit-appearance:none;
  transition:transform .2s ease;
}

.icon-btn svg{
  width:28px;
  height:28px;
  color:#111827;
  stroke-width:1.6;
  transition:transform .5s ease;
}

.icon-btn:hover{
  transform:translateY(-2px);
}

.icon-btn:hover svg{
  transform:scale(1.05);
}

.search__panel{
  position:absolute;
  left:calc(100% + 10px);
  top:50%;
  transform:translateY(-50%);

  width:0;
  overflow:visible;
  opacity:0;
  pointer-events:none;
  white-space:nowrap;
  z-index:20;

  transition:
    width .5s cubic-bezier(.16,1,.3,1),
    opacity .2s ease;
}

.search__input{
  width:230px;
  height:40px;

  border-radius:8px;
  border:1px solid #e5e7eb;

  padding:0 14px;
  outline:none;

  font-size:14px;

  background:#fff;
  color:#111827;

  box-shadow:0 6px 18px rgba(0,0,0,.08);
}

.search__results{
  position:absolute;
  top:calc(100% + 8px);
  left:0;
  width:100%;
  max-height:0;
  overflow:hidden;
  opacity:0;
  transform:translateY(-6px);
  background:#fff;
  border:1px solid #e5e7eb;
  border-radius:12px;
  box-shadow:0 16px 30px rgba(0,0,0,.12);
  transition:max-height .28s ease, opacity .2s ease, transform .24s ease;
}

.search__results.is-open{
  max-height:380px;
  opacity:1;
  transform:translateY(0);
  overflow-y:auto;
}

.search__result-item{
  width:100%;
  border:none;
  background:transparent;
  display:flex;
  align-items:center;
  gap:12px;
  text-align:left;
  padding:10px 12px;
  cursor:pointer;
  transition:background .2s ease;
}

.search__result-item:hover{
  background:#f8fafc;
}

.search__result-thumb{
  width:44px;
  height:44px;
  border-radius:8px;
  object-fit:cover;
  background:#f3f4f6;
  flex:0 0 44px;
}

.search__result-meta{
  min-width:0;
  flex:1;
}

.search__result-name{
  margin:0;
  font-size:14px;
  font-weight:600;
  color:#111827;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.search__result-type{
  margin:2px 0 0;
  font-size:12px;
  color:#6b7280;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.search__result-empty{
  padding:12px;
  margin:0;
  font-size:12px;
  color:#6b7280;
}

@media (max-width: 768px) {
  .search__input {
    width: 240px;
    height: 36px;
    font-size: 13px;
  }
  
  .search.is-open .search__panel {
    width: 300px;
  }
}

@media (max-width: 480px) {
  .search {
    display: none;
  }
}

.search__input:focus{
  border-color:#111827;
  box-shadow:0 0 0 3px rgba(17,24,39,.15);
}

.search.is-open .search__panel{
  width:380px;
  opacity:1;
  pointer-events:auto;
}

.search:hover .search__panel,
.search:focus-within .search__panel{
  width:380px;
  opacity:1;
  pointer-events:auto;
}

/* ================= ICONS ================= */

.nav-icon{
  color:#111827;
  text-decoration:none;

  display:flex;
  align-items:center;
  justify-content:center;

  line-height:1;

  background:none;
  border:none;
  cursor:pointer;

  padding:0;

  transition:transform .2s ease, opacity .2s ease;
}

/* ICON SIZE */

.nav-icon i{
  font-size:22px;
  display:block;
  opacity:.9;
}

@media (max-width: 768px) {
  .nav-icon i {
    font-size: 20px;
  }
}

@media (max-width: 480px) {
  .nav-icon i {
    font-size: 18px;
  }
}

/* ICON BUTTON SIZE */

.profile-btn,
.nav-orders-btn,
.nav-message-btn,
.cart-nav-btn{
  width:32px;
  height:32px;
}

@media (max-width: 480px) {
  .profile-btn,
  .nav-orders-btn,
  .nav-message-btn,
  .cart-nav-btn {
    width: 28px;
    height: 28px;
  }
}

/* HOVER */

.nav-icon:hover{
  transform:translateY(-2px);
  opacity:.9;
}

/* ================= BADGE ================= */

.cart-badge{
  position:absolute;
  top:-5px;
  right:-6px;

  min-width:16px;
  height:16px;

  padding:0 4px;

  border-radius:50%;

  background:#e53935;
  color:#fff;

  font-size:10px;
  font-weight:600;

  display:flex;
  align-items:center;
  justify-content:center;
}

/* ================= PROFILE ================= */

.nav-profile-wrap{
  position:relative;
  display:inline-block;
}

#navProfileImg{
  width:34px;
  height:34px;
  border-radius:50%;
  object-fit:cover;
  display:none;
}

/* DROPDOWN */

.profile-dropdown{
  position:absolute;
  right:0;
  top:calc(100% + 10px);

  min-width:180px;

  background:rgba(255,255,255,0.9);
  backdrop-filter:blur(10px);

  border:1px solid rgba(0,0,0,0.08);
  border-radius:12px;

  padding:8px;

  box-shadow:0 12px 28px rgba(0,0,0,0.15);

  display:none;
  z-index:9999;
}

.profile-dropdown.open{
  display:block;
}

/* DROPDOWN ITEMS */

.profile-dd-item{
  width:100%;
  display:flex;
  align-items:center;
  gap:10px;

  padding:10px 12px;

  border:0;
  background:transparent;

  color:#333;

  border-radius:8px;
  cursor:pointer;

  font:inherit;
  text-align:left;
}

.profile-dd-item:hover{
  background:rgba(0,0,0,0.05);
}

.profile-dd-item.danger{
  color:#e53935;
}

.profile-dd-item.danger:hover{
  background:rgba(229,57,53,0.1);
}

/* ================= UNDERLINE ================= */

.logo::after,
.nav__link::after{
  content:'';
  position:absolute;
  bottom:-2px;
  left:50%;
  transform:translateX(-50%);

  width:0;
  height:2px;

  background:#050506;

  transition:width .4s ease;
}

.logo:hover::after,
.nav__link:hover::after{
  width:100%;
}

/* ================= RESPONSIVE ================= */

@media (max-width:900px){

  .nav{
    padding:14px 18px;
  }

  .nav__menu{
    display:none;
  }

  .logo{
    font-size:22px;
  }

  .search__input{
    width:200px;
  }

  .search.is-open .search__panel{
    width:200px;
  }

  .search:hover .search__panel,
  .search:focus-within .search__panel{
    width:200px;
  }

  .nav__right{
    gap:6px;
  }

}

@media (max-width: 768px) {
  .search.is-open .search__panel,
  .search:hover .search__panel,
  .search:focus-within .search__panel {
    width: 300px;
  }
}