/* QQG mobile order layout v4. body.dy8-store-page.dy8-config-page.qqg-mobile-order-v4 is expanded to a page-specific prefix.
   Higher specificity deliberately survives old store-v14/v15 sheets loaded
   later by the module HTML. Native Vue controls and pricing stay in place. */
@media (max-width: 820px) {
  body.dy8-store-page.dy8-config-page.qqg-mobile-order-v4 { padding-bottom: 0 !important; }
  body.dy8-store-page.dy8-config-page.qqg-mobile-order-v4 .goods > .el-container > .el-container > .el-main {
    min-width: 0 !important;
    height: auto !important;
    overflow: visible !important;
    padding-bottom: 24px !important;
  }
  body.dy8-store-page.dy8-config-page.qqg-mobile-order-v4 .goods .config-box {
    min-width: 0 !important;
    height: auto !important;
    padding-bottom: 220px !important;
    padding-bottom: calc(220px + env(safe-area-inset-bottom, 0px)) !important;
  }
  body.dy8-store-page.dy8-config-page.qqg-mobile-order-v4 .goods .config-box > .content,
  body.dy8-store-page.dy8-config-page.qqg-mobile-order-v4 .goods .config-box > .content > .template,
  body.dy8-store-page.dy8-config-page.qqg-mobile-order-v4 .goods .config-box > .content > .template > .main-card {
    min-width: 0 !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: visible !important;
  }
  body.dy8-store-page.dy8-config-page.qqg-mobile-order-v4 .goods .config-box > .content > .template:not(.common-config) {
    display: block !important;
  }
  body.dy8-store-page.dy8-config-page.qqg-mobile-order-v4 .goods .config-box .template .f-order {
    position: fixed !important;
    z-index: 190 !important;
    top: auto !important;
    right: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    display: block !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    grid-column: auto !important;
    grid-row: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    background: #fff !important;
    border: 0 !important;
    border-top: 1px solid #d8e3f1 !important;
    border-radius: 0 !important;
    box-shadow: 0 -5px 20px rgba(25,61,105,.12) !important;
    transform: none !important;
    backdrop-filter: none !important;
    box-sizing: border-box !important;
  }
  body.dy8-store-page.dy8-config-page.qqg-mobile-order-v4 .goods .config-box .template .f-order > .l-empty { display: none !important; }
  body.dy8-store-page.dy8-config-page.qqg-mobile-order-v4 .goods .config-box .template .f-order > .el-main {
    width: 100% !important;
    min-width: 0 !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 10px 12px !important;
    padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px)) !important;
    overflow: visible !important;
    background: transparent !important;
    box-shadow: none !important;
    box-sizing: border-box !important;
  }
  body.dy8-store-page.dy8-config-page.qqg-mobile-order-v4 .goods .config-box .template .f-order > .el-main > .main-card {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(148px, 1fr) !important;
    grid-template-rows: auto auto !important;
    grid-template-areas: "controls controls" "price actions" !important;
    gap: 8px 10px !important;
    align-items: center !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    background: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    box-sizing: border-box !important;
  }
  body.dy8-store-page.dy8-config-page.qqg-mobile-order-v4 .goods .config-box .template .f-order .qqg-summary-head,
  body.dy8-store-page.dy8-config-page.qqg-mobile-order-v4 .goods .config-box .template .f-order .qqg-summary-config,
  body.dy8-store-page.dy8-config-page.qqg-mobile-order-v4 .goods .config-box .template .f-order .qqg-summary-fees,
  body.dy8-store-page.dy8-config-page.qqg-mobile-order-v4 .goods .config-box .template .f-order .qqg-v16-live-summary,
  body.dy8-store-page.dy8-config-page.qqg-mobile-order-v4 .goods .config-box .template .f-order .qqg-summary-trust,
  body.dy8-store-page.dy8-config-page.qqg-mobile-order-v4 .goods .config-box .template .f-order .qqg-v16-summary-empty { display: none !important; }
  body.dy8-store-page.dy8-config-page.qqg-mobile-order-v4 .goods .config-box .template .f-order .left {
    display: grid !important;
    grid-area: controls !important;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr) !important;
    gap: 10px !important;
    width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    align-items: end !important;
    box-sizing: border-box !important;
  }
  body.dy8-store-page.dy8-config-page.qqg-mobile-order-v4 .goods .config-box .template .f-order .time,
  body.dy8-store-page.dy8-config-page.qqg-mobile-order-v4 .goods .config-box .template .f-order .num {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 3px !important;
    width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  body.dy8-store-page.dy8-config-page.qqg-mobile-order-v4 .goods .config-box .template .f-order .left .l-txt {
    display: block !important;
    margin: 0 !important;
    color: #526178 !important;
    font-size: 12px !important;
    line-height: 18px !important;
    white-space: normal !important;
  }
  body.dy8-store-page.dy8-config-page.qqg-mobile-order-v4 .goods .config-box .template .f-order .duration-select,
  body.dy8-store-page.dy8-config-page.qqg-mobile-order-v4 .goods .config-box .template .f-order .left .el-select,
  body.dy8-store-page.dy8-config-page.qqg-mobile-order-v4 .goods .config-box .template .f-order .left .el-input,
  body.dy8-store-page.dy8-config-page.qqg-mobile-order-v4 .goods .config-box .template .f-order .left .el-input-number {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    height: 44px !important;
    margin: 0 !important;
    box-sizing: border-box !important;
  }
  body.dy8-store-page.dy8-config-page.qqg-mobile-order-v4 .goods .config-box .template .f-order .left .el-input__inner {
    width: 100% !important;
    min-width: 0 !important;
    height: 44px !important;
    padding: 0 30px 0 10px !important;
    font-size: 16px !important;
    line-height: 44px !important;
    box-sizing: border-box !important;
  }
  body.dy8-store-page.dy8-config-page.qqg-mobile-order-v4 .goods .config-box .template .f-order .num .el-input__inner {
    padding: 0 32px !important;
    text-align: center !important;
  }
  body.dy8-store-page.dy8-config-page.qqg-mobile-order-v4 .goods .config-box .template .f-order .el-input-number__increase,
  body.dy8-store-page.dy8-config-page.qqg-mobile-order-v4 .goods .config-box .template .f-order .el-input-number__decrease {
    width: 30px !important;
    height: 42px !important;
    font-size: 16px !important;
    line-height: 42px !important;
  }
  body.dy8-store-page.dy8-config-page.qqg-mobile-order-v4 .goods .config-box .template .f-order .mid {
    display: block !important;
    grid-area: price !important;
    width: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    border: 0 !important;
  }
  /* Element popover wraps the old configuration link in a span. */
  body.dy8-store-page.dy8-config-page.qqg-mobile-order-v4 .goods .config-box .template .f-order .mid > span { display: none !important; }
  body.dy8-store-page.dy8-config-page.qqg-mobile-order-v4 .goods .config-box .template .f-order .demand-box,
  body.dy8-store-page.dy8-config-page.qqg-mobile-order-v4 .goods .config-box .template .f-order .bot-price {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  body.dy8-store-page.dy8-config-page.qqg-mobile-order-v4 .goods .config-box .template .f-order .bot-price::before {
    display: block !important;
    content: "当前费用" !important;
    margin: 0 0 2px !important;
    font-size: 11px !important;
    line-height: 16px !important;
    color: #718198 !important;
  }
  html[lang^="en"] body.dy8-store-page.dy8-config-page.qqg-mobile-order-v4 .goods .config-box .template .f-order .bot-price::before { content: "Current total" !important; }
  body.dy8-store-page.dy8-config-page.qqg-mobile-order-v4 .goods .config-box .template .f-order .bot-price .new,
  body.dy8-store-page.dy8-config-page.qqg-mobile-order-v4 .goods .config-box .template .f-order .bot-price .new .price {
    max-width: 100% !important;
    font-size: 24px !important;
    line-height: 30px !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
    color: #ef492d !important;
  }
  body.dy8-store-page.dy8-config-page.qqg-mobile-order-v4 .goods .config-box .template .f-order .bot-price .total-icon {
    font-size: 15px !important;
    line-height: 20px !important;
  }
  body.dy8-store-page.dy8-config-page.qqg-mobile-order-v4 .goods .config-box .template .f-order .demand-fee { white-space: normal !important; overflow-wrap: anywhere !important; }
  body.dy8-store-page.dy8-config-page.qqg-mobile-order-v4 .goods .config-box .template .f-order .right {
    position: static !important;
    display: grid !important;
    grid-area: actions !important;
    grid-template-columns: 44px minmax(0, 1fr) !important;
    gap: 8px !important;
    width: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
  }
  body.dy8-store-page.dy8-config-page.qqg-mobile-order-v4 .goods .config-box .template .f-order .right > span { min-width: 0 !important; }
  body.dy8-store-page.dy8-config-page.qqg-mobile-order-v4 .goods .config-box .template .f-order .right > span:only-child { grid-column: 1 / -1 !important; }
  body.dy8-store-page.dy8-config-page.qqg-mobile-order-v4 .goods .config-box .template .f-order .add-cart,
  body.dy8-store-page.dy8-config-page.qqg-mobile-order-v4 .goods .config-box .template .f-order .buy {
    display: flex !important;
    width: 100% !important;
    min-width: 0 !important;
    height: auto !important;
    min-height: 46px !important;
    margin: 0 !important;
    padding: 8px 4px !important;
    font-size: 14px !important;
    line-height: 20px !important;
    white-space: normal !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
  }
  body.dy8-store-page.dy8-config-page.qqg-mobile-order-v4 .goods .config-box .template .f-order .add-cart span { display: none !important; }
  /* The duration popup is appended to body by Element UI. */
  body.dy8-store-page.dy8-config-page.qqg-mobile-order-v4 .duration-pup {
    min-width: 0 !important;
    max-width: calc(100vw - 24px) !important;
    box-sizing: border-box !important;
  }
  body.dy8-store-page.dy8-config-page.qqg-mobile-order-v4 .duration-pup .el-select-dropdown__wrap {
    max-height: 40vh !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
  }
  body.dy8-store-page.dy8-config-page.qqg-mobile-order-v4 .duration-pup .el-select-dropdown__item {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    gap: 4px 8px !important;
    height: auto !important;
    min-height: 44px !important;
    padding: 10px 12px !important;
    font-size: 14px !important;
    line-height: 22px !important;
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
    overflow-wrap: anywhere !important;
    box-sizing: border-box !important;
  }
  body.dy8-store-page.dy8-config-page.qqg-mobile-order-v4 .duration-pup .txt { min-width: 0 !important; overflow-wrap: anywhere !important; }
  body.dy8-store-page.dy8-config-page.qqg-mobile-order-v4 .duration-pup .tip { margin-left: 0 !important; font-size: 12px !important; white-space: normal !important; }
}
/* Short landscape viewports use the same card in document flow. */
@media (max-width: 820px) and (max-height: 520px) {
  body.dy8-store-page.dy8-config-page.qqg-mobile-order-v4 .goods .config-box { padding-bottom: 24px !important; }
  body.dy8-store-page.dy8-config-page.qqg-mobile-order-v4 .goods .config-box .template .f-order {
    position: static !important;
    margin-top: 20px !important;
  }
}
