/* GOODSKI — button motion. Loaded last on every layout.
   Defaults use :where() (zero specificity) so any button that already defines its own hover/active look keeps it. */

/* Every clickable button-like element */
:where(button, .btn, input[type="submit"], input[type="button"], [class*="-btn"], [class$="btn"], .pill-btn, .btn-arrow, .btn-book, .btn-auth, .btn-join, .link-btn) {
  transition:
    transform .18s cubic-bezier(.2, .8, .2, 1),
    box-shadow .22s ease,
    background-color .2s ease,
    border-color .2s ease,
    color .2s ease,
    opacity .2s ease,
    filter .2s ease;
  -webkit-tap-highlight-color: transparent;
  will-change: transform;
}

/* Elements that should not move (segmented controls, tabs, toggles, chips inside groups, date/time pickers) */
:where(.gs-seg button, .gs-quick button, [role="tab"], [role="switch"], .switch, .toggle, .time-slot-btn, .date-btn, .stepper-btn) {
  will-change: auto;
}

@media (hover: hover) and (pointer: fine) {
  :where(.btn, input[type="submit"], [class*="-btn"], .btn-book, .btn-auth, .btn-join, button[type="submit"]):where(:not(.time-slot-btn, .date-btn, .stepper-btn, .icon-btn, .ia-btn, [role="tab"], [role="switch"])):where(:hover:not(:disabled, .disabled, [aria-disabled="true"])) {
    transform: translateY(-1px);
    filter: brightness(1.04);
    box-shadow: 0 8px 20px -10px rgba(0, 0, 0, .35);
  }
  :where(.icon-btn, .ia-btn):where(:hover:not(:disabled)) {
    transform: scale(1.06);
  }
}

/* Press feedback — all buttons, touch included */
:where(button, .btn, input[type="submit"], input[type="button"], [class*="-btn"], .pill-btn, .btn-arrow):where(:active:not(:disabled):not(.disabled):not([aria-disabled="true"])) {
  transform: scale(.97);
  filter: brightness(.97);
  box-shadow: none;
  transition-duration: .08s;
}
:where(.gs-seg button, .gs-quick button, [role="tab"]):where(:active) { transform: scale(.98); }

/* Keyboard focus ring */
:where(button, .btn, input[type="submit"], input[type="button"], [class*="-btn"], .pill-btn, a.btn-arrow):where(:focus-visible) {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}

/* Disabled look */
:where(button, .btn, input[type="submit"], [class*="-btn"]):where(:is(:disabled, .disabled, [aria-disabled="true"])) {
  cursor: not-allowed;
}

/* Arrow inside "go" buttons nudges forward on hover */
@media (hover: hover) and (pointer: fine) {
  :where(.btn, [class*="-btn"], .btn-book) svg:last-child { transition: transform .2s cubic-bezier(.2, .8, .2, 1); }
  :where(.btn, [class*="-btn"], .btn-book):where(:hover:not(:disabled)) svg:last-child:not(:first-child) { transform: translateX(2px); }
}

/* Click ripple (added by js/goodski-motion.js) */
.gs-ripple-host { position: relative; overflow: hidden; isolation: isolate; }
.gs-ripple {
  position: absolute; border-radius: 50%; pointer-events: none; z-index: 0;
  background: currentColor; opacity: .18; transform: scale(0);
  animation: gs-ripple .5s ease-out forwards;
}
@keyframes gs-ripple { to { transform: scale(1); opacity: 0; } }

/* Loading state for submit buttons while the next page loads */
.gs-loading { position: relative; pointer-events: none; color: transparent !important; }
.gs-loading > * { visibility: hidden; }
.gs-loading::after {
  content: ""; position: absolute; inset: 0; margin: auto;
  width: 1.05em; height: 1.05em; border-radius: 50%;
  border: 2px solid var(--gs-spin, #fff); border-right-color: transparent;
  animation: gs-spin .7s linear infinite;
}
@keyframes gs-spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  :where(button, .btn, input[type="submit"], input[type="button"], [class*="-btn"], .pill-btn, .btn-arrow, .btn-book),
  :where(button, .btn, input[type="submit"], input[type="button"], [class*="-btn"], .pill-btn, .btn-arrow, .btn-book):where(:is(:hover, :active)) {
    transform: none !important;
    transition-duration: .01s !important;
  }
  .gs-ripple { display: none; }
  .gs-loading::after { animation-duration: 1.6s; }
}
