/*
 * YourCart Design System — Animations, Utilities & Section Helpers
 * Sources: design-system.css: 141 - 260, 277 - 285; components.css: 6 - 23
 */

/* ─── Animations ─────────────────────────────────────────────────────────────── */

/* bounce-subtle — hero badge ping, etc. */
@keyframes ycc-bounce-subtle {
  0%, 100% { transform: translateY(-5%); }
  50%       { transform: translateY(0); }
}
.ycc-bounce-subtle {
  animation: ycc-bounce-subtle 2s ease-in-out infinite;
}

/* shimmer — skeleton loaders */
@keyframes ycc-shimmer {
  0%   { background-position: -1000px 0; }
  100% { background-position:  1000px 0; }
}
.ycc-shimmer {
  background: linear-gradient(90deg, var(--ycc-slate-100) 25%, var(--ycc-slate-200) 50%, var(--ycc-slate-100) 75%);
  background-size: 2000px 100%;
  animation: ycc-shimmer 2s linear infinite;
}

/* marquee — partner logos (40s) */
@keyframes ycc-marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
.ycc-marquee {
  animation: ycc-marquee 40s linear infinite;
}
.ycc-marquee:hover,
.ycc-marquee-track:hover .ycc-marquee {
  animation-play-state: paused;
}

/* reviews-marquee — customer reviews (75s) */
@keyframes ycc-reviews-marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
.ycc-reviews-marquee {
  animation: ycc-reviews-marquee 75s linear infinite;
}
.ycc-reviews-marquee:hover {
  animation-play-state: paused;
}

/* slide-in-right — cart drawer */
@keyframes ycc-slide-in-right {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}
.ycc-slide-in-right {
  animation: ycc-slide-in-right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* fade-in-up — modals, dropdowns */
@keyframes ycc-fade-in-up {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0);   }
}
.ycc-fade-in-up {
  animation: ycc-fade-in-up 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* toast appear */
@keyframes ycc-toast-in {
  from { opacity: 0; transform: translate(-50%, 20px) scale(0.95); }
  to   { opacity: 1; transform: translate(-50%, 0)    scale(1);    }
}

/* ─── Utility Classes ────────────────────────────────────────────────────────── */

/* Backdrop blur (used by navbar, cart drawer backdrop) */
.ycc-backdrop-blur {
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter:         blur(12px);
}

/* Gradient text — hero H1 */
.ycc-gradient-text {
  background: linear-gradient(to right, var(--ycc-blue-600), #4f46e5, #9333ea);
  -webkit-background-clip: text;
  background-clip:         text;
  -webkit-text-fill-color: transparent;
  color:                   transparent;
}

/* Fade masks for marquee edges */
.ycc-fade-mask {
  -webkit-mask-image: linear-gradient(to right, transparent 0%, black 10%, black 90%, transparent 100%);
  mask-image:         linear-gradient(to right, transparent 0%, black 10%, black 90%, transparent 100%);
}

/* Scrollbar hide */
.ycc-scrollbar-hide::-webkit-scrollbar { display: none; }
.ycc-scrollbar-hide {
  -ms-overflow-style: none;
  scrollbar-width:    none;
}

/* Safe area for mobile bottom */
.ycc-pb-safe {
  padding-bottom: env(safe-area-inset-bottom, 20px);
}

/* Overflow clip for marquee containers */
.ycc-overflow-clip {
  overflow: hidden;
}

/* ─── Reduced Motion ─────────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ─── Responsive Container Breakpoints ──────────────────────────────────────── */
@media (min-width: 640px) {
  :root { --ycc-container-px: 1.5rem; }
}
@media (min-width: 1024px) {
  :root { --ycc-container-px: 2rem; }
}

/* ─── Section Helpers ─────────────────────────────────────────────────────── */
.ycc-section-heading {
  font-size:      24px;
  font-weight:    700;
  color:          var(--ycc-text);
  letter-spacing: -0.025em;
  margin:         0 0 8px;
}
@media (min-width: 768px) { .ycc-section-heading { font-size: 30px; } }
html.dark .ycc-section-heading { color: var(--ycc-text-dark); }

.ycc-section-subheading {
  font-size: 15px;
  color:     var(--ycc-text-muted);
  margin:    0 0 24px;
  max-width: 480px;
}

/* ─── Scoped Form & Focus Utilities ─────────────────────────────────────────── */

/* Universal Form Control Base */
.ycc-form-control,
.ycc-input,
.ycc-select,
.ycc-textarea {
  display: block;
  width: 100%;
  font-family: var(--ycc-font);
  font-size: 14px;
  line-height: var(--ycc-line-height);
  color: var(--ycc-color-text);
  background-color: var(--ycc-surface);
  border: 1px solid var(--ycc-color-border);
  border-radius: var(--ycc-radius-lg);
  padding: 0 14px;
  min-height: var(--ycc-control-h-md);
  box-sizing: border-box;
  transition: var(--ycc-transition);
}

/* Placeholder styling */
.ycc-form-control::placeholder,
.ycc-input::placeholder,
.ycc-textarea::placeholder {
  color: var(--ycc-color-muted);
  opacity: 0.7;
}

/* Focus States — visible focus replacement with accessible focus ring */
.ycc-form-control:focus,
.ycc-input:focus,
.ycc-select:focus,
.ycc-textarea:focus {
  border-color: var(--ycc-color-primary);
  outline: none;
  box-shadow: var(--ycc-focus-ring);
}

/* Disabled & Readonly states */
.ycc-form-control:disabled,
.ycc-form-control[readonly],
.ycc-input:disabled,
.ycc-input[readonly],
.ycc-select:disabled,
.ycc-textarea:disabled,
.ycc-textarea[readonly] {
  background-color: var(--ycc-slate-100);
  color: var(--ycc-color-muted);
  cursor: not-allowed;
  opacity: 0.75;
}

/* Textarea specific */
.ycc-textarea {
  min-height: 100px;
  height: auto;
  padding: 10px 14px;
  resize: vertical;
}

/* Select specific */
.ycc-select {
  cursor: pointer;
  padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
  appearance: none;
  -webkit-appearance: none;
}

/* Sizing Modifiers */
.ycc-control-sm,
.ycc-form-control-sm,
.ycc-input-sm {
  min-height: var(--ycc-control-h-sm);
  height: var(--ycc-control-h-sm);
  padding: 0 10px;
  font-size: 13px;
}

.ycc-control-lg,
.ycc-form-control-lg,
.ycc-input-lg {
  min-height: var(--ycc-control-h-lg);
  height: var(--ycc-control-h-lg);
  padding: 0 16px;
  font-size: 15px;
}

/* Accessible Focus-Visible Utility */
.ycc-focus-visible:focus-visible {
  outline: none;
  box-shadow: var(--ycc-focus-ring);
}

/* Dark Mode Overrides for Form Controls */
html.dark .ycc-form-control,
html.dark .ycc-input,
html.dark .ycc-select,
html.dark .ycc-textarea {
  background-color: var(--ycc-surface-dark);
  color: var(--ycc-color-text);
  border-color: var(--ycc-color-border);
}

html.dark .ycc-form-control:disabled,
html.dark .ycc-form-control[readonly],
html.dark .ycc-input:disabled,
html.dark .ycc-input[readonly],
html.dark .ycc-select:disabled,
html.dark .ycc-textarea:disabled,
html.dark .ycc-textarea[readonly] {
  background-color: var(--ycc-slate-800);
  color: var(--ycc-color-muted);
}

html.dark .ycc-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
}
