/* Animations - Micro-interactions and reveals */

/* ── PAGE TRANSITIONS ───────────────────────────────────── */
.page {
  animation: none;
}
.page.active {
  animation: pageFadeSlide 0.45s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
}

@keyframes pageFadeSlide {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── SCROLL REVEAL SYSTEM ───────────────────────────────── */
[data-reveal] {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s cubic-bezier(0.22, 0.61, 0.36, 1),
              transform 0.7s cubic-bezier(0.22, 0.61, 0.36, 1);
}
[data-reveal].visible {
  opacity: 1;
  transform: translateY(0);
}

.section-block {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.65s cubic-bezier(0.22, 0.61, 0.36, 1),
              transform 0.65s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.section-block.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered grid items */
.products-grid .product-card,
.deal-cards .deal-card,
.packages-grid > div,
.laptops-grid > div {
  opacity: 0;
  transform: translateY(24px) scale(0.97);
  animation: gridItemReveal 0.5s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
}

@keyframes gridItemReveal {
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Nth-child stagger delays */
.products-grid .product-card:nth-child(1),
.deal-cards .deal-card:nth-child(1) { animation-delay: 0.05s; }
.products-grid .product-card:nth-child(2),
.deal-cards .deal-card:nth-child(2) { animation-delay: 0.1s; }
.products-grid .product-card:nth-child(3),
.deal-cards .deal-card:nth-child(3) { animation-delay: 0.15s; }
.products-grid .product-card:nth-child(4) { animation-delay: 0.2s; }
.products-grid .product-card:nth-child(5) { animation-delay: 0.25s; }
.products-grid .product-card:nth-child(6) { animation-delay: 0.3s; }
.products-grid .product-card:nth-child(7) { animation-delay: 0.35s; }
.products-grid .product-card:nth-child(8) { animation-delay: 0.4s; }
.products-grid .product-card:nth-child(n+9) { animation-delay: 0.45s; }

/* ── PRODUCT CARD HOVER EFFECTS ─────────────────────────── */
.product-card {
  transition: transform 0.3s cubic-bezier(0.22, 0.61, 0.36, 1),
              box-shadow 0.3s ease,
              border-color 0.3s ease;
}
.product-card:hover {
  transform: translateY(-6px) scale(1.015);
  box-shadow: 0 12px 40px rgba(37, 99, 235, 0.18),
              0 0 0 1px rgba(37, 99, 235, 0.15);
  border-color: var(--accent);
}
.product-card:hover .product-image-area {
  background: linear-gradient(180deg, var(--surface2) 0%, rgba(37, 99, 235, 0.04) 100%);
}
.product-card:hover .product-photo--loaded {
  transform: scale(1.06);
  transition: transform 0.4s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.product-card:active {
  transform: translateY(-2px) scale(1.005);
  transition-duration: 0.1s;
}

/* ── ADD-TO-CART BUTTON HOVER ───────────────────────────── */
.add-cart-btn {
  position: relative;
  overflow: hidden;
  transition: all 0.25s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.add-cart-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 40%, rgba(255,255,255,0.15) 100%);
  opacity: 0;
  transition: opacity 0.3s;
}
.add-cart-btn:hover::after {
  opacity: 1;
}
.add-cart-btn:hover {
  transform: scale(1.06);
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.3);
}
.add-cart-btn:active {
  transform: scale(0.95);
  transition-duration: 0.08s;
}

/* ── FLY-TO-CART GHOST ELEMENT ──────────────────────────── */
.fly-cart-ghost {
  position: fixed;
  z-index: 9999;
  pointer-events: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 4px 20px rgba(37, 99, 235, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 900;
  font-size: 1rem;
  opacity: 0;
}
.fly-cart-ghost.animate {
  animation: flyToCart 0.65s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

@keyframes flyToCart {
  0% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.9;
    transform: scale(0.6) translateY(-40px);
  }
  100% {
    opacity: 0;
    transform: scale(0.2);
  }
}

/* Cart count bounce */
.cart-count.bump {
  animation: cartBump 0.4s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}
@keyframes cartBump {
  0%   { transform: scale(1); }
  30%  { transform: scale(1.4); }
  60%  { transform: scale(0.85); }
  100% { transform: scale(1); }
}

/* ── SKELETON LOADERS ───────────────────────────────────── */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--surface2) 25%,
    var(--s3, rgba(37, 99, 235,0.08)) 50%,
    var(--surface2) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.8s ease-in-out infinite;
  border-radius: 8px;
}
.skeleton-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.skeleton-img {
  width: 100%;
  height: 160px;
  background: linear-gradient(
    90deg,
    var(--surface2) 25%,
    var(--s3, rgba(37, 99, 235,0.08)) 50%,
    var(--surface2) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.8s ease-in-out infinite;
}
.skeleton-text {
  height: 12px;
  margin: 12px 16px 0;
  border-radius: 6px;
  background: linear-gradient(
    90deg,
    var(--surface2) 25%,
    var(--s3, rgba(37, 99, 235,0.08)) 50%,
    var(--surface2) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.8s ease-in-out infinite;
}
.skeleton-text.short { width: 60%; }
.skeleton-text.medium { width: 80%; }
.skeleton-text:last-child { margin-bottom: 16px; }

@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* ── MODAL ANIMATIONS ───────────────────────────────────── */
.modal-overlay {
  transition: opacity 0.25s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.modal-overlay .modal {
  transform: translateY(24px) scale(0.96);
  opacity: 0;
  transition: transform 0.35s cubic-bezier(0.22, 0.61, 0.36, 1),
              opacity 0.25s ease;
}
.modal-overlay.open .modal {
  transform: translateY(0) scale(1);
  opacity: 1;
}

/* ── TOAST ANIMATION ────────────────────────────────────── */
.toast {
  transition: transform 0.35s cubic-bezier(0.22, 0.61, 0.36, 1),
              opacity 0.35s ease;
  transform: translateX(-50%) translateY(20px);
  opacity: 0;
}
.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* ── BUTTON MICRO-INTERACTIONS ──────────────────────────── */
.btn-primary,
.btn-secondary,
.btn-deal,
.slot-btn,
.filter-btn,
.nav-tab {
  transition: all 0.2s cubic-bezier(0.22, 0.61, 0.36, 1);
  position: relative;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.35);
}
.btn-primary:active {
  transform: translateY(0px) scale(0.97);
  transition-duration: 0.08s;
}

.btn-secondary:hover {
  transform: translateY(-1px);
}
.btn-secondary:active {
  transform: translateY(0px) scale(0.97);
  transition-duration: 0.08s;
}

/* Ripple effect base (JS adds .ripple-active) */
.ripple-active::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(circle at var(--rx, 50%) var(--ry, 50%),
    rgba(255,255,255,0.25) 0%,
    transparent 60%);
  animation: rippleOut 0.5s ease-out forwards;
  pointer-events: none;
}
@keyframes rippleOut {
  from { opacity: 1; transform: scale(0.5); }
  to   { opacity: 0; transform: scale(2.5); }
}

/* ── HERO ANIMATIONS ────────────────────────────────────── */
.hero-title {
  animation: heroTitleEnter 0.8s cubic-bezier(0.22, 0.61, 0.36, 1) 0.1s both;
}
.hero-eyebrow {
  animation: heroFadeUp 0.6s cubic-bezier(0.22, 0.61, 0.36, 1) 0.0s both;
}
.hero-btns {
  animation: heroFadeUp 0.6s cubic-bezier(0.22, 0.61, 0.36, 1) 0.3s both;
}
.services-strip {
  animation: heroFadeUp 0.6s cubic-bezier(0.22, 0.61, 0.36, 1) 0.45s both;
}

@keyframes heroTitleEnter {
  from {
    opacity: 0;
    transform: translateY(40px) scale(0.95);
    filter: blur(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}
@keyframes heroFadeUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── HERO SCANLINE ANIMATION ────────────────────────────── */
.hero-scanline {
  animation: scanline 4s linear infinite;
}
@keyframes scanline {
  0%   { top: -2px; opacity: 0; }
  10%  { opacity: 0.3; }
  90%  { opacity: 0.3; }
  100% { top: 100%; opacity: 0; }
}

/* ── DEALS CARD ANIMATIONS ──────────────────────────────── */
.deal-card {
  transition: transform 0.3s cubic-bezier(0.22, 0.61, 0.36, 1),
              box-shadow 0.3s ease;
  animation: gridItemReveal 0.5s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
}
.deal-card:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow: 0 12px 36px rgba(37, 99, 235, 0.2);
}

/* Deal badge pulse */
.deal-badge {
  animation: badgePulse 2s ease-in-out infinite;
}
@keyframes badgePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(234, 179, 8, 0.3); }
  50%      { box-shadow: 0 0 0 6px rgba(234, 179, 8, 0); }
}

/* Deal image area */
.deal-img-area {
  width: 100%;
  height: 120px;
  overflow: hidden;
  border-radius: 8px;
  margin-bottom: 0.75rem;
  background: var(--surface2);
  display: flex;
  align-items: center;
  justify-content: center;
}
.deal-img-area img,
.deal-img-area .product-photo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 8px;
  transition: transform 0.3s ease;
}
.deal-card:hover .deal-img-area img,
.deal-card:hover .deal-img-area .product-photo {
  transform: scale(1.08);
}

/* Deal specs text */
.deal-specs {
  font-size: 0.72rem;
  color: var(--text3);
  margin-bottom: 0.5rem;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── SERVICE TILES HOVER ────────────────────────────────── */
.service-tile {
  transition: transform 0.25s cubic-bezier(0.22, 0.61, 0.36, 1),
              box-shadow 0.25s ease,
              border-color 0.25s ease;
}
.service-tile:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 28px rgba(37, 99, 235, 0.12);
  border-color: var(--accent);
}

/* ── WISHLIST HEART ANIMATION ───────────────────────────── */
.wishlist-btn {
  transition: transform 0.2s cubic-bezier(0.22, 0.61, 0.36, 1),
              color 0.2s ease;
}
.wishlist-btn:hover {
  transform: scale(1.2);
}
.wishlist-btn.wishlisted {
  animation: heartPop 0.35s cubic-bezier(0.22, 0.61, 0.36, 1);
}
@keyframes heartPop {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.35); }
  60%  { transform: scale(0.9); }
  100% { transform: scale(1); }
}

/* ── COMPARE BUTTON TOGGLE ──────────────────────────────── */
.compare-btn {
  transition: all 0.2s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.compare-btn.comparing {
  animation: compareToggle 0.3s ease;
}
@keyframes compareToggle {
  0%   { transform: scale(1); }
  50%  { transform: scale(0.9); }
  100% { transform: scale(1); }
}

/* ── NAV TAB INDICATOR ──────────────────────────────────── */
.nav-tab {
  position: relative;
}
.nav-tab::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--accent);
  border-radius: 1px;
  transition: width 0.3s cubic-bezier(0.22, 0.61, 0.36, 1),
              left 0.3s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.nav-tab.active::after {
  width: 70%;
  left: 15%;
}

/* ── BUILDER SLOT ANIMATIONS ────────────────────────────── */
.builder-slot {
  transition: all 0.25s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.builder-slot:hover {
  transform: translateX(4px);
  border-color: var(--accent);
  box-shadow: -4px 0 0 0 var(--accent);
}
.builder-slot.slot-filled {
  border-left: 3px solid var(--accent);
}

/* ── RIG RATING GLOW ────────────────────────────────────── */
.rating-arc {
  transition: stroke-dashoffset 0.8s cubic-bezier(0.22, 0.61, 0.36, 1),
              stroke 0.4s ease;
  filter: drop-shadow(0 0 6px currentColor);
}

.rig-rating-gauge {
  transition: transform 0.3s ease;
}
.rig-rating-gauge:hover {
  transform: scale(1.05);
}

/* ── POWER METER FILL ───────────────────────────────────── */
.power-fill {
  transition: width 0.6s cubic-bezier(0.22, 0.61, 0.36, 1),
              background 0.4s ease !important;
}

/* ── THEME TOGGLE ANIMATION ─────────────────────────────── */
.theme-toggle-btn,
.admin-theme-btn {
  transition: transform 0.3s cubic-bezier(0.22, 0.61, 0.36, 1),
              background 0.3s ease;
}
.theme-toggle-btn:hover,
.admin-theme-btn:hover {
  transform: rotate(25deg) scale(1.15);
}
.theme-toggle-btn:active,
.admin-theme-btn:active {
  transform: rotate(-10deg) scale(0.9);
  transition-duration: 0.1s;
}

/* ── CART ITEM ANIMATIONS ───────────────────────────────── */
.cart-item {
  animation: cartItemSlide 0.3s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
  transition: background 0.2s ease, transform 0.2s ease;
}
.cart-item:hover {
  background: var(--surface2);
  transform: translateX(4px);
}
@keyframes cartItemSlide {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ── ORDER CARD ANIMATIONS ──────────────────────────────── */
.order-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.order-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.1);
}

/* ── NOTIFICATION BELL ──────────────────────────────────── */
.notif-bell-btn:hover svg {
  animation: bellRing 0.5s ease;
}
@keyframes bellRing {
  0%, 100% { transform: rotate(0); }
  25% { transform: rotate(12deg); }
  50% { transform: rotate(-12deg); }
  75% { transform: rotate(6deg); }
}

/* ── FOCUS RINGS (a11y) ─────────────────────────────────── */
.btn-primary:focus-visible,
.btn-secondary:focus-visible,
.nav-tab:focus-visible,
.add-cart-btn:focus-visible,
.filter-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: inherit;
}

/* ── IMAGE VIEWER TRANSITIONS ───────────────────────────── */
.image-viewer-overlay {
  transition: opacity 0.3s ease;
}
.image-viewer-img {
  transition: transform 0.3s cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* ── FORM INPUT FOCUS ANIMATION ─────────────────────────── */
.form-input,
.form-select,
.form-textarea {
  transition: border-color 0.25s ease,
              box-shadow 0.25s ease,
              transform 0.15s ease;
}
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
  transform: translateY(-1px);
}

/* ── CHECKOUT MAP PIN DROP ──────────────────────────────── */
.co-map-marker {
  animation: pinDrop 0.4s cubic-bezier(0.22, 0.61, 0.36, 1);
}
@keyframes pinDrop {
  0%   { transform: translateY(-30px); opacity: 0; }
  60%  { transform: translateY(4px); }
  100% { transform: translateY(0); opacity: 1; }
}

/* ── LOADING SPINNER ────────────────────────────────────── */
.ds-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── BADGE NEW/PKG PULSE ────────────────────────────────── */
.nav-tab-new,
.nav-tab-pkg {
  animation: tagPulse 2s ease-in-out infinite;
}
@keyframes tagPulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.6; }
}

/* ── SMOOTH NUMBER COUNTER ──────────────────────────────── */
.stat-val,
.kpi-val {
  transition: color 0.3s ease;
}


