/* Rejuvenated Knives — booking widget UX layer */

.rk-ux {
  --rkx-brand: var(--rk-gold, #a63530);
  --rkx-brand-pale: var(--rk-gold-pale, #f6e3e1);
  --rkx-ink: var(--rk-charcoal, #231f20);
  --rkx-muted: var(--rk-text-muted, #7a6f6c);
  --rkx-line: var(--rk-border-med, #d9d2c7);
  --rkx-ok: #1f8a4d;
  --rkx-ok-ring: rgba(31, 138, 77, 0.18);
  --rkx-ease: cubic-bezier(.2, .8, .2, 1);
}

.rk-sr {
  position: absolute !important;
  width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* ───────── Package cards: selected check ───────── */
.rk-ux .bundle-card,
.rk-ux .sub-knife-card { -webkit-tap-highlight-color: transparent; }
.rk-ux .bundle-card:focus-visible,
.rk-ux .sub-knife-card:focus-visible { outline: 2px solid var(--rkx-brand); outline-offset: 2px; }

.rk-ux .bundle-card.selected,
.rk-ux .sub-knife-card.selected {
  border-color: var(--rkx-ok);
  box-shadow: 0 0 0 3px var(--rkx-ok-ring), 0 8px 22px -12px rgba(31, 138, 77, .55);
}

.rk-bundle-check {
  position: absolute;
  top: -11px;
  left: -11px;
  z-index: 2;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--rkx-ok);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 3px #fff, 0 4px 10px rgba(31, 138, 77, .35);
  transform: scale(0);
  opacity: 0;
  transition: transform .28s var(--rkx-ease), opacity .2s ease;
  pointer-events: none;
}

.rk-bundle-check svg {
  width: 15px; height: 15px;
  fill: none; stroke: currentColor; stroke-width: 3;
  stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 22; stroke-dashoffset: 22;
  transition: stroke-dashoffset .3s .12s ease;
}

.bundle-card.selected .rk-bundle-check,
.sub-knife-card.selected .rk-bundle-check { transform: scale(1); opacity: 1; }
.bundle-card.selected .rk-bundle-check svg,
.sub-knife-card.selected .rk-bundle-check svg { stroke-dashoffset: 0; }

/* ───────── Category tabs: counter badge ───────── */
.rk-ux .cat-tab { position: relative; overflow: visible; }

.rk-tab-count {
  position: absolute;
  top: -8px;
  right: -6px;
  z-index: 3;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--rkx-ok);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 20px;
  text-align: center;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 0 0 2px #fff, 0 3px 8px rgba(0, 0, 0, .18);
  transform: scale(0);
  transition: transform .25s var(--rkx-ease);
  cursor: default;
}

.rk-tab-count.is-on { transform: scale(1); }
.rk-tab-count.rk-pop { animation: rkx-pop .35s var(--rkx-ease); }

@keyframes rkx-pop {
  0% { transform: scale(1); }
  40% { transform: scale(1.3); }
  100% { transform: scale(1); }
}

.rk-tab-tip {
  position: absolute;
  bottom: calc(100% + 10px);
  right: -4px;
  min-width: 190px;
  max-width: 260px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--rkx-ink);
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.35;
  text-align: left;
  box-shadow: 0 12px 28px -8px rgba(0, 0, 0, .35);
  opacity: 0;
  visibility: hidden;
  transform: translateY(4px);
  transition: opacity .18s ease, transform .18s ease, visibility .18s;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.rk-tab-tip::after {
  content: "";
  position: absolute;
  top: 100%;
  right: 12px;
  border: 6px solid transparent;
  border-top-color: var(--rkx-ink);
}

/* Badge sits on the tab's right edge: open the tip rightwards, except on the last tab. */
.cat-tab:not(:last-child) .rk-tab-tip { right: auto; left: -8px; }
.cat-tab:not(:last-child) .rk-tab-tip::after { right: auto; left: 12px; }

.rk-tip-row { display: flex; justify-content: space-between; gap: 14px; white-space: normal; }
.rk-tip-row strong { color: #8be0ad; font-weight: 700; white-space: nowrap; }

.rk-tab-count.is-on:hover .rk-tab-tip,
.cat-tab:focus-visible .rk-tab-count.is-on .rk-tab-tip {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* ───────── Service rows ───────── */
.rk-ux .service-item { gap: 12px; transition: background .2s ease; }
.rk-ux .service-info { align-items: center; min-width: 0; }

.rk-ux .service-icon { transition: background .2s ease, color .2s ease, transform .2s var(--rkx-ease); }
.rk-ux .service-icon svg.ico {
  width: 18px; height: 18px;
  fill: none; stroke: currentColor; stroke-width: 1.7;
  stroke-linecap: round; stroke-linejoin: round;
}
.rk-ux .service-item.rk-has-qty .service-icon { background: var(--rkx-brand); color: #fff; }

.rk-ux .service-name { display: block; line-height: 1.3; }
.rk-ux .service-item.rk-has-qty .service-name { font-weight: 600; }

/* Info button */
.rk-info-btn {
  position: relative;
  flex: none;
  width: 22px;
  height: 22px;
  padding: 0;
  margin: -2px 0 0 4px;
  vertical-align: middle;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--rkx-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color .15s ease, background .15s ease, transform .15s ease;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.rk-info-btn::before { /* 40px tap area */
  content: "";
  position: absolute;
  inset: -9px;
  border-radius: 50%;
}

.rk-info-btn svg {
  width: 17px; height: 17px;
  fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round;
}
.rk-info-btn .rk-dot { fill: currentColor; stroke: none; }
.rk-info-btn:hover,
.rk-info-btn:focus-visible { color: var(--rkx-brand); background: var(--rkx-brand-pale); outline: none; }
.rk-info-btn:active { transform: scale(.9); }

/* ───────── Quantity stepper ───────── */
.rk-ux .booking-body .qty-control {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px;
  border: 1px solid var(--rkx-line);
  border-radius: 999px;
  background: #fff;
  overflow: visible;
  flex-shrink: 0;
  touch-action: manipulation;
  transition: border-color .2s ease, box-shadow .2s ease;
}

.rk-ux .booking-body .service-item.rk-has-qty .qty-control {
  border-color: var(--rkx-brand);
  box-shadow: 0 0 0 3px rgba(166, 53, 48, .08);
}

.rk-ux .booking-body .qty-control .qty-btn {
  width: 34px;
  height: 34px;
  min-width: 34px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--rkx-brand-pale);
  color: var(--rkx-brand);
  font-size: 20px;
  font-weight: 500;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: background .15s ease, color .15s ease, transform .12s var(--rkx-ease), opacity .2s ease, box-shadow .15s ease;
}

.rk-ux .booking-body .qty-control .qty-plus { background: var(--rkx-brand); color: #fff; box-shadow: 0 3px 8px -3px rgba(166, 53, 48, .6); }

@media (hover: hover) {
  .rk-ux .booking-body .qty-control .qty-btn:hover { background: #ecd0cd; }
  .rk-ux .booking-body .qty-control .qty-plus:hover { background: #8e2a26; }
}

.rk-ux .booking-body .qty-control .qty-btn:active,
.rk-ux .booking-body .qty-control .qty-btn.rk-pressing { transform: scale(.86); }
.rk-ux .booking-body .qty-control .qty-plus:active,
.rk-ux .booking-body .qty-control .qty-plus.rk-pressing { box-shadow: 0 0 0 6px rgba(166, 53, 48, .14); }

.rk-ux .booking-body .qty-control .qty-btn:focus-visible { outline: 2px solid var(--rkx-brand); outline-offset: 2px; }

.rk-ux .booking-body .qty-control.rk-qty-zero .qty-minus { opacity: .38; cursor: default; }
.rk-ux .booking-body .qty-control.rk-qty-zero .qty-minus:active { transform: none; }

.rk-ux .booking-body .qty-control .qty-num {
  width: 34px;
  min-width: 30px;
  height: 34px;
  padding: 0;
  margin: 0;
  border: 0;
  background: transparent;
  color: var(--rkx-ink);
  font-size: 16px; /* ≥16px stops iOS zooming in on tap */
  font-weight: 700;
  text-align: center;
  font-variant-numeric: tabular-nums;
  -moz-appearance: textfield;
  appearance: textfield;
  box-shadow: none;
  outline: none;
}

.rk-ux .booking-body .qty-control .qty-num:focus { color: var(--rkx-brand); }
.rk-ux .booking-body .qty-num.rk-bump { animation: rkx-bump .28s var(--rkx-ease); }

@keyframes rkx-bump {
  0% { transform: scale(1); }
  45% { transform: scale(1.35); color: var(--rkx-brand); }
  100% { transform: scale(1); }
}

/* Phones & small tablets: thumb-sized targets (44px, Apple/Google guideline) */
@media (max-width: 767px), (pointer: coarse) {
  .rk-ux .service-item { padding: 14px 0; }

  .rk-ux .booking-body .qty-control { gap: 6px; padding: 4px; }

  .rk-ux .booking-body .qty-control .qty-btn {
    width: 44px;
    height: 44px;
    min-width: 44px;
    font-size: 24px;
  }

  .rk-ux .booking-body .qty-control .qty-num { width: 32px; height: 44px; font-size: 17px; }

  .rk-ux .cat-tab { min-height: 40px; }

  /* Tooltip has no hover on touch screens; counts stay visible on the badge. */
  .rk-tab-tip { display: none; }
}

@media (max-width: 380px) {
  .rk-ux .service-info { grid-template-columns: 28px 1fr; gap: 8px; }
  .rk-ux .service-icon { width: 28px; height: 28px; }
  .rk-ux .booking-body .qty-control { gap: 2px; }
  .rk-ux .booking-body .qty-control .qty-btn { width: 42px; height: 42px; min-width: 42px; }
  .rk-ux .booking-body .qty-control .qty-num { width: 28px; }
}

/* ───────── Product info modal ───────── */
html.rk-pm-lock { overflow: hidden; scrollbar-gutter: stable; }

.rk-pm {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.rk-pm[hidden] { display: none; }

.rk-pm-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(22, 18, 17, .55);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity .22s ease;
}

.rk-pm-dialog {
  position: relative;
  width: 100%;
  max-width: 480px;
  max-height: min(80vh, 640px);
  overflow: auto;
  padding: 26px 28px 28px;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 30px 70px -20px rgba(0, 0, 0, .45);
  opacity: 0;
  transform: translateY(12px) scale(.97);
  transition: opacity .22s ease, transform .26s var(--rkx-ease, cubic-bezier(.2, .8, .2, 1));
}

.rk-pm.is-open .rk-pm-backdrop { opacity: 1; }
.rk-pm.is-open .rk-pm-dialog { opacity: 1; transform: none; }

.rk-pm-grab { display: none; }

.rk-pm-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 16px; }

.rk-pm-title {
  margin: 0;
  font-family: 'Geologica', sans-serif;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--rk-gold, #a63530);
}

.rk-pm-close {
  flex: none;
  width: 38px;
  height: 38px;
  margin: -6px -8px 0 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--rk-gold, #a63530);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s ease, transform .15s ease;
}

.rk-pm-close svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; }
.rk-pm-close:hover,
.rk-pm-close:focus-visible { background: var(--rk-gold-pale, #f6e3e1); outline: none; }
.rk-pm-close:active { transform: scale(.92); }

.rk-pm-body {
  padding: 16px 20px;
  border-radius: 12px;
  background: var(--rk-cream, #f2efe6);
  color: var(--rk-charcoal, #231f20);
  font-size: 15px;
  line-height: 1.6;
}

.rk-pm-body > :first-child { margin-top: 0; }
.rk-pm-body > :last-child { margin-bottom: 0; }
.rk-pm-body ul, .rk-pm-body ol { padding-left: 1.2em; }

/* Bottom sheet on phones */
@media (max-width: 600px) {
  .rk-pm { align-items: flex-end; padding: 0; }
  .rk-pm-dialog {
    max-width: none;
    max-height: 85vh;
    padding: 12px 20px calc(24px + env(safe-area-inset-bottom));
    border-radius: 20px 20px 0 0;
    transform: translateY(100%);
  }
  .rk-pm-grab { display: block; width: 40px; height: 4px; margin: 0 auto 14px; border-radius: 4px; background: #ddd5cc; }
  .rk-pm-title { font-size: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  .rk-bundle-check, .rk-bundle-check svg, .rk-tab-count, .rk-pm-dialog, .rk-pm-backdrop,
  .rk-ux .booking-body .qty-control .qty-btn { transition: none; }
  .rk-tab-count.rk-pop, .rk-ux .booking-body .qty-num.rk-bump { animation: none; }
}
