/* Small fixed-link affordances, using the storefront's existing theme tokens. */
.storefront-link-copy{flex:none;min-height:36px;padding:7px 11px;margin:0;border:1px solid var(--border-strong);border-radius:9px;background:var(--bg-surface);color:var(--text-primary);font:inherit;font-size:12px;font-weight:700;white-space:nowrap;cursor:pointer;transition:background-color .18s ease,color .18s ease,transform .18s ease}
#buy-modal .modal-header:has(.storefront-link-copy){gap:16px;align-items:flex-start}
#buy-modal .modal-header:has(.storefront-link-copy) .modal-title-wrap{min-width:0;flex:1;flex-wrap:wrap;gap:8px 10px!important}
#buy-modal .modal-header:has(.storefront-link-copy) .modal-title{min-width:0;max-width:calc(100% - 46px);overflow-wrap:anywhere}
#buy-modal .modal-header:has(.storefront-link-copy) :is(.sku-icon,.sku-badge,.btn-close){flex-shrink:0}
.storefront-link-copy:hover{background:var(--brand-navy);color:var(--text-inverse,#fff)}
.storefront-link-copy:active{transform:translateY(1px)}
.storefront-link-copy:focus-visible{outline:2px solid var(--brand-orange);outline-offset:3px}
.storefront-route-notice{margin:0 0 12px;padding:11px 14px;border:1px solid var(--border-strong);border-radius:10px;background:var(--bg-surface);color:var(--text-secondary);font-size:13px;line-height:1.7}
#buy-modal[data-route-unavailable="true"] .modal-right{display:none!important}
#buy-modal[data-route-unavailable="true"] .modal-left{width:100%;max-width:none;flex:1}
#buy-modal[data-route-unavailable="true"] .modal-body{grid-template-columns:minmax(0,1fr)}
@media(max-width:860px){.storefront-link-copy{min-height:40px;padding:8px 10px;font-size:12px}.storefront-route-notice{font-size:13px}#buy-modal .modal-header:has(.storefront-link-copy) .modal-title-wrap{gap:7px!important}#buy-modal .modal-header:has(.storefront-link-copy){gap:8px}}
@media(prefers-reduced-motion:reduce){.storefront-link-copy{transition:none}}

/* A compact page header on phones: one return target, the product identity,
   and a stable share action. It never wraps the share button onto its own row. */
.storefront-mobile-back{display:none}
@media(max-width:860px){
  body.mobile-storefront-ready #buy-modal .modal-header:has(.storefront-mobile-back){
    display:grid;grid-template-columns:44px minmax(0,1fr) 62px;align-items:center;
    column-gap:8px;min-height:82px;box-sizing:border-box;
    padding:calc(10px + env(safe-area-inset-top,0px)) max(10px,env(safe-area-inset-right,0px)) 10px max(8px,env(safe-area-inset-left,0px));
  }
  body.mobile-storefront-ready .storefront-mobile-back{
    display:inline-flex;align-items:center;justify-content:center;
    box-sizing:border-box;width:44px;height:44px;min-width:44px;min-height:44px;
    padding:0;margin:0;border:1px solid var(--border-hairline);border-radius:11px;
    background:var(--bg-surface);color:var(--text-primary);font-size:0;
    cursor:pointer;-webkit-tap-highlight-color:transparent;
  }
  body.mobile-storefront-ready .storefront-mobile-back::before{
    content:"";width:21px;height:21px;background:currentColor;
    -webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m14 5-7 7 7 7' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/contain no-repeat;
    mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m14 5-7 7 7 7' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/contain no-repeat;
  }
  body.mobile-storefront-ready .storefront-mobile-back:focus-visible{
    outline:2px solid var(--brand-orange);outline-offset:2px;
  }
  body.mobile-storefront-ready .storefront-mobile-back:active{background:var(--brand-orange-soft);}
  body.mobile-storefront-ready #buy-modal .modal-header .storefront-mobile-back{grid-column:1;grid-row:1;}
  body.mobile-storefront-ready #buy-modal .modal-header:has(.storefront-mobile-back) .modal-title-wrap{
    display:grid;grid-template-columns:32px minmax(0,1fr);grid-template-rows:auto auto;
    grid-column:2;grid-row:1;min-width:0;gap:3px 8px!important;align-items:center;
  }
  body.mobile-storefront-ready #buy-modal .modal-header:has(.storefront-mobile-back) .sku-icon{
    grid-column:1;grid-row:1 / span 2;align-self:center;
    width:32px!important;height:32px!important;min-width:32px;flex-basis:32px;padding:0;
  }
  body.mobile-storefront-ready #buy-modal .modal-header:has(.storefront-mobile-back) .modal-title{
    grid-column:2;grid-row:1;min-width:0;max-width:none;width:auto;margin:0;
    font-size:14px!important;font-weight:800;line-height:20px;white-space:normal;
    overflow-wrap:anywhere;word-break:normal;letter-spacing:0;
  }
  body.mobile-storefront-ready #buy-modal .modal-header:has(.storefront-mobile-back) #modal-delivery-tag{
    grid-column:2;grid-row:2;justify-self:start;min-width:0;max-width:100%;
    margin:0;padding:2px 5px;font-size:10px!important;line-height:16px;
    white-space:normal;overflow-wrap:anywhere;
  }
  body.mobile-storefront-ready #buy-modal .modal-header:has(.storefront-mobile-back)>.storefront-link-copy{
    display:flex;flex-direction:column;align-items:center;justify-content:center;
    grid-column:3;grid-row:1;box-sizing:border-box;width:62px;min-width:62px;
    min-height:48px;padding:5px 3px;gap:3px;font-size:10.5px;line-height:15px;
    border-radius:10px;background:var(--bg-surface);color:var(--text-primary);
  }
  body.mobile-storefront-ready #buy-modal .storefront-link-copy::before{
    content:"";display:block;width:16px;height:16px;background:currentColor;
    -webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m10 13 4-4M8 16l-1 1a4.2 4.2 0 0 1-6-6l5-5a4.2 4.2 0 0 1 6 0m0 12a4.2 4.2 0 0 0 6 0l5-5a4.2 4.2 0 0 0-6-6l-1 1' transform='translate(1 0)' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E") center/contain no-repeat;
    mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m10 13 4-4M8 16l-1 1a4.2 4.2 0 0 1-6-6l5-5a4.2 4.2 0 0 1 6 0m0 12a4.2 4.2 0 0 0 6 0l5-5a4.2 4.2 0 0 0-6-6l-1 1' transform='translate(1 0)' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E") center/contain no-repeat;
  }
  body.mobile-storefront-ready #buy-modal .modal-header:has(.storefront-mobile-back)>.btn-close{display:none!important;}
  body.mobile-storefront-ready .modal-backdrop[id] .dialog-head:has(>.storefront-mobile-back){position:relative;}
  body.mobile-storefront-ready .modal-backdrop[id] .dialog-head>.storefront-mobile-back{
    position:absolute;left:max(10px,env(safe-area-inset-left,0px));
    top:calc(50% + env(safe-area-inset-top,0px)/2);transform:translateY(-50%);z-index:1;
  }
  body.mobile-storefront-ready .modal-backdrop[id] .dialog-head:has(>.storefront-mobile-back)>.btn-close{display:none!important;}
}
