/* Buildner Books: the buy bar on every book page (buy-bar.js). The same materials as the header
   (white, blur, one hairline), the page's edition picker (the chosen edition yellow with an ink
   border, the same focus ring) and its dark "Add to bag" button. Type: 15 title, 14 controls,
   13 small grey, the eyebrow in the sheet. */
.ad-mobile-buy{display:none!important}   /* the bar below replaces the prototype's phone bar */
.buy-bar{--ad-pad:clamp(24px,4.5vw,80px);position:fixed;left:0;right:0;bottom:0;z-index:18;background:#fffffffa;backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);border-top:1px solid var(--line);padding-bottom:env(safe-area-inset-bottom);transform:translateY(105%);transition:transform .28s ease,box-shadow .28s ease}
.buy-bar.is-on{transform:none;box-shadow:0 -10px 30px rgba(20,20,20,.06)}
.buy-bar-row{display:flex;align-items:center;gap:24px;min-height:76px;padding:12px var(--ad-pad)}
.buy-bar-book{display:flex;align-items:center;gap:14px;flex:1;min-width:0}
.buy-bar-cover{width:36px;height:44px;flex:0 0 auto;object-fit:contain;background:#f0f0eb;mix-blend-mode:multiply}
.buy-bar-text{display:block;min-width:0}
.buy-bar-title{display:block;font-size:15px;line-height:1.3;letter-spacing:-.01em;color:var(--ink);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.buy-bar-format{display:block;margin-top:2px;font-size:13px;line-height:1.4;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.buy-bar-editions{display:flex;gap:8px;margin:0;padding:0;border:0;flex:0 0 auto}
.buy-bar-option{position:relative;display:flex;align-items:center;gap:10px;min-height:48px;padding:0 16px;border:1px solid #cacac3;background:#fff;font-size:14px;cursor:pointer;transition:border-color .18s,background .18s}
.buy-bar-option:hover{border-color:var(--ink)}
.buy-bar-option input{position:absolute;inset:0;width:100%;height:100%;margin:0;opacity:0;cursor:pointer}
.buy-bar-option b{font-weight:700}
.buy-bar-option:has(input:checked){background:#f3f0af;border-color:var(--ink);box-shadow:inset 0 0 0 1px var(--ink)}
.buy-bar-option:has(input:focus-visible){outline:3px solid #4158ed;outline-offset:3px}
.buy-bar .buy-bar-add{margin:0;flex:0 0 auto;min-height:52px;padding:0 20px;gap:28px;font-size:14px}
.buy-bar .buy-bar-add span{font-size:18px}
.buy-bar-change{display:none}
.buy-bar-edition,.buy-bar-benefit{display:none}
.buy-bar.is-single .buy-bar-book{flex:1}

/* Tablets and phones: the chosen edition, and a sheet with all of them */
.buy-sheet{position:absolute;left:0;right:0;bottom:100%;max-height:min(70vh,560px);overflow:auto;padding:18px var(--ad-pad) 8px;background:#fff;border-top:1px solid var(--line);box-shadow:0 -14px 34px rgba(20,20,20,.1)}
.buy-sheet[hidden]{display:none}
.buy-sheet-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:12px}
.buy-sheet-head .eyebrow{font-size:12px}
.buy-sheet .buy-sheet-close{width:44px;height:44px;min-height:44px;padding:0;justify-content:center;font-size:26px;line-height:1}
.buy-sheet .format-option{margin-bottom:8px}
.buy-scrim{position:fixed;inset:0;z-index:17;background:rgba(20,20,20,.28)}
/* the open sheet is the top layer, over the cookie notice (meta.css, z-index 25) too */
.buy-bar.is-open{z-index:30}
.buy-scrim[hidden]{display:none}

/* The end of the page stays readable above the bar */
body.on-book .footer{padding-bottom:calc(25px + 77px)}

@media(max-width:1000px){
  .buy-bar:not(.is-single) .buy-bar-book,.buy-bar-editions{display:none}
  .buy-bar-change{display:flex;align-items:center;gap:12px;flex:1;min-width:0;min-height:52px;padding:0;text-align:left;justify-content:space-between}
  .buy-bar-chevron{flex:0 0 auto;width:32px;height:32px;display:grid;place-items:center;border:1px solid #cacac3;border-radius:50%;font-size:14px;transition:transform .2s}
  .buy-bar.is-open .buy-bar-chevron{transform:rotate(180deg)}
}
@media(max-width:700px){
  .buy-bar{--ad-pad:22px}
  .buy-bar-row{gap:14px;min-height:68px;padding:10px var(--ad-pad)}
  .buy-bar-title{font-size:14px}
  .buy-bar .buy-bar-add{min-height:48px;padding:0 16px;gap:14px}
  .buy-bar .buy-bar-add span{font-size:16px}
  .buy-bar-cover{display:none}
  /* phones: the chosen edition is the line to read (the page already says which book), the price is on the button */
  .buy-bar-change .buy-bar-title,.buy-bar-change .buy-bar-format{display:none}
  .buy-bar-edition{display:block;font-size:15px;line-height:1.3;color:var(--ink)}
  .buy-bar-benefit{display:block;margin-top:2px;font-size:13px;line-height:1.4;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  body.on-book .footer{padding-bottom:calc(110px + env(safe-area-inset-bottom))}
}
@media(max-width:380px){
  .buy-bar .buy-bar-add{padding:0 14px;gap:10px}
  .buy-bar-chevron{display:none}
}
@media(prefers-reduced-motion:reduce){.buy-bar,.buy-bar-chevron{transition:none}}
/* A translation's longer words for Add to bag (i18n.py): on a phone the bar's button keeps the short part (Aggiungi). */
@media (max-width:700px){.buy-bar-long{display:none}}
