.main_header {
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 999;
  background: transparent;
  transition:
    background 0.4s ease,
    box-shadow 0.4s ease;
  /* padding: 16px; */
}

.main_header.scrolled {
  background: var(--menu-header-primary-color, var(--primary-color));
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
}

/* Header Buttons */
.main_header .acc_btn {
  border-radius: 50%;
  padding: 4px;
  border: none;
  background-color: var(--primary-color);
  filter: brightness(20%);
}

.main_header .header-options {
  .header-search {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    padding: 3px;
    transition: all 0.4s ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;

    &:hover {
      background: var(--text-color-primary-bg);
      svg path {
        stroke: var(--white-color);
      }
    }
  }

  .wishlist-icon {
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    padding: 3px;
    transition: all 0.4s ease-in-out;

    &:hover {
      background: var(--text-color-primary-bg);
      svg path {
        stroke: var(--white-color);
      }
    }
  }

  .language-btn {
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    padding: 3px;
    transition: all 0.4s ease-in-out;

    &:hover {
      background: var(--text-color-primary-bg) !important;
      color: var(--white-color);
    }
  }

  .a-shopping-cart {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    padding: 3px;
    position: relative;
    transition: all 0.4s ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;

    &:hover {
      background: var(--text-color-primary-bg);
      svg path {
        stroke: var(--white-color);
      }
    }
  }

  .account-area {
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    /* border: 1px solid var(--text-color-primary-bg); */

    .account-btn {
      border-radius: 50%;
      color: var(--header-text-color-primary-bg, var(--text-color-primary-bg));
      width: 30px;
      height: 30px;
      display: flex;
      align-items: center;
      justify-content: center;
      transition: all 0.4s ease-in-out;
      background: transparent;
      border:none;

      &:hover {
        background: var(--text-color-primary-bg);
        color: var(--white-color);
      }
    }
  }

  .search-box {
    top: 20%;
    left: 50%;
    transform: translateX(-50%) !important;
    position: absolute;
    width: 60%;
    max-width: 500px;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    padding: 20px;
    transition: transform 0.4s;

    @media (max-width: 768px) {
      left: 28%;
      transform: translateX(0px);
    }

    .autocomplete {
      input {
        border: none;
        outline: none;
        flex: 1;
        font-size: 16px;
        background: var(--secondary-color-alt7);
        width: 90%;
      }

      .autocomplete-items {
        padding: 20px 0;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-direction: column;
        gap: 10px;

        .autocomplete-item {
          width: 100%;

          a {
            border: 1px solid #d4d4d4;
            border-color: var(--text-color-primary-bg);
            color: var(--primary-color);
            border-radius: 20px;
            padding: 8px 12px;

            -webkit-box-orient: vertical;
            /* display: -webkit-box !important; */
            overflow: hidden;
            transition: all 0.3s ease-in-out;
            width: 100%;
            font-size: 16px;
            display: flex;
            align-items: center;
            flex-direction: row;
            justify-content: flex-start;
            gap: 10px;
            transition: all 0.4s ease-in-out;

            &:hover {
              background-color: var(--primary-color);
              color: var(--white-color);
            }

            .autocomplete-img {
              max-height: 80px;
              max-width: 80px;
              display: flex;
              align-items: center;
              margin: auto 0;
              justify-content: center;
              aspect-ratio: 1/1;

              img {
                width: 100%;
                height: 100%;
              }
            }

            .autocomplete-info {
              display: flex;
              align-items: flex-start;
              justify-content: space-between;
              flex-flow: column;
              height: 100%;
              gap: 12px;
            }
          }
        }

        .autocomplete-view-all {
          color: var(--secondary-color-alt1);
          filter: drop-shadow(0px 0px 12px var(--primary-color));

          a {
            color: var(--primary-color);
            transition: all 0.4s ease-in-out;

            &:hover {
              color: var(--secondary-color-alt1);
            }
          }
        }

        .autocomplete-no-results {
          flex-direction: column;
          display: flex;
          align-items: center;
          justify-content: center;
          gap: 10px;
          padding: 5px 20px;
          border-radius: 15px;
          width: 100%;
          height: 65px;
        }
      }
    }
  }

  .close-search {
    margin: 0 10px;
    border: none;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    background: var(--secondary-color);
    border-radius: 50%;
    text-align: center;
    padding: 0;
    height: 25px;
    width: 25px;
    color: red;
    box-shadow: 0 0 8px 0px red;
    transition: all 0.4s ease-in-out;
    position: absolute;
    top: 28px;
    left: 5px;
    right: unset;
    display: flex;
    align-items: center;
    justify-content: center;

    &:hover {
      color: var(--black-color);
      box-shadow: 0 0 8px 0px var(--black-color);
    }
  }
}

.ltr .main_header .header-options .close-search {
  right: 5px;
  left: unset;
}
.main_header .wishlist-icon button {
  border: none;
  background-color: transparent;
  /* padding-top: 8px; */
  padding-inline: 0;
}

.main_header .wishlist-icon button:focus {
  outline: none;
}

button:focus {
  outline: none !important;
}

.main_header .search-toggle-btn {
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
}

.main_header .search-overlay {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100vw;
  height: 100dvh;
  background: rgba(10, 10, 10, 0.7);
  backdrop-filter: blur(6px);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding-top: 15vh;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
  z-index: 9999;
  /* margin-top: -25px; */
}

.main_header .search-toggle-btn {
  padding: 0;
}

.main_header .icon-search {
  font-size: 32px;
}

.main_header .btn-link:hover {
  text-decoration: none;
}

.main_header .search-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.main_header .search-box {
  position: relative;
  width: 90%;
  max-width: 500px;
  background: #fff;
  border-radius: 50px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  padding: 10px 20px;
  transform: translateY(-20px);
  transition: transform 0.4s ease;
}

.main_header .search-overlay.active .search-box {
  transform: translateY(0);
}

.main_header .search-box input {
  border: none;
  outline: none;
  flex: 1;
  font-size: 16px;
  background: transparent;
}

.main_header .close-search {
  background: none;
  border: none;
  font-size: 28px;
  line-height: 1;
  color: #333;
  cursor: pointer;
}

.main_header .close-search:hover {
  color: #000;
}

.main_header .icon-heart-mask {
  background-color: var(
    --header-text-color-primary-bg,
    var(--text-color-primary-bg)
  );
}

/* Wishlist Modal */
.main_header .wishlist-actions {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
}

.main_header .modal-custom {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 99999;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  background: var(--backGround-color);
  overflow-y: auto;
  opacity: 0;
  transform: translateY(-20px);
  transition: 0.4s;
}

.main_header .modal-custom.active {
  opacity: 1;
  transform: translateY(0);
}

.main_header .modal-dialog-custom {
  position: relative;
  width: 100%;
  max-width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  border-radius: 0;
  box-shadow: none;
}

.main_header .modal-body-custom {
  padding: 10px 0;
}

.main_header .modal-content-custom {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  background-color: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(10px);
}

.main_header .modal-header-custom {
  padding: 15px 20px;
  border-bottom: 1px solid #ddd;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.main_header .modal-title-custom {
  margin: 0;
  font-size: 1.5rem;
  color: var(--header-primary-color);
}

.main_header .close-btn-custom {
  background: none;
  border: none;
  font-size: 28px;
  cursor: pointer;
  color: #000;
}

/* Wishlist Grid */
.main_header .wishlist-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  justify-items: center;
}

.wishlist-card-img-container {
  position: relative;
  width: 100% !important;
  height: 100% !important;
  overflow: hidden;
  transition: all 0.3s ease-in-out;
  max-height: 60%;
  display: flex;
  justify-content: center;
  align-items: center !important;
}

/* للأجهزة المتوسطة مثل التابلت */
@media (max-width: 1024px) {
  .main_header .wishlist-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* للأجهزة الصغيرة مثل الجوال */
@media (max-width: 768px) {
  .main_header .wishlist-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
}

/* للموبايلات الصغيرة جداً */
@media (max-width: 480px) {
  .main_header .wishlist-grid {
    padding: 20px;
  }
}

/* Wishlist Card */
.main_header .wishlist-card {
  overflow: hidden;
  background: linear-gradient(180deg, #808080d1, #8080803d);
  border-radius: 16px;
  padding: 10px 10px 30px;
  border: 1px solid #eeeeee54;
  border-top-color: #eeeeee;
  border-bottom-color: transparent;
  position: relative;
  transition: 0.3s ease;
  width: 100%;
  height: 38vh;

  /* أفضل نسبة للكارت */
}

/* Hover effect */
.main_header .wishlist-card:hover {
  transform: translateY(-5px);
}

/* Image inside card */
.main_header .wishlist-card img {
  width: 100%;
  height: 200px;

  border-radius: 8px;
}

.main_header .wishlist-card .spinner {
  width: 20px !important;
  height: 20px;
}

/* Card Body */
.main_header .wishlist-card-body {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

/* Product title */
.main_header .wishlist-card-body h5 {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.2;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
}

/* Product description */
.main_header .wishlist-card-body .product-discription p,
.main_header .wishlist-card-body .product-discription {
  font-size: 14px;
  font-weight: 400;
  color: #363636;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Price */
.main_header .wishlist-card-body p {
  font-size: 16px;
  font-weight: 700;
  color: var(--primary-color);
  flex: 1;
  margin: 0;
}

/* Button */
.main_header .wishlist-card-body button {
  background: var(--primary-color);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 5px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  margin-top: auto;
  width: 100%;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: space-evenly;
}

/* Button Image */
.main_header .wishlist-card-body button img {
  width: unset;
  height: unset;
  border-radius: unset;
  object-fit: cover;
}

.main_header .wishlist-grid.empty-wishlist {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 400px;
}

.empty-state {
  text-align: center;
  padding: 40px 20px;
}

.empty-state i {
  font-size: 76px;
  color: var(--primary-color);
  margin-bottom: 20px;
  opacity: 0.8;
}

.empty-state .empty-text {
  font-size: 18px;
  color: #666;
  margin: 0;
}

/*  Loading State Styles  */
/* Loading State */
.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  gap: 20px;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

.loading-text {
  font-size: 16px;
  color: #666;
  margin: 0;
}

/* Error State */
.error-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  text-align: center;
  gap: 15px;
}

.error-state i {
  font-size: 64px;
  color: #dc3545;
  opacity: 0.8;
}

.error-text {
  font-size: 16px;
  color: #dc3545;
  margin: 0;
}

/* Responsive adjustments */
@media (max-width: 1024px) {
  .main_header .wishlist-card {
    aspect-ratio: 3 / 4;
  }

  .main_header .wishlist-card-body h5 {
    font-size: 17px;
  }

  .main_header .wishlist-card-body p {
    font-size: 15px;
  }

  .main_header .wishlist-card-body button {
    font-size: 15px;
    height: 48px;
  }
}

@media (max-width: 768px) {
  .main_header .wishlist-card {
    aspect-ratio: 4 / 5;
    padding: 8px 8px 20px;
  }

  .main_header .wishlist-card-body h5 {
    font-size: 16px;
  }

  .main_header .wishlist-card-body p {
    font-size: 14px;
  }

  .main_header .wishlist-card-body button {
    font-size: 14px;
    height: 46px;
  }
}

@media (max-width: 480px) {
  .main_header .wishlist-card {
    aspect-ratio: 1 / 2.3;
    padding: 6px 6px 16px;
  }

  .main_header .wishlist-card-body h5 {
    font-size: 15px;
  }

  .main_header .wishlist-card-body p {
    font-size: 13px;
  }

  .main_header .wishlist-card-body button {
    font-size: 14px;
    height: 44px;
  }
}

/* .main_header {
    background: rgba(255,255,255,0.5);
    position: fixed;
    width: 100%;
    z-index: 50;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 40px;
    backdrop-filter: blur(10px);
  } */
.main_header .fixed-nav-bar {
  margin-top: 25px;
  background: var(
    --header-bg-color-primary-bg,
    var(--primary-color)
  ) !important;
  position: fixed;
  width: 80%;
  z-index: 50;
  left: 50%;
  transform: translateX(-50%);
  border-radius: 40px;
  backdrop-filter: blur(10px);
}

/* تنسيق شبكة المنتجات */
.wishlist-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 15px;
  padding: 10px;
}

.wishlist-card {
  position: relative;
  border: 1px solid #eee;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  transition: transform 0.2s;
}

.wishlist-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* زر الحذف (X) */
.remove-from-wishlist-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(255, 255, 255, 0.9);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  z-index: 5;
  color: #333;
  font-size: 20px;
  font-weight: bold;
  border: none;
  transition: all 0.2s;
}

.remove-from-wishlist-btn:hover {
  background: #dc3545;
  color: #fff;
}

.wishlist-card-body {
  padding: 10px;
}

.product-name {
  font-size: 14px;
  margin-bottom: 5px;
  overflow: hidden;
}

.product-price {
  color: var(--primary-color, #000);
  font-weight: bold;
  margin-bottom: 10px;
}

.add-to-cart-btn {
  width: 100%;
  padding: 8px;
  background: #f8f9fa;
  border: 1px solid #ddd;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}
