/* Common Styles */
.menu-open {
  transform: rotate(0deg) !important; /* Point Down (Natural state of SVG) */
  transition: transform 0.3s ease;
}

.header {
  display: none;
}
/* ... */
  /* Ensure SVGs are visible and white */
  #header #menu .parent-link-svg {
    width: 20px;
    height: 20px;
    fill: #ffffff !important;
    stroke: #ffffff !important;
    transform: rotate(-90deg); /* Point Right (Rotated from Down) */
    transition: transform 0.3s ease;
  }

#header {
  background: #ffffff;
  padding: 0 30px;
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 10;
}

body.admin-bar #header {
  top: 32px;
}

@media screen and (max-width: 782px) {
  body.admin-bar #header {
    top: 46px;
  }
}

.top-header {
  display: flex;
  align-items: center;
}

#header .logo {
  display: flex;
}

#header .logo-text {
  text-align: center;
  max-width: 200px;
}

#header .logo-img {
  height: 42px !important;
  width: auto;
}

#header .search-button {
  border: none;
  border-radius: 50%;
  background: var(--primary-color);
  cursor: pointer;
}

#header .search-button svg {
  fill: none;
}

#header .search-text {
  flex: auto;
  width: auto;
  height: 100%;
  border: none;
  background: none;
}

#header .search-text::placeholder {
  color: #cccccc;
}

#header .number {
  display: none;
}

#header .right-icon {
  display: flex;
  gap: 30px;
}

#header .right-icon svg {
  width: auto;
}

#header .cart-icon {
  position: relative;
  display: flex;
}

#header .cart-count {
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  top: -5px;
  right: -2px;
  width: 17px;
  height: 17px;
  background: var(--primary-color);
  border-radius: 50%;
  font-size: 10px;
  color: #ffffff;
}

/* Desktop Styles */
@media (min-width: 1510px) {
  #open-menu,
  .close-header-collection svg,
  .phone-search-bar {
    display: none;
  }

  .top-header {
    height: 60px;
  }

  #header .logo-text {
    color: #000000;
    font-size: 20px;
  }

  #header .logo-img {
    margin-right: 10px;
  }

  #header .search-bar {
    margin: 0 auto;
    width: 60%;
    max-width: 800px;
    height: 50px;
    border: 2px solid #000000;
    border-radius: 30px;
    background: #fff;
    display: flex;
    padding: 4px;
    align-items: center;
  }

  #header .search-button {
    width: 40px;
    height: 40px;
  }

  #header .search-text {
    padding: 0 10px;
  }

  .menu-collection-list-container {
    width: 90%;
  }

  #header .bottom-header {
    height: 60px;
    position: relative;
    color: #000000;
    display: flex;
    align-items: center;
    right: 0px !important;
  }

  #header .menu-collection-list-container>ul {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 40px;
  }

  #header .menu-item-object-product_cat:has(> ul) {
    color: #000000;
    position: relative;
  }

  #header .menu-item-object-product_cat:has(> ul) a {
    outline: none;
  }

  #header .menu-item-object-product_cat:has(> ul):after {
    content: "";
    display: block;
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: width 0.3s ease;
  }

  #header .menu-item-object-product_cat:has(> ul):hover:after {
    width: 100%;
  }

  #header .menu-item-object-product_cat {
    display: inline-block;
    color: #000000;
    font-size: 15px;
    position: relative;
    text-align: center;
    font-weight: 600;
  }

  #header .menu-item-object-product_cat:after {
    content: "";
    display: block;
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--primary-color);
  }

  #header .right-link {
    margin-left: auto;
    margin-right: 0;
    position: relative;
  }

  #header .right-link:before {
    content: "";
    display: block;
    position: absolute;
    left: -25px;
    top: 50%;
    transform: translateY(-50%);
    width: 1px;
    height: 40px;
    background-color: #000000;
  }

  #header .menu-item-object-product_cat>.sub-menu {
    display: none;
    top: 35px;
    min-width: 250px;
    position: absolute;
    background: rgba(255, 255, 255);
    padding: 15px;
    transform: translateX(-50%);
    left: 50%;
    filter: drop-shadow(0 4px 4px rgba(0, 0, 0, 0.25));
    font-size: 16px;
    color: #8d8d8d;
    flex-direction: column;
    border-radius: 20px;
  }

  #header .menu .menu-item-object-product_cat:first-child>.sub-menu {
    left: -10px;
    transform: translateX(0);
  }

  #header .menu .menu-item-object-product_cat:nth-child(2)>.sub-menu {
    left: -30px;
    transform: translateX(0);
  }

  #header .menu .menu-item-object-product_cat:last-child>.sub-menu {
    right: -10px;
    transform: translateX(-90%);
  }

  #header .menu-item-object-product_cat>.sub-menu li {
    margin-bottom: 10px;
    text-align: left;
    position: relative;
  }

  #header .menu-item-14027>.sub-menu,
  #header .menu-item-4280>.sub-menu,
  #header .menu-item-4283>.sub-menu {
    display: none;
    flex-direction: row;
    width: 800px;
    justify-content: center;
    gap: 50px;
  }

  #header .menu-item-74792>.sub-menu {
    display: none;
    flex-direction: row;
    width: 1600px;
    justify-content: center;
    gap: 50px;
  }

  #header .menu-item-14027>.sub-menu>li>a,
  #header .menu-item-4280>.sub-menu>li>a,
  #header .menu-item-4283>.sub-menu>li>a,
  #header .menu-item-74792>.sub-menu>li>a {
    font-size: 20px;
    text-align: center;
    display: block;
    margin-bottom: 10px;
  }

  #header .menu-item-14027>.sub-menu>li:after,
  #header .menu-item-4280>.sub-menu>li:after,
  #header .menu-item-4283>.sub-menu>li:after,
  #header .menu-item-74792>.sub-menu>li:after {
    content: "";
    display: block;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    right: -25px;
    width: 1px;
    height: 90%;
    background-color: #cccccc;
  }

  #header .menu-item-14027>.sub-menu>li:last-child:after,
  #header .menu-item-4280>.sub-menu>li:last-child:after,
  #header .menu-item-4283>.sub-menu>li:last-child:after,
  #header .menu-item-74792>.sub-menu>li:last-child:after {
    content: none;
  }

  #header .menu-item-object-product_tag>.sub-menu {
    background: rgba(255, 255, 255, 0.9);
    padding: 10px;
    font-size: 15px;
    color: #a7a7a7;
    overflow-y: auto;
    max-height: 500px;
  }

  #header .menu-item-object-product_tag>.sub-menu::-webkit-scrollbar {
    width: 5px;
    background: #e6e6e6;
    border-radius: 5px;
  }

  #header .menu-item-object-product_tag>.sub-menu::-webkit-scrollbar-thumb {
      background: #9a9a9a;
      border-radius: 5px;
      cursor: pointer;
  }
}

@media (min-width: 1510px) and (max-width: 1735px) {
  #header .right-link:before {
    display: none;
  }
}

/* Mobile Styles */
@media (max-width: 1509px) {
  .search-bar {
    display: none;
  }

  #header {
    height: 70px;
  }

  .top-header {
    height: 70px;
  }

  #header .logo-text {
    color: #B6B6B6;
    font-size: 16px;
    display: flex;
    align-items: center;
  }

  #header .logo-img {
    margin-right: 5px;
  }

  #header .phone-search-bar {
    margin: 20px 0;
    width: 100%;
    height: 45px;
    border: 1px solid #333333;
    border-radius: 8px;
    background: #1a1a1a;
    display: flex;
    padding: 5px;
    align-items: center;
  }

  #header .search-button {
    width: 35px;
    height: 35px;
    border: none;
    border-radius: 6px;
    background: var(--primary-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  #header .search-button svg {
    fill: none;
    height: 18px;
    width: 18px;
  }

  #header .search-text {
    flex: auto;
    width: auto;
    height: 100%;
    border: none;
    background: none;
    color: #ffffff;
    padding-left: 10px;
  }

  #header .right-icon {
    align-items: center;
    margin-left: auto;
  }

  .bottom-header {
    position: fixed;
    right: -320px;
    top: 0;
    width: 300px;
    height: 100%;
    background: #000000;
    box-shadow: -2px 0 5px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    transition: right 0.5s ease;
    padding: 15px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
  }

  .close-header-collection {
    width: 100%;
    border: none;
    background: none;
  }

  .close-header-collection svg {
    background: #333333;
    border-radius: 8px;
    padding: 8px;
    height: 30px;
    float: right;
    width: auto;
    cursor: pointer;
  }
  
  .close-header-collection svg path {
    fill: #ffffff;
  }

  /* Level 1: Main Items - Now the Gold Buttons */
  #header #menu .menu > .menu-item > a {
    background: var(--primary-color) !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    border-radius: 10px;
    margin-bottom: 10px;
    padding: 12px 20px !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    border-bottom: none !important;
  }
  
  #header #menu .menu > .menu-item > a:hover {
    opacity: 0.9;
  }

  /* Level 2: Sub Items - Lighter Gold/Orange */
  #header #menu .menu > .menu-item > .sub-menu > .menu-item > a {
    background: rgba(234, 179, 68, 0.6) !important; /* Lighter version of primary */
    color: #ffffff !important;
    font-weight: 600 !important;
    border-radius: 8px;
    margin-bottom: 8px;
    padding: 10px 20px !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    height: auto !important;
    letter-spacing: 1px;
  }

  /* Level 3: Sub-Sub Items (Grey/White) */
  #header #menu .menu > .menu-item > .sub-menu > .menu-item > .sub-menu > .menu-item > a {
    background: #f3f3f3 !important;
    color: #646464 !important;
    padding: 8px 15px 8px 30px !important;
    margin-bottom: 5px;
    border-radius: 4px;
    display: block;
    font-size: 14px;
  }

  /* Ensure SVGs are visible and white */
  #header #menu .parent-link-svg {
    width: 20px;
    height: 20px;
    fill: #ffffff !important;
    stroke: #ffffff !important;
    transform: rotate(0deg); /* Default: Point Right */
    transition: transform 0.3s ease;
  }

  #header #menu .parent-link-svg.rotate-90 {
    transform: rotate(90deg); /* Expanded: Point Down */
  }
  
  #header #menu .menu-item-object-product_cat > .sub-menu > .menu-item > a .parent-link-svg {
     /* Level 2 arrows also white */
     fill: #ffffff !important;
     stroke: #ffffff !important;
  }

  .menu-collection-list-container .sub-menu {
    display: none;
  }

  .menu-collection-list-container .menu>.menu-item>a>svg{
    transition: transform 0.3s ease;
    width: 30px;
    height: 30px;
    cursor: pointer;
  }
  
  .menu-collection-list-container .menu-item-object-product_cat>.sub-menu>.menu-item-has-children>a>svg{
    width: 18px;
    height: 18px;
    cursor: pointer;
    transition: transform 0.3s ease;
  }

  /* Right Link (Return to Shop) - Mobile */
  #header .right-link {
    margin-top: auto;
    margin-bottom: 30px;
    text-align: center;
    display: block;
    width: 100%;
    flex-shrink: 0;
  }

  #header .right-link a {
    color: #ffffff !important;
    font-size: 16px;
    text-decoration: none;
    border-bottom: 2px solid var(--primary-color); /* Gold underline */
    padding-bottom: 5px;
    display: inline-block;
  }
}

@media (max-width: 600px) {
  #header .right-icon svg {
    width: 35px;
    height: 35px;
  }
  
  #header .right-icon {
    gap: 20px;
  }

  #header {
    padding: 0 10px;
  }
}