/* =========================================================
   Zöldbeton V7 MASTER – Web Production 1.1
   Sprint 4.2 – Executive Mobile Workspace Rebuild
   Mobile-only layer. Desktop Executive layout remains unchanged.
   ========================================================= */

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

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

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

  .zb-mobile-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, 0.96);
    border-bottom: 1px solid rgba(0, 115, 61, 0.14);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    z-index: 5000;
    display: flex;
    align-items: center;
    gap: 12px;
  }

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

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

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

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

  .app {
    display: block !important;
    width: 100%;
    max-width: 100%;
    min-height: 100vh;
    padding-top: calc(56px + env(safe-area-inset-top));
  }

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

  body.zb-menu-open .sidebar {
    transform: translateX(0) !important;
  }

  .sidebar .logo {
    height: 44px !important;
    margin-bottom: 8px !important;
  }

  .sidebar .logo img {
    width: 150px !important;
    max-height: 42px !important;
  }

  .sidebar .nav {
    display: flex !important;
    gap: 6px !important;
    margin-top: 12px !important;
  }

  .sidebar .nav a {
    min-height: 46px !important;
    height: auto !important;
    padding: 8px 12px !important;
    border-radius: 12px !important;
    font-size: 13px !important;
    line-height: 1.15 !important;
    white-space: normal !important;
  }

  .sidebar .side-note {
    margin-top: auto !important;
    font-size: 12px !important;
    padding-top: 16px !important;
  }

  .main {
    width: 100% !important;
    max-width: 100% !important;
    padding: 14px 12px 28px !important;
    min-width: 0 !important;
  }

  .topbar {
    height: auto !important;
    min-height: 38px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 8px !important;
    margin-bottom: 12px !important;
  }

  .topbar .divider,
  .topbar .title {
    display: none !important;
  }

  .top-actions {
    margin-left: 0 !important;
    gap: 8px !important;
  }

  .pill {
    height: 34px !important;
    padding: 0 12px !important;
    font-size: 11px !important;
    border-radius: 11px !important;
    box-shadow: 0 8px 22px rgba(16, 70, 43, 0.06) !important;
  }

  .iconTop {
    font-size: 16px !important;
  }

  .bt {
    width: 34px !important;
    height: 34px !important;
    font-size: 11px !important;
  }

  .workspace {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 14px !important;
    width: 100% !important;
  }

  .panel {
    width: 100% !important;
    border-radius: 15px !important;
    overflow: hidden !important;
    box-shadow: 0 10px 28px rgba(17, 24, 39, 0.06) !important;
  }

  .panel-head {
    height: 46px !important;
    padding: 0 14px !important;
    font-size: 12px !important;
    letter-spacing: .01em !important;
  }

  .step {
    width: 24px !important;
    height: 24px !important;
    font-size: 12px !important;
  }

  .panel-body {
    padding: 13px 13px !important;
  }

  .product h2 {
    font-size: 20px !important;
    line-height: 1.15 !important;
    margin-bottom: 8px !important;
  }

  .prod-img {
    height: auto !important;
    min-height: 0 !important;
    padding: 10px !important;
    border-radius: 13px !important;
  }

  .prod-img img {
    width: 100% !important;
    max-width: 260px !important;
    height: auto !important;
    margin: 0 auto !important;
    display: block !important;
    object-fit: contain !important;
  }

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

  .price-box {
    min-height: 58px !important;
    padding: 10px 12px !important;
  }

  .price-box strong {
    font-size: 18px !important;
  }

  .spec-row,
  .mini-row {
    gap: 10px !important;
    font-size: 12px !important;
  }

  .catalogbar,
  .pickerbar {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
  }

  .addSelect,
  .calcLink,
  .addBtn,
  .greenBtn,
  .primary,
  .quote-button {
    width: 100% !important;
    min-height: 42px !important;
    justify-content: center !important;
    text-align: center !important;
  }

  .cart-table-wrap,
  .cart-table {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
  }

  .cart-table {
    min-width: 620px !important;
  }

  .logistics,
  .right,
  .summary,
  .bottom,
  .ctaBox {
    width: 100% !important;
    max-width: 100% !important;
  }

  .ship-options,
  .customer-two {
    grid-template-columns: 1fr !important;
  }

  .summary-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
  }

  .bottom {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 12px !important;
    margin-top: 14px !important;
  }

  .sumcell {
    border: 1px solid var(--line) !important;
    border-radius: 12px !important;
    padding: 10px 12px !important;
    min-height: 58px !important;
    min-width: 0 !important;
  }

  .sumcell small {
    line-height: 1.2 !important;
    overflow-wrap: normal !important;
  }

  .sumcell strong {
    white-space: nowrap !important;
  }

  .sumcell.gross strong {
    font-size: 24px !important;
  }

  .product-picker-card,
  .quote-modal-card {
    width: min(94vw, 720px) !important;
    max-height: 86dvh !important;
    border-radius: 16px !important;
    padding: 14px !important;
  }

  .product-picker-grid {
    grid-template-columns: 1fr !important;
  }

  .product-picker-item {
    grid-template-columns: 70px 1fr !important;
    min-height: 92px !important;
  }

  .product-picker-item img {
    width: 70px !important;
    height: 70px !important;
  }
}

@media (max-width: 390px) {
  .main {
    padding-left: 10px !important;
    padding-right: 10px !important;
  }
  .panel-body {
    padding: 11px !important;
  }
  .prod-img img {
    max-width: 230px !important;
  }
}


/* =========================================================
   Sprint 4.2.1 – Mobile Drawer Visibility Fix
   Creates a dedicated mobile drawer so the menu opens reliably.
   ========================================================= */
@media (max-width: 900px) {
  .sidebar {
    display: none !important;
  }

  .zb-mobile-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, 0.98);
    border-right: 1px solid rgba(0, 115, 61, 0.14);
    z-index: 5200;
    transform: translateX(-106%);
    transition: transform .28s cubic-bezier(.22,.61,.36,1);
    box-shadow: 18px 0 50px rgba(17, 24, 39, 0.22);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

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

  .zb-mobile-drawer-brand {
    display: flex;
    align-items: center;
    min-height: 48px;
    margin-bottom: 14px;
  }

  .zb-mobile-drawer-brand img {
    width: 150px;
    max-height: 42px;
    object-fit: contain;
  }

  .zb-mobile-drawer .nav {
    display: flex !important;
    flex-direction: column !important;
    gap: 7px !important;
    margin: 0 !important;
  }

  .zb-mobile-drawer .nav a,
  .zb-mobile-drawer .nav-item {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    min-height: 46px !important;
    padding: 9px 12px !important;
    border-radius: 13px !important;
    color: #111827 !important;
    text-decoration: none !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    line-height: 1.15 !important;
    background: transparent !important;
    border: 0 !important;
  }

  .zb-mobile-drawer .nav a.active,
  .zb-mobile-drawer .nav-item.active {
    background: #eaf4ef !important;
    color: #007a3d !important;
    box-shadow: inset 4px 0 0 #007a3d;
  }

  .zb-mobile-drawer .ico,
  .zb-mobile-drawer .nav span {
    width: 22px;
    min-width: 22px;
    text-align: center;
    color: #007a3d;
  }

  .zb-mobile-drawer-note {
    margin-top: 28px;
    padding-top: 16px;
    border-top: 1px solid rgba(0, 115, 61, 0.14);
    font-size: 12px;
    line-height: 1.35;
    color: #667280;
  }

  .zb-mobile-overlay {
    z-index: 5100 !important;
  }

  .zb-mobile-header {
    z-index: 5300 !important;
  }
}


/* Sprint 4.3.3 Commercial Logistics + Workflow Restore */
@media (max-width: 900px){
  .route-info b,.route-info span{word-break:break-word;}
  .ors-strip{grid-template-columns:1fr!important;}
  .ship-options label{min-height:38px;}
  .quote-modal-card{width:calc(100vw - 24px)!important;max-width:calc(100vw - 24px)!important;}
  .pdf-professional{width:100%!important;max-width:100%!important;overflow-x:hidden!important;}
  .pdf-product-grid,.pdf-two,.pdf-meta-grid{grid-template-columns:1fr!important;}
  .pdf-pro-table{font-size:11px!important;}
}

/* =========================================================
   Zöldbeton V7 MASTER – Mobile Professional 1.0
   2026-07-18 – valódi telefonos elrendezés (360–768 px)
   ========================================================= */
@media (max-width: 900px) {
  :root { --zb-mobile-gap: 10px; }

  html { min-width: 0 !important; }
  body {
    margin: 0 !important;
    min-width: 0 !important;
    width: 100% !important;
    max-width: 100vw !important;
    background: #eef4ef !important;
  }

  body > .app,
  .app,
  .main,
  .workspace,
  .workspace > *,
  .panel,
  .panel-body,
  .bottom,
  .summary,
  .ctaBox {
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  .app {
    display: block !important;
    grid-template-columns: none !important;
    margin: 0 !important;
    width: 100vw !important;
    max-width: 100vw !important;
  }

  .main {
    margin: 0 !important;
    padding: 10px var(--zb-mobile-gap) calc(24px + env(safe-area-inset-bottom)) !important;
    width: 100% !important;
    max-width: none !important;
  }

  .main > [data-v7-global-header] {
    width: 100% !important;
    max-width: none !important;
    margin: 0 0 10px !important;
  }

  .workspace {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    width: 100% !important;
    max-width: none !important;
    gap: 10px !important;
  }

  .panel {
    width: 100% !important;
    max-width: none !important;
    border-radius: 14px !important;
  }

  .panel-head {
    min-height: 44px !important;
    height: auto !important;
    padding: 9px 12px !important;
    font-size: 11.5px !important;
    line-height: 1.25 !important;
  }

  .panel-body { padding: 11px !important; }

  .product h2 {
    margin: 0 0 7px !important;
    font-size: clamp(18px, 5.2vw, 22px) !important;
  }

  .product .sub { font-size: 13px !important; }

  .prod-img {
    height: auto !important;
    max-height: none !important;
    aspect-ratio: 1 / 0.78 !important;
    padding: 6px !important;
    display: grid !important;
    place-items: center !important;
  }

  .prod-img img {
    width: 100% !important;
    height: 100% !important;
    max-width: 285px !important;
    max-height: 245px !important;
    object-fit: contain !important;
  }

  .price-row,
  .prices {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
  }

  .price-box {
    min-width: 0 !important;
    min-height: 70px !important;
    padding: 9px 10px !important;
  }

  .price-box strong { font-size: clamp(17px, 5vw, 21px) !important; }
  .price-box span { font-size: 11px !important; }
  .price-box small { font-size: 10px !important; }

  .spec {
    grid-template-columns: 20px minmax(0, 1fr) minmax(90px, auto) !important;
    font-size: 11.5px !important;
    padding: 5px 0 !important;
  }

  .spec .v { overflow-wrap: anywhere !important; }

  .customer-fields,
  .mini-card { padding-left: 10px !important; padding-right: 10px !important; }

  .two,
  .customer-two,
  .pdf-two {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 0 !important;
  }

  .field input,
  .field select,
  .logi input,
  .ors-strip input {
    width: 100% !important;
    min-width: 0 !important;
    height: 44px !important;
    font-size: 16px !important;
    box-sizing: border-box !important;
  }

  .open-btn,
  .smallBtn,
  .searchbtn,
  .ors-strip button,
  .ghost,
  .primary {
    min-height: 44px !important;
    touch-action: manipulation;
  }

  .pickerbar {
    height: auto !important;
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 8px !important;
    margin-bottom: 10px !important;
  }

  .pickerbar .smallBtn,
  .pickerMain,
  .catalogbar .calcLink {
    width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
  }

  /* A táblázat telefonon kártyákká alakul, nincs vízszintes görgetés. */
  .cart-table {
    display: block !important;
    min-width: 0 !important;
    width: 100% !important;
    overflow: visible !important;
  }

  .cart-table thead { display: none !important; }
  .cart-table tbody { display: grid !important; gap: 9px !important; }
  .cart-table tbody tr {
    display: grid !important;
    grid-template-columns: 1fr auto !important;
    gap: 8px 10px !important;
    width: 100% !important;
    padding: 10px !important;
    border: 1px solid #dbe7df !important;
    border-radius: 12px !important;
    background: #fff !important;
    box-sizing: border-box !important;
  }

  .cart-table td {
    display: block !important;
    width: auto !important;
    height: auto !important;
    min-width: 0 !important;
    padding: 0 !important;
    border: 0 !important;
  }

  .cart-table td:nth-child(1) { grid-column: 1 / -1; }
  .cart-table td:nth-child(2) { grid-column: 1; }
  .cart-table td:nth-child(3) { grid-column: 2; align-self: center; text-align: right; }
  .cart-table td:nth-child(4),
  .cart-table td:nth-child(5) {
    grid-column: 1;
    font-size: 12px !important;
  }
  .cart-table td:nth-child(4)::before { content: "Egységár: "; color: #667085; font-weight: 700; }
  .cart-table td:nth-child(5)::before { content: "Összeg: "; color: #667085; font-weight: 700; }
  .cart-table td:nth-child(6) { grid-column: 2; grid-row: 3 / 5; align-self: end; }

  .cart-table .item { gap: 9px !important; }
  .cart-table .item img { width: 54px !important; height: 54px !important; flex: 0 0 54px !important; }
  .cart-table .item strong { font-size: 13.5px !important; }
  .cart-table .item small { font-size: 11px !important; }
  .cart-table .qty { height: 40px !important; grid-template-columns: 38px 58px 38px !important; }
  .cart-table .qty input { width: 58px !important; height: 40px !important; font-size: 16px !important; }
  .cart-table .qty button { min-width: 38px !important; min-height: 40px !important; }
  .cart-table .actions { justify-content: flex-end !important; }
  .cart-table .act { width: 40px !important; height: 40px !important; }

  .cart-table .empty-row { display: block !important; }
  .cart-table .empty-row td { display: block !important; padding: 18px 10px !important; text-align: center !important; }

  .radio-row {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 8px !important;
    align-items: start !important;
  }

  .radio-row label,
  .ship-options label {
    min-height: 44px !important;
    display: flex !important;
    align-items: center !important;
    gap: 9px !important;
  }

  .radio-row input,
  .ship-options input { width: 20px !important; height: 20px !important; flex: 0 0 20px !important; }

  .zip-line { display: grid !important; grid-template-columns: minmax(0, 1fr) 48px !important; gap: 7px !important; }
  .zip-line .searchbtn { width: 48px !important; }

  .mini-title {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    line-height: 1.25 !important;
  }
  .mini-title .mapBtn { width: 100% !important; margin-left: 0 !important; }

  .info-grid,
  .route-info {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 3px !important;
  }
  .route-info b { margin-bottom: 7px !important; }

  .ors-strip {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 7px !important;
  }
  .ors-strip label { grid-column: auto !important; }

  .ship-options,
  .summary-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
  }

  .bottom {
    margin-top: 10px !important;
    gap: 10px !important;
  }

  .summary { padding: 11px !important; }
  .summary h3 { font-size: 13px !important; margin: 0 0 9px !important; }
  .sumcell { min-width: 0 !important; min-height: 68px !important; padding: 9px !important; }
  .sumcell small { font-size: 10px !important; line-height: 1.2 !important; overflow-wrap: normal !important; }
  .sumcell strong { font-size: 15px !important; white-space: nowrap !important; overflow-wrap: normal !important; }
  .sumcell.gross { grid-column: 1 / -1 !important; }
  .sumcell.gross strong { font-size: 23px !important; }

  @media (max-width: 390px) {
    .summary-grid { gap: 7px !important; }
    .sumcell { padding: 8px 7px !important; min-height: 66px !important; }
    .sumcell strong { font-size: 14px !important; }
    .sumcell.gross strong { font-size: 21px !important; }
  }

  .ctaBox.actionTwo {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 8px !important;
    padding: 0 !important;
  }

  .foot {
    padding: 12px 4px 0 !important;
    font-size: 10.5px !important;
    line-height: 1.35 !important;
    text-align: center !important;
  }

  .product-picker-modal,
  .quote-modal { padding: 8px !important; box-sizing: border-box !important; }

  .product-picker-card,
  .quote-modal-card {
    width: 100% !important;
    max-width: 100% !important;
    max-height: calc(100dvh - 16px) !important;
    border-radius: 14px !important;
    padding: 12px !important;
  }

  .product-picker-head { margin-right: 38px !important; }
  .product-picker-head h2 { font-size: 20px !important; }
  .product-picker-head p { font-size: 12px !important; }

  .quote-preview-scroll { overflow-x: hidden !important; }
  .quote-actions { display: grid !important; grid-template-columns: 1fr !important; gap: 8px !important; }

  .pdf-professional {
    width: 100% !important;
    min-width: 0 !important;
    padding: 8px !important;
    transform: none !important;
  }
}

@media (max-width: 420px) {
  :root { --zb-mobile-gap: 7px; }
  .panel-body { padding: 9px !important; }
  .ship-options { grid-template-columns: 1fr !important; }
  .price-row, .prices { gap: 6px !important; }
  .price-box { padding: 8px !important; }
}

/* =========================================================
   Production Stabilization – Mobile Sprint 1.0
   Az örökölt mobil fejléc/drawer kikapcsolása és a központi
   production/mobile-shell kizárólagos használata.
   ========================================================= */
@media (max-width: 900px) {
  .zb-mobile-header,
  .zb-mobile-overlay,
  .zb-mobile-drawer {
    display: none !important;
  }

  body > .app > .sidebar,
  .app > .sidebar {
    display: none !important;
  }

  .app {
    padding-top: 0 !important;
    min-height: calc(100vh - 58px) !important;
  }

  .main {
    margin-left: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    overflow: visible !important;
  }

  .workspace,
  .bottom,
  .summary,
  .ctaBox,
  .panel,
  .panel-body {
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  .cart-table-wrap {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }
}


/* =========================================================
   P0-03 – Mobile ZIP Input Fix
   ========================================================= */
@media (max-width:900px){
  .zip-highlight,.zip-line{position:relative!important;isolation:isolate!important;overflow:visible!important}
  .zip-line #zip{position:relative!important;z-index:20!important;pointer-events:auto!important;touch-action:auto!important;-webkit-user-select:text!important;user-select:text!important;opacity:1!important;visibility:visible!important;min-height:48px!important}
  .zip-line .searchbtn{position:relative!important;z-index:10!important;pointer-events:auto!important}
  body:not(.zb-menu-open) .zb-mobile-shell-overlay,.zb-mobile-shell-overlay[aria-hidden="true"]{pointer-events:none!important;visibility:hidden!important;opacity:0!important}
}
/* V7 MASTER Visual Lock Migration 1.0 – Gate 2
   Responsive ownership for the three-column Executive Workspace. */
@media (min-width:901px) and (max-width:1159px){
  body.v7-visual-lock .workspace{
    grid-template-columns:240px 360px 280px;
    overflow-x:auto;
    overflow-y:visible;
    overscroll-behavior-inline:contain;
    scrollbar-gutter:stable;
  }
}

@media (min-width:1160px) and (max-width:1399px){
  body.v7-visual-lock .workspace{
    grid-template-columns:minmax(240px,.9fr) minmax(360px,1.5fr) minmax(280px,.9fr);
  }
}

@media (min-width:901px) and (max-width:1599px){
  body.v7-visual-lock .pickerbar.zb-quote-toolbar{
    display:grid;
    grid-template-columns:minmax(0,1fr) minmax(0,1fr)!important;
    height:auto;
    align-items:stretch;
  }
  body.v7-visual-lock .pickerbar .smallBtn{
    width:100%;
    min-width:0;
    height:auto;
    min-height:34px;
    padding:6px 8px;
    white-space:normal;
  }
  body.v7-visual-lock .pickerbar .calcLink{
    grid-column:1 / -1!important;
    margin-left:0!important;
  }
}
