/* Checkout presentation only. Existing controls, labels and behavior are preserved. */
#bag-dialog:has(#checkout-form){width:min(650px,100%);background:#fff;border-left:1px solid var(--line);overflow-y:auto;overscroll-behavior:contain;scroll-padding-block:24px 210px}
#bag-dialog:has(#checkout-form) .bag-header{padding:26px 28px 20px;border-bottom:0}
#bag-dialog:has(#checkout-form) .bag-header .eyebrow{color:var(--ink);font-size:12px;letter-spacing:.075em;margin-bottom:8px}
#bag-dialog:has(#checkout-form) .bag-header h2{font-size:28px;font-weight:700;line-height:1.15;letter-spacing:-.035em}
#bag-dialog:has(#checkout-form) .bag-inner{padding:0 28px;min-width:0}
#bag-dialog:has(#checkout-form) .checkout-items{display:grid;gap:8px;list-style:none;padding:0;margin:0 0 12px;min-width:0}
#bag-dialog:has(#checkout-form) .checkout-item{display:grid;grid-template-columns:72px minmax(0,1fr) auto;align-items:center;gap:15px;padding:12px 14px;background:#f2f1ee;border-radius:8px;min-width:0}
#bag-dialog:has(#checkout-form) .checkout-item-image{width:72px;height:88px;object-fit:cover;border-radius:5px;background:#e8e6e1}
#bag-dialog:has(#checkout-form) .checkout-item-copy{min-width:0}
#bag-dialog:has(#checkout-form) .checkout-item-name{font-size:16px;line-height:1.3;font-weight:700;letter-spacing:-.025em;overflow-wrap:anywhere}
#bag-dialog:has(#checkout-form) .checkout-item-meta{margin-top:5px;font-size:13px;line-height:1.5;color:var(--muted);overflow-wrap:anywhere}
#bag-dialog:has(#checkout-form) .checkout-item-price{max-width:120px;font-size:18px;font-weight:700;line-height:1.3;letter-spacing:-.025em;text-align:right;overflow-wrap:anywhere;font-variant-numeric:tabular-nums}
#bag-dialog:has(#checkout-form) #checkout-form{min-width:0}
#bag-dialog:has(#checkout-form) .checkout-section{min-width:0;margin:0 0 24px}
#bag-dialog:has(#checkout-form) .checkout-section-title{margin:0 0 12px;font-size:24px;line-height:1.2;font-weight:700;letter-spacing:-.025em}
#bag-dialog:has(#checkout-form) .field{margin-bottom:14px;min-width:0}
#bag-dialog:has(#checkout-form) .field label{margin-bottom:7px;font-size:16px;line-height:1.35;font-weight:500;color:var(--ink)}
#bag-dialog:has(#checkout-form) .field input{height:44px;border-color:#caccc7;border-radius:6px;background:#fff;padding-inline:13px;font-size:16px;min-width:0}
#bag-dialog:has(#checkout-form) .field input[readonly]{background:#f5f5f1;color:var(--ink)}
#bag-dialog:has(#checkout-form) .field input:disabled{background:#f1f1ed;color:var(--muted)}
#bag-dialog:has(#checkout-form) .field input[aria-invalid=true]{border-color:var(--accent)}
#bag-dialog:has(#checkout-form) .field-hint{margin-top:6px;font-size:12px;line-height:1.45}
#bag-dialog:has(#checkout-form) .field-error:empty{margin:0}
#bag-dialog:has(#checkout-form) .checkout-customer .field:last-child{margin-bottom:0}
#bag-dialog:has(#checkout-form) #checkout-delivery{margin-bottom:0}
#bag-dialog:has(#checkout-form) .delivery-carriers{margin-bottom:16px}
#bag-dialog:has(#checkout-form) .delivery-carriers legend{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);clip-path:inset(50%);white-space:nowrap;border:0}
#bag-dialog:has(#checkout-form) .checkout-shipping{margin-bottom:0}
#bag-dialog:has(#checkout-form) .checkout-payment{padding-top:16px;border-top:1px solid var(--line);margin-bottom:0}
#bag-dialog:has(#checkout-form) .checkout-payment .payment-box{padding:0;border:0}
#bag-dialog:has(#checkout-form) .checkout-payment .payment-choice legend{margin-bottom:12px;font-size:24px;line-height:1.2;letter-spacing:-.025em}
#bag-dialog:has(#checkout-form) .checkout-legal{margin:22px 0 0;font-size:12px;line-height:1.55;color:var(--muted);overflow-wrap:anywhere}
#bag-dialog:has(#checkout-form) .checkout-bottom{position:sticky;bottom:0;z-index:3;margin:24px -28px 0;padding:16px 28px calc(16px + env(safe-area-inset-bottom));background:#fff;border-top:1px solid var(--line);box-shadow:0 -8px 20px #19191904}
#bag-dialog:has(#checkout-form) .checkout-bottom .bag-summary{display:flex;flex-direction:column;margin-top:0}
#bag-dialog:has(#checkout-form) .checkout-bottom .summary-row{margin-top:7px;margin-bottom:0;gap:16px;font-size:12px;line-height:1.4}
#bag-dialog:has(#checkout-form) .checkout-bottom .summary-total{order:-1;align-items:baseline;gap:16px;border-top:0;padding-top:0;margin-top:0;font-size:18px;font-weight:700;line-height:1.3}
#bag-dialog:has(#checkout-form) .checkout-bottom .summary-total strong{font-size:26px;line-height:1.3;font-variant-numeric:tabular-nums;text-align:right;overflow-wrap:anywhere;min-width:0}
#bag-dialog:has(#checkout-form) .checkout-bottom .delivery-note{margin:7px 0 12px;font-size:12px;line-height:1.45}
#bag-dialog:has(#checkout-form) .checkout-bottom .field-error:not(:empty){margin-top:10px}
/* Keep the field or delivery results fully available while the phone keyboard is open. */
#bag-dialog:has(#checkout-form):has(.field input:focus) .checkout-bottom,
#bag-dialog:has(#checkout-form):has(.delivery-results:not([hidden])) .checkout-bottom{position:static}
@media(max-width:650px){
  #bag-dialog:has(#checkout-form){border-left:0}
  #bag-dialog:has(#checkout-form) .bag-header{padding:23px 16px 17px}
  #bag-dialog:has(#checkout-form) .bag-header .eyebrow{font-size:11px;margin-bottom:7px}
  #bag-dialog:has(#checkout-form) .bag-header h2{font-size:24px;line-height:1.18;padding-right:32px}
  #bag-dialog:has(#checkout-form) .bag-inner{padding-inline:16px}
  #bag-dialog:has(#checkout-form) .checkout-item{grid-template-columns:56px minmax(0,1fr) auto;gap:10px;padding:10px;border-radius:7px}
  #bag-dialog:has(#checkout-form) .checkout-item-image{width:56px;height:72px;border-radius:4px}
  #bag-dialog:has(#checkout-form) .checkout-item-name{font-size:14px;line-height:1.3}
  #bag-dialog:has(#checkout-form) .checkout-item-meta{font-size:12px;margin-top:4px;line-height:1.45}
  #bag-dialog:has(#checkout-form) .checkout-item-price{max-width:85px;font-size:16px}
  #bag-dialog:has(#checkout-form) .checkout-section{margin-bottom:23px}
  #bag-dialog:has(#checkout-form) .checkout-section-title,
  #bag-dialog:has(#checkout-form) .checkout-payment .payment-choice legend{font-size:22px}
  #bag-dialog:has(#checkout-form) .checkout-shipping{margin-bottom:0}
  #bag-dialog:has(#checkout-form) .checkout-payment{padding-top:16px;margin-bottom:0}
  #bag-dialog:has(#checkout-form) .checkout-bottom{margin-inline:-16px;padding:14px 16px calc(14px + env(safe-area-inset-bottom))}
  #bag-dialog:has(#checkout-form) .checkout-bottom .summary-total{font-size:17px}
  #bag-dialog:has(#checkout-form) .checkout-bottom .summary-total strong{font-size:24px}
}
@media(max-width:360px){
  #bag-dialog:has(#checkout-form) .bag-header h2{font-size:22px}
  #bag-dialog:has(#checkout-form) .checkout-item{grid-template-columns:48px minmax(0,1fr) auto;gap:8px;padding:9px}
  #bag-dialog:has(#checkout-form) .checkout-item-image{width:48px;height:64px}
  #bag-dialog:has(#checkout-form) .checkout-item-name{font-size:13px}
  #bag-dialog:has(#checkout-form) .checkout-item-price{font-size:14px;max-width:76px}
}
@media(max-height:600px){
  #bag-dialog:has(#checkout-form){scroll-padding-block:16px}
  #bag-dialog:has(#checkout-form) .checkout-bottom{position:static}
}

/* Reference styling: appearance only; native controls and labels remain intact. */
#bag-dialog:has(#checkout-form){background:#fff;scroll-padding-block:24px 220px}
#bag-dialog:has(#checkout-form) .bag-header{padding:25px 28px 21px}
#bag-dialog:has(#checkout-form) .bag-header h2{padding-right:28px;color:#111;font-size:28px;font-weight:750}
#bag-dialog:has(#checkout-form) .close-button{top:14px;right:14px;width:44px;height:44px;background:transparent;border:0;border-radius:4px;color:#151515;font-size:30px;font-weight:400}
#bag-dialog:has(#checkout-form) .checkout-items{margin-bottom:4px}
#bag-dialog:has(#checkout-form) .checkout-item{background:#f3f2f0}
#bag-dialog:has(#checkout-form) .checkout-item-name{color:#111}
#bag-dialog:has(#checkout-form) .checkout-item-meta{font-size:14px;color:#555}
#bag-dialog:has(#checkout-form) .back-link{min-height:44px;padding:7px 0 11px;margin-bottom:5px;color:#252525;font-size:14px;line-height:1.4;text-decoration:underline;text-underline-offset:3px;text-align:left}
#bag-dialog:has(#checkout-form) .checkout-section-title{margin-bottom:14px;font-size:24px;line-height:1.2;font-weight:750;letter-spacing:-.03em;color:#111}
#bag-dialog:has(#checkout-form) .field{margin-bottom:14px}
#bag-dialog:has(#checkout-form) .field label{font-size:16px;line-height:1.35;color:#161616}
#bag-dialog:has(#checkout-form) .field input{border:1px solid #c9c9c6;border-radius:6px;color:#202020}
#bag-dialog:has(#checkout-form) .field input::placeholder{color:#73736f;opacity:1}
#bag-dialog:has(#checkout-form) .field input[readonly]{background:#f6f6f3;color:#333}
#bag-dialog:has(#checkout-form) .field input:disabled{background:#f0efed;color:#777;opacity:1}
#bag-dialog:has(#checkout-form) .field input[aria-invalid=true]{border-color:var(--accent)}
#bag-dialog:has(#checkout-form) .field-hint{font-size:12px;color:#6b6b67}
#bag-dialog:has(#checkout-form) .checkout-customer .field:last-child{margin-bottom:0}
#bag-dialog:has(#checkout-form) .delivery-carriers{position:relative;gap:11px;margin-bottom:16px}
/* Visually redundant legend retains the fieldset's accessible name. */
#bag-dialog:has(#checkout-form) .delivery-carriers legend{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}
#bag-dialog:has(#checkout-form) .delivery-carriers label{display:flex;align-items:center;gap:10px;min-height:56px;padding:11px 16px;border:1px solid #d1d1ce;border-radius:6px;background:#fff;font-size:16px;font-weight:700;line-height:1.25;min-width:0;color:#161616}
#bag-dialog:has(#checkout-form) .delivery-carriers label span{min-width:0;overflow-wrap:anywhere}
#bag-dialog:has(#checkout-form) .delivery-carriers input{order:-1;width:20px;height:20px;margin:0;flex:0 0 20px;accent-color:#191919}
#bag-dialog:has(#checkout-form) .delivery-carriers label::before{content:'';display:block;flex:0 0 32px;width:32px;height:32px;background-repeat:no-repeat;background-position:center;background-size:contain}
#bag-dialog:has(#checkout-form) .delivery-carriers label:has(input[value="nova_poshta"])::before{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath fill='%23ed2d18' d='M16 1l7 7h-4v6h-6V8H9zM16 31l-7-7h4v-6h6v6h4zM1 16l7-7v4h6v6H8v4zM31 16l-7 7v-4h-6v-6h6V9z'/%3E%3C/svg%3E")}
#bag-dialog:has(#checkout-form) .delivery-carriers label:has(input[value="ukrposhta"])::before{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 32'%3E%3Cpath fill='%23ffba00' d='M12 1C5.9 1 1 5.9 1 12c0 9 11 19 11 19s11-10 11-19C23 5.9 18.1 1 12 1z'/%3E%3Ccircle cx='12' cy='11' r='6' fill='white'/%3E%3C/svg%3E")}
#bag-dialog:has(#checkout-form) .delivery-carriers label:has(input[value="nova_poshta"]:checked){border-color:#e54227;background:#fff2ed}
#bag-dialog:has(#checkout-form) .delivery-carriers label:has(input[value="ukrposhta"]:checked){border-color:#c8950c;background:#fff9e8}
#bag-dialog:has(#checkout-form) .delivery-carriers label:has(input:focus-visible),
#bag-dialog:has(#checkout-form) .payment-option:has(input:focus-visible){outline:2px solid var(--accent);outline-offset:3px}
#bag-dialog:has(#checkout-form) #delivery-city:not([readonly]){padding-right:40px;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 24 24' fill='none' stroke='%23747470' stroke-width='1.3' stroke-linecap='round'%3E%3Ccircle cx='10' cy='10' r='6.5'/%3E%3Cpath d='m15 15 6 6'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 12px center}
#bag-dialog:has(#checkout-form) .delivery-results{border-radius:0 0 6px 6px}
#bag-dialog:has(#checkout-form) .delivery-manual{padding:4px 0;min-height:40px;margin:0 0 10px;color:#252525;font-size:14px;line-height:1.4}
#bag-dialog:has(#checkout-form) .checkout-shipping{margin-bottom:0}
#bag-dialog:has(#checkout-form) .checkout-payment{padding-top:18px;margin-bottom:0;border-top-color:#dededb}
#bag-dialog:has(#checkout-form) .checkout-payment .payment-choice legend{margin-bottom:12px;font-size:21px;line-height:1.3;font-weight:700;letter-spacing:-.025em;color:#111}
#bag-dialog:has(#checkout-form) .checkout-payment .payment-choice legend::before{content:'';display:inline-block;width:26px;height:25px;margin-right:10px;vertical-align:-4px;background:center/contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 28 26' fill='none' stroke='%23191919' stroke-width='1.5' stroke-linejoin='round'%3E%3Cpath d='M4 6V4.5L21 1.5V6M4 6h19a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2Z'/%3E%3Cpath d='M25 12h-6a3 3 0 0 0 0 6h6'/%3E%3Ccircle cx='19.5' cy='15' r='.7' fill='%23191919' stroke='none'/%3E%3C/svg%3E")}
#bag-dialog:has(#checkout-form) .payment-option{gap:11px;padding:12px;margin-top:7px;border:1px solid #dededb;border-radius:6px;background:#fff;color:#191919}
#bag-dialog:has(#checkout-form) .payment-option:first-of-type{margin-top:0}
#bag-dialog:has(#checkout-form) .payment-option:has(input:checked){border-color:#777773;background:#f6f6f3}
#bag-dialog:has(#checkout-form) .payment-option input{width:18px;height:18px;margin-top:2px}
#bag-dialog:has(#checkout-form) .payment-option span{font-size:15px;line-height:1.4}
#bag-dialog:has(#checkout-form) .payment-option small{margin-top:3px;font-size:12px;line-height:1.45;color:#676761}
#bag-dialog:has(#checkout-form) .checkout-legal{margin-top:20px;color:#6b6b65}
#bag-dialog:has(#checkout-form) .checkout-bottom{margin-top:22px;padding:15px 28px calc(18px + env(safe-area-inset-bottom));border-top-color:#dededb;box-shadow:0 -6px 16px #19191904}
#bag-dialog:has(#checkout-form) .checkout-bottom .bag-summary{display:flex;flex-direction:column}
#bag-dialog:has(#checkout-form) .checkout-bottom .summary-total{order:0;font-size:18px;font-weight:700}
#bag-dialog:has(#checkout-form) .checkout-bottom .summary-total strong{font-size:23px}
#bag-dialog:has(#checkout-form) .checkout-bottom .summary-row{order:1;margin:5px 0 0;font-size:12px;line-height:1.4}
#bag-dialog:has(#checkout-form) .checkout-bottom .delivery-note{order:2;margin:6px 0 12px;font-size:12px}
#bag-dialog:has(#checkout-form) .checkout-bottom .primary-button{display:flex;justify-content:center;align-items:center;gap:15px;width:100%;min-height:52px;padding:12px 18px;border:1px solid #191919;border-radius:8px;background:#191919;color:#fff;font-size:20px;font-weight:700;line-height:1.25;letter-spacing:-.025em}
#bag-dialog:has(#checkout-form) .checkout-bottom .primary-button::after{content:'';display:block;width:24px;height:24px;flex:0 0 24px;background:center/contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 12h17M14 5l7 7-7 7'/%3E%3C/svg%3E")}
#bag-dialog:has(#checkout-form) .checkout-bottom .primary-button:disabled{cursor:wait}
@media(hover:hover){
  #bag-dialog:has(#checkout-form) .checkout-bottom .primary-button:hover:not(:disabled){background:#30302e;border-color:#30302e}
  #bag-dialog:has(#checkout-form) .close-button:hover{background:#f3f3ef}
}
@media(max-width:650px){
  #bag-dialog:has(#checkout-form) .bag-header{padding:23px 16px 17px}
  #bag-dialog:has(#checkout-form) .bag-header h2{font-size:24px;line-height:1.18;padding-right:26px}
  #bag-dialog:has(#checkout-form) .close-button{top:9px;right:6px}
  #bag-dialog:has(#checkout-form) .checkout-item-meta{font-size:12px}
  #bag-dialog:has(#checkout-form) .checkout-section-title{font-size:22px;margin-bottom:13px}
  #bag-dialog:has(#checkout-form) .field label{font-size:14px}
  #bag-dialog:has(#checkout-form) .delivery-carriers{gap:8px}
  #bag-dialog:has(#checkout-form) .delivery-carriers label{gap:7px;min-height:52px;padding:10px;font-size:14px}
  #bag-dialog:has(#checkout-form) .delivery-carriers input{width:18px;height:18px;flex-basis:18px}
  #bag-dialog:has(#checkout-form) .delivery-carriers label::before{width:26px;height:28px;flex-basis:26px}
  #bag-dialog:has(#checkout-form) .checkout-payment{padding-top:16px}
  #bag-dialog:has(#checkout-form) .checkout-payment .payment-choice legend{font-size:20px}
  #bag-dialog:has(#checkout-form) .checkout-bottom{padding:13px 16px calc(14px + env(safe-area-inset-bottom))}
  #bag-dialog:has(#checkout-form) .checkout-bottom .summary-total{font-size:17px}
  #bag-dialog:has(#checkout-form) .checkout-bottom .summary-total strong{font-size:22px}
  #bag-dialog:has(#checkout-form) .checkout-bottom .primary-button{gap:12px;padding-inline:12px;font-size:18px}
  #bag-dialog:has(#checkout-form) .checkout-bottom .primary-button::after{width:21px;height:21px;flex-basis:21px}
}
@media(max-width:360px){
  #bag-dialog:has(#checkout-form) .bag-header h2{font-size:22px}
  #bag-dialog:has(#checkout-form) .delivery-carriers label{gap:5px;padding-inline:8px;font-size:13px}
  #bag-dialog:has(#checkout-form) .delivery-carriers input{width:16px;height:16px;flex-basis:16px}
  #bag-dialog:has(#checkout-form) .delivery-carriers label::before{width:21px;height:26px;flex-basis:21px}
  #bag-dialog:has(#checkout-form) .checkout-bottom .primary-button{font-size:17px;gap:9px}
}
@media(max-height:600px){
  #bag-dialog:has(#checkout-form){scroll-padding-block:16px}
}
