/* Cookbook Shelf mobile commerce/account layer.
 * The desktop pages keep their existing editorial treatment; this file only resolves
 * narrow-screen hierarchy, touch sizing and safe-area overlap without changing hooks or forms.
 */
@media (max-width: 768px) {
  :where(.cart-page,.co-page,.order-success-page,.auth-page,.acct-page,.profile-content) input,
  :where(.cart-page,.co-page,.order-success-page,.auth-page,.acct-page,.profile-content) select,
  :where(.cart-page,.co-page,.order-success-page,.auth-page,.acct-page,.profile-content) textarea {
    font-size:16px!important;
  }

  /* Cart — a compact order ticket with one persistent checkout decision. */
  body.cooking .cart-page{padding:18px 0 calc(160px + env(safe-area-inset-bottom,0px))!important}
  body.cooking .cart-page>.container{width:100%!important;padding-inline:14px!important}
  body.cooking .cart-page-head{display:grid!important;grid-template-columns:1fr!important;gap:2px!important;margin-bottom:16px!important;padding-bottom:14px!important}
  body.cooking .cart-page-head h1{display:block!important;font-size:34px!important;line-height:1.04!important}
  body.cooking .cart-page-head h1:before{margin-bottom:8px!important;font-size:9px!important;line-height:1.2!important}
  body.cooking .cart-page-head>a{width:max-content;min-height:44px;align-items:center;margin-top:2px}
  body.cooking #cart-layout{grid-template-columns:minmax(0,1fr)!important;gap:16px!important}
  body.cooking #cart-layout>div{min-width:0!important}
  body.cooking #cart-items-list{min-width:0!important}
  body.cooking #reward-bar{padding:13px 14px!important}
  body.cooking #reward-bar-msg{font-size:12px!important;line-height:1.42!important}
  body.cooking .cart-item-card{display:grid;grid-template-columns:74px minmax(0,1fr) auto;gap:10px!important;padding:12px!important;align-items:start}
  body.cooking .cart-item-img{grid-row:1/3;width:74px!important;height:102px!important}
  body.cooking .cart-item-card>div{min-width:0}
  body.cooking .cart-item-card h3,body.cooking .cart-item-card a{overflow-wrap:anywhere}
  body.cooking .cart-qty-wrap{min-height:46px}
  body.cooking .cart-qty-btn{width:44px!important;height:44px!important}
  body.cooking .cart-qty-input{width:42px!important;height:44px!important}
  body.cooking .cart-remove-btn{min-width:44px!important;min-height:44px!important}
  body.cooking #cart-items details summary{min-height:52px;padding-inline:14px!important}
  body.cooking #promo-btn{min-width:92px!important;min-height:48px!important}
  body.cooking #upsell-grid{display:flex!important;grid-template-columns:none!important;gap:12px!important;overflow-x:auto;padding:2px 2px 10px;scroll-snap-type:x proximity}
  body.cooking #upsell-grid>*{min-width:156px;scroll-snap-align:start}
  body.cooking #cart-sidebar{display:none!important}
  body.cooking #cart-sticky-bar.cart-has-items{
    display:block!important;left:0!important;right:0!important;bottom:0!important;
    border-top:1px solid #d8ded9!important;background:rgba(255,253,250,.97)!important;
    box-shadow:0 -14px 36px rgba(34,24,17,.14)!important;backdrop-filter:blur(14px)
  }
  body.cooking #sticky-reward{padding:8px 14px 7px!important}
  body.cooking #cart-sticky-bar>div:last-child{min-height:68px;padding:10px 14px calc(10px + env(safe-area-inset-bottom,0px))!important}
  body.cooking #cart-sticky-bar a[href="/checkout"]{min-width:156px;min-height:50px;padding:0 20px!important;justify-content:center;font-size:15px!important;background:#c86422!important}
  body.cooking #upsell-grid .pcard-add-btn{min-height:44px!important}
  body.cooking .cart-empty-state{padding:44px 20px!important}
  body.cooking .cart-empty-state>a{min-height:50px;justify-content:center}

  /* Checkout — progress stays readable and the summary never competes with the form. */
  body.cooking[data-page="checkout"] .co-shell-inner{padding-inline:14px!important}
  body.cooking[data-page="checkout"] .co-shell-logo{font-size:19px!important;line-height:1.05!important}
  body.cooking[data-page="checkout"] .co-shell-secure{font-size:9px!important;letter-spacing:.1em!important}
  body.cooking[data-page="checkout"] .co-page{padding:14px 0 34px!important}
  body.cooking[data-page="checkout"] .co-page>.container{width:100%!important;padding-inline:12px!important}
  body.cooking[data-page="checkout"] .co-progress{display:grid!important;grid-template-columns:auto 1fr auto 1fr auto;gap:4px;align-items:center;margin-bottom:12px!important;padding:7px 8px!important;border-radius:14px!important}
  body.cooking[data-page="checkout"] .co-progress-step{min-width:0;min-height:44px;justify-content:center;font-size:8px!important;line-height:1.12!important;text-align:center;letter-spacing:.03em!important}
  body.cooking[data-page="checkout"] .co-progress-step span{flex:0 0 25px}
  body.cooking[data-page="checkout"] .co-progress i{width:100%;min-width:8px!important;margin:0!important}
  body.cooking[data-page="checkout"] .co-contact-card{padding:25px 18px 21px!important}
  body.cooking[data-page="checkout"] .co-contact-card h2{font-size:31px!important;line-height:1.02!important}
  body.cooking[data-page="checkout"] .co-lead{font-size:14px!important;line-height:1.5!important}
  body.cooking[data-page="checkout"] .co-label{font-size:10px!important;line-height:1.3!important}
  body.cooking[data-page="checkout"] :where(.co-input,.phone-group,.phone-cc,.co-btn,.co-step-back,.co-saved-btn,.co-saved-back,.co-review-edit){min-height:44px!important}
  body.cooking[data-page="checkout"] .phone-input{height:44px!important;font-size:16px!important}
  body.cooking[data-page="checkout"] .co-btn{width:100%;min-height:56px!important}
  body.cooking[data-page="checkout"] .co-step-back{display:inline-flex;align-items:center;padding:0 4px}
  body.cooking[data-page="checkout"] .co-review-edit{display:inline-flex;align-items:center;padding-inline:12px}
  body.cooking[data-page="checkout"] .co-summary{padding:0 18px 18px!important}
  body.cooking[data-page="checkout"] .co-summary:before{margin-inline:-18px;padding-inline:18px}
  body.cooking[data-page="checkout"] #checkout-items>div{gap:10px!important}
  body.cooking[data-page="checkout"] #checkout-items img{width:56px!important;height:72px!important}
  body.cooking[data-page="checkout"] .co-summary-total #checkout-total{font-size:28px!important}

  /* Order receipt — private details and long book names wrap inside the ticket. */
  body.cooking .order-success-page{padding:28px 0 calc(42px + env(safe-area-inset-bottom,0px))!important}
  body.cooking .order-success-shell{width:100%!important;padding-inline:14px!important}
  body.cooking .order-success-hero{margin-bottom:24px!important;padding-inline:4px}
  body.cooking .order-success-mark{width:62px!important;height:62px!important;margin-bottom:14px!important}
  body.cooking .order-success-hero h1{font-size:31px!important;line-height:1.06!important}
  body.cooking .order-success-hero p{font-size:14px!important;line-height:1.55!important}
  body.cooking .order-ticket{border-radius:16px!important}
  body.cooking .order-ticket-head{align-items:flex-start!important;padding:17px!important}
  body.cooking .order-ticket-grid{grid-template-columns:1fr!important;gap:13px!important}
  body.cooking .order-ticket-customer,body.cooking .order-ticket-items{padding:17px!important}
  body.cooking .order-ticket-item{align-items:flex-start!important;gap:12px!important}
  body.cooking .order-ticket-item>div:first-child{min-width:0;overflow-wrap:anywhere}
  body.cooking .order-ticket-total{padding:15px 17px!important}
  body.cooking .order-success-actions{display:grid!important;grid-template-columns:1fr!important;gap:10px!important}
  body.cooking .order-success-actions a{width:100%;min-height:50px;justify-content:center;box-sizing:border-box}

  /* Access pages — one coherent shell for sign-in, recovery and invalid-link states. */
  body.cooking[data-page="login"] .auth-intro{min-height:310px!important;padding:72px 18px 38px!important}
  body.cooking[data-page="login"] .auth-intro h1{font-size:36px!important;line-height:.98!important}
  body.cooking[data-page="login"] .auth-intro>p{font-size:13px!important;line-height:1.45!important}
  body.cooking[data-page="login"] .auth-card{padding:24px 18px calc(38px + env(safe-area-inset-bottom,0px))!important}
  body.cooking[data-page="login"] .auth-card-heading h2{font-size:29px!important}
  body.cooking[data-page="login"] :where(.auth-tab,.auth-google,.auth-submit,.auth-input,.phone-group,.phone-cc,.pw-eye,.auth-back){min-height:44px!important}
  body.cooking[data-page="login"] .auth-brand{min-width:44px;min-height:44px}
  body.cooking[data-page="login"] a[href="/forgot-password"],body.cooking[data-page="login"] .auth-recovery-card a{display:inline-flex;align-items:center;min-height:44px}
  body.cooking[data-page="login"] .phone-input{height:44px!important;font-size:16px!important}
  body.cooking[data-page="login"] #register-form label:has(input[type="checkbox"]){min-height:44px;align-items:center!important}
  body.cooking[data-page="login"] #register-form input[type="checkbox"]{width:24px!important;height:24px!important;margin-top:0!important}
  body.cooking[data-page="login"] .auth-page-compact .auth-intro{min-height:250px!important;justify-content:flex-end}
  body.cooking[data-page="login"] .auth-page-compact .auth-intro h1{font-size:34px!important;margin-bottom:10px!important}
  body.cooking[data-page="login"] .auth-page-compact .auth-card{min-height:300px;justify-content:flex-start;padding-top:30px!important}
  body.cooking[data-page="login"] .auth-recovery-card{margin-top:0!important}

  /* Account — the identity card becomes a header; tabs remain reachable by touch. */
  body.cooking .acct-page{padding:18px 0 calc(92px + env(safe-area-inset-bottom,0px))!important}
  body.cooking .acct-shell{width:100%!important;padding-inline:14px!important;gap:14px!important}
  body.cooking .acct-card{grid-template-columns:48px minmax(0,1fr)!important;padding:13px!important}
  body.cooking .acct-mail{font-size:12px!important}
  body.cooking .acct-nav{margin-inline:-14px;padding:5px 14px!important;border-inline:0!important;border-radius:0!important;scroll-padding-inline:14px}
  body.cooking .acct-nav-item{min-height:44px!important;padding-inline:13px!important}
  body.cooking .acct-title{font-size:34px!important;line-height:1.02!important}
  body.cooking .acct-sub{font-size:14px!important;line-height:1.45!important}
  body.cooking .acct-panel,body.cooking .acct-main>div[style*="background:#fff"]{padding:17px!important}
  body.cooking .acct-row{align-items:flex-start;flex-direction:column}
  body.cooking .acct-btn-sm,body.cooking .acct-cta{min-height:44px!important;justify-content:center}
  body.cooking .acct-order-head{align-items:flex-start}
  body.cooking .acct-order-acts{width:100%;margin-left:0;gap:8px}
  body.cooking .acct-act{min-height:44px!important;padding:0 9px!important;border:1px solid #d8ded9!important;border-radius:4px!important}
  body.cooking .acct-book{display:flex!important;flex-wrap:wrap;align-items:flex-start;gap:10px!important}
  body.cooking .acct-book-link{display:flex!important;flex:1 1 calc(100% - 84px);min-width:0}
  body.cooking .acct-book-link img,body.cooking .acct-book-nocover{flex:0 0 58px}
  body.cooking .acct-book-money{flex:0 0 auto;margin:0!important;padding:0!important}
  body.cooking .acct-book-qtyblock{min-height:44px;margin:0 0 0 68px!important;align-self:flex-end}
  body.cooking .acct-main form{max-width:none!important}
  body.cooking .acct-main button[type="submit"]{width:100%;min-height:48px!important}

  /* Public profile — tabs scroll instead of squeezing into unreadable labels. */
  body.cooking .profile-hero{padding:28px 0 24px}
  body.cooking .profile-hero .container{gap:16px;padding-inline:18px}
  body.cooking .profile-avatar{width:76px;height:76px;font-size:32px}
  body.cooking .profile-info h1{font-size:25px;line-height:1.08}
  body.cooking .profile-stats{width:100%;gap:10px;justify-content:space-between}
  body.cooking .profile-tabs{top:61px;overflow:hidden}
  body.cooking .profile-tabs .container{overflow-x:auto;padding-inline:12px;scroll-snap-type:x proximity}
  body.cooking .profile-tab{min-width:max-content;min-height:48px;padding:12px 15px;font-size:13px;scroll-snap-align:start}
  body.cooking .profile-content{padding:20px 0 calc(86px + env(safe-area-inset-bottom,0px))}
  body.cooking .profile-content .container{padding-inline:14px}
  body.cooking .content-card{padding:16px;border-radius:10px}
}

@media (max-width: 380px) {
  body.cooking[data-page="checkout"] .co-shell-logo{font-size:17px!important}
  body.cooking[data-page="checkout"] .co-shell-secure{max-width:82px;text-align:right}
  body.cooking[data-page="checkout"] .co-progress-step{font-size:7px!important}
  body.cooking .cart-item-card{grid-template-columns:66px minmax(0,1fr) auto}
  body.cooking .cart-item-img{width:66px!important;height:92px!important}
  body.cooking .acct-stats{grid-template-columns:1fr!important}
}

@media (prefers-reduced-motion: reduce) {
  :where(.cart-page,.co-page,.order-success-page,.auth-page,.acct-page,.profile-content) *{
    scroll-behavior:auto!important;
  }
}
