/* ==========================================================================
   FairTech Micro-Interactions — sitewide, subtle, desktop-aware.
   Loaded on every page (like design-system.css). Builds on Step 1's tokens.
   Nothing here touches JS business logic — only presentation + the two
   small, purely observational scripts in footer.php (cursor glow, cart
   "just added" detection via document.referrer, no backend changes).
   ========================================================================== */

/* ---- Cursor-follow glow (desktop only) ---- */

.ds-cursor-glow {
  position: fixed;
  top: 0;
  left: 0;
  width: 220px;
  height: 220px;
  margin-left: -110px;
  margin-top: -110px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(61, 139, 255, 0.14) 0%, rgba(61, 139, 255, 0) 70%);
  pointer-events: none;
  z-index: var(--ds-z-toast, 1100);
  opacity: 0;
  transition: opacity 260ms ease;
  will-change: transform;
}

.ds-cursor-glow.is-active {
  opacity: 1;
}

@media (max-width: 991px), (hover: none), (pointer: coarse) {
  .ds-cursor-glow {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ds-cursor-glow {
    display: none;
  }
}

/* ---- Fixed side "Repair Phone" button — every page, links to the repair
   booking form. Sits at the .ds-z-overlay tier: above normal page content,
   but below Bootstrap's dropdown/modal/offcanvas range (~1000+) so it never
   covers an open modal or the mobile menu. ---- */

.ds-side-repair-btn {
  position: fixed;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: var(--ds-z-overlay, 500);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 14px 9px 11px;
  background: linear-gradient(180deg, var(--ds-accent, #3d8bff) 0%, var(--ds-accent-strong, #0066ff) 100%);
  color: #ffffff;
  text-decoration: none;
  border-radius: 999px 0 0 999px;
  box-shadow: var(--ds-shadow-lg, 0 24px 60px rgba(2, 6, 16, 0.35)), inset 0 0 0 1px rgba(255, 255, 255, 0.12);
  font-family: "Poppins", sans-serif;
  font-weight: 600;
  font-size: 12px;
  line-height: 1.2;
  white-space: nowrap;
  transition: transform 260ms var(--ds-ease-out, cubic-bezier(0.16, 1, 0.3, 1)),
              box-shadow 260ms var(--ds-ease-out, cubic-bezier(0.16, 1, 0.3, 1));
}

.ds-side-repair-btn .material-symbols-outlined {
  font-size: 16px;
}

@media (hover: hover) and (pointer: fine) {
  .ds-side-repair-btn:hover {
    transform: translateY(-50%) translateX(-6px);
    box-shadow: var(--ds-shadow-lg, 0 24px 60px rgba(2, 6, 16, 0.35)), 0 0 22px rgba(61, 139, 255, 0.55);
    color: #ffffff;
  }
}

.ds-side-repair-btn:active {
  transform: translateY(-50%) scale(0.96);
}

.ds-side-repair-btn:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 3px;
}

@media (max-width: 767px) {
  .ds-side-repair-btn {
    padding: 8px;
    border-radius: 50%;
  }
  .ds-side-repair-btn .material-symbols-outlined {
    font-size: 15px;
  }
  .ds-side-repair-btn__label {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ds-side-repair-btn {
    transition-duration: 1ms;
  }
}

/* ---- Buttons: press feedback for the sitewide button classes that
   predate the .ds-btn system (.ds-btn already has :active from Step 1) ---- */

.btn-blue:active {
  transform: translateY(0) scale(0.97);
}

.signin-submit {
  transition: transform 150ms var(--ease-smooth, cubic-bezier(0.4, 0, 0.2, 1)),
              box-shadow 150ms var(--ease-smooth, cubic-bezier(0.4, 0, 0.2, 1));
}

.signin-submit:active {
  transform: scale(0.97);
}

/* ---- Links: smooth, subtle underline sweep — opt-in via .ds-link so
   existing nav/button/card links (which already have their own hover
   treatments) aren't affected. Safe to sprinkle onto plain content links
   (footer, accordion body copy, breadcrumb, etc). ---- */

.ds-link {
  position: relative;
  text-decoration: none;
  background-image: linear-gradient(currentColor, currentColor);
  background-position: 0 100%;
  background-repeat: no-repeat;
  background-size: 0% 1px;
  transition: background-size 220ms var(--ease-smooth, cubic-bezier(0.4, 0, 0.2, 1)),
              color 220ms var(--ease-smooth, cubic-bezier(0.4, 0, 0.2, 1));
}

.ds-link:hover {
  background-size: 100% 1px;
}

@media (prefers-reduced-motion: reduce) {
  .ds-link {
    transition-duration: 1ms;
  }
}

/* A very light, universal touch: let color changes that *already* happen
   on hover (via other rules elsewhere) ease instead of snap. This changes
   no colors itself — only smooths transitions that already exist. */
a {
  transition: color 180ms ease;
}

/* ---- Inputs: sitewide focus glow for .ft-input (previously only scoped
   to the header's login/register modals) — now also covers repair.php,
   trade-in, checkout, shipping-details, etc. Native validation states
   (:invalid/:required) are untouched, so browser/JS validation still
   surfaces normally. ---- */

.ft-input {
  border: 1px solid rgba(15, 23, 42, 0.14);
  border-radius: 8px;
  transition: border-color 220ms var(--ease-smooth, cubic-bezier(0.4, 0, 0.2, 1)),
              box-shadow 220ms var(--ease-smooth, cubic-bezier(0.4, 0, 0.2, 1));
}

.ft-input:focus {
  outline: none;
  border-color: var(--mainblue, #0066ff);
  box-shadow: 0 0 0 3px rgba(0, 102, 255, 0.16);
}

/* ---- Cart: brief highlight + count animation, gated to genuine
   "just added" navigations only (see footer.php) — not every page load. ---- */

.ds-cart-badge {
  animation: none; /* Step 2's unconditional pop is now opt-in via the class below */
}

.ds-cart-badge.ds-cart-badge--pulse {
  animation: ds-cart-pop 520ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.cart-conatiner.ds-cart-highlight .icon {
  animation: ds-cart-ring 900ms ease-out;
}

@keyframes ds-cart-ring {
  0%   { box-shadow: 0 0 0 0 rgba(0, 102, 255, 0.45); border-radius: 50%; }
  70%  { box-shadow: 0 0 0 14px rgba(0, 102, 255, 0); border-radius: 50%; }
  100% { box-shadow: 0 0 0 0 rgba(0, 102, 255, 0); border-radius: 50%; }
}

@media (prefers-reduced-motion: reduce) {
  .ds-cart-badge.ds-cart-badge--pulse,
  .cart-conatiner.ds-cart-highlight .icon {
    animation: none;
  }
}

/* ---- Navigation: subtle indicator for the current section (distinct
   from the JS-driven .active used to open/close the mega-menu dropdown) ---- */

.pc-menu-item--current {
  color: var(--ds-text-primary, #fff);
}

.pc-menu-item--current .underline {
  background: linear-gradient(90deg, var(--ds-accent, #3d8bff), var(--ds-accent-strong, #0066ff));
  transform: scaleX(1);
}
