/* ============================================================
   KUMA TECHNOLOGY — Global Styles & Reset
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Outfit:wght@400;500;600;700;800&display=swap');
@import './tokens.css';

/* --- Reset --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--color-text);
  background-color: var(--color-bg);
  min-height: 100vh;
  overflow-x: hidden;
}

img, video { max-width: 100%; height: auto; display: block; }
a { text-decoration: none; color: inherit; }
button { cursor: pointer; font-family: inherit; border: none; background: none; }
ul, ol { list-style: none; }
input, select, textarea { font-family: inherit; }
h1,h2,h3,h4,h5,h6 { font-family: var(--font-display); line-height: var(--leading-tight); }

/* --- Layout --- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.section { padding: var(--space-16) 0; }
.section-sm { padding: var(--space-10) 0; }

/* --- Grid --- */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-6); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-6); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-6); }
.grid-5 { display: grid; grid-template-columns: repeat(5, 1fr); gap: var(--space-4); }

/* --- Flex --- */
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-col { display: flex; flex-direction: column; }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }

/* --- Typography --- */
.text-display { font-family: var(--font-display); }
.text-xs { font-size: var(--text-xs); }
.text-sm { font-size: var(--text-sm); }
.text-lg { font-size: var(--text-lg); }
.text-xl { font-size: var(--text-xl); }
.text-2xl { font-size: var(--text-2xl); }
.text-3xl { font-size: var(--text-3xl); }
.text-4xl { font-size: var(--text-4xl); }
.text-muted { color: var(--color-muted); }
.text-secondary { color: var(--color-text-secondary); }
.text-primary { color: var(--color-primary); }
.text-accent { color: var(--color-accent); }
.font-medium { font-weight: var(--weight-medium); }
.font-semibold { font-weight: var(--weight-semibold); }
.font-bold { font-weight: var(--weight-bold); }

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  transition: all var(--transition-base);
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0);
  transition: background var(--transition-fast);
}

.btn:hover::after { background: rgba(255,255,255,0.12); }
.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--gradient-accent);
  color: var(--color-on-primary);
  box-shadow: var(--shadow-primary);
}
.btn-primary:hover { box-shadow: 0 6px 25px rgba(10,126,164,0.5); transform: translateY(-1px); }

.btn-dark {
  background: var(--color-nav);
  color: var(--color-on-dark);
}
.btn-dark:hover { background: var(--color-nav-hover); transform: translateY(-1px); }

.btn-outline {
  border: 2px solid var(--color-primary);
  color: var(--color-primary);
  background: transparent;
}
.btn-outline:hover { background: var(--color-primary); color: #fff; }

.btn-ghost {
  color: var(--color-text-secondary);
  background: transparent;
  padding: var(--space-2) var(--space-4);
}
.btn-ghost:hover { background: var(--color-bg-alt); color: var(--color-text); }

.btn-danger {
  background: var(--color-danger);
  color: #fff;
}
.btn-danger:hover { background: #dc2626; }

.btn-lg {
  padding: var(--space-4) var(--space-8);
  font-size: var(--text-base);
  border-radius: var(--radius-lg);
}

.btn-sm {
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-xs);
  border-radius: var(--radius-sm);
}

.btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* --- Cards --- */
.card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-base);
  overflow: hidden;
}
.card:hover { box-shadow: var(--shadow-lg); transform: translateY(-3px); }

/* --- Badge --- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px var(--space-2);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
}
.badge-primary { background: var(--color-primary); color: #fff; }
.badge-accent { background: var(--color-accent); color: #fff; }
.badge-success { background: var(--color-success-bg); color: var(--color-success); }
.badge-warning { background: var(--color-warning-bg); color: var(--color-warning); }
.badge-danger { background: var(--color-danger-bg); color: var(--color-danger); }
.badge-dark { background: var(--color-nav); color: #fff; }

/* --- Form Controls --- */
.form-group { display: flex; flex-direction: column; gap: var(--space-2); }
.form-label {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--color-text-secondary);
}
.form-control {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  color: var(--color-text);
  background: var(--color-surface);
  transition: all var(--transition-fast);
  outline: none;
}
.form-control:focus {
  border-color: var(--color-border-focus);
  box-shadow: 0 0 0 3px rgba(10,126,164,0.15);
}
.form-control::placeholder { color: var(--color-muted); }

/* --- Stars --- */
.stars { display: flex; gap: 2px; }
.star { font-size: var(--text-sm); color: #D1D5DB; }
.star.filled { color: #F59E0B; }

/* --- Divider --- */
.divider {
  height: 1px;
  background: var(--color-border);
  margin: var(--space-6) 0;
}

/* --- Section Headers --- */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-8);
}
.section-title {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: var(--weight-bold);
  color: var(--color-text);
  position: relative;
}
.section-title::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 0;
  width: 48px;
  height: 3px;
  background: var(--gradient-accent);
  border-radius: var(--radius-full);
}

/* --- Animations --- */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInLeft {
  from { opacity: 0; transform: translateX(-20px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes fadeInRight {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.05); }
}
@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
@keyframes shimmer {
  from { background-position: -200% 0; }
  to   { background-position: 200% 0; }
}
@keyframes bounceIn {
  0%   { transform: scale(0.3); opacity: 0; }
  50%  { transform: scale(1.05); }
  70%  { transform: scale(0.9); }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes cartBounce {
  0%, 100% { transform: scale(1); }
  30%       { transform: scale(1.3); }
  60%       { transform: scale(0.9); }
}

.animate-fadeIn { animation: fadeIn 0.5s ease forwards; }
.animate-fadeInLeft { animation: fadeInLeft 0.5s ease forwards; }
.animate-fadeInRight { animation: fadeInRight 0.5s ease forwards; }

/* --- Skeleton Loading --- */
.skeleton {
  background: linear-gradient(90deg, var(--color-bg-alt) 25%, var(--color-bg) 50%, var(--color-bg-alt) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-md);
}

/* --- Scrollbar --- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--color-bg); }
::-webkit-scrollbar-thumb { background: var(--color-border); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: var(--color-muted); }

/* --- Modal Overlay --- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(1, 24, 38, 0.7);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
}
.modal-overlay.active { display: flex; animation: fadeIn 0.2s ease; }

.modal {
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  animation: bounceIn 0.35s ease;
}
.modal-header {
  padding: var(--space-6);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-body { padding: var(--space-6); }
.modal-footer {
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--color-border);
  display: flex;
  justify-content: flex-end;
  gap: var(--space-3);
}

/* --- Toast Notifications --- */
.toast-container {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  pointer-events: none;
}
.toast {
  background: var(--color-nav);
  color: #fff;
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--text-sm);
  min-width: 280px;
  animation: fadeInRight 0.3s ease;
  pointer-events: all;
  border-left: 4px solid var(--color-accent);
}
.toast.toast-success { border-color: var(--color-success); }
.toast.toast-error   { border-color: var(--color-danger); }
.toast.toast-warning { border-color: var(--color-warning); }

/* --- Tabs --- */
.tabs { display: flex; border-bottom: 2px solid var(--color-border); gap: var(--space-1); }
.tab-btn {
  padding: var(--space-3) var(--space-5);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--color-muted);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  transition: all var(--transition-fast);
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
}
.tab-btn.active {
  color: var(--color-primary);
  border-color: var(--color-primary);
  background: var(--color-info-bg);
}
.tab-btn:hover:not(.active) { color: var(--color-text); background: var(--color-bg-alt); }
.tab-panel { display: none; padding: var(--space-6) 0; }
.tab-panel.active { display: block; animation: fadeIn 0.3s ease; }

/* --- Range Slider --- */
.range-slider { width: 100%; accent-color: var(--color-primary); }

/* --- Utility --- */
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.text-center { text-align: center; }
.text-right  { text-align: right; }
.w-full { width: 100%; }
.mt-auto { margin-top: auto; }
.mb-0 { margin-bottom: 0; }
.rounded { border-radius: var(--radius-md); }
.rounded-full { border-radius: var(--radius-full); }
.overflow-hidden { overflow: hidden; }

/* --- Icon Typography --- */
i[class^="ph"] { display: inline-flex; align-items: center; justify-content: center; line-height: 1; }
.feature-icon-ph { font-size: 1.6rem; color: var(--color-primary); filter: drop-shadow(0 2px 4px rgba(10,126,164,0.3)); }
.icon-action { font-size: 1.5rem; color: var(--color-text); transition: all var(--transition-bounce); }
.header-action-btn:hover .icon-action { color: var(--color-primary); transform: translateY(-2px) scale(1.1); filter: drop-shadow(0 4px 6px rgba(10,126,164,0.4)); }

/* --- Page transitions --- */
.page { display: none; }
.page.active { display: block; animation: fadeIn 0.3s ease; }

/* --- Number Input Stepper --- */
.qty-stepper {
  display: flex;
  align-items: center;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.qty-stepper button {
  width: 36px;
  height: 36px;
  background: var(--color-bg-alt);
  font-size: var(--text-lg);
  font-weight: var(--weight-bold);
  color: var(--color-text-secondary);
  transition: all var(--transition-fast);
}
.qty-stepper button:hover { background: var(--color-primary); color: #fff; }
.qty-stepper input {
  width: 50px;
  text-align: center;
  border: none;
  border-left: 1.5px solid var(--color-border);
  border-right: 1.5px solid var(--color-border);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  outline: none;
  height: 36px;
}

/* --- Price --- */
.price-current {
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
  color: var(--color-primary);
  font-family: var(--font-display);
}
.price-original {
  font-size: var(--text-sm);
  color: var(--color-muted);
  text-decoration: line-through;
}
.price-discount {
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  color: var(--color-danger);
  background: var(--color-danger-bg);
  padding: 2px 6px;
  border-radius: var(--radius-full);
}

/* ============================================================
   RESPONSIVE BREAKPOINTS
   ============================================================ */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(3, 1fr); }
  .grid-5 { grid-template-columns: repeat(3, 1fr); }
  .container { padding: 0 var(--space-4); }
}

@media (max-width: 768px) {
  .grid-2 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-5 { grid-template-columns: repeat(2, 1fr); }
  .section { padding: var(--space-10) 0; }
  .section-title { font-size: var(--text-xl); }
}

@media (max-width: 480px) {
  .grid-3 { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); gap: var(--space-3); }
  .container { padding: 0 var(--space-4); }
}

/* ============================================================
   MICRO-ANIMACIONES
   ============================================================ */
@keyframes staggerFadeUp {
  from { opacity: 0; transform: translateY(15px); }
  to { opacity: 1; transform: translateY(0); }
}
.stagger-item {
  opacity: 0;
  animation: staggerFadeUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
/* Generate nth-child staggered delays for up to 15 items */
.stagger-item:nth-child(1) { animation-delay: 50ms; }
.stagger-item:nth-child(2) { animation-delay: 100ms; }
.stagger-item:nth-child(3) { animation-delay: 150ms; }
.stagger-item:nth-child(4) { animation-delay: 200ms; }
.stagger-item:nth-child(5) { animation-delay: 250ms; }
.stagger-item:nth-child(n+6) { animation-delay: 300ms; }

/* Promo Banners Extra Animations */
@keyframes float {
  0% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
  100% { transform: translateY(0px); }
}
@keyframes pulseGlow {
  0% { transform: scale(1); filter: drop-shadow(0 0 0 rgba(0,201,167,0)); }
  50% { transform: scale(1.05); filter: drop-shadow(0 0 10px rgba(0,201,167,0.5)); }
  100% { transform: scale(1); filter: drop-shadow(0 0 0 rgba(0,201,167,0)); }
}
@keyframes spinSlow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
.animate-float { animation: float 3s ease-in-out infinite; }
.animate-pulseGlow { animation: pulseGlow 2.5s ease-in-out infinite; }
.animate-spinSlow { animation: spinSlow 8s linear infinite; }
