/* ==========================================================================
   Shop promo ticker
   Isolated: only applies when .layout-with-shop-ticker is present.
   Ticker is position:fixed (out of flow) so padding is counted once.
   ========================================================================== */

:root {
  --mm-ticker-h: 1.85rem;
  --mm-menu-w: 16.25rem;
}

.shop-ticker {
  position: fixed;
  top: 0;
  /* Align with content column — do not cover the sidebar */
  left: var(--mm-menu-w);
  right: 0;
  z-index: 1085;
  width: auto;
  display: flex;
  justify-content: center;
  background: var(--shop-ticker-bg, linear-gradient(90deg, #1a1a2e 0%, #16213e 45%, #0f3460 100%));
  color: var(--shop-ticker-text, #fff);
  overflow: hidden;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  box-sizing: border-box;
}

html.layout-menu-collapsed .shop-ticker {
  left: 5.25rem;
}

@media (max-width: 1199.98px) {
  .shop-ticker,
  html.layout-menu-collapsed .shop-ticker {
    left: 0;
  }
}

/* Text lane centered: e.g. 70% wide → 15% empty left + 15% empty right */
.shop-ticker__lane {
  width: 70%;
  max-width: 70%;
  flex: 0 0 70%;
  overflow: hidden;
}

.shop-ticker__track {
  overflow: hidden;
  width: 100%;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 3%, #000 97%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 3%, #000 97%, transparent);
}

.shop-ticker__inner {
  display: flex;
  align-items: center;
  width: max-content;
  min-height: 1.85rem;
  padding: 0.3rem 0;
  will-change: transform;
  animation: shopTickerScrollRtl var(--shop-ticker-duration, 24s) linear infinite;
}

.shop-ticker__inner--scroll {
  animation: shopTickerScrollRtl var(--shop-ticker-duration, 24s) linear infinite;
}

.shop-ticker__segment,
.shop-ticker__content,
.shop-ticker__link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
  padding: 0 2.75rem;
  white-space: nowrap;
  color: inherit;
  text-decoration: none;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  line-height: 1.3;
}

.shop-ticker__link:hover {
  color: var(--shop-ticker-text, #fff);
  opacity: 0.92;
}

.shop-ticker__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  font-size: 0.8rem;
  flex-shrink: 0;
}

.shop-ticker__cta {
  opacity: 0.75;
  font-size: 0.75rem;
  flex-shrink: 0;
}

@keyframes shopTickerScrollRtl {
  0% { transform: translate3d(0, 0, 0); }
  100% { transform: translate3d(calc(-1 * var(--shop-ticker-shift, 50%)), 0, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .shop-ticker__inner,
  .shop-ticker__inner--scroll {
    animation: none;
  }
  .shop-ticker__segment--clone {
    display: none !important;
  }
}

/* ---- Layout offsets: ONLY when ticker is enabled ----
   Sidebar is NOT shifted — ticker starts after the menu. */
html.layout-navbar-fixed .layout-wrapper.layout-with-shop-ticker .layout-navbar {
  top: var(--mm-ticker-h) !important;
}

/* Same base 78px as brand.css, plus ticker height once (ticker is fixed, not in flow) */
html.layout-navbar-fixed .layout-wrapper.layout-with-shop-ticker:not(.layout-without-menu) .layout-page {
  padding-top: calc(78px + var(--mm-ticker-h)) !important;
}

html.layout-navbar-fixed .layout-wrapper.layout-with-shop-ticker:not(.layout-horizontal):not(.layout-without-menu) .layout-page {
  padding-top: calc(78px + var(--mm-ticker-h)) !important;
}

@media (max-width: 1199.98px) {
  html.layout-navbar-fixed .layout-wrapper.layout-with-shop-ticker:not(.layout-without-menu) .layout-page,
  html.layout-navbar-fixed .layout-wrapper.layout-with-shop-ticker:not(.layout-horizontal):not(.layout-without-menu) .layout-page {
    padding-top: calc(64px + var(--mm-ticker-h)) !important;
  }
}

/* Free shipping progress widget (cart summary) */
.free-ship-widget {
  background: #f8f9fc;
  border: 1px solid rgba(67, 89, 113, 0.12);
  border-radius: 0.625rem;
  padding: 0.75rem 0.85rem 0.7rem;
  margin-bottom: 0;
}

.free-ship-widget--done {
  background: #f0fdf4;
  border-color: rgba(34, 197, 94, 0.22);
}

.free-ship-widget__header {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  margin-bottom: 0.55rem;
}

.free-ship-widget__icon {
  flex-shrink: 0;
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--shop-button-bg, #696cff);
  color: #fff;
  font-size: 0.95rem;
  margin-top: 0.05rem;
}

.free-ship-widget--done .free-ship-widget__icon {
  background: #16a34a;
}

.free-ship-widget__copy {
  min-width: 0;
  flex: 1 1 auto;
}

.free-ship-widget__title {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #697a8d;
  line-height: 1.2;
  margin-bottom: 0.15rem !important;
}

.free-ship-widget--done .free-ship-widget__title {
  color: #15803d;
}

.free-ship-widget__message {
  font-size: 0.84rem;
  font-weight: 600;
  color: #2f3349;
  line-height: 1.35;
}

.free-ship-widget--done .free-ship-widget__message {
  color: #166534;
}

.free-ship-widget__bar {
  height: 6px;
  border-radius: 999px;
  background: rgba(67, 89, 113, 0.12);
  overflow: hidden;
}

.free-ship-widget__fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--shop-button-bg, #1a1a2e) 0%, var(--shop-button-hover-bg, #696cff) 55%, color-mix(in srgb, var(--shop-button-hover-bg, #9b1c47) 80%, #9b1c47) 100%);
  transition: width 0.45s cubic-bezier(0.4, 0, 0.2, 1);
  min-width: 4%;
}

.free-ship-widget--done .free-ship-widget__fill {
  background: linear-gradient(90deg, #22c55e 0%, #16a34a 100%);
  min-width: 100%;
}

.free-ship-widget__meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.4rem;
  font-size: 0.72rem;
  color: #8592a3;
  font-weight: 500;
}

.free-ship-widget--done .free-ship-widget__meta {
  color: #16a34a;
}

.free-ship-widget__pct {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

/* Floating free-shipping bubble — bottom-right of the viewport */
.free-ship-bubble {
  position: fixed;
  right: 1.25rem;
  left: auto;
  bottom: 1.25rem;
  z-index: 1060;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.55rem;
  max-width: min(19rem, calc(100vw - 2rem));
  pointer-events: none;
}

.free-ship-bubble[hidden] {
  display: none !important;
}

.free-ship-bubble__panel {
  pointer-events: auto;
  opacity: 0;
  transform: translateY(0.4rem) scale(0.96);
  transform-origin: bottom right;
  transition: opacity 0.2s ease, transform 0.2s ease;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(67, 89, 113, 0.12);
  border-radius: 0.85rem;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.14);
  padding: 0.75rem 0.85rem 0.8rem;
  width: 100%;
  visibility: hidden;
}

.free-ship-bubble.is-open .free-ship-bubble__panel,
.free-ship-bubble:hover .free-ship-bubble__panel,
.free-ship-bubble:focus-within .free-ship-bubble__panel {
  opacity: 1;
  transform: translateY(0) scale(1);
  visibility: visible;
}

.free-ship-bubble__title {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #8592a3;
  margin-bottom: 0.2rem !important;
}

.free-ship-bubble--done .free-ship-bubble__title {
  color: #16a34a;
}

.free-ship-bubble__message {
  margin: 0 0 0.45rem;
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.35;
  color: #2f3349;
}

.free-ship-bubble--done .free-ship-bubble__message {
  color: #166534;
}

.free-ship-bubble__bar {
  height: 4px;
  border-radius: 999px;
  background: rgba(67, 89, 113, 0.12);
  overflow: hidden;
  margin-bottom: 0.45rem;
}

.free-ship-bubble__fill {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--shop-button-bg, #696cff), var(--shop-button-hover-bg, #9b1c47));
  transition: width 0.4s ease;
  min-width: 3%;
}

.free-ship-bubble--done .free-ship-bubble__fill {
  background: linear-gradient(90deg, #22c55e, #16a34a);
  min-width: 100%;
}

.free-ship-bubble__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.free-ship-bubble__detail {
  font-size: 0.7rem;
  color: #8592a3;
  font-weight: 500;
}

.free-ship-bubble__link {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--shop-button-bg, #696cff);
  text-decoration: none;
  white-space: nowrap;
}

.free-ship-bubble__link:hover {
  color: var(--shop-button-hover-bg, #5a5fef);
}

.free-ship-bubble__dock {
  pointer-events: auto;
  display: flex;
  flex-direction: row-reverse;
  align-items: center;
  gap: 0.45rem;
}

.free-ship-bubble__fab {
  position: relative;
  width: 3.35rem;
  height: 3.35rem;
  border: 0;
  border-radius: 50%;
  padding: 0;
  cursor: pointer;
  background: transparent;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.18);
  animation: freeShipFloat 3.2s ease-in-out infinite;
  flex-shrink: 0;
}

.free-ship-bubble__chip {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.05rem;
  border: 1px solid rgba(67, 89, 113, 0.12);
  background: rgba(255, 255, 255, 0.98);
  border-radius: 0.75rem;
  padding: 0.4rem 0.7rem;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.12);
  cursor: pointer;
  text-align: right;
  line-height: 1.15;
  max-width: 9.5rem;
}

.free-ship-bubble__chip-label {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #8592a3;
}

.free-ship-bubble__chip-value {
  font-size: 0.78rem;
  font-weight: 700;
  color: #2f3349;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.free-ship-bubble--done .free-ship-bubble__chip {
  border-color: rgba(34, 197, 94, 0.25);
  background: #f0fdf4;
}

.free-ship-bubble--done .free-ship-bubble__chip-label,
.free-ship-bubble--done .free-ship-bubble__chip-value {
  color: #166534;
}

.free-ship-bubble__ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background:
    conic-gradient(var(--shop-button-bg, #696cff) calc(var(--free-ship-pct, 0) * 1%), rgba(67, 89, 113, 0.16) 0);
}

.free-ship-bubble--done .free-ship-bubble__ring {
  background: conic-gradient(#16a34a 100%, #16a34a 0);
}

.free-ship-bubble__ring::after {
  content: '';
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: #fff;
}

.free-ship-bubble__icon {
  position: absolute;
  inset: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
  color: var(--shop-button-bg, #696cff);
  font-size: 1.2rem;
}

.free-ship-bubble--done .free-ship-bubble__icon {
  color: #16a34a;
}

.free-ship-bubble.is-pulse .free-ship-bubble__fab {
  animation: freeShipPulse 0.55s ease;
}

@keyframes freeShipFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

@keyframes freeShipPulse {
  0% { transform: scale(1); }
  40% { transform: scale(1.12); }
  100% { transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .free-ship-bubble__fab,
  .free-ship-bubble.is-pulse .free-ship-bubble__fab {
    animation: none;
  }
}

@media (max-width: 575.98px) {
  .free-ship-bubble {
    right: 0.85rem;
    left: auto;
    bottom: 0.85rem;
  }
}
