/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

/* Public site styles */

/* Hero video background — fade-out overlay hides Bunny play button flash before autoplay */
@keyframes heroVideoFadeOut {
  from {
    opacity: 1;
  }

  to {
    opacity: 0;
  }
}



/* Hide number input spin buttons (up/down arrows) */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}


input[type=number] {
  -moz-appearance: textfield;
  appearance: none;
}

/* FontAwesome font-display: swap overrides moved to font-awesome.css */
/* Terms Page Styling */
.terms-block h1 {
  font-size: 1.5rem !important;
  /* 24px */
  line-height: 2rem !important;
  font-weight: 700 !important;
  margin-top: 2.5rem !important;
  margin-bottom: 1rem !important;
  padding-top: 1.5rem !important;
}

.terms-block h2 {
  font-size: 1.25rem !important;
  /* 20px */
  line-height: 1.75rem !important;
  font-weight: 600 !important;
  margin-top: 2rem !important;
  margin-bottom: 0.75rem !important;
  padding-top: 1.25rem !important;
}

.terms-block h3 {
  font-size: 1.125rem !important;
  /* 18px */
  line-height: 1.5rem !important;
  font-weight: 600 !important;
  margin-top: 1.5rem !important;
  margin-bottom: 0.5rem !important;
  padding-top: 1rem !important;
}

.terms-fixed-content {
  font-size: 1rem !important;
  line-height: 1.25rem !important;
}

/* Reveal Animations */
.reveal-slide-down {
  opacity: 0;
  transform: translateY(-2rem);
  transition: all 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-slide-down.reveal-active {
  opacity: 1;
  transform: translateY(0);
}

.reveal-fade-in {
  opacity: 0;
  transition: opacity 0.7s ease-out;
}

.reveal-fade-in.reveal-active {
  opacity: 1;
}

/* ==========================================================================
   "Add to cart" → "Open cart" button morph animations
   Driven by cart_add_controller.js. The JS swaps the label/icon at the
   animation midpoint (~300ms of a 600ms run) so the transition reads as a
   single fluid morph. Theme colors are preserved (no background overrides).
   ========================================================================== */
.cart-add-btn {
  position: relative;
  overflow: hidden;
}

.cart-add-label {
  display: inline-block;
}

/* Cart icon shown only once the button has morphed into "Open cart" */
.cart-add-icon {
  display: none;
}

.cart-add-btn.cart-added .cart-add-icon {
  display: inline-block;
}

/* Spacing only when the cart icon sits next to a text label */
.cart-add-btn.cart-added .cart-add-icon:has(+ .cart-add-label) {
  margin-right: 0.5rem;
}

/* Icon-only buttons (e.g. compact quick-add): hide the default icon once added */
.cart-add-btn.cart-added .cart-add-default-icon {
  display: none;
}

/* 1. Slide — old label slides up & out, new label slides up into place */
.cart-anim-slide .cart-add-label {
  animation: cartSlideSwap 600ms cubic-bezier(0.65, 0, 0.35, 1) both;
}

@keyframes cartSlideSwap {
  0% { transform: translateY(0); opacity: 1; }
  45% { transform: translateY(-160%); opacity: 0; }
  55% { transform: translateY(160%); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}

/* 2. Flip — button flips on its X axis, revealing the new label mid-flip */
.cart-anim-flip {
  animation: cartFlip 600ms ease both;
}

@keyframes cartFlip {
  0% { transform: perspective(600px) rotateX(0); }
  50% { transform: perspective(600px) rotateX(-90deg); }
  100% { transform: perspective(600px) rotateX(0); }
}

/* 3. Pop — bouncy scale that reads as a confirmation, label swaps at the dip */
.cart-anim-pop {
  animation: cartPop 600ms cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes cartPop {
  0% { transform: scale(1); }
  30% { transform: scale(0.88); }
  60% { transform: scale(1.07); }
  100% { transform: scale(1); }
}

/* 4. Sweep — a light sheen wipes across while the label crossfades */
.cart-anim-sweep .cart-add-label {
  animation: cartFadeSwap 600ms ease both;
}

.cart-anim-sweep::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 0%, rgba(255, 255, 255, 0.55) 50%, transparent 100%);
  transform: translateX(-100%);
  animation: cartSweep 600ms ease both;
  pointer-events: none;
}

@keyframes cartFadeSwap {
  0% { opacity: 1; }
  40% { opacity: 0; }
  60% { opacity: 0; }
  100% { opacity: 1; }
}

@keyframes cartSweep {
  to { transform: translateX(100%); }
}

@media (prefers-reduced-motion: reduce) {
  .cart-anim-slide .cart-add-label,
  .cart-anim-flip,
  .cart-anim-pop,
  .cart-anim-sweep .cart-add-label,
  .cart-anim-sweep::after {
    animation: none !important;
  }
}