/* ------------------------------------------------------------------
 * Product page buy bar (TMA-9), see snippets/listing-buybar.liquid.
 * Linked with a ?v= cache-buster from the snippet: bump it on every change.
 * ------------------------------------------------------------------ */
.kr-buybar {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 990;
  border-top: 1px solid #e5e7eb;
  background: #fff;
  box-shadow: 0 -4px 16px rgba(17, 24, 39, 0.08);
  transform: translateY(110%);
  visibility: hidden;
  transition: transform 0.25s ease, visibility 0.25s;
}

.kr-buybar[hidden] {
  display: none;
}

.kr-buybar.is-visible {
  transform: none;
  visibility: visible;
}

.kr-buybar__inner {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 72px;
  padding-top: 10px;
  padding-bottom: 10px;
}

.kr-buybar__thumb {
  flex: none;
  width: 48px;
  height: 48px;
  border-radius: 8px;
  object-fit: cover;
}

.kr-buybar__info {
  flex: 1 1 auto;
  min-width: 0;
}

.kr-buybar__title {
  overflow: hidden;
  color: #111827;
  font-size: 15px;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kr-buybar__price {
  color: #111827;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
}

.kr-buybar__fav {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 1px solid #111827;
  border-radius: 50%;
  background: #fff;
  color: #111827;
  cursor: pointer;
}

.kr-buybar__fav[hidden] {
  display: none;
}

.kr-buybar__fav[aria-pressed="true"] svg {
  fill: currentColor;
}

.kr-buybar__cta {
  flex: none;
  min-width: 220px;
  height: 48px;
  padding: 0 24px;
  border: none;
  border-radius: 80px;
  background: oklch(var(--p));
  color: #000;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
}

/* Keep the end of the page, the back-to-top button and the cookie widget
   clear of the bar. */
body:has(.kr-buybar:not([hidden])) {
  padding-bottom: 72px;
}

body:has(.kr-buybar.is-visible) #back-top {
  bottom: 88px;
}

body:has(.kr-buybar.is-visible) #CookiebotWidget {
  bottom: 88px !important;
}

/* Phones and tablets: price and buttons only, above the bottom navigation
   (56px + its 1px border). */
@media (max-width: 991px) {
  .kr-buybar {
    bottom: calc(57px + env(safe-area-inset-bottom));
  }

  .kr-buybar__inner {
    gap: 10px;
    min-height: 64px;
    padding-top: 8px;
    padding-bottom: 8px;
  }

  .kr-buybar__thumb,
  .kr-buybar__title {
    display: none;
  }

  .kr-buybar__fav {
    width: 44px;
    height: 44px;
  }

  .kr-buybar__cta {
    min-width: 0;
    height: 44px;
    padding: 0 20px;
    font-size: 15px;
  }

  body:has(.kr-buybar:not([hidden])) {
    padding-bottom: calc(56px + 64px + env(safe-area-inset-bottom));
  }

  body:has(.kr-buybar.is-visible) #back-top {
    bottom: calc(72px + 64px + env(safe-area-inset-bottom));
  }

  body:has(.kr-buybar.is-visible) #CookiebotWidget {
    bottom: calc(72px + 64px + env(safe-area-inset-bottom)) !important;
  }

  /* The open menu reaches down to the bottom navigation. */
  body:has(#main-nav.in) .kr-buybar {
    display: none;
  }
}
