/* =========================================================
   Zöldbeton V7 MASTER – Web Production 1.1
   Sprint 4.3 – Unified Mobile Shell
   Egységes mobil fejléc + hamburger menü minden oldalhoz.
   Desktop nézet változatlan.
   ========================================================= */

.zb-mobile-shell-header,
.zb-mobile-shell-overlay,
.zb-mobile-shell-drawer {
  display: none;
}

@media (max-width: 900px) {
  html,
  body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
    touch-action: manipulation;
  }

  body.zb-menu-open {
    overflow: hidden !important;
  }

  .zb-mobile-shell-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: calc(56px + env(safe-area-inset-top));
    padding: env(safe-area-inset-top) 14px 0 14px;
    background: rgba(255,255,255,.96);
    border-bottom: 1px solid rgba(0,115,61,.14);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    z-index: 9000;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 6px 22px rgba(17,24,39,.05);
  }

  .zb-mobile-shell-button {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    border: 1px solid rgba(0,115,61,.18);
    background: #fff;
    color: #007a3d;
    font-size: 24px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 18px rgba(16,70,43,.06);
  }

  .zb-mobile-shell-brand {
    font-size: 15px;
    font-weight: 800;
    color: #111827;
    letter-spacing: -.02em;
  }

  .zb-mobile-shell-overlay {
    position: fixed;
    inset: 0;
    background: rgba(17,24,39,.44);
    z-index: 8800;
    opacity: 0;
    pointer-events: none;
    transition: opacity .24s ease;
  }

  body.zb-menu-open .zb-mobile-shell-overlay {
    display: block;
    opacity: 1;
    pointer-events: auto;
  }

  .zb-mobile-shell-drawer {
    position: fixed;
    top: 0;
    left: 0;
    width: min(82vw, 318px);
    height: 100dvh;
    padding: calc(18px + env(safe-area-inset-top)) 14px 18px;
    background: rgba(255,255,255,.985);
    border-right: 1px solid rgba(0,115,61,.14);
    z-index: 8900;
    display: flex;
    flex-direction: column;
    gap: 14px;
    transform: translateX(-105%);
    transition: transform .28s cubic-bezier(.22,.61,.36,1);
    box-shadow: 18px 0 50px rgba(17,24,39,.20);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  body.zb-menu-open .zb-mobile-shell-drawer {
    transform: translateX(0);
  }

  .zb-mobile-shell-logo {
    min-height: 44px;
    display: flex;
    align-items: center;
    padding: 2px 6px 8px;
  }

  .zb-mobile-shell-logo img {
    max-width: 160px;
    max-height: 42px;
    object-fit: contain;
  }

  .zb-mobile-shell-logo strong {
    color: #007a3d;
    font-size: 19px;
    font-weight: 900;
  }

  .zb-mobile-shell-nav,
  .zb-mobile-shell-drawer nav,
  .zb-mobile-shell-drawer .nav,
  .zb-mobile-shell-drawer .sidebar-nav {
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .zb-mobile-shell-drawer a,
  .zb-mobile-shell-drawer .nav-item,
  .zb-mobile-shell-drawer .v7-nav-item {
    min-height: 46px !important;
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    padding: 0 14px !important;
    border-radius: 12px !important;
    text-decoration: none !important;
    color: #07131f !important;
    font-size: 14px !important;
    font-weight: 750 !important;
    line-height: 1.15 !important;
    border: 1px solid transparent !important;
    background: transparent !important;
  }

  .zb-mobile-shell-drawer a.active,
  .zb-mobile-shell-drawer .active,
  .zb-mobile-shell-drawer a[aria-current="page"] {
    color: #007a3d !important;
    background: #eef4ef !important;
    border-color: rgba(0,115,61,.10) !important;
    box-shadow: inset 4px 0 0 #008a4a;
  }

  .zb-mobile-shell-drawer a span,
  .zb-mobile-shell-drawer .nav-icon,
  .zb-mobile-shell-drawer .v7-nav-icon {
    width: 20px !important;
    min-width: 20px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: inherit !important;
  }

  .zb-mobile-shell-note {
    margin-top: auto;
    border-top: 1px solid rgba(0,115,61,.14);
    padding: 16px 10px 2px;
    color: #66756d;
    font-size: 13px;
    line-height: 1.35;
  }

  /* Old desktop sidebars are hidden on mobile. Drawer uses cloned navigation. */
  body.zb-mobile-shell-ready .app-shell > .sidebar,
  body.zb-mobile-shell-ready .app > .sidebar,
  body.zb-mobile-shell-ready aside.sidebar:not(.zb-mobile-shell-drawer),
  body.zb-mobile-shell-ready .v7-sidebar {
    display: none !important;
  }

  body.zb-mobile-shell-ready .app-shell,
  body.zb-mobile-shell-ready .app,
  body.zb-mobile-shell-ready .v7-shell {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    min-height: 100vh;
    padding-top: calc(56px + env(safe-area-inset-top)) !important;
    grid-template-columns: 1fr !important;
  }

  body.zb-mobile-shell-ready .content,
  body.zb-mobile-shell-ready main,
  body.zb-mobile-shell-ready .v7-main,
  body.zb-mobile-shell-ready .page-main,
  body.zb-mobile-shell-ready .wrap {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
  }

  /* Avoid old duplicate mobile headers from earlier sprints */
  .zb-mobile-header:not(.zb-mobile-shell-header),
  .zb-mobile-drawer:not(.zb-mobile-shell-drawer),
  .zb-mobile-overlay:not(.zb-mobile-shell-overlay) {
    display: none !important;
  }
}


/* =========================================================
   Sprint 4.3.2 – Unified Mobile Shell Hotfix
   - Commercial JS stabilizálás támogatása
   - Árlista mobil táblázat igazítás
   ========================================================= */
@media (max-width: 900px) {
  /* A mobil shell overlay csak nyitott menünél fogjon kattintást. */
  .zb-mobile-shell-overlay[aria-hidden="true"] {
    display: none !important;
    pointer-events: none !important;
  }

  /* Árlista: ne csússzon ki jobbra. */
  .price-table {
    width: 100% !important;
    max-width: 100% !important;
    table-layout: fixed !important;
    border-collapse: collapse !important;
    font-size: 11px !important;
  }

  .price-table th,
  .price-table td {
    padding: 9px 7px !important;
    vertical-align: top !important;
    overflow-wrap: anywhere !important;
    word-break: normal !important;
  }

  .price-table th:nth-child(1),
  .price-table td:nth-child(1) { width: 34% !important; }

  .price-table th:nth-child(2),
  .price-table td:nth-child(2) { width: 21% !important; }

  .price-table th:nth-child(3),
  .price-table td:nth-child(3) { width: 18% !important; }

  .price-table th:nth-child(4),
  .price-table td:nth-child(4) { width: 14% !important; }

  .price-table th:nth-child(5),
  .price-table td:nth-child(5) {
    width: 13% !important;
    font-size: 10px !important;
  }

  .panel {
    width: calc(100% - 28px) !important;
    max-width: calc(100% - 28px) !important;
    margin-left: auto !important;
    margin-right: auto !important;
    overflow: hidden !important;
  }

  .actions {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }
}


/* =========================================================
   Sprint 4.3.2b – Commercial Button + Árlista Stability Patch
   ========================================================= */
@media (max-width: 900px) {
  /* A zárt overlay soha ne takarja a gombokat. */
  .zb-mobile-shell-overlay[aria-hidden="true"] {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    display: none !important;
  }
  body:not(.zb-menu-open) .zb-mobile-shell-overlay {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }
  body.zb-menu-open .zb-mobile-shell-overlay {
    visibility: visible !important;
  }

  /* Commercial gombok mindig kattinthatóak legyenek a shell alatt is. */
  body.zb-mobile-shell-ready .app,
  body.zb-mobile-shell-ready .content,
  body.zb-mobile-shell-ready .panel,
  body.zb-mobile-shell-ready .panel-body,
  body.zb-mobile-shell-ready button,
  body.zb-mobile-shell-ready input,
  body.zb-mobile-shell-ready select,
  body.zb-mobile-shell-ready textarea,
  body.zb-mobile-shell-ready label {
    pointer-events: auto;
  }

  /* Árlista végleges mobil középre igazítás */
  body.zb-mobile-shell-ready .panel {
    box-sizing: border-box !important;
  }
  body.zb-mobile-shell-ready .price-table {
    min-width: 0 !important;
    margin: 0 auto !important;
  }
  body.zb-mobile-shell-ready .price-table small {
    font-size: 10px !important;
    line-height: 1.15 !important;
  }
}
