/* V240 — Premium unified package selector layer
   Shared visual language for Quick Buy, category package picker and checkout picker. */
:root{
  --pkg240-bg:#ffffff;
  --pkg240-surface:#ffffff;
  --pkg240-surface-2:#f7f9fc;
  --pkg240-border:#dfe6f2;
  --pkg240-text:#1d2940;
  --pkg240-muted:#75829a;
  --pkg240-accent:#4f5dff;
  --pkg240-accent-2:#11a7f5;
  --pkg240-success:#26c9a1;
  --pkg240-success-bg:#ecfaf6;
  --pkg240-shadow:0 28px 80px rgba(17,31,61,.18);
}
html[data-theme="dark"]{
  --pkg240-bg:#101b2d;
  --pkg240-surface:#17243a;
  --pkg240-surface-2:#132036;
  --pkg240-border:#34445e;
  --pkg240-text:#eef4ff;
  --pkg240-muted:#9fb0c8;
  --pkg240-accent:#727cff;
  --pkg240-accent-2:#1ca8ff;
  --pkg240-success:#49ddb8;
  --pkg240-success-bg:#143b35;
  --pkg240-shadow:0 34px 100px rgba(0,0,0,.46);
}

/* Overlay/dialog */
.flex-package-modal,
.checkout-picker-modal[data-checkout-modal="package"],
.hero-v11-buy .qb-choice-modal[data-mode="package"]{
  padding:clamp(18px,3vh,34px)!important;
}
.flex-package-modal-dialog,
.checkout-picker-modal[data-checkout-modal="package"] .checkout-picker-modal-dialog,
.hero-v11-buy .qb-choice-modal[data-mode="package"] .qb-choice-panel{
  width:min(1560px,96vw)!important;
  max-height:calc(100dvh - clamp(36px,6vh,68px))!important;
  background:var(--pkg240-bg)!important;
  color:var(--pkg240-text)!important;
  border:1px solid var(--pkg240-border)!important;
  border-radius:30px!important;
  box-shadow:var(--pkg240-shadow)!important;
  padding:18px 20px 16px!important;
  overflow:hidden!important;
}
.flex-package-modal-head,
.checkout-picker-modal[data-checkout-modal="package"] .checkout-picker-modal-head,
.hero-v11-buy .qb-choice-modal[data-mode="package"] .qb-choice-head{
  min-height:68px!important;
  padding-bottom:12px!important;
  border-bottom:1px solid var(--pkg240-border)!important;
}
.flex-package-modal-head h3,
.checkout-picker-modal[data-checkout-modal="package"] .checkout-picker-modal-head h3,
.hero-v11-buy .qb-choice-modal[data-mode="package"] .qb-choice-head h3{
  font-size:clamp(24px,2.2vw,34px)!important;
  font-weight:850!important;
  line-height:1.08!important;
  letter-spacing:-.035em!important;
  color:var(--pkg240-text)!important;
}
.flex-package-modal-head p,
.checkout-picker-modal[data-checkout-modal="package"] .checkout-picker-modal-head p{
  font-size:12px!important;
  color:var(--pkg240-muted)!important;
}

/* Compact segmented tier controls */
.hero-v11-buy .qb-choice-modal[data-mode="package"] .qb-package-group-tabs{
  display:grid!important;
  grid-template-columns:repeat(4,minmax(0,1fr))!important;
  gap:10px!important;
  margin:12px 0!important;
}
.hero-v11-buy .qb-choice-modal[data-mode="package"] .qb-package-tier-card{
  min-height:62px!important;
  padding:10px 12px!important;
  border:1px solid var(--pkg240-border)!important;
  border-radius:16px!important;
  background:var(--pkg240-surface)!important;
  display:grid!important;
  grid-template-columns:auto minmax(0,1fr) auto!important;
  grid-template-areas:"badge title price"!important;
  gap:8px!important;
  align-items:center!important;
  color:var(--pkg240-text)!important;
  transition:.18s ease!important;
}
.hero-v11-buy .qb-choice-modal[data-mode="package"] .qb-package-tier-card:hover{
  transform:translateY(-1px)!important;
  border-color:color-mix(in srgb,var(--pkg240-accent) 40%,var(--pkg240-border))!important;
}
.hero-v11-buy .qb-choice-modal[data-mode="package"] .qb-package-tier-card.is-active{
  background:linear-gradient(135deg,color-mix(in srgb,var(--pkg240-accent) 14%,var(--pkg240-surface)),var(--pkg240-surface))!important;
  border-color:var(--pkg240-accent)!important;
  box-shadow:0 0 0 2px color-mix(in srgb,var(--pkg240-accent) 18%,transparent)!important;
}
.hero-v11-buy .qb-choice-modal[data-mode="package"] .qb-tier-discount{
  grid-area:badge!important;
  position:static!important;
  min-width:54px!important;
  padding:6px 10px!important;
  border-radius:999px!important;
  background:color-mix(in srgb,var(--pkg240-accent) 14%,transparent)!important;
  color:var(--pkg240-text)!important;
  font-size:12px!important;
  font-weight:900!important;
}
.hero-v11-buy .qb-choice-modal[data-mode="package"] .qb-package-tier-card strong{
  grid-area:title!important;
  min-width:0!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  white-space:nowrap!important;
  font-size:14px!important;
  color:var(--pkg240-text)!important;
}
.hero-v11-buy .qb-choice-modal[data-mode="package"] .qb-tier-from{
  grid-area:price!important;
  white-space:nowrap!important;
  font-size:11px!important;
  color:var(--pkg240-muted)!important;
}

/* Shared grid */
.flex-package-modal-list,
.flex-package-modal-list[data-package-grid],
.checkout-picker-modal[data-checkout-modal="package"] .checkout-picker-package-grid,
.hero-v11-buy .qb-choice-modal[data-mode="package"] .qb-package-choice-grid{
  display:grid!important;
  grid-template-columns:repeat(4,minmax(0,1fr))!important;
  gap:10px 12px!important;
  padding:0!important;
  margin:0!important;
  overflow:visible!important;
}

/* Shared card */
.flex-package-modal-item,
.checkout-picker-modal[data-checkout-modal="package"] .checkout-picker-package-card,
.hero-v11-buy .qb-choice-modal[data-mode="package"] .qb-package-pro-card{
  min-height:78px!important;
  height:78px!important;
  border:1px solid var(--pkg240-border)!important;
  border-radius:18px!important;
  background:var(--pkg240-surface)!important;
  padding:10px 12px!important;
  display:grid!important;
  grid-template-columns:34px minmax(0,1fr) minmax(118px,auto)!important;
  align-items:center!important;
  gap:10px!important;
  color:var(--pkg240-text)!important;
  overflow:visible!important;
  box-shadow:none!important;
}
.flex-package-modal-item:hover,
.checkout-picker-modal[data-checkout-modal="package"] .checkout-picker-package-card:hover,
.hero-v11-buy .qb-choice-modal[data-mode="package"] .qb-package-pro-card:hover{
  border-color:color-mix(in srgb,var(--pkg240-success) 72%,var(--pkg240-border))!important;
  box-shadow:0 8px 22px rgba(14,38,70,.07)!important;
}
.flex-package-modal-item.is-featured,
.checkout-picker-modal[data-checkout-modal="package"] .checkout-picker-package-card[aria-current="page"],
.hero-v11-buy .qb-choice-modal[data-mode="package"] .qb-package-pro-card[aria-pressed="true"]{
  border-color:var(--pkg240-success)!important;
  background:color-mix(in srgb,var(--pkg240-surface) 94%,var(--pkg240-success) 6%)!important;
}
.flex-package-select-mark,
.hero-v11-buy .qb-choice-modal[data-mode="package"] .qb-package-check{
  width:30px!important;height:30px!important;border-radius:9px!important;
  border:1px solid var(--pkg240-border)!important;
  background:var(--pkg240-surface-2)!important;
  color:#fff!important;display:grid!important;place-items:center!important;
  font-size:15px!important;font-weight:900!important;
}
.flex-package-modal-item.is-featured .flex-package-select-mark,
.hero-v11-buy .qb-choice-modal[data-mode="package"] .qb-package-pro-card[aria-pressed="true"] .qb-package-check{
  background:var(--pkg240-success)!important;border-color:var(--pkg240-success)!important;
}
.flex-package-modal-copy,
.hero-v11-buy .qb-choice-modal[data-mode="package"] .qb-package-pro-copy,
.checkout-picker-modal[data-checkout-modal="package"] .checkout-picker-package-copy{
  min-width:0!important;display:flex!important;flex-direction:column!important;gap:2px!important;
}
.flex-package-modal-copy b,
.hero-v11-buy .qb-choice-modal[data-mode="package"] .qb-package-pro-copy strong,
.checkout-picker-modal[data-checkout-modal="package"] .checkout-picker-package-copy b{
  font-size:16px!important;font-weight:850!important;line-height:1.05!important;color:var(--pkg240-text)!important;
  white-space:nowrap!important;overflow:visible!important;text-overflow:clip!important;
}
.flex-package-modal-copy small,
.hero-v11-buy .qb-choice-modal[data-mode="package"] .qb-package-pro-copy span,
.checkout-picker-modal[data-checkout-modal="package"] .checkout-picker-package-copy small{
  font-size:11px!important;line-height:1.2!important;color:var(--pkg240-muted)!important;white-space:nowrap!important;
}
.flex-package-modal-price,
.hero-v11-buy .qb-choice-modal[data-mode="package"] .qb-package-pro-price,
.checkout-picker-modal[data-checkout-modal="package"] .checkout-picker-package-price{
  min-width:118px!important;min-height:58px!important;padding:8px 12px!important;border-radius:14px!important;
  background:var(--pkg240-success-bg)!important;display:flex!important;flex-direction:column!important;align-items:center!important;justify-content:center!important;gap:5px!important;white-space:nowrap!important;
}
.flex-package-modal-price b,
.hero-v11-buy .qb-choice-modal[data-mode="package"] .qb-package-pro-price b,
.checkout-picker-modal[data-checkout-modal="package"] .checkout-picker-package-price b{
  color:var(--pkg240-success)!important;font-size:15px!important;font-weight:900!important;
}
.flex-package-modal-discount,
.hero-v11-buy .qb-choice-modal[data-mode="package"] .qb-package-pro-price small,
.checkout-picker-modal[data-checkout-modal="package"] .checkout-picker-package-price small{
  margin:0!important;padding:3px 8px!important;border:1px solid color-mix(in srgb,var(--pkg240-success) 65%,transparent)!important;border-radius:999px!important;background:transparent!important;color:var(--pkg240-success)!important;font-size:9.5px!important;font-style:normal!important;font-weight:850!important;
}
.flex-package-favorite,
.hero-v11-buy .qb-choice-modal[data-mode="package"] .qb-package-pro-badge,
.checkout-picker-modal[data-checkout-modal="package"] .checkout-picker-package-badge{
  position:absolute!important;top:-9px!important;left:50%!important;transform:translateX(-50%)!important;
  padding:5px 9px!important;border-radius:999px!important;background:#ff7b2f!important;color:#fff!important;font-size:9px!important;font-weight:900!important;line-height:1!important;text-transform:uppercase!important;white-space:nowrap!important;z-index:3!important;
}

/* Premium bottom control bar */
.flex-package-custom-choice,
.checkout-picker-modal[data-checkout-modal="package"] .checkout-picker-quantity-switch,
.hero-v11-buy .qb-choice-modal[data-mode="package"] .qb-package-choice-footer{
  margin-top:12px!important;padding-top:12px!important;border-top:1px solid var(--pkg240-border)!important;
}
.hero-v11-buy .qb-choice-modal[data-mode="package"] .qb-package-choice-footer{
  display:grid!important;grid-template-columns:minmax(160px,.7fr) minmax(280px,1.15fr) minmax(190px,.72fr) minmax(190px,.72fr)!important;gap:10px!important;align-items:stretch!important;
}
.hero-v11-buy .qb-choice-modal[data-mode="package"] .qb-package-footer-copy{display:flex!important;flex-direction:column!important;justify-content:center!important;gap:3px!important;min-width:0!important}
.hero-v11-buy .qb-choice-modal[data-mode="package"] .qb-package-footer-copy strong{font-size:15px!important;color:var(--pkg240-text)!important}.hero-v11-buy .qb-choice-modal[data-mode="package"] .qb-package-footer-copy small{font-size:10px!important;color:var(--pkg240-muted)!important}
.hero-v11-buy .qb-choice-modal[data-mode="package"] .qb-package-footer-stepper{display:grid!important;grid-template-columns:54px minmax(0,1fr) 54px!important;min-height:58px!important;border:1px solid var(--pkg240-border)!important;border-radius:15px!important;overflow:hidden!important;background:var(--pkg240-surface)!important}
.hero-v11-buy .qb-choice-modal[data-mode="package"] .qb-package-footer-stepper button{border:0!important;background:color-mix(in srgb,var(--pkg240-success) 10%,var(--pkg240-surface))!important;color:var(--pkg240-success)!important;font-size:26px!important;font-weight:800!important;cursor:pointer!important}
.hero-v11-buy .qb-choice-modal[data-mode="package"] .qb-package-footer-stepper input{min-width:0!important;width:100%!important;border:0!important;background:transparent!important;color:var(--pkg240-text)!important;text-align:center!important;font-size:24px!important;font-weight:900!important;outline:none!important}
.hero-v11-buy .qb-choice-modal[data-mode="package"] .qb-package-footer-price{min-height:58px!important;padding:9px 13px!important;border:1px solid var(--pkg240-border)!important;border-radius:15px!important;background:var(--pkg240-surface-2)!important;display:flex!important;flex-direction:column!important;justify-content:center!important;gap:2px!important}.hero-v11-buy .qb-choice-modal[data-mode="package"] .qb-package-footer-price small{font-size:10px!important;color:var(--pkg240-muted)!important}.hero-v11-buy .qb-choice-modal[data-mode="package"] .qb-package-footer-price strong{font-size:18px!important;color:var(--pkg240-text)!important}
.hero-v11-buy .qb-choice-modal[data-mode="package"] .qb-package-footer-apply{min-height:58px!important;border-radius:15px!important;background:linear-gradient(100deg,#2415ff 0%,#0aa8f7 100%)!important;border:0!important;font-weight:850!important;box-shadow:none!important}

/* Category quantity + benefits become compact and premium */
.flex-package-custom-head{margin-bottom:8px!important}.flex-package-custom-head strong{font-size:14px!important}.flex-package-custom-head small{font-size:10px!important}
.flex-package-custom-form{display:grid!important;grid-template-columns:minmax(260px,1fr) minmax(220px,.9fr) minmax(220px,.8fr) minmax(190px,.72fr)!important;gap:10px!important;align-items:stretch!important}
.flex-package-stepper{min-height:58px!important;height:58px!important;border-radius:15px!important}
.flex-package-live-box{min-height:58px!important;height:58px!important;border-radius:15px!important;padding:9px 12px!important}
.flex-package-continue{min-height:58px!important;height:58px!important;border-radius:15px!important}
.package-benefit-strip{display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:8px!important;margin-top:9px!important}.package-benefit-card{min-height:52px!important;padding:8px 10px!important;border-radius:14px!important}

/* Responsive */
@media(max-width:1180px){
  .flex-package-modal-list,.flex-package-modal-list[data-package-grid],.checkout-picker-modal[data-checkout-modal="package"] .checkout-picker-package-grid,.hero-v11-buy .qb-choice-modal[data-mode="package"] .qb-package-choice-grid{grid-template-columns:repeat(3,minmax(0,1fr))!important}
  .hero-v11-buy .qb-choice-modal[data-mode="package"] .qb-package-group-tabs{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .hero-v11-buy .qb-choice-modal[data-mode="package"] .qb-package-choice-footer{grid-template-columns:1fr 1.35fr 1fr!important}.hero-v11-buy .qb-choice-modal[data-mode="package"] .qb-package-footer-apply{grid-column:1/-1!important}
  .flex-package-custom-form{grid-template-columns:1fr 1fr!important}.flex-package-continue{grid-column:1/-1!important}
}
@media(max-width:760px){
  .flex-package-modal,.checkout-picker-modal[data-checkout-modal="package"],.hero-v11-buy .qb-choice-modal[data-mode="package"]{padding:10px!important;align-items:end!important}
  .flex-package-modal-dialog,.checkout-picker-modal[data-checkout-modal="package"] .checkout-picker-modal-dialog,.hero-v11-buy .qb-choice-modal[data-mode="package"] .qb-choice-panel{width:100%!important;max-height:94dvh!important;border-radius:24px 24px 0 0!important;padding:14px!important}
  .hero-v11-buy .qb-choice-modal[data-mode="package"] .qb-package-group-tabs{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:8px!important}
  .hero-v11-buy .qb-choice-modal[data-mode="package"] .qb-package-tier-card{min-height:70px!important;grid-template-columns:1fr auto!important;grid-template-areas:"title badge" "price price"!important}
  .flex-package-modal-list,.flex-package-modal-list[data-package-grid],.checkout-picker-modal[data-checkout-modal="package"] .checkout-picker-package-grid,.hero-v11-buy .qb-choice-modal[data-mode="package"] .qb-package-choice-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:8px!important}
  .flex-package-modal-item,.checkout-picker-modal[data-checkout-modal="package"] .checkout-picker-package-card,.hero-v11-buy .qb-choice-modal[data-mode="package"] .qb-package-pro-card{height:auto!important;min-height:118px!important;grid-template-columns:28px minmax(0,1fr)!important;grid-template-rows:auto auto!important;padding:10px!important}
  .flex-package-modal-price,.checkout-picker-modal[data-checkout-modal="package"] .checkout-picker-package-price,.hero-v11-buy .qb-choice-modal[data-mode="package"] .qb-package-pro-price{grid-column:1/-1!important;width:100%!important;min-width:0!important;min-height:48px!important}
  .hero-v11-buy .qb-choice-modal[data-mode="package"] .qb-package-choice-footer{grid-template-columns:1fr!important}
  .hero-v11-buy .qb-choice-modal[data-mode="package"] .qb-package-footer-copy{display:none!important}
  .flex-package-custom-form{grid-template-columns:1fr!important}.flex-package-continue{grid-column:auto!important}
  .package-benefit-strip{grid-template-columns:repeat(2,minmax(0,1fr))!important}
}
@media(max-width:420px){
  .flex-package-modal-list,.flex-package-modal-list[data-package-grid],.checkout-picker-modal[data-checkout-modal="package"] .checkout-picker-package-grid,.hero-v11-buy .qb-choice-modal[data-mode="package"] .qb-package-choice-grid{grid-template-columns:1fr!important}
}
