/* Hide the AJAX loading spinner on category/filter pages */
#res-loader-result {
  display: none !important;
}

@media (min-width: 768px) {
  .header-searchbar-margin.group-category {
    margin-left: 18px;
  }

  .header-searchbar-margin.group-category nav {
    position: relative;
  }

  .header-searchbar-margin.group-category .navbar {
    position: relative;
    width: 48px;
    height: 48px;
    margin-top: 6px;
  }

  .header-searchbar-margin.group-category .nav-container {
    position: relative;
    width: 48px;
    height: 48px;
  }

  .header-searchbar-margin.group-category .checkbox {
    position: absolute;
    inset: 0;
    width: 48px;
    height: 48px;
    margin: 0;
    opacity: 0;
    cursor: pointer;
    z-index: 3;
    appearance: none;
  }

  .header-searchbar-margin.group-category .hamburger-lines {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: #00985f;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    z-index: 2;
  }

  .header-searchbar-margin.group-category .hamburger-lines .line {
    display: block;
    width: 20px;
    height: 2px;
    border-radius: 999px;
    background: #fff;
    transition: transform 0.2s ease, opacity 0.2s ease;
  }

  .header-searchbar-margin.group-category .menu-items {
    position: absolute;
    top: calc(100% + 20px);
    left: 0;
    display: block;
    width: 205px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(8px);
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
    z-index: 60;
  }

  /* Invisible bridge to cover the 20px gap between hamburger and dropdown */
  .header-searchbar-margin.group-category .menu-items::before {
    content: '';
    position: absolute;
    top: -20px;
    left: 0;
    width: 100%;
    height: 20px;
  }

  .header-searchbar-margin.group-category .checkbox:checked ~ .menu-items,
  .header-searchbar-margin.group-category .menu-items:hover {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
  }

  /* Fix subcategory gap: 100% instead of 101% so there is no hole */
  .group-category li:hover > ul {
    transform: translateX(100%) scale(1) !important;
  }
  html[dir="rtl"] .group-category li:hover > ul {
    transform: translateX(-100%) scale(1) !important;
  }

  /* Smooth transition with slight delay so submenu doesn't vanish instantly */
  .group-category li > ul {
    transition: transform 0.18s ease 0.05s !important;
  }

  .header-searchbar-margin.group-category .checkbox:checked + .hamburger-lines {
    box-shadow: 0 12px 28px rgba(0, 152, 95, 0.2);
  }

  .header-searchbar-margin.group-category .checkbox:checked + .hamburger-lines .line1 {
    transform: translateY(6px) rotate(45deg);
  }

  .header-searchbar-margin.group-category .checkbox:checked + .hamburger-lines .line2 {
    opacity: 0;
  }

  .header-searchbar-margin.group-category .checkbox:checked + .hamburger-lines .line3 {
    transform: translateY(-6px) rotate(-45deg);
  }

  html[dir="rtl"] .header-searchbar-margin.group-category .menu-items {
    right: 0;
    left: auto;
  }
}

/* Product card shadow & rounded corners (ported from old site tailwind-custom) */
.newcard {
  box-shadow: 0px 0px 4px 0px rgba(0, 0, 0, 0.25);
  border-radius: 25px;
  overflow: hidden;
}

/* Remove inner image-container border/radius so it fills the card cleanly */
.newcard > .border.rev-img {
  border: none;
  border-radius: 0;
}

/* On mobile (2-col grid) use a smaller border-radius for compactness */
@media (max-width: 767px) {
  .newcard {
    border-radius: 18px;
  }
}

/* Keep homepage product card CTAs aligned across each row */
.grid.grid-cols-2.md\:grid-cols-5 > .newcard {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.grid.grid-cols-2.md\:grid-cols-5 > .newcard > .sm\:text-left.flex.flex-col {
  flex: 1 1 auto;
}

.grid.grid-cols-2.md\:grid-cols-5 > .newcard > .sm\:text-left.flex.flex-col > a:first-of-type p.line-clamp {
  min-height: 50px;
}

.grid.grid-cols-2.md\:grid-cols-5 > .newcard > .sm\:text-left.flex.flex-col > .add-to-cart {
  display: block;
  margin-top: auto;
}

.grid.grid-cols-2.md\:grid-cols-5 > .newcard > .sm\:text-left.flex.flex-col > .add-to-cart > div {
  margin-bottom: 0 !important;
}

/* Search-results cards need their own alignment rules */
.product-result .newcard {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.product-result .filter-product-card-content {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
}

.product-result .filter-product-card-content > a:first-of-type p.line-clamp {
  min-height: 50px;
}

.product-result .product-filter-grid-action {
  margin-top: auto;
}


/* Myaccount address overflow fix */
#customer_address_create,
#customer_address_edit {
  position: relative;
  z-index: 2;
  padding-bottom: 24px;
}

#customer_address_create .radio-buttons,
#customer_address_edit .radio-buttons {
  flex-wrap: wrap;
}

#customer_address_create form > .flex.gap-3.mt-6,
#customer_address_edit form > .flex.gap-3.mt-6 {
  position: relative;
  z-index: 3;
  flex-wrap: wrap;
  row-gap: 10px;
  margin-top: 1.5rem;
  padding-top: 0.25rem;
  background: #fff;
}
#customer_address_create > div,
#customer_address_edit > div {
  width: 100% !important;
  max-width: 100%;
}