/* ================================================================
   MOBILE RESPONSIVE FIXES — SK Studios
   Scoped to specific components; nav rules removed because the
   floating top nav in navigation.twig owns its own mobile drawer.
   ================================================================ */


/* ================================================================
   1. PRODUCT CARD GRID — Mobile two-column
   ================================================================ */

/* ================================================================
   0. HOME HERO - keep the floating logos inside mobile viewports
   ================================================================ */

@media (max-width: 768px) {
  .page-index .hero-section {
    min-height: auto !important;
    padding: 28px 0 46px !important;
    overflow: hidden !important;
  }

  .page-index .hero-container {
    grid-template-columns: 1fr !important;
    gap: 22px !important;
    padding: 0 18px !important;
    text-align: center !important;
  }

  .page-index .hero-section .hero-content {
    order: 1 !important;
    max-width: 100% !important;
    margin: 0 auto !important;
    text-align: center !important;
  }

  .page-index .hero-section .hero-headline,
  .page-index .hero-section .hero-subcopy {
    max-width: 100% !important;
  }

  .page-index .hero-visual {
    order: 2 !important;
    width: 100% !important;
    max-width: 420px !important;
    height: auto !important;
    margin: 0 auto !important;
    display: block !important;
  }

  .page-index .hero-logo-stage {
    width: 100% !important;
    height: clamp(280px, 80vw, 360px) !important;
    max-width: 420px !important;
    margin: 0 auto !important;
    overflow: visible !important;
  }

  .page-index .hero-logo--large {
    width: min(78vw, 340px) !important;
    right: -24px !important;
    top: 0 !important;
  }

  .page-index .hero-logo--medium {
    width: min(36vw, 150px) !important;
    left: 12px !important;
    top: 52% !important;
  }

  .page-index .hero-logo--small {
    width: min(13vw, 52px) !important;
    left: 4px !important;
    top: 35% !important;
  }
}

@media (max-width: 480px) {
  .page-index .hero-section {
    padding-top: 18px !important;
  }

  .page-index .hero-container {
    gap: 16px !important;
  }

  .page-index .hero-logo-stage {
    height: clamp(250px, 78vw, 300px) !important;
  }

  .page-index .hero-logo--large {
    width: min(76vw, 282px) !important;
    right: -14px !important;
  }

  .page-index .hero-logo--medium {
    width: min(34vw, 126px) !important;
    left: 10px !important;
    top: 53% !important;
  }

  .page-index .hero-logo--small {
    width: min(12vw, 44px) !important;
    left: 4px !important;
    top: 35% !important;
  }
}

@media (max-width: 768px) {
  .store-products-images,
  .store-products-list {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px !important;
    padding: 12px 0 !important;
  }
}

@media (max-width: 480px) {
  .store-products-images,
  .store-products-list {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
  }

  /* Slightly taller image slot so weapon images breathe */
  .product-card__image-wrapper,
  article.product .image-link {
    aspect-ratio: 4 / 3 !important;
  }
}


/* ================================================================
   2. PACKAGE PAGE — Media slider + breadcrumb on mobile

   GOAL: Match the PC experience (image 2) exactly:
   - Same 16:9 aspect ratio box
   - object-fit:cover so gun fills the frame edge-to-edge (matches PC)
   - Perfect circle nav buttons that can't be squashed
   - Single-line horizontal breadcrumb on all orientations

   ROOT CAUSE of previous glitch: two nested aspect-ratio boxes
   (viewport + container both had 16/9) caused height mismatch.
   FIX: viewport owns the ratio; container fills it via absolute inset.
   ================================================================ */

/* ── Portrait mobile ── */
@media (max-width: 768px) and (orientation: portrait) {

  /* Viewport: owns the size */
  .store-product-full .product-media .media-viewport,
  .media-viewport {
    aspect-ratio: 16 / 9 !important;
    border-radius: 12px !important;
    overflow: hidden !important;
    border: none !important;
    background: #0a0a0a !important;
    position: relative !important;
    width: 100% !important;
  }

  /* Container: fill viewport 100% — no own aspect-ratio */
  .media-slider-container {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    aspect-ratio: unset !important;
    border-radius: 0 !important;
    background: #0a0a0a !important;
    overflow: hidden !important;
  }

  .single-media {
    aspect-ratio: 16 / 9 !important;
    border-radius: 12px !important;
    background: #0a0a0a !important;
    overflow: hidden !important;
    border: none !important;
  }

  /* Images: cover fills the frame exactly like PC view */
  .media-content {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center !important;
    padding: 0 !important;
    background: #0a0a0a !important;
  }

  .single-media .media-content {
    object-fit: cover !important;
    object-position: center !important;
    padding: 0 !important;
  }

  /* Nav buttons: all 6 dimension props locked → guaranteed perfect circle */
  .slider-nav {
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    min-height: 36px !important;
    max-width: 36px !important;
    max-height: 36px !important;
    border-radius: 50% !important;
    background: rgba(10, 10, 12, 0.70) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    border: 1px solid rgba(255,255,255,0.15) !important;
    box-shadow: 0 2px 10px rgba(0,0,0,0.5) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    padding: 0 !important;
    box-sizing: border-box !important;
  }

  .slider-nav--prev { left: 10px !important; right: auto !important; }
  .slider-nav--next { right: 10px !important; left: auto !important; }

  .slider-nav svg {
    width: 14px !important;
    height: 14px !important;
    flex-shrink: 0 !important;
    stroke-width: 2.5 !important;
    display: block !important;
  }

  .slider-nav:active {
    transform: translateY(-50%) scale(0.88) !important;
    background: rgba(10,10,12,0.9) !important;
  }

  /* Pagination dots */
  .slider-indicators {
    bottom: 10px !important;
    padding: 6px 10px !important;
    gap: 5px !important;
  }

  .slider-indicator {
    width: 7px !important;
    height: 7px !important;
    min-width: unset !important;
    min-height: unset !important;
    padding: 0 !important;
    border-radius: 50% !important;
  }

  /* Thumbnails */
  .media-thumbs {
    gap: 5px !important;
    margin-top: 8px !important;
  }

  .thumb {
    width: 52px !important;
    height: 52px !important;
    border-radius: 6px !important;
    flex-shrink: 0 !important;
  }
}

/* Landscape on tablet/phone: same treatment */
@media (max-width: 960px) and (orientation: landscape) {

  .store-product-full .product-media .media-viewport,
  .media-viewport {
    aspect-ratio: 16 / 9 !important;
    border-radius: 12px !important;
    overflow: hidden !important;
    border: none !important;
    position: relative !important;
    width: 100% !important;
  }

  .media-slider-container {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    aspect-ratio: unset !important;
    border-radius: 0 !important;
  }

  .media-content {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center !important;
    padding: 0 !important;
  }

  .slider-nav {
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    min-height: 36px !important;
    max-width: 36px !important;
    max-height: 36px !important;
    border-radius: 50% !important;
  }
}

/* ── Breadcrumb rules live in package.html <style> block ──
   They are defined there so they load after all external stylesheets
   and naturally override shared.ccs / generic.html without !important. */


/* ================================================================
   3. FEATURE CARDS — Fix "Optimized" card hover flash
   Root cause: generic.ccs applies a white drop-shadow to ALL
   .feature-card:hover .feature-icon svg, which fires BEFORE the
   per-card colour rule in index.html, causing a white→yellow flash.
   Fix: neutralise the generic white glow, then restate each colour.
   ================================================================ */

/* Cancel the conflicting generic white glow for this section */
.features-section .feature-card:hover .feature-icon svg,
.features-section .feature-card:hover .feature-icon i {
  filter: none !important;
  transform: none !important;
}

/* Per-card colour rules — all transitions start from the base state */
.features-section .feature-icon svg,
.features-section .feature-icon i {
  transition: stroke 0.25s ease, fill 0.25s ease, filter 0.25s ease !important;
}

/* Weapons — red */
.feature-card--weapons:hover .feature-icon svg {
  stroke: #ef4444 !important;
  filter: drop-shadow(0 0 6px rgba(239,68,68,0.6)) drop-shadow(0 0 12px rgba(239,68,68,0.3)) !important;
}

/* Weapons uses fill on path, not stroke */
.feature-card--weapons .feature-icon svg path {
  transition: fill 0.25s ease !important;
}
.feature-card--weapons:hover .feature-icon svg path {
  fill: #ef4444 !important;
}

/* Clothing — purple */
.feature-card--clothing:hover .feature-icon svg {
  stroke: #a855f7 !important;
  filter: drop-shadow(0 0 6px rgba(168,85,247,0.6)) drop-shadow(0 0 12px rgba(168,85,247,0.3)) !important;
}

/* Props — blue */
.feature-card--props:hover .feature-icon svg {
  stroke: #3b82f6 !important;
  filter: drop-shadow(0 0 6px rgba(59,130,246,0.6)) drop-shadow(0 0 12px rgba(59,130,246,0.3)) !important;
}

/* Optimized / Performance — yellow (the one that was flashing) */
.feature-card--performance:hover .feature-icon svg {
  stroke: #FFD700 !important;
  filter: drop-shadow(0 0 6px rgba(255,215,0,0.6)) drop-shadow(0 0 12px rgba(255,215,0,0.3)) !important;
}


/* ================================================================
   4. FORMS & INPUTS — Prevent iOS auto-zoom on focus (< 16px = zoom)
   ================================================================ */

@media (max-width: 768px) {
  input[type="text"],
  input[type="email"],
  input[type="number"],
  input[type="search"],
  textarea,
  select,
  .wf-search,
  .wf-sort {
    font-size: 16px !important;
  }
}


/* ================================================================
   5. TOUCH TARGETS — 44×44 minimum
   ================================================================ */

@media (pointer: coarse) {
  a, button, [role="button"], .wf-tag, .wf-filter-btn {
    min-height: 44px !important;
  }

  /* Exclude tiny pagination dots */
  .slider-indicator {
    min-height: unset !important;
    min-width: unset !important;
  }
}


/* ================================================================
   6. CATEGORY FILTER BAR — Stack neatly on small screens
   ================================================================ */

@media (max-width: 640px) {
  .wf-bar {
    flex-direction: column !important;
    gap: 8px !important;
    padding-top: 16px !important;
  }

  .wf-bar__right {
    order: 1 !important;
    width: 100% !important;
    display: flex !important;
    gap: 8px !important;
    justify-content: space-between !important;
  }

  .wf-bar__left {
    order: 2 !important;
    width: 100% !important;
  }

  .wf-sort-wrap { flex: 1 !important; }
  .wf-sort { width: 100% !important; }
  .wf-search-wrap { max-width: 100% !important; }
  .wf-bar__count { display: none !important; }
}


/* ================================================================
   7. DISCOUNT TOAST — Mobile position
   ================================================================ */

@media (max-width: 768px) {
  .discount-toast {
    left: 8px !important;
    right: 8px !important;
    width: auto !important;
    transform: translateY(140%) !important;
  }

  .discount-toast.is-visible {
    transform: translateY(0) !important;
  }
}


/* ================================================================
   8. REDUCED MOTION
   ================================================================ */

@media (prefers-reduced-motion: reduce) {
  .product-card,
  article.product {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}


/* ================================================================
   9. FEATURES SECTION — 2×2 grid on portrait mobile
   ================================================================ */

@media (max-width: 640px) {
  .features-section .features-container {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 20px 16px !important;
    padding: 0 16px !important;
    justify-items: start !important;
    align-items: start !important;
  }

  .features-section .feature-card {
    width: 100% !important;
    min-width: 0 !important;
    flex-wrap: nowrap !important;
    align-items: flex-start !important;
    gap: 12px !important;
  }

  .features-section .feature-icon {
    flex-shrink: 0 !important;
    width: 38px !important;
    height: 38px !important;
    min-width: 38px !important;
  }

  .features-section .feature-content {
    max-width: none !important;
    flex: 1 1 auto !important;
  }

  .features-section .feature-title {
    font-size: 13px !important;
    margin-bottom: 4px !important;
  }

  .features-section .feature-description {
    font-size: 11px !important;
    line-height: 1.5 !important;
  }
}


/* ================================================================
   10. PRODUCT CARD GRID — Portrait phone: single column,
   landscape phones / tablets: 2 columns.
   ================================================================ */

/* 2-col on tablets and landscape phones */
@media (max-width: 768px) {
  .store-products-images,
  .store-products-list {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px !important;
    padding: 12px 0 !important;
  }
}

/* Single column in portrait phone mode */
@media (max-width: 480px) and (orientation: portrait) {
  .store-products-images,
  .store-products-list {
    grid-template-columns: 1fr !important;
    gap: 14px !important;
  }
}

/* 2-col when phone is landscape */
@media (max-width: 812px) and (orientation: landscape) {
  .store-products-images,
  .store-products-list {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px !important;
  }
}

/* Product card image wrapper — consistent proportions */
@media (max-width: 768px) {
  .product-card__image-wrapper {
    aspect-ratio: 16 / 9 !important;
    width: 100% !important;
    overflow: hidden !important;
    display: block !important;
    position: relative !important;
    border-radius: 10px 10px 0 0 !important;
    flex-shrink: 0 !important;
  }

  .product-card__image-link {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    overflow: hidden !important;
    border-radius: 10px 10px 0 0 !important;
  }

  /* FILL the card — object-fit:cover so the weapon fills edge to edge.
     The focal point (object-position) from the inline style is preserved
     because we don't override it here (no object-position rule). */
  img.product-card__image {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    /* No object-position — lets the Twig inline focal point stay intact */
    display: block !important;
    padding: 0 !important;
    background: #1c1c1c !important;
    border-radius: 10px 10px 0 0 !important;
    /* Smooth zoom transition */
    transition: transform 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94) !important;
    transform: scale(1) !important;
    will-change: transform !important;
  }

  /* Zoom on hover (desktop-style pointer) */
  .product-card__image-link:hover img.product-card__image {
    transform: scale(1.07) !important;
  }

  /* Zoom on tap/press (mobile touch) */
  .product-card__image-link:active img.product-card__image {
    transform: scale(1.07) !important;
  }

  /* Keep the hover overlay visible on top of the zoom */
  .product-card__hover-overlay {
    z-index: 2 !important;
    position: absolute !important;
    inset: 0 !important;
  }
}
