/**
 * PopustKod Mobile Optimizations v1.0
 * Performance-focused mobile styles
 *
 * This file overrides expensive effects for mobile devices
 * Load AFTER main stylesheets with media="(max-width: 768px)"
 *
 * @package PopustKod
 * @version 1.0.0
 */

/* =============================================
   DISABLE EXPENSIVE EFFECTS ON MOBILE
   ============================================= */

/* Remove backdrop-filter (very expensive on mobile GPUs) */
.pk-hero-v2__stats,
.pk-hero-carousel__indicators,
.pk-platform-pill,
.pk-platform-tag,
.pk-cookie-modal__backdrop {
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}

/* Solid fallback backgrounds instead of blur */
.pk-hero-v2__stats {
  background: rgba(26, 26, 46, 0.85) !important;
}

.pk-hero-carousel__indicators {
  background: rgba(0, 0, 0, 0.7) !important;
}

.pk-platform-pill,
.pk-platform-tag {
  background: rgba(255, 255, 255, 0.15) !important;
}

.pk-cookie-modal__backdrop {
  background: rgba(0, 0, 0, 0.6) !important;
}

/* =============================================
   DISABLE CONTINUOUS ANIMATIONS
   ============================================= */

/* Stop pulsing/glowing animations that drain battery */
.pk-product-card__discount-badge,
.pk-card-v2__badge,
.pk-badge--high-discount,
.pk-hot-badge,
.pk-expiry-badge--urgent {
  animation: none !important;
}

/* Stop shimmer effects on CTAs */
.pk-card-v2__cta::after,
.pk-product-card__cta::after,
.pk-btn-primary::after {
  animation: none !important;
  display: none !important;
}

/* Stop network line animations in shop header */
.pk-network-line,
.pk-network-node {
  animation: none !important;
}

.pk-network-line {
  stroke-dashoffset: 0 !important;
}

.pk-network-node {
  opacity: 0.5 !important;
}

/* Stop live counter pulse */
.pk-live-counter::before {
  animation: none !important;
}

/* Stop claim progress shimmer */
.pk-claim-progress__fill::after {
  animation: none !important;
  display: none !important;
}

/* =============================================
   SIMPLIFY HOVER/TRANSITION EFFECTS
   ============================================= */

/* Reduce card hover transforms */
.pk-card-v2:hover,
.pk-product-card:hover,
.pk-trust-v2__card:hover {
  transform: none !important;
}

/* Remove image zoom on hover (causes repaint) */
.pk-card-v2:hover .pk-card-v2__image img,
.pk-product-card:hover .pk-product-card__image {
  transform: none !important;
}

/* Faster transitions */
.pk-card-v2,
.pk-product-card,
.pk-trust-v2__card,
.pk-filter-chip,
.pk-btn-primary,
.pk-card-v2__cta,
.pk-product-card__cta {
  transition-duration: 150ms !important;
}

/* =============================================
   REDUCE BOX-SHADOW COMPLEXITY
   ============================================= */

/* Simpler shadows for cards */
.pk-card-v2,
.pk-product-card,
.pk-trust-v2__card {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
}

/* Remove glow shadows from badges */
.pk-product-card__discount-badge,
.pk-card-v2__badge {
  box-shadow: none !important;
}

/* Simpler CTA shadows */
.pk-btn-primary,
.pk-card-v2__cta,
.pk-product-card__cta {
  box-shadow: 0 2px 8px rgba(255, 107, 53, 0.3) !important;
}

/* =============================================
   OPTIMIZE LAYOUT FOR TOUCH
   ============================================= */

/* Larger touch targets */
.pk-filter-chip,
.pk-platform-pill,
.pk-copy-btn {
  min-height: 44px;
  min-width: 44px;
}

/* Better tap feedback */
.pk-card-v2__cta:active,
.pk-product-card__cta:active,
.pk-btn-primary:active,
.pk-filter-chip:active {
  opacity: 0.8;
  transform: scale(0.98) !important;
}

/* =============================================
   HIDE DESKTOP-ONLY ELEMENTS
   ============================================= */

/* Hide hero visual/carousel on mobile (saves bandwidth) */
.pk-hero-v2__visual,
.pk-hero-carousel {
  display: none !important;
}

/* Hide image overlay effects on mobile */
.pk-product-card__image-overlay {
  display: none !important;
}

/* =============================================
   OPTIMIZE TEXT RENDERING
   ============================================= */

body {
  text-rendering: optimizeSpeed;
  -webkit-font-smoothing: antialiased;
}

/* Prevent text size adjustment on rotation */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* =============================================
   REDUCE REPAINTS ON SCROLL
   ============================================= */

/* Use will-change sparingly on fixed elements */
.pk-mobile-sticky-cta,
.pk-cookie-banner,
.pk-cookie-float {
  will-change: transform;
  transform: translateZ(0);
}

/* Don't use will-change on scrolling content */
.pk-card-v2,
.pk-product-card {
  will-change: auto;
}

/* =============================================
   IMAGE OPTIMIZATIONS
   ============================================= */

/* Optimize image rendering */
img {
  content-visibility: auto;
}

/* Lazy load images below the fold */
.pk-card-v2__image img {
  loading: lazy;
}

/* =============================================
   FILTER TOOLBAR MOBILE OPTIMIZATIONS
   ============================================= */

/* Horizontal scroll for filter chips */
.pk-filter-chips {
  display: flex;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.pk-filter-chips::-webkit-scrollbar {
  display: none;
}

.pk-filter-chip {
  scroll-snap-align: start;
  flex-shrink: 0;
}

/* =============================================
   COOKIE CONSENT MOBILE OPTIMIZATIONS
   ============================================= */

/* Simpler cookie banner on mobile */
.pk-cookie-banner {
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1) !important;
}

.pk-cookie-modal__dialog {
  max-height: 80vh;
  margin: auto 10px;
}

/* =============================================
   FONT DISPLAY OPTIMIZATION
   ============================================= */

/* Ensure text is visible during font load */
@font-face {
  font-display: swap;
}
