/* ===================== Header ===================== */
header{
  background:linear-gradient(135deg, 
    rgba(138, 0, 74, 0.92) 0%, 
    rgba(138, 0, 74, 0.95) 50%, 
    rgba(233, 30, 99, 0.88) 100%);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border-bottom:2px solid rgba(138, 0, 74, 0.25);
  padding:16px 0;
  position:sticky;
  top:0;
  z-index:1000;
  box-shadow:0 4px 20px rgba(138, 0, 74, 0.2);
}

.nav{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:20px;
  flex-wrap:wrap;
}

.logo{
  display:flex;
  align-items:center;
  gap:12px;
  cursor:pointer;
  transition:transform 0.3s ease;
}

.logo:hover{
  transform:scale(1.05);
}

.logo-circle{
  width:52px;
  height:52px;
  border-radius:50%;
  background:rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(10px);
  color:#fff;
  display:flex;
  justify-content:center;
  align-items:center;
  font-size:24px;
  font-weight:800;
  box-shadow:0 4px 12px rgba(0, 0, 0, 0.2);
  border:2px solid rgba(255, 255, 255, 0.3);
}

.nav-links{
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
}

.nav-links a{
  margin:0 4px;
  text-decoration:none;
  color:rgba(255, 255, 255, 0.9);
  font-weight:600;
  font-size:15px;
  padding:8px 16px;
  border-radius:10px;
  transition:all 0.3s ease;
  position:relative;
}

.nav-links a:hover{
  color:#fff;
  background:rgba(255, 255, 255, 0.15);
  transform:translateY(-2px);
}

.nav-links a.active{
  color:#fff;
  background:rgba(255, 255, 255, 0.25);
  font-weight:700;
  box-shadow:0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Profile link in header */
.profile-link-header {
  display: inline-flex !important;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.2) !important;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 8px 14px !important;
  border-radius: 20px;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.profile-link-header:hover {
  background: rgba(255, 255, 255, 0.3) !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.profile-link-header.logged-in {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.85) 100%) !important;
  color: #8a004a !important;
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.profile-link-header.logged-in:hover {
  background: linear-gradient(135deg, #ffffff 0%, rgba(255, 255, 255, 0.95) 100%) !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  transform: translateY(-2px);
}

.profile-icon-wrapper {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  transition: all 0.3s ease;
}

.profile-link-header.logged-in .profile-icon-wrapper {
  background: linear-gradient(135deg, #E91E63 0%, #8a004a 100%);
  color: white;
  box-shadow: 0 2px 6px rgba(233, 30, 99, 0.4);
}

.profile-name-text {
  font-weight: 600;
  font-size: 14px;
}

.profile-link-header.logged-in .profile-name-text {
  font-weight: 700;
  color: #8a004a;
}

/* Mobile profile link */
.mobile-profile-link-header {
  display: flex !important;
  align-items: center;
  gap: 10px;
  padding: 12px 16px !important;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  margin: 4px 0;
  transition: all 0.3s ease;
}

.mobile-profile-link-header:hover {
  background: rgba(255, 255, 255, 0.2);
}

.mobile-profile-link-header.logged-in {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.85) 100%);
  color: #8a004a !important;
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.mobile-profile-icon {
  font-size: 20px;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  transition: all 0.3s ease;
}

.mobile-profile-link-header.logged-in .mobile-profile-icon {
  background: linear-gradient(135deg, #E91E63 0%, #8a004a 100%);
  box-shadow: 0 2px 6px rgba(233, 30, 99, 0.4);
}

.mobile-profile-name {
  flex: 1;
  font-weight: 600;
  font-size: 15px;
}

.mobile-profile-link-header.logged-in .mobile-profile-name {
  font-weight: 700;
  color: #8a004a;
}

/* Mobile menu */
.mobile-menu-btn{
  display:none;
  background:linear-gradient(135deg, #E91E63 0%, #8a004a 100%);
  color:white;
  border:none;
  padding:10px 14px;
  border-radius:10px;
  font-size:20px;
  cursor:pointer;
  box-shadow:0 2px 8px rgba(233, 30, 99, 0.3);
}

.mobile-menu{
  display:none;
  position:absolute;
  top:100%;
  right:0;
  left:0;
  background:linear-gradient(135deg, rgba(138, 0, 74, 0.98) 0%, rgba(233, 30, 99, 0.95) 100%);
  backdrop-filter: blur(10px);
  box-shadow:0 8px 24px rgba(138, 0, 74, 0.3);
  border-top:2px solid rgba(255, 255, 255, 0.2);
  padding:20px;
  z-index:999;
}

.mobile-menu.active{
  display:block;
  animation:slideDown 0.3s ease;
}

.mobile-menu a{
  display:block;
  padding:12px 16px;
  text-decoration:none;
  color:rgba(255, 255, 255, 0.9);
  font-weight:600;
  border-radius:8px;
  margin-bottom:8px;
  transition:all 0.3s ease;
}

.mobile-menu a:hover{
  background:rgba(255, 255, 255, 0.15);
  color:#fff;
  padding-right:24px;
}

.mobile-menu a.active{
  background:rgba(255, 255, 255, 0.25);
  color:#fff;
  font-weight:700;
}

/* Header Search */
.header-search-wrapper{
  position:relative;
}

.header-search-input{
  width:100%;
  padding:12px 16px 12px 44px;
  border-radius:28px;
  border:2px solid rgba(255, 255, 255, 0.3);
  font-size:15px;
  transition:all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background:rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(12px);
  color:#333;
  font-weight:400;
}

.header-search-input::placeholder{
  color:rgba(255, 255, 255, 0.75);
  font-weight:400;
}

.header-search-input:focus{
  outline:none;
  border-color:rgba(255, 255, 255, 0.6);
  background:rgba(255, 255, 255, 0.98);
  box-shadow:0 4px 20px rgba(255, 255, 255, 0.3), 0 0 0 4px rgba(255, 255, 255, 0.15);
  color:#1a1a1a;
  transform:translateY(-1px);
}

.header-search-icon{
  position:absolute;
  left:14px;
  top:50%;
  transform:translateY(-50%);
  font-size:20px;
  color:rgba(255, 255, 255, 0.85);
  pointer-events:none;
  transition:all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index:1;
}

.header-search-wrapper:has(.header-search-input:focus) .header-search-icon{
  color:#8a004a;
  transform:translateY(-50%) scale(1.1);
}

.header-search-results{
  position:absolute;
  top:50px;
  width:100%;
  background:#fff;
  border-radius:16px;
  border:1px solid #e0e0e0;
  box-shadow:0 4px 20px rgba(0,0,0,0.12), 0 2px 8px rgba(0,0,0,0.08);
  z-index:9999;
  max-height:500px;
  overflow-y:auto;
  display:none;
  margin-top:4px;
}

.header-search-results::-webkit-scrollbar {
  width: 8px;
}

.header-search-results::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 16px;
}

.header-search-results::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 16px;
}

.header-search-results::-webkit-scrollbar-thumb:hover {
  background: #999;
}

/* Mobile search icon button */
.mobile-search-icon-btn {
  display: none;
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  width: 42px;
  height: 42px;
  font-size: 20px;
  cursor: pointer;
  transition: all 0.3s ease;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(10px);
}

.mobile-search-icon-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

.mobile-search-container {
  position: relative;
}

.mobile-search-close {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.9);
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
  z-index: 15;
  display: none;
  line-height: 1;
}

.mobile-search-container.active .mobile-search-close {
  display: block;
}

.mobile-search-container.active .header-search-icon {
  left: 14px;
  z-index: 1;
}

/* Cart and Wishlist icons */
.wishlist-link{
  position:relative;
}

.wishlist-count{
  position:absolute;
  top:-8px;
  right:-8px;
  background:linear-gradient(135deg, #E91E63 0%, #c2185b 100%);
  color:white;
  padding:2px 6px;
  border-radius:50%;
  font-size:11px;
  font-weight:bold;
  display:none;
  min-width:18px;
  text-align:center;
  box-shadow:0 2px 6px rgba(233, 30, 99, 0.4);
}

.cart-icon-wrapper{
  cursor:pointer;
  font-size:24px;
  color:#fff;
  position:relative;
  padding:10px;
  border-radius:14px;
  transition:all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  text-shadow:0 2px 4px rgba(0,0,0,0.2);
  background:rgba(255, 255, 255, 0.15);
  backdrop-filter:blur(10px);
  border:1px solid rgba(255, 255, 255, 0.2);
  box-shadow:0 4px 12px rgba(0, 0, 0, 0.1),
             0 2px 4px rgba(0, 0, 0, 0.05);
  display:flex;
  align-items:center;
  justify-content:center;
  min-width:48px;
  min-height:48px;
}

.cart-icon-wrapper:hover{
  background:rgba(255, 255, 255, 0.25);
  transform:translateY(-2px) scale(1.05);
  box-shadow:0 6px 20px rgba(0, 0, 0, 0.15),
             0 4px 8px rgba(0, 0, 0, 0.1);
  border-color:rgba(255, 255, 255, 0.3);
}

.cart-icon-wrapper:active{
  transform:translateY(0) scale(1);
}

.cart-count{
  position:absolute;
  top:-4px;
  right:-4px;
  background:linear-gradient(135deg, #E91E63 0%, #c2185b 100%);
  color:white;
  padding:3px 7px;
  border-radius:12px;
  font-size:11px;
  font-weight:bold;
  display:none;
  min-width:20px;
  height:20px;
  text-align:center;
  line-height:14px;
  box-shadow:0 3px 8px rgba(233, 30, 99, 0.5),
             0 1px 3px rgba(0, 0, 0, 0.2);
  border:2px solid rgba(255, 255, 255, 0.3);
  z-index:10;
}

.wishlist-count-mobile{
  position:absolute;
  top:-8px;
  right:-8px;
  background:linear-gradient(135deg, #E91E63 0%, #c2185b 100%);
  color:white;
  padding:2px 6px;
  border-radius:50%;
  font-size:11px;
  font-weight:bold;
  display:none;
  min-width:18px;
  text-align:center;
  box-shadow:0 2px 6px rgba(233, 30, 99, 0.4);
}

/* Desktop search results */
@media (min-width: 769px) {
  .mobile-search-icon-btn,
  .mobile-search-container {
    display: none !important;
  }
  
  .desktop-search-container {
    display: block !important;
  }
  
  .logo-home-text {
    display: none !important; /* إخفاء "الرئيسية" في الكومبيوتر */
  }

  .header-search-result-item{
    padding:10px 12px !important;
    gap:8px !important;
  }
  
  .header-search-result-img {
    width:45px !important;
    height:45px !important;
    min-width:45px !important;
    border-radius: 8px !important;
  }
  
  .header-search-result-name {
    font-size:12px !important;
    margin-bottom:3px !important;
    line-height:1.3 !important;
  }
  
  .header-search-result-category {
    font-size:10px !important;
    line-height:1.2 !important;
    margin-bottom:4px !important;
  }
  
  .header-search-price-main {
    font-size:13px !important;
  }
  
  .header-search-price-old {
    font-size:10px !important;
  }
  
  .header-search-discount {
    font-size:9px !important;
    padding: 2px 6px !important;
  }
  
  .header-search-result-arrow {
    font-size: 16px !important;
  }
  
  .header-search-result-price {
    gap: 6px !important;
  }
}

/* Mobile responsive */
@media (max-width: 768px) {
  /* منع التمرير الأفقي عند فتح البحث */
  body.search-open {
    overflow-x: hidden !important;
    position: fixed;
    width: 100%;
  }
  
  .nav-links{
    display:none;
  }
  .mobile-menu-btn{
    display:block;
  }
  
  .nav {
    flex-wrap: nowrap;
    gap: 8px;
    position: relative;
  }
  
  .logo {
    order: 0;
    margin-right: auto;
    display: flex;
    align-items: center;
    gap: 8px;
  }
  
  .header-search-wrapper {
    order: 1;
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 8px;
  }
  
  .cart-icon-wrapper {
    order: 2;
  }
  
  .mobile-menu-btn {
    order: 3;
  }
  
  .mobile-search-icon-btn {
    display: flex;
  }
  
  .mobile-search-container {
    display: none !important;
  }
  
  .header-search-wrapper > div:not(.mobile-search-container):not(.mobile-search-icon-btn) {
    display: none !important;
  }
  
  .mobile-search-container.active {
    display: block !important;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    transform: none;
    width: 100% !important;
    max-width: 100% !important;
    z-index: 1000;
    animation: none;
    padding: 0 50px 0 10px;
    box-sizing: border-box;
  }
  
  .mobile-search-container {
    position: relative !important;
  }
  
  .header-search-wrapper.search-active {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 1000;
  }
  
  .header-search-wrapper.search-active .mobile-search-icon-btn {
    display: none;
  }
  
  .header-search-wrapper.search-active ~ .mobile-menu-btn,
  .header-search-wrapper.search-active ~ .cart-icon-wrapper {
    opacity: 0;
    pointer-events: none;
    width: 0;
    overflow: hidden;
    margin: 0;
    padding: 0;
  }
  
  .header-search-wrapper.search-active ~ .logo {
    opacity: 1;
    pointer-events: auto;
    width: auto;
    overflow: visible;
    margin: 0;
    padding: 0;
    min-width: auto;
  }
  
  .header-search-wrapper.search-active ~ .logo .logo-circle,
  .header-search-wrapper.search-active ~ .logo > div:nth-child(2) {
    display: none;
  }
  
  .header-search-wrapper.search-active ~ .logo .logo-home-text {
    display: inline !important;
    font-size: 14px !important;
  }
  
  .header-search-wrapper.search-active ~ .logo .logo-back-arrow {
    display: inline !important;
  }
  
  .header-search-input{
    font-size:16px !important;
    padding:14px 45px 14px 50px !important;
    width: 100% !important;
  }
  
  .mobile-search-container.active .header-search-input {
    padding-right: 45px !important;
  }
  
  .mobile-search-container .header-search-results,
  .mobile-search-container.active .header-search-results {
    max-height:70vh !important;
    border-radius:12px !important;
    width: calc(100% - 20px) !important;
    max-width: calc(100% - 20px) !important;
    left: 10px !important;
    right: 10px !important;
    transform: none !important;
    top: 100% !important;
    margin-top: 8px !important;
    z-index: 1001 !important;
    position: absolute !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
  }
  
  .header-search-result-item{
    padding:10px 12px !important;
    gap:8px !important;
  }
  
  .header-search-result-img {
    width:45px !important;
    height:45px !important;
    min-width:45px !important;
    border-radius: 8px !important;
  }
  
  .header-search-result-name {
    font-size:12px !important;
    margin-bottom:3px !important;
    line-height:1.3 !important;
  }
  
  .header-search-result-category {
    font-size:10px !important;
    line-height:1.2 !important;
    margin-bottom:4px !important;
  }
  
  .header-search-price-main {
    font-size:13px !important;
  }
  
  .header-search-price-old {
    font-size:10px !important;
  }
  
  .header-search-discount {
    font-size:9px !important;
    padding: 2px 6px !important;
  }
  
  .header-search-result-arrow {
    font-size: 16px !important;
  }
  
  .header-search-result-price {
    gap: 6px !important;
  }
  
  .logo > div:nth-child(2) {
    display: none; /* إخفاء "جمالك" في الجوال */
  }
  
  .logo-home-text {
    display: block !important; /* إظهار "الرئيسية" في الجوال */
  }
}



