/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Amazon-style Header */
.he-amazon-header {
  background: linear-gradient(to bottom, #37475a, #2a3749);
  color: white;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  margin-bottom: 20px;
  direction: rtl;
}

/* Top Navigation Bar */
.he-nav-main {
  display: flex;
  flex-direction: column;
  padding: 10px 25px;
  gap: 15px;
}

.he-nav-main-top {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 0;
}

.he-nav-main-bottom {
  display: flex;
  align-items: center;
  gap: 15px;
  justify-content: space-between;
}

/* Logo Section */
.he-nav-logo {
  border: 1px solid transparent;
  border-radius: 3px;
  transition: all 0.15s ease;
  cursor: pointer;
  flex-shrink: 0;
}

.he-nav-logo:hover {
  border-color: #fff;
}

.he-logo {
  font-size: 32px;
  font-weight: bold;
  color: #fff;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
}

.he-logo-icon {
  font-size: 36px;
  color: #ff9900;
}

/* Location Section */
.he-nav-location {
  padding: 12px 15px;
  border: 1px solid transparent;
  border-radius: 3px;
  transition: all 0.15s ease;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 140px;
  flex-shrink: 0;
}

.he-nav-location:hover {
  border-color: #fff;
}

.he-location-icon {
  font-size: 18px;
  color: #ccc;
  margin-top: 2px;
}

.he-location-text {
  font-size: 12px;
  color: #ccc;
  line-height: 1.3;
  margin-bottom: 2px;
}

.he-location-city {
  font-size: 14px;
  font-weight: bold;
  color: #fff;
  line-height: 1.2;
}

/* Search Section */
.he-nav-search {
  flex: 1;
  max-width: 900px;
  position: relative;
  margin: 0 20px;
}

.he-search-container {
  display: flex;
  height: 42px;
  border-radius: 5px;
  overflow: hidden;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
}

.he-search-category {
  background: #f3f3f3;
  border: none;
  padding: 0 18px;
  font-size: 12px;
  color: #333;
  cursor: pointer;
  border-left: 1px solid #cdcdcd;
  min-width: 140px;
  font-weight: 500;
}

.he-search-category:hover {
  background: #e6e6e6;
}

.he-search-input {
  flex: 1;
  border: none;
  padding: 0 18px;
  font-size: 16px;
  outline: none;
  background: white;
  color: #333;
}

.he-search-input::placeholder {
  color: #999;
}

.he-search-button {
  background: #ff9900;
  border: none;
  padding: 0 18px;
  cursor: pointer;
  transition: background 0.15s ease;
  min-width: 50px;
}

.he-search-button:hover {
  background: #e88b00;
}

.he-search-button i {
  font-size: 18px;
  color: #333;
}

/* Account Section */
.he-nav-account {
  position: relative;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 3px;
  transition: all 0.15s ease;
  text-align: right;
  min-width: 120px;
  height: 50px;
  display: flex;
  align-items: center;
}

.he-account-dropdown {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  padding: 0 10px;
}

.he-account-button {
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 5px 0;
  width: 100%;
  height: 100%;
  text-align: right;
  transition: all 0.2s ease;
}

.he-account-button:hover {
  color: #ff9900;
}

.he-user-icon {
  font-size: 24px;
  flex-shrink: 0;
}

.he-dropdown-arrow {
  font-size: 12px;
  transition: transform 0.3s ease;
  margin-right: 5px;
}

.he-account-dropdown:hover .he-dropdown-arrow {
  transform: rotate(180deg);
}

.he-dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  background: white;
  border-radius: 4px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  min-width: 200px;
  z-index: 1001;
  display: none;
  padding: 5px 0;
  margin-top: 0;
  border: 1px solid #e0e0e0;
}

.he-account-dropdown:hover .he-dropdown-menu {
  display: block;
  animation: fadeIn 0.2s ease-in-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

.he-dropdown-item {
  display: flex;
  align-items: center;
  padding: 10px 15px;
  color: #111;
  text-decoration: none;
  transition: all 0.2s ease;
  gap: 10px;
  font-size: 14px;
  white-space: nowrap;
}

.he-dropdown-item i {
  width: 20px;
  text-align: center;
  color: #666;
}

.he-dropdown-item:hover {
  background-color: #f7f7f7;
  color: #e47911;
}

.he-dropdown-item:hover i {
  color: #e47911;
}

.he-dropdown-divider {
  height: 1px;
  background-color: #eee;
  margin: 5px 0;
  border: none;
}

.he-login-link {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  color: white;
  text-decoration: none;
  padding: 0 10px;
  height: 100%;
  transition: all 0.2s ease;
}

.he-login-link:hover {
  color: #ff9900;
}

/* Prevent layout shift on hover */
.he-nav-account:hover {
  border-color: transparent;
}

/* Fix for header z-index */
.he-amazon-header {
  position: relative;
  z-index: 1000;
}

/* Ensure dropdown appears above other elements */
.he-account-dropdown {
  z-index: 1001;
}

.he-account-greeting {
  font-size: 12px;
  color: #ccc;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100px;
}

.he-account-greeting:first-line {
  font-weight: bold;
  color: white;
  font-size: 14px;
}

/* Cart Section */
.he-nav-cart {
  padding: 12px 15px;
  border: 1px solid transparent;
  border-radius: 3px;
  transition: all 0.15s ease;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
  min-width: 100px;
  flex-shrink: 0;
}

.he-nav-cart:hover {
  border-color: #fff;
}

.he-cart-icon {
  font-size: 26px;
  color: #fff;
}

.he-cart-count {
  background: #ff9900;
  color: #333;
  font-size: 12px;
  font-weight: bold;
  padding: 2px 6px;
  border-radius: 10px;
  position: absolute;
  top: 8px;
  right: 8px;
  min-width: 20px;
  text-align: center;
  line-height: 1.2;
}

.he-cart-text {
  font-size: 14px;
  font-weight: bold;
  color: #fff;
  margin-right: 5px;
}

/* Secondary Navigation */
.he-nav-secondary {
  background: #232f3e;
  padding: 10px 25px;
  display: flex;
  align-items: center;
  gap: 25px;
  border-top: 1px solid #3a4553;
}

.he-nav-menu-toggle {
  background: none;
  border: none;
  color: #fff;
  font-size: 14px;
  font-weight: bold;
  padding: 10px 15px;
  cursor: pointer;
  border-radius: 3px;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.he-nav-menu-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
}

.he-nav-links {
  display: flex;
  align-items: center;
  gap: 25px;
  flex: 1;
}

.he-nav-links a {
  color: #fff;
  text-decoration: none;
  font-size: 14px;
  padding: 10px 15px;
  border-radius: 3px;
  transition: all 0.15s ease;
  white-space: nowrap;
  font-weight: 500;
}

.he-nav-links a:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* Dropdown Menu */
.he-dropdown {
  position: relative;
  display: inline-block;
}

.he-dropdown-content {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  background: #fff;
  min-width: 320px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border-radius: 5px;
  z-index: 1000;
  padding: 15px 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s ease;
  margin-top: 5px;
}

.he-dropdown:hover .he-dropdown-content {
  display: block;
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.he-dropdown-item {
  padding: 12px 25px;
  color: #333;
  text-decoration: none;
  display: block;
  transition: background 0.15s ease;
  font-size: 14px;
  border-bottom: 1px solid #f0f0f0;
}

.he-dropdown-item:last-child {
  border-bottom: none;
}

.he-dropdown-item:hover {
  background: #f8f9fa;
}

/* Search Suggestions */
.he-search-suggestions {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 0 0 5px 5px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  max-height: 300px;
  overflow-y: auto;
  margin-top: 1px;
}

.he-search-suggestions ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.he-search-suggestions li {
  padding: 12px 18px;
  cursor: pointer;
  border-bottom: 1px solid #f0f0f0;
  color: #333;
  transition: background 0.15s ease;
  font-size: 14px;
}

.he-search-suggestions li:hover {
  background: #f8f9fa;
}

.he-search-suggestions li:last-child {
  border-bottom: none;
}

/* Mobile Bottom Navigation */
.he-mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #232f3e;
  border-top: 1px solid #3a4553;
  z-index: 1000;
  padding: 8px 0;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}

.he-mobile-bottom-nav ul {
  display: flex;
  justify-content: space-around;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
}

.he-mobile-bottom-nav li {
  flex: 1;
  text-align: center;
}

.he-mobile-bottom-nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  color: #fff;
  text-decoration: none;
  padding: 8px 4px;
  border-radius: 4px;
  transition: all 0.2s ease;
  font-size: 10px;
  position: relative;
}

.he-mobile-bottom-nav a:hover {
  background: rgba(255, 255, 255, 0.1);
}

.he-mobile-bottom-nav a.active {
  color: #ff9900;
}

.he-mobile-bottom-nav i {
  font-size: 18px;
  margin-bottom: 4px;
}

.he-mobile-bottom-nav .he-cart-badge {
  position: absolute;
  top: 4px;
  right: 8px;
  background: #ff9900;
  color: #333;
  font-size: 10px;
  font-weight: bold;
  padding: 2px 6px;
  border-radius: 10px;
  min-width: 16px;
  text-align: center;
  line-height: 1;
}

/* Add padding to body for mobile bottom nav */
body.he-mobile-nav-active {
  padding-bottom: 70px;
}

/* Location in Mobile Header */
.he-mobile-location-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 15px;
  background-color: #232f3e;
  border-top: 1px solid #37475a;
  color: #fff;
  font-size: 14px;
  direction: rtl;
  gap: 8px;
}

.he-mobile-location-bar .fa-map-marker-alt {
  color: #ff9900;
  font-size: 16px;
}

.he-mobile-location-bar .he-location-city {
  font-weight: 500;
}

/* Responsive Design */
@media (max-width: 1024px) {
  .he-nav-main {
    padding: 8px 20px;
    gap: 12px;
  }

  .he-nav-main-bottom {
    gap: 12px;
  }

  .he-nav-search {
    margin: 0 15px;
  }

  .he-nav-links {
    gap: 20px;
  }
}

@media (max-width: 768px) {
  .he-nav-main {
    gap: 10px;
    padding: 8px 15px;
  }

  .he-nav-main-bottom {
    flex-wrap: wrap;
    gap: 10px;
  }

  .he-nav-search {
    order: 3;
    width: 100%;
    margin: 10px 0 0 0;
  }

  .he-nav-location {
    display: none;
  }

  .he-nav-secondary {
    flex-wrap: wrap;
    gap: 15px;
    padding: 8px 15px;
  }

  .he-nav-links {
    gap: 15px;
  }

  .he-dropdown-content {
    min-width: 280px;
  }

  /* Show mobile bottom nav */
  .he-mobile-bottom-nav {
    display: block;
  }

  /* Hide desktop account and cart in mobile */
  .he-nav-account,
  .he-nav-cart {
    display: none;
  }
}

@media (max-width: 480px) {
  .he-nav-main {
    padding: 5px 10px;
  }

  .he-nav-secondary {
    padding: 5px 10px;
  }

  .he-logo {
    font-size: 28px;
  }

  .he-logo-icon {
    font-size: 32px;
  }

  .he-search-category {
    display: none;
  }

  .he-nav-links {
    gap: 10px;
  }

  .he-nav-links a {
    padding: 8px 10px;
    font-size: 12px;
  }
}




/* اضافه کردن این کد در فایل CSS */
html {
    scroll-behavior: smooth;
}

/* اطمینان از اینکه صفحه همیشه از بالا شروع شه */
body {
    scroll-behavior: smooth;
}

/* برای موبایل */
@media (max-width: 768px) {
    html, body {
        scroll-behavior: smooth;
        overflow-x: hidden;
    }
}

/* استایل‌دهی به آیکون‌های فونت‌آی‌کان */
.fas, .far, .fab, .fa {
  font-style: normal;
  font-variant: normal;
  text-rendering: auto;
  line-height: 1;
  display: inline-block;
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  -moz-osx-font-smoothing: grayscale;
  -webkit-font-smoothing: antialiased;
  direction: rtl;
}

/* استایل برای آیکون‌های کنار متن‌ها */
.profile-info-item .fas,
.profile-info-item .far,
.profile-info-item .fa {
  margin-left: 8px;
  color: var(--secondary-color);
  width: 20px;
  text-align: center;
}

/* استایل برای گروه ورودی‌ها */
.input-group-text {
  background-color: #f8f9fa;
  border: 1px solid #ced4da;
  border-left: none;
  border-radius: 0 0.25rem 0.25rem 0;
  padding: 0.375rem 0.75rem;
}

.input-group > .form-control {
  border-right: none;
  border-radius: 0.25rem 0 0 0.25rem;
}

.input-group > .form-control:focus + .input-group-text {
  border-color: #80bdff;
  box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* استایل‌های اضافی برای کارت پروفایل */
.card-body .fa-phone,
.card-body .fa-envelope,
.card-body .fa-edit {
  font-size: 1.1em;
  vertical-align: middle;
  margin-left: 5px;
}


/* WhatsApp Button Styles */
.he-nav-account,
.he-nav-cart,
.he-nav-request {
    position: relative;
    padding: 0 10px;
    cursor: pointer;
}

.he-request-button {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #fff;
    text-decoration: none;
    font-size: 12px;
    transition: all 0.3s ease;
    padding: 5px 10px;
    border-radius: 4px;
}

.he-request-button:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.he-request-button i {
    font-size: 20px;
    margin-bottom: 2px;
}

.whatsapp-float {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background-color: #25D366;
    color: #FFF;
    border-radius: 50%;
    text-align: center;
    font-size: 30px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    animation: pulse 2s infinite;
}

.whatsapp-float:hover {
    background-color: #128C7E;
    transform: scale(1.1);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
}

.whatsapp-float i {
    margin-top: 2px;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(37, 211, 102, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0);
    }
}

@media (max-width: 768px) {
    .whatsapp-float {
        width: 50px;
        height: 50px;
        font-size: 25px;
        bottom: 20px;
        right: 15px;
    }
}