/**
 * FILE: assets/css/patch-mobile.css
 * VERSION: 1.0.7 | 2026-01-17 (Europe/Berlin)
 * SCOP:
 *  - patch-uri STRICT pentru mobil
 *  - NU atinge PC
 *  - + WHEEL MODE (doar cand body are clasa wheel-mobile)
 *  - FIX 1.0.7: wheel “deformat” -> reset layout desktop (flex/transform) doar in wheel + fix double scrollbar
 */

/* ======== (PASTRAT 1:1 din 1.0.6) ======== */

/* 1) Header “invizibil” (dar păstrează logo + hamburger) */
@media (max-width: 1024px) {
  .site-header {
    background: rgba(0,0,0,0.10) !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  .site-header,
  .site-brand,
  .nav-toggle,
  .main-nav,
  .nav-overlay {
    z-index: 5000 !important;
  }
}

/* 2) Pe index/submeniu: împinge conținutul sub header */
@media (max-width: 1024px) {
  body.home-page .coverflow-wrapper,
  body.submeniu-page .coverflow-wrapper {
    padding-top: calc(78px + env(safe-area-inset-top)) !important;
  }

  body.home-page .info,
  body.submeniu-page .info {
    top: calc(92px + env(safe-area-inset-top)) !important;
    width: min(92vw, 980px) !important;
    padding: 0 12px !important;
  }

  body.home-page .info h2,
  body.submeniu-page .info h2 {
    font-size: clamp(18px, 5vw, 26px) !important;
    line-height: 1.08 !important;
    margin-bottom: 8px !important;
  }

  body.home-page .info p,
  body.submeniu-page .info p {
    font-size: clamp(13px, 3.6vw, 16px) !important;
    line-height: 1.25 !important;
    opacity: 0.92 !important;
  }
}

/* 3) Landscape: info mai lat + mai puține rânduri */
@media (max-width: 1024px) and (orientation: landscape) {
  body.home-page .info,
  body.submeniu-page .info {
    width: min(96vw, 1200px) !important;
    top: calc(78px + env(safe-area-inset-top)) !important;
  }

  body.home-page .info p,
  body.submeniu-page .info p {
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
  }
}

/* =========================================================
   4) COVERFLOW MOBILE – CONTROL CU VARIABILE (ramane)
   ========================================================= */
@media (max-width: 1024px) {
  body.home-page,
  body.submeniu-page {
    --cf-x: -100px;
    --cf-y: -18px;

    --ui-x: -100px;

    --card-w: 245px;
    --card-h: 245px;

    --label-bottom: 16px;
    --nav-inset: 14px;
  }

  html, body {
    overflow-x: hidden !important;
    overscroll-behavior-x: none !important;
  }

  body.home-page .coverflow-wrapper,
  body.submeniu-page .coverflow-wrapper {
    width: 100% !important;
    max-width: none !important;
    overflow-x: hidden !important;
  }

  body.home-page .coverflow-container,
  body.submeniu-page .coverflow-container {
    width: 100% !important;
    max-width: none !important;
    overflow-x: hidden !important;
    overflow-y: visible !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  body.home-page .coverflow,
  body.submeniu-page .coverflow {
    position: relative !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow: visible !important;
    left: 50% !important;
    margin: 0 !important;
    transform: translateX(calc(-50% + var(--cf-x))) translateY(var(--cf-y)) !important;
  }

  body.home-page .coverflow-item,
  body.submeniu-page .coverflow-item {
    width: var(--card-w) !important;
    height: var(--card-h) !important;

    left: 50% !important;
    transform: translateX(-50%) !important;
  }

  body.home-page .coverflow-item .cover,
  body.submeniu-page .coverflow-item .cover {
    overflow: hidden !important;
  }

  body.home-page .coverflow-item .card-label,
  body.submeniu-page .coverflow-item .card-label {
    top: auto !important;
    bottom: var(--label-bottom) !important;
    left: 18px !important;
    right: 18px !important;
    text-align: left !important;
    z-index: 9999 !important;
  }

  body.home-page .coverflow-item .card-label p,
  body.submeniu-page .coverflow-item .card-label p {
    display: block !important;
    opacity: 0.92 !important;
  }

  body.home-page .info,
  body.submeniu-page .info {
    left: 50% !important;
    transform: translateX(calc(-50% + var(--ui-x))) !important;
  }

  body.home-page .dots-container,
  body.submeniu-page .dots-container,
  body.home-page .play-pause-button,
  body.submeniu-page .play-pause-button {
    left: 50% !important;
    transform: translateX(calc(-50% + var(--ui-x))) !important;
  }

  body.home-page .nav-button,
  body.submeniu-page .nav-button {
    transform: translateY(-50%) !important;
  }

  body.home-page .nav-button.prev,
  body.submeniu-page .nav-button.prev {
    left: max(6px, var(--nav-inset)) !important;
  }

  body.home-page .nav-button.next,
  body.submeniu-page .nav-button.next {
    right: max(6px, var(--nav-inset)) !important;
  }
}

/* 5) PORTRAIT */
@media (max-width: 768px) and (orientation: portrait) {
  body.home-page,
  body.submeniu-page {
    --cf-x: -100px;
    --cf-y: -24px;

    --ui-x: -100px;

    --card-w: 150px;
    --card-h: 150px;

    --label-bottom: 16px;
    --nav-inset: 14px;
  }

  body.home-page .info,
  body.submeniu-page .info {
    top: 110px !important;
  }

  body.home-page .coverflow-item .card-label h3,
  body.submeniu-page .coverflow-item .card-label h3 {
    font-size: 18px !important;
    line-height: 1.15 !important;
    margin-bottom: 6px !important;
  }

  body.home-page .coverflow-item .card-label p,
  body.submeniu-page .coverflow-item .card-label p {
    font-size: 13px !important;
    line-height: 1.25 !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 3 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
  }
}

/* 6) LANDSCAPE */
@media (max-width: 1024px) and (orientation: landscape) {
  body.home-page,
  body.submeniu-page {
    --cf-x: -100px;
    --cf-y: -10px;

    --ui-x: -100px;

    --card-w: 160px;
    --card-h: 160px;

    --label-bottom: 10px;
    --nav-inset: 10px;
  }

  body.home-page .coverflow-item .card-label h3,
  body.submeniu-page .coverflow-item .card-label h3 {
    font-size: 14px !important;
    line-height: 1.10 !important;
    margin-bottom: 4px !important;
  }

  body.home-page .coverflow-item .card-label p,
  body.submeniu-page .coverflow-item .card-label p {
    font-size: 11px !important;
    line-height: 1.20 !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
  }

  .site-header,
  .main-nav,
  .nav-overlay {
    max-width: 100vw !important;
  }
}

/* =========================================================
   WHEEL MODE (MOBILE ONLY) – activ doar cand JS pune body.wheel-mobile
   - nu afecteaza desktop
   - nu rupe coverflow: doar suprascrie strict ce trebuie
   ========================================================= */
@media (max-width: 1024px) {

  body.wheel-mobile.home-page .coverflow,
  body.wheel-mobile.submeniu-page .coverflow {
    /* anulam offsetul vechi cf-x/cf-y in wheel */
    left: 0 !important;
    transform: none !important;
    width: 100% !important;
    height: 100% !important;
  }

  body.wheel-mobile.home-page .coverflow-container,
  body.wheel-mobile.submeniu-page .coverflow-container {
    position: relative !important;
    height: calc(100vh - 180px) !important;
    min-height: 420px !important;
    overflow-x: hidden !important;
    overflow-y: visible !important;
  }

  /* itemurile in wheel sunt controlate de JS (left/top/transform) */
  body.wheel-mobile.home-page .coverflow-item,
  body.wheel-mobile.submeniu-page .coverflow-item {
    left: auto !important;
    top: auto !important;
    transform: none !important; /* JS pune transform complet */
    will-change: transform, opacity !important;
  }

  /* highlight pe activ */
  body.wheel-mobile.home-page .coverflow-item.active .cover,
  body.wheel-mobile.submeniu-page .coverflow-item.active .cover {
    outline: 2px solid rgba(59,130,246,0.85) !important;
    box-shadow: 0 0 0 6px rgba(59,130,246,0.18), 0 12px 28px rgba(0,0,0,0.45) !important;
    filter: saturate(1.05) contrast(1.04) !important;
  }

  /* pe wheel ascund dots + play (raman prev/next) */
  body.wheel-mobile.home-page .dots-container,
  body.wheel-mobile.submeniu-page .dots-container,
  body.wheel-mobile.home-page .play-pause-button,
  body.wheel-mobile.submeniu-page .play-pause-button {
    display: none !important;
  }

  /* prev/next in ecran */
  body.wheel-mobile.home-page .nav-button.prev,
  body.wheel-mobile.submeniu-page .nav-button.prev {
    left: 8px !important;
  }

  body.wheel-mobile.home-page .nav-button.next,
  body.wheel-mobile.submeniu-page .nav-button.next {
    right: 8px !important;
  }
}

@media (max-width: 768px) and (orientation: portrait) {
  body.wheel-mobile.home-page .coverflow-container,
  body.wheel-mobile.submeniu-page .coverflow-container {
    height: calc(100vh - 190px) !important;
    min-height: 460px !important;
  }
}

@media (max-width: 1024px) and (orientation: landscape) {
  body.wheel-mobile.home-page .coverflow-container,
  body.wheel-mobile.submeniu-page .coverflow-container {
    height: calc(100vh - 140px) !important;
    min-height: 340px !important;
  }
}

/* =========================================================
   WHEEL MOBILE (HOME + SUBMENIU) – SAFE, NO DESKTOP IMPACT
   (PASTRAT din 1.0.6)
   ========================================================= */
@media (max-width: 1024px) {

  body.wheel-mobile.home-page .coverflow-wrapper,
  body.wheel-mobile.submeniu-page .coverflow-wrapper {
    width: 100% !important;
    max-width: none !important;
    overflow-x: hidden !important;
  }

  body.wheel-mobile.home-page .coverflow-container,
  body.wheel-mobile.submeniu-page .coverflow-container {
    position: relative !important;
    width: 100% !important;
    max-width: none !important;
    overflow: hidden !important; /* wheel sta in centru, nu vrem scrollbar */
    touch-action: pan-y !important; /* vertical swipe ok */
  }

  body.wheel-mobile.home-page .coverflow,
  body.wheel-mobile.submeniu-page .coverflow {
    position: relative !important;
    width: 100% !important;
    height: clamp(360px, 62vh, 560px) !important;
    left: 0 !important;
    transform: none !important;
    margin: 0 !important;
    overflow: visible !important;
  }

  body.wheel-mobile.home-page .coverflow-item,
  body.wheel-mobile.submeniu-page .coverflow-item {
    position: absolute !important;
    left: 50% !important;
    top: 50% !important;
    transform: translate(-50%, -50%) !important;
    will-change: transform, opacity !important;
  }

  body.wheel-mobile.home-page .coverflow-item,
  body.wheel-mobile.submeniu-page .coverflow-item {
    width: 190px !important;
    height: 190px !important;
  }

  @media (max-width: 768px) and (orientation: portrait) {
    body.wheel-mobile.home-page .coverflow-item,
    body.wheel-mobile.submeniu-page .coverflow-item {
      width: 210px !important;
      height: 210px !important;
    }
  }

  @media (max-width: 1024px) and (orientation: landscape) {
    body.wheel-mobile.home-page .coverflow,
    body.wheel-mobile.submeniu-page .coverflow {
      height: clamp(280px, 70vh, 420px) !important;
    }

    body.wheel-mobile.home-page .coverflow-item,
    body.wheel-mobile.submeniu-page .coverflow-item {
      width: 160px !important;
      height: 160px !important;
    }
  }

  body.wheel-mobile.home-page .coverflow-item .cover,
  body.wheel-mobile.submeniu-page .coverflow-item .cover {
    overflow: hidden !important;
  }

  body.wheel-mobile.home-page .coverflow-item .card-label,
  body.wheel-mobile.submeniu-page .coverflow-item .card-label {
    position: absolute !important;
    left: 14px !important;
    right: 14px !important;
    bottom: 12px !important;
    top: auto !important;
    text-align: left !important;
    z-index: 50 !important;
  }

  body.wheel-mobile.home-page .coverflow-item .card-label p,
  body.wheel-mobile.submeniu-page .coverflow-item .card-label p {
    display: block !important;
    opacity: 0.92 !important;
  }

  body.wheel-mobile.home-page .coverflow-item.active .cover,
  body.wheel-mobile.submeniu-page .coverflow-item.active .cover {
    outline: 2px solid rgba(59, 130, 246, 0.85) !important;
    box-shadow: 0 0 0 6px rgba(59, 130, 246, 0.18) !important;
  }

  body.wheel-mobile.home-page .dots-container,
  body.wheel-mobile.submeniu-page .dots-container,
  body.wheel-mobile.home-page .play-pause-button,
  body.wheel-mobile.submeniu-page .play-pause-button {
    display: none !important;
  }

  body.wheel-mobile.home-page .nav-button,
  body.wheel-mobile.submeniu-page .nav-button {
    top: 50% !important;
    transform: translateY(-50%) !important;
    opacity: 0.85 !important;
  }

  body.wheel-mobile.home-page .nav-button.prev,
  body.wheel-mobile.submeniu-page .nav-button.prev {
    left: 10px !important;
  }

  body.wheel-mobile.home-page .nav-button.next,
  body.wheel-mobile.submeniu-page .nav-button.next {
    right: 10px !important;
  }

  body.wheel-mobile.home-page .info,
  body.wheel-mobile.submeniu-page .info {
    position: relative !important;
    top: 0 !important;
    margin: 0 auto 10px auto !important;
    width: min(92vw, 980px) !important;
    left: auto !important;
    transform: none !important;
    padding: 0 12px !important;
    z-index: 100 !important;
  }
}

/* =========================================================
   FIX FINAL 1.0.7 (NU atinge desktop):
   - index.css are .coverflow-wrapper flex center + .coverflow transform translateY(-40px)
   - in wheel asta strica cercul -> resetam DOAR cand body.wheel-mobile
   - eliminam double scrollbar (un singur context)
   ========================================================= */
@media (max-width: 1024px) {

  /* 1) elimina 2 scrollbars: cand wheel e ON, nu vrem scroll pe body + scroll intern */
  html body.wheel-mobile.home-page,
  html body.wheel-mobile.submeniu-page {
    height: 100svh !important;
    overflow: hidden !important;
  }

  /* 2) wrapper-ul nu mai centreaza vertical ca desktop; wheel are “arena” proprie */
  body.wheel-mobile.home-page .coverflow-wrapper,
  body.wheel-mobile.submeniu-page .coverflow-wrapper {
    height: 100svh !important;
    min-height: 100svh !important;
    align-items: flex-start !important;
    justify-content: flex-start !important;
    padding-top: calc(78px + env(safe-area-inset-top)) !important;
  }

  /* 3) container-ul devine “scena” (fara inca un scroll) */
  body.wheel-mobile.home-page .coverflow-container,
  body.wheel-mobile.submeniu-page .coverflow-container {
    height: calc(100svh - (78px + env(safe-area-inset-top))) !important;
    min-height: 0 !important;
    overflow: hidden !important;
  }

  /* 4) anuleaza complet transform-ul vechi din index.css (translateY(-40px)) */
  body.wheel-mobile.home-page .coverflow,
  body.wheel-mobile.submeniu-page .coverflow {
    display: block !important;
    transform: none !important;
    left: 0 !important;
    margin-top: 10px !important;
    height: clamp(420px, 66vh, 640px) !important;
  }

  /* 5) ca sa nu taie cercul */
  body.wheel-mobile.home-page .coverflow,
  body.wheel-mobile.submeniu-page .coverflow {
    overflow: visible !important;
  }
}