/* V243 — hard layout reset for package pickers. Fixes desktop overlap and mobile inline/overflow. */

/* --- shared modal shell --- */
.flex-package-modal[hidden],
.hero-v11-buy .qb-choice-modal[hidden]{display:none!important}

.flex-package-modal,
.hero-v11-buy .qb-choice-modal[data-mode="package"]{
  position:fixed!important;
  inset:0!important;
  z-index:10120!important;
  padding:18px!important;
  display:grid!important;
  place-items:center!important;
  overflow:hidden!important;
}
.flex-package-modal-backdrop,
.hero-v11-buy .qb-choice-modal[data-mode="package"] .qb-choice-backdrop{
  position:absolute!important;inset:0!important;background:rgba(5,11,22,.68)!important;backdrop-filter:blur(5px)!important;
}
.flex-package-modal-dialog,
.hero-v11-buy .qb-choice-modal[data-mode="package"] .qb-choice-panel{
  position:relative!important;z-index:1!important;
  width:min(1240px,calc(100vw - 36px))!important;
  max-width:1240px!important;
  height:auto!important;
  max-height:min(94dvh,900px)!important;
  overflow:hidden!important;
  border-radius:26px!important;
  display:flex!important;flex-direction:column!important;
}

/* --- category/service package modal: desktop --- */
.flex-package-modal-dialog{padding:16px 18px!important}
.flex-package-modal-head{flex:0 0 auto!important;margin:0!important;padding:0 0 9px!important;min-height:58px!important;border-bottom:1px solid var(--pkg240-border)!important}
.flex-package-modal-head h3{font-size:clamp(22px,2.1vw,34px)!important;line-height:1.05!important;margin:2px 0!important}
.flex-package-modal-head p{font-size:11px!important;line-height:1.2!important;margin:0!important}
.flex-package-modal-panel{
  flex:1 1 auto!important;min-height:0!important;
  overflow:hidden!important;
  display:flex!important;flex-direction:column!important;
  gap:8px!important;padding-top:8px!important;
}
.flex-package-modal-panel[hidden]{display:none!important}
.flex-package-modal-section-head{flex:0 0 auto!important;margin:0!important;min-height:24px!important}
.flex-package-modal-section-head strong{font-size:13px!important}
.flex-package-modal-section-head small{font-size:9px!important;padding:5px 8px!important}
.flex-package-modal-list,
.flex-package-modal-list[data-package-grid]{
  flex:1 1 auto!important;min-height:0!important;overflow:hidden!important;
  display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr))!important;
  grid-template-rows:repeat(4,minmax(62px,1fr))!important;
  gap:7px!important;align-content:stretch!important;
}
.flex-package-modal-item{
  min-width:0!important;min-height:62px!important;height:auto!important;
  padding:7px 9px!important;border-radius:14px!important;
  display:grid!important;grid-template-columns:28px minmax(70px,1fr) minmax(104px,auto)!important;
  align-items:center!important;gap:8px!important;overflow:visible!important;
}
.flex-package-select-mark{width:28px!important;height:28px!important;border-radius:8px!important}
.flex-package-modal-copy{min-width:0!important;gap:2px!important}
.flex-package-modal-copy b{font-size:14px!important;line-height:1!important;white-space:nowrap!important}
.flex-package-modal-copy small{font-size:9px!important;line-height:1.1!important;white-space:nowrap!important}
.flex-package-modal-price{min-width:104px!important;min-height:45px!important;padding:6px 8px!important;border-radius:11px!important;gap:3px!important}
.flex-package-modal-price b{font-size:12px!important;line-height:1!important}
.flex-package-modal-discount{font-size:7.5px!important;padding:2px 6px!important}
.flex-package-favorite{top:-7px!important;font-size:7px!important;padding:3px 6px!important}

/* bottom area always in normal flow — never over package rows */
.flex-package-custom-choice{
  flex:0 0 auto!important;min-height:0!important;margin:0!important;padding:7px 0 0!important;
  border-top:1px solid var(--pkg240-border)!important;
  display:flex!important;flex-direction:column!important;gap:6px!important;
}
.flex-package-custom-head{display:none!important}
.flex-package-custom-form{
  display:grid!important;
  grid-template-columns:minmax(180px,.85fr) minmax(250px,1.25fr) minmax(150px,.7fr) minmax(170px,.75fr)!important;
  grid-template-areas:"step range price action"!important;
  gap:8px!important;align-items:center!important;
}
.flex-package-stepper{grid-area:step!important;height:50px!important;min-height:50px!important;border-radius:13px!important}
.flex-package-range-wrap{grid-area:range!important;min-width:0!important;padding:3px 2px 0!important;gap:4px!important}
.flex-package-range-wrap input[type=range]{display:block!important;width:100%!important;height:6px!important;opacity:1!important;visibility:visible!important}
.flex-package-range-meta{font-size:8px!important}
.flex-package-live-box{grid-area:price!important;height:50px!important;min-height:50px!important;border-radius:13px!important;padding:6px 10px!important}
.flex-package-live-box strong{font-size:14px!important}.flex-package-live-box small{font-size:8px!important}.flex-package-live-box span{display:none!important}
.flex-package-continue{grid-area:action!important;height:50px!important;min-height:50px!important;border-radius:13px!important;font-size:12px!important;margin:0!important}
.package-benefit-strip{display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:7px!important;margin:0!important}
.package-benefit-card{min-height:44px!important;padding:6px 8px!important;border-radius:12px!important;grid-template-columns:26px minmax(0,1fr)!important;gap:6px!important}
.package-benefit-icon{width:26px!important;height:26px!important}
.package-benefit-card strong{font-size:9px!important;line-height:1.15!important;overflow-wrap:normal!important;word-break:normal!important}
.package-ai-query{display:grid!important;grid-template-columns:minmax(220px,1fr) auto!important;grid-template-areas:"copy providers"!important;gap:8px 12px!important;padding:7px 9px!important;border-radius:12px!important;align-items:center!important}
.package-ai-copy{grid-area:copy!important}.package-ai-copy small{display:none!important}.package-ai-copy strong{font-size:10px!important}.package-ai-kicker{font-size:7px!important}
.package-ai-providers{grid-area:providers!important;grid-template-columns:repeat(4,minmax(72px,1fr))!important;gap:6px!important}
.package-ai-providers button{min-height:32px!important;font-size:8px!important;padding:0 8px!important;border-radius:9px!important}
.package-ai-status{display:none!important}

/* --- Quick Buy package modal desktop reset --- */
.hero-v11-buy .qb-choice-modal[data-mode="package"]{align-items:center!important}
.hero-v11-buy .qb-choice-modal[data-mode="package"] .qb-choice-panel{padding:16px!important;overflow:hidden!important;display:flex!important;flex-direction:column!important}
.hero-v11-buy .qb-choice-modal[data-mode="package"] .qb-choice-head{flex:0 0 auto!important;margin:0 0 8px!important}
.hero-v11-buy .qb-choice-modal[data-mode="package"] .qb-choice-search{display:none!important}
.hero-v11-buy .qb-choice-modal[data-mode="package"] .qb-package-group-tabs{flex:0 0 auto!important;display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:8px!important;margin:0 0 8px!important}
.hero-v11-buy .qb-choice-modal[data-mode="package"] .qb-package-tier-card{min-height:70px!important;padding:10px 12px!important;border-radius:14px!important;grid-template-columns:1fr auto!important;grid-template-areas:"title badge" "price price"!important}
.hero-v11-buy .qb-choice-modal[data-mode="package"] .qb-package-tier-card strong{font-size:12px!important;margin:0!important;line-height:1.15!important}
.hero-v11-buy .qb-choice-modal[data-mode="package"] .qb-tier-discount{position:static!important;grid-area:badge!important;min-width:44px!important;height:22px!important;font-size:9px!important;padding:0 6px!important;justify-self:end!important}
.hero-v11-buy .qb-choice-modal[data-mode="package"] .qb-tier-from{font-size:9px!important;grid-area:price!important}
.hero-v11-buy .qb-choice-modal[data-mode="package"] .qb-package-choice-grid{flex:1 1 auto!important;min-height:0!important;overflow:hidden!important;display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr))!important;grid-template-rows:repeat(4,minmax(58px,1fr))!important;gap:7px!important;padding:0!important}
.hero-v11-buy .qb-choice-modal[data-mode="package"] .qb-package-pro-card{min-height:58px!important;height:auto!important;padding:7px 8px!important;border-radius:13px!important;grid-template-columns:26px minmax(60px,1fr) minmax(92px,auto)!important;gap:7px!important}
.hero-v11-buy .qb-choice-modal[data-mode="package"] .qb-package-check{width:26px!important;height:26px!important;min-width:26px!important}
.hero-v11-buy .qb-choice-modal[data-mode="package"] .qb-package-pro-copy strong{font-size:13px!important;line-height:1!important}.hero-v11-buy .qb-choice-modal[data-mode="package"] .qb-package-pro-copy span{font-size:8px!important}
.hero-v11-buy .qb-choice-modal[data-mode="package"] .qb-package-pro-price{min-width:92px!important;max-width:120px!important;min-height:42px!important;padding:5px 7px!important;border-radius:10px!important;gap:3px!important}
.hero-v11-buy .qb-choice-modal[data-mode="package"] .qb-package-pro-price b{font-size:11px!important}.hero-v11-buy .qb-choice-modal[data-mode="package"] .qb-package-pro-price small{font-size:7px!important}
.hero-v11-buy .qb-choice-modal[data-mode="package"] .qb-package-choice-footer{flex:0 0 auto!important;display:grid!important;grid-template-columns:minmax(180px,.9fr) minmax(150px,.7fr) minmax(170px,.75fr)!important;gap:8px!important;margin:8px 0 0!important;padding:8px 0 0!important;border-top:1px solid var(--pkg240-border)!important;position:static!important;background:transparent!important}
.hero-v11-buy .qb-choice-modal[data-mode="package"] .qb-package-footer-copy{display:none!important}
.hero-v11-buy .qb-choice-modal[data-mode="package"] .qb-package-footer-stepper,.hero-v11-buy .qb-choice-modal[data-mode="package"] .qb-package-footer-price,.hero-v11-buy .qb-choice-modal[data-mode="package"] .qb-package-footer-apply{min-height:50px!important;height:50px!important;border-radius:13px!important}

/* --- mobile: 1 viewport, no page/nested scroll --- */
@media(max-width:760px){
  body.has-package-modal{overflow:hidden!important;overscroll-behavior:none!important}
  .flex-package-modal,
  .hero-v11-buy .qb-choice-modal[data-mode="package"]{padding:5px!important;align-items:center!important;overflow:hidden!important}
  .flex-package-modal-dialog,
  .hero-v11-buy .qb-choice-modal[data-mode="package"] .qb-choice-panel{
    width:calc(100vw - 10px)!important;height:calc(100dvh - 10px)!important;max-height:calc(100dvh - 10px)!important;
    border-radius:18px!important;padding:7px!important;overflow:hidden!important;
  }

  /* category modal */
  .flex-package-modal-head{min-height:44px!important;padding:0 0 4px!important}
  .flex-package-modal-head .flex-kicker{font-size:6px!important}.flex-package-modal-head h3{font-size:15px!important;line-height:1!important}.flex-package-modal-head p{font-size:7px!important}
  .flex-package-modal-x{width:32px!important;height:32px!important;font-size:19px!important;border-radius:9px!important}
  .flex-package-modal-panel{gap:3px!important;padding-top:3px!important}
  .flex-package-modal-section-head{min-height:17px!important}.flex-package-modal-section-head strong{font-size:8px!important}.flex-package-modal-section-head small{font-size:6px!important;padding:2px 5px!important}
  .flex-package-modal-list,.flex-package-modal-list[data-package-grid]{grid-template-columns:repeat(4,minmax(0,1fr))!important;grid-template-rows:repeat(4,minmax(0,1fr))!important;gap:3px!important;min-height:0!important}
  .flex-package-modal-item{min-height:0!important;height:auto!important;padding:3px 2px!important;border-radius:8px!important;display:flex!important;flex-direction:column!important;justify-content:center!important;align-items:center!important;gap:1px!important;text-align:center!important;overflow:visible!important}
  .flex-package-select-mark{position:absolute!important;top:2px!important;right:2px!important;width:12px!important;height:12px!important;border-radius:4px!important;font-size:7px!important}
  .flex-package-modal-copy{display:grid!important;place-items:center!important;gap:1px!important;width:100%!important}.flex-package-modal-copy b{font-size:9px!important}.flex-package-modal-copy small{font-size:5.5px!important}
  .flex-package-modal-price{min-width:0!important;width:auto!important;max-width:100%!important;min-height:0!important;padding:2px 4px!important;border-radius:6px!important;gap:1px!important}.flex-package-modal-price b{font-size:6.8px!important}.flex-package-modal-discount{font-size:5px!important;padding:1px 3px!important}
  .flex-package-favorite{top:-3px!important;font-size:4px!important;padding:1px 3px!important}
  .flex-package-custom-choice{padding-top:3px!important;gap:3px!important}
  .flex-package-custom-form{grid-template-columns:minmax(94px,.8fr) minmax(0,1fr) minmax(68px,.58fr)!important;grid-template-areas:"step range price" "action action action"!important;gap:3px!important}
  .flex-package-stepper{height:34px!important;min-height:34px!important;grid-template-columns:27px minmax(0,1fr) 27px!important;border-radius:9px!important}.flex-package-stepper button{font-size:15px!important}.flex-package-qty-manual{font-size:13px!important;height:27px!important}
  .flex-package-range-wrap{padding:0!important;gap:1px!important}.flex-package-range-wrap input[type=range]{height:4px!important}.flex-package-range-meta{font-size:5px!important}
  .flex-package-live-box{height:34px!important;min-height:34px!important;border-radius:9px!important;padding:3px 5px!important}.flex-package-live-box small{font-size:5px!important}.flex-package-live-box strong{font-size:8px!important}
  .flex-package-continue{height:32px!important;min-height:32px!important;border-radius:9px!important;font-size:8px!important}
  .package-benefit-strip{grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:2px!important}.package-benefit-card{min-height:27px!important;padding:2px 3px!important;border-radius:7px!important;display:flex!important;justify-content:center!important;gap:2px!important}.package-benefit-icon{width:13px!important;height:13px!important;font-size:6px!important}.package-benefit-card strong{font-size:5px!important;line-height:1.05!important;text-align:center!important}
  .package-ai-query{grid-template-columns:1fr!important;grid-template-areas:"providers"!important;padding:2px 3px!important;border-radius:7px!important}.package-ai-copy{display:none!important}.package-ai-providers{grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:2px!important}.package-ai-providers button{min-height:22px!important;font-size:5.5px!important;padding:0 2px!important;border-radius:6px!important}

  /* Quick Buy package modal: full overlay and 4x4 packages */
  .hero-v11-buy .qb-choice-modal[data-mode="package"] .qb-choice-panel{display:flex!important;flex-direction:column!important}
  .hero-v11-buy .qb-choice-modal[data-mode="package"] .qb-choice-head{flex:0 0 auto!important;margin:0 0 3px!important;min-height:36px!important}.hero-v11-buy .qb-choice-modal[data-mode="package"] .qb-choice-head h3{font-size:16px!important}.hero-v11-buy .qb-choice-modal[data-mode="package"] .qb-choice-close{width:32px!important;height:32px!important}
  .hero-v11-buy .qb-choice-modal[data-mode="package"] .qb-package-group-tabs{flex:0 0 auto!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:3px!important;margin:0 0 3px!important}
  .hero-v11-buy .qb-choice-modal[data-mode="package"] .qb-package-tier-card{min-height:42px!important;padding:5px 6px!important;border-radius:8px!important;grid-template-columns:1fr auto!important;grid-template-areas:"title badge" "price price"!important}
  .hero-v11-buy .qb-choice-modal[data-mode="package"] .qb-package-tier-card strong{font-size:7px!important;line-height:1.05!important}.hero-v11-buy .qb-choice-modal[data-mode="package"] .qb-tier-discount{height:16px!important;min-width:31px!important;font-size:5.5px!important;padding:0 3px!important}.hero-v11-buy .qb-choice-modal[data-mode="package"] .qb-tier-from{font-size:5.5px!important}
  .hero-v11-buy .qb-choice-modal[data-mode="package"] .qb-package-choice-grid{flex:1 1 auto!important;min-height:0!important;grid-template-columns:repeat(4,minmax(0,1fr))!important;grid-template-rows:repeat(4,minmax(0,1fr))!important;gap:3px!important;overflow:hidden!important}
  .hero-v11-buy .qb-choice-modal[data-mode="package"] .qb-package-pro-card{min-height:0!important;height:auto!important;padding:3px 2px!important;border-radius:8px!important;display:flex!important;flex-direction:column!important;justify-content:center!important;align-items:center!important;gap:1px!important;text-align:center!important;overflow:visible!important}
  .hero-v11-buy .qb-choice-modal[data-mode="package"] .qb-package-check{position:absolute!important;top:2px!important;right:2px!important;width:12px!important;height:12px!important;min-width:12px!important;border-radius:4px!important}
  .hero-v11-buy .qb-choice-modal[data-mode="package"] .qb-package-pro-copy{align-items:center!important;gap:1px!important}.hero-v11-buy .qb-choice-modal[data-mode="package"] .qb-package-pro-copy strong{font-size:8px!important}.hero-v11-buy .qb-choice-modal[data-mode="package"] .qb-package-pro-copy span{font-size:5px!important}
  .hero-v11-buy .qb-choice-modal[data-mode="package"] .qb-package-pro-price{grid-column:auto!important;width:auto!important;min-width:0!important;max-width:100%!important;min-height:0!important;padding:2px 4px!important;border-radius:6px!important;gap:1px!important}.hero-v11-buy .qb-choice-modal[data-mode="package"] .qb-package-pro-price b{font-size:6.5px!important}.hero-v11-buy .qb-choice-modal[data-mode="package"] .qb-package-pro-price small{font-size:4.5px!important;padding:1px 3px!important}
  .hero-v11-buy .qb-choice-modal[data-mode="package"] .qb-package-pro-badge{top:-3px!important;font-size:4px!important;padding:1px 3px!important}
  .hero-v11-buy .qb-choice-modal[data-mode="package"] .qb-package-choice-footer{flex:0 0 auto!important;display:grid!important;grid-template-columns:minmax(90px,.8fr) minmax(64px,.55fr)!important;gap:3px!important;margin:3px 0 0!important;padding:3px 0 0!important;position:static!important;background:transparent!important}
  .hero-v11-buy .qb-choice-modal[data-mode="package"] .qb-package-footer-stepper{height:32px!important;min-height:32px!important;grid-template-columns:27px minmax(0,1fr) 27px!important;border-radius:8px!important}.hero-v11-buy .qb-choice-modal[data-mode="package"] .qb-package-footer-stepper button{font-size:15px!important}.hero-v11-buy .qb-choice-modal[data-mode="package"] .qb-package-footer-stepper input{font-size:12px!important}
  .hero-v11-buy .qb-choice-modal[data-mode="package"] .qb-package-footer-price{height:32px!important;min-height:32px!important;padding:3px 5px!important;border-radius:8px!important}.hero-v11-buy .qb-choice-modal[data-mode="package"] .qb-package-footer-price small{font-size:5px!important}.hero-v11-buy .qb-choice-modal[data-mode="package"] .qb-package-footer-price strong{font-size:8px!important}
  .hero-v11-buy .qb-choice-modal[data-mode="package"] .qb-package-footer-apply{grid-column:1/-1!important;height:30px!important;min-height:30px!important;border-radius:8px!important;font-size:8px!important}
}

@media(max-width:390px){
  .flex-package-modal,.hero-v11-buy .qb-choice-modal[data-mode="package"]{padding:3px!important}
  .flex-package-modal-dialog,.hero-v11-buy .qb-choice-modal[data-mode="package"] .qb-choice-panel{width:calc(100vw - 6px)!important;height:calc(100dvh - 6px)!important;max-height:calc(100dvh - 6px)!important;padding:5px!important}
}
