/* Hide the add-to-cart toast completely. */
#root [data-testid="status-toast"] {
  display: none !important;
}

#root main > section.border-b.bg-primary.px-5.py-8.text-center {
  background-color: #fff !important;
  color: #000 !important;
}

#root main > section.border-b.bg-primary.px-5.py-8.text-center p {
  color: #000 !important;
  font-family: 'DM Sans', sans-serif !important;
}

#root main > section.border-b.bg-primary.px-5.py-8.text-center p:first-child {
  font-weight: 400 !important;
  letter-spacing: -0.025em;
}

#root main > section.border-b.bg-primary.px-5.py-8.text-center p:nth-child(2) {
  font-weight: 400 !important;
  letter-spacing: -0.015em;
}

#root main > section.border-b.bg-primary.px-5.py-8.text-center p:nth-child(3) {
  font-weight: 400 !important;
  line-height: 1.55;
}

/* Hide the product-image enlargement badge while keeping the image intact. */
#root
  main
  div.relative.aspect-square.overflow-hidden.rounded-3xl
  > div.absolute.bottom-4.right-4 {
  display: none !important;
}

/* Remove the favorite heart from storefront product cards. */
#root main button[data-testid^='button-favorite-'] {
  display: none !important;
}

/* Remove the favorite heart from the main product image. */
#root main button[data-testid='button-product-favorite'] {
  display: none !important;
}

/* Give the product hero image a cleaner, more deliberate presentation. */
#root main div[class*='md:grid-cols-[1.02fr_.98fr]'],
#root main div[class*='md:grid-cols-[1.02fr_.98fr]'] > div:first-child {
  width: 100%;
  min-width: 0;
}

#root main div.relative.aspect-square.overflow-hidden.rounded-3xl {
  width: 100%;
  min-width: 0;
  aspect-ratio: 1 / 1;
  border: 1px solid rgba(55, 76, 32, 0.12);
  background: radial-gradient(circle at 50% 42%, #fffef9 0%, #f2f0e3 100%) !important;
  box-shadow: 0 16px 38px rgba(35, 53, 20, 0.08);
}

#root
  main
  div.relative.aspect-square.overflow-hidden.rounded-3xl
  > button[data-testid='button-open-lightbox'] {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-width: 0;
  min-height: 0;
  padding: clamp(12px, 3vw, 24px);
}

#root
  main
  div.relative.aspect-square.overflow-hidden.rounded-3xl
  > button[data-testid='button-open-lightbox']
  img {
  display: block;
  min-width: 0;
  min-height: 0;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

/* Keep product thumbnails in one polished, swipeable strip on small screens. */
#root
  main
  div.relative.aspect-square.overflow-hidden.rounded-3xl
  + div.mt-3.grid.grid-cols-3.gap-3 {
  display: flex !important;
  gap: 12px !important;
  margin-top: 14px !important;
  padding: 2px 2px 8px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  scroll-snap-type: x mandatory;
}

#root
  main
  div.relative.aspect-square.overflow-hidden.rounded-3xl
  + div.mt-3.grid.grid-cols-3.gap-3::-webkit-scrollbar {
  display: none;
}

#root
  main
  div.relative.aspect-square.overflow-hidden.rounded-3xl
  + div.mt-3.grid.grid-cols-3.gap-3
  > button[data-testid^='button-thumbnail-'] {
  flex: 0 0 clamp(78px, 24vw, 112px);
  border: 1px solid rgba(55, 76, 32, 0.12);
  border-radius: 14px;
  scroll-snap-align: start;
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease,
    transform 180ms ease;
}

#root
  main
  div.relative.aspect-square.overflow-hidden.rounded-3xl
  + div.mt-3.grid.grid-cols-3.gap-3
  > button[data-testid^='button-thumbnail-'][class*='ring-2'] {
  border-color: #526a31;
  box-shadow: 0 0 0 2px rgba(82, 106, 49, 0.14);
}

#root
  main
  div.relative.aspect-square.overflow-hidden.rounded-3xl
  + div.mt-3.grid.grid-cols-3.gap-3
  > button[data-testid^='button-thumbnail-']:hover {
  transform: translateY(-2px);
}

/* Remove the discount badge from storefront product cards. */
#root main article[data-testid^='card-product-']
  > div
  > span.absolute.left-0.top-0[class*='bg-[#987b3e]'] {
  display: none !important;
}

@media (max-width: 767px) {
  /* Keep the normal purchase button in the product details flow. */
  #root main div:has(> button[data-testid='button-add-product']) {
    flex-wrap: wrap;
  }

  #root main button[data-testid='button-add-product'] {
    position: static !important;
    inset: auto !important;
    z-index: auto !important;
    width: 100% !important;
    min-height: 52px;
    flex: 0 0 100% !important;
    box-shadow: none !important;
  }
}

.product-floating-cart {
  position: fixed;
  right: 1rem;
  bottom: calc(1rem + env(safe-area-inset-bottom));
  left: 1rem;
  z-index: 40;
  display: flex;
  width: calc(100% - 2rem);
  min-height: 52px;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: 0;
  border-radius: 9999px;
  background: hsl(var(--primary));
  padding: 0.75rem 1.25rem;
  color: hsl(var(--primary-foreground));
  font-size: 0.875rem;
  font-weight: 700;
  box-shadow: 0 10px 24px rgba(31, 56, 11, 0.22);
  cursor: pointer;
}

.product-floating-cart[hidden],
.product-floating-cart svg {
  display: none !important;
}

.product-floating-cart:not([hidden]) svg {
  display: block !important;
}

@media (min-width: 768px) {
  .product-floating-cart {
    display: none !important;
  }
}
