/* HAVIO shop pages: checkout, order status, tracking, returns (shop.js), plus the product-page buying details.
   Phone first; larger screens get a two-column checkout with a sticky order summary. */

/* Product page additions */
.tax-note{font-size:12px;color:var(--muted);margin-top:4px}
.preview-label.is-out{color:#a23b2a}
.buy-now{background:var(--white);border:1px solid var(--ink);color:var(--ink)}
.buy-now:hover{background:var(--ink);color:var(--white)}
.product-promises{list-style:none;margin:16px 0 0;padding:0;display:grid;gap:8px;font-size:13px;color:var(--ink)}
.product-promises li{display:flex;gap:10px;align-items:flex-start;line-height:1.5}
.product-promises li:before{content:"";flex:0 0 16px;height:16px;margin-top:2px;border-radius:50%;background:var(--brand) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4.5 8.3l2.2 2.2 4.8-5' fill='none' stroke='%23134a75' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/16px no-repeat}
.declarations{display:grid;gap:0;margin:0 0 6px}
.declarations>div{display:grid;grid-template-columns:minmax(110px,38%) 1fr;gap:12px;padding:9px 0;border-bottom:1px solid var(--line);font-size:13px;line-height:1.55}
.declarations dt{color:var(--muted)}
.declarations dd{margin:0;color:var(--ink)}
.declarations small{color:var(--muted)}
.to-fill{display:inline-block;padding:1px 8px;border-radius:4px;background:#fff3cd;color:#7a5a00;font-size:12px}
.quick-add.is-out{color:var(--muted);font-size:12px;cursor:default}
.origin-filter{display:flex;flex-wrap:wrap;align-items:center;gap:8px 12px;font-size:12px;color:var(--muted)}
.origin-filter select{font:inherit;color:var(--ink);background:var(--white);border:1px solid var(--line);border-radius:999px;padding:6px 12px;min-height:36px}
.origin-sort{display:inline-flex;align-items:center;gap:6px}
.collection-note{font-size:10px;letter-spacing:.8px;color:var(--muted);text-align:right}
.footer-legal{font-size:12px;color:var(--muted);line-height:1.6;padding:0 0 14px;margin:0}
.checkout-button.is-disabled{opacity:.45;pointer-events:none}

/* Page frame */
.shop-page{padding-top:28px;padding-bottom:80px;max-width:1180px}
.shop-page h1{font-size:clamp(30px,4vw,46px);line-height:1.1;letter-spacing:-1.2px;margin:6px 0 14px}
.shop-page h1:focus{outline:none}
.shop-page h2{font-size:17px;letter-spacing:-.2px;margin:0 0 12px}
.shop-page .eyebrow{font-size:11px;letter-spacing:1.4px;color:var(--muted);margin-top:4px}
.shop-lead{font-size:15px;line-height:1.7;color:var(--muted);max-width:620px;margin:0 0 22px}
.shop-loading{color:var(--muted);font-size:14px;padding:30px 0}
.shop-actions{display:flex;flex-wrap:wrap;gap:10px;margin:18px 0}
.shop-actions .button{min-height:48px}
.shop-actions .button:not(.button-dark),.tracking-box .button{border:1px solid var(--ink);background:var(--white);color:var(--ink)}
.shop-actions .button:not(.button-dark):hover{background:var(--ink);color:var(--white)}
.preview-banner{background:#fff6dc;border:1px solid #f0dc9b;color:#5c4a12;font-size:13px;line-height:1.6;padding:12px 14px;margin:4px 0 18px;border-radius:6px}
.secure-note{display:flex;align-items:center;gap:8px;font-size:13px;color:var(--muted);margin:0 0 20px}
.secure-note svg{width:16px;height:16px;stroke-width:1.8}
.smallprint{font-size:12px;color:var(--muted);line-height:1.6;margin:12px 0 0}
.text-link{background:none;border:0;padding:0;color:var(--accent);text-decoration:underline;text-underline-offset:3px;cursor:pointer;font:inherit;font-size:13px;min-height:32px}

/* Forms */
.checkout-section{border:1px solid var(--line);background:var(--white);border-radius:10px;padding:18px 16px 20px;margin:0 0 16px;min-width:0}
.checkout-section legend{display:flex;align-items:center;gap:10px;font-size:16px;font-weight:600;padding:0 6px;margin-left:-6px}
.step{display:inline-grid;place-items:center;width:26px;height:26px;border-radius:50%;background:var(--brand);color:var(--brand-text);font-size:13px;font-weight:700}
.field{margin:0 0 14px}
.field label{display:block;font-size:13px;font-weight:500;margin:0 0 6px;color:var(--ink)}
.optional{font-weight:400;color:var(--muted)}
.field input,.field select,.field textarea,.mini-form input{width:100%;font:inherit;font-size:16px;color:var(--ink);background:var(--white);border:1px solid #c9d1d8;border-radius:8px;padding:12px 13px;min-height:48px;box-sizing:border-box;transition:border-color .15s,box-shadow .15s}
.field textarea{min-height:76px;resize:vertical}
.field input:focus,.field select:focus,.field textarea:focus{outline:none;border-color:var(--accent);box-shadow:0 0 0 3px rgba(35,115,179,.18)}
.field [aria-invalid="true"]{border-color:#b3261e;box-shadow:0 0 0 3px rgba(179,38,30,.12)}
.input-prefix{display:flex;align-items:stretch}
.input-prefix>span{display:grid;place-items:center;padding:0 12px;border:1px solid #c9d1d8;border-right:0;border-radius:8px 0 0 8px;background:var(--cream);font-size:15px;color:var(--muted)}
.input-prefix input{border-radius:0 8px 8px 0}
.field-hint{font-size:12px;color:var(--muted);margin:6px 0 0;line-height:1.5}
.field-error{font-size:13px;color:#b3261e;margin:6px 0 0;line-height:1.5}
.field-row{display:grid;grid-template-columns:1fr;gap:0}
.delivery-estimate{font-size:13px;color:var(--muted);margin:2px 0 0;line-height:1.6}
.error-summary{border:1px solid #e3b6b1;background:#fdf1ef;color:#5f1a14;border-radius:8px;padding:12px 14px;margin:0 0 16px;font-size:14px}
.error-summary ul{margin:6px 0 0;padding-left:18px}
.error-summary a{color:#8c1d15}
.form-notice{border-radius:8px;padding:12px 14px;margin:12px 0;font-size:14px;line-height:1.6}
.form-notice.is-error{background:#fdf1ef;border:1px solid #e3b6b1;color:#5f1a14}
.form-notice.is-info{background:var(--tint);border:1px solid var(--line);color:var(--ink)}
.form-notice.is-success{background:#eef8f0;border:1px solid #bfe0c6;color:#1d4d27}
.check{display:flex;gap:12px;align-items:flex-start;font-size:14px;line-height:1.55;margin:12px 0;cursor:pointer;min-height:44px}
.check input{flex:0 0 20px;width:20px;height:20px;margin:1px 0 0;accent-color:var(--accent)}
.check a{color:var(--accent)}
.pay-options{display:grid;gap:10px}
.pay-option{display:flex;gap:12px;align-items:flex-start;border:1px solid #c9d1d8;border-radius:10px;padding:14px;cursor:pointer;background:var(--white);min-height:56px;transition:border-color .15s,background .15s}
.pay-option input{flex:0 0 20px;width:20px;height:20px;margin:2px 0 0;accent-color:var(--accent)}
.pay-option strong{display:block;font-size:15px}
.pay-option small{display:block;font-size:13px;color:var(--muted);line-height:1.5;margin-top:2px}
.pay-option:has(input:checked){border-color:var(--accent);background:var(--tint);box-shadow:0 0 0 1px var(--accent)}
.pay-option.is-disabled{opacity:.55;cursor:not-allowed}
.place-order{width:100%;min-height:54px;font-size:15px;margin-top:8px;justify-content:center}
.spinner{display:inline-block;width:14px;height:14px;border:2px solid currentColor;border-right-color:transparent;border-radius:50%;animation:spin .7s linear infinite;vertical-align:-2px}
@keyframes spin{to{transform:rotate(360deg)}}
.mini-form{max-width:460px}
.mini-form .button{min-height:50px;width:100%;justify-content:center}

/* Order summary and totals */
.checkout-layout{display:grid;grid-template-columns:1fr;gap:16px}
.checkout-summary details{border:1px solid var(--line);background:var(--white);border-radius:10px;padding:0 16px}
.checkout-summary summary{display:flex;justify-content:space-between;align-items:center;min-height:56px;cursor:pointer;font-size:15px;font-weight:600;list-style:none}
.checkout-summary summary::-webkit-details-marker{display:none}
.checkout-summary summary span:after{content:" ▾";font-size:12px;color:var(--muted)}
.checkout-summary details[open] summary span:after{content:" ▴"}
.checkout-summary details>.text-link{margin:4px 0 14px}
.order-lines{list-style:none;margin:0;padding:0}
.order-lines li{display:grid;grid-template-columns:56px 1fr auto;gap:12px;align-items:center;padding:10px 0;border-bottom:1px solid var(--line);font-size:14px}
.line-thumb{width:56px;height:56px;border-radius:8px;overflow:hidden;background:var(--tile)}
.line-thumb img{width:100%;height:100%;object-fit:cover;display:block}
.line-name small{display:block;color:var(--muted);font-size:12px;margin-top:2px}
.line-total{font-weight:600}
.totals{margin:12px 0 0;display:grid;gap:6px;font-size:14px}
.totals>div{display:flex;justify-content:space-between;gap:12px}
.totals dt{color:var(--muted)}
.totals dd{margin:0}
.totals .saving dd{color:#1d6b35}
.totals .free{color:#1d6b35;font-weight:600}
.totals .grand{border-top:1px solid var(--line);padding-top:10px;margin-top:4px;font-size:17px;font-weight:700}
.totals .grand dt{color:var(--ink)}
.you-save{font-size:13px;color:#1d6b35;margin:8px 0 0}
.free-hint{font-size:13px;color:var(--accent);margin:6px 0 12px}
.review-totals .totals{margin-top:0}
.checkout-bar{display:none}

/* Order page */
.order-hero{background:var(--tint);border-radius:12px;padding:16px 18px;margin:0 0 18px}
.order-number{font-size:13px;color:var(--muted);margin:0 0 6px}
.order-status-text{font-size:16px;line-height:1.6;margin:0}
.order-hero.status-cancelled{background:#f4f1ee}
.order-hero.status-pending_payment{background:#fff6dc}
.order-steps{list-style:none;display:grid;grid-template-columns:repeat(5,1fr);margin:0 0 22px;padding:0;counter-reset:step}
.order-steps li{position:relative;text-align:center;font-size:11px;color:var(--muted);padding-top:30px;line-height:1.3}
.order-steps li:before{content:"";position:absolute;top:8px;left:50%;width:14px;height:14px;margin-left:-7px;border-radius:50%;background:var(--white);border:2px solid #c9d1d8;z-index:1}
.order-steps li:after{content:"";position:absolute;top:14px;left:-50%;width:100%;height:2px;background:#c9d1d8}
.order-steps li:first-child:after{display:none}
.order-steps li.done:before,.order-steps li.current:before{background:var(--accent);border-color:var(--accent)}
.order-steps li.done:after,.order-steps li.current:after{background:var(--accent)}
.order-steps li.current{color:var(--ink);font-weight:600}
.pay-box,.tracking-box,.cancel-box,.preview-tools{border:1px solid var(--line);background:var(--white);border-radius:10px;padding:16px;margin:0 0 16px}
.cancel-box{border-color:#e3b6b1}
.preview-tools{background:#fffaf0;border-style:dashed;font-size:13px}
.order-grid{display:grid;grid-template-columns:1fr;gap:16px}
.order-card{border:1px solid var(--line);background:var(--white);border-radius:10px;padding:16px;margin:0 0 16px}
.order-grid .order-card{margin:0}
.order-card p{font-size:14px;line-height:1.7;margin:0 0 14px}
.refund-line{color:#1d6b35}
.timeline{list-style:none;margin:0;padding:0}
.timeline li{display:grid;grid-template-columns:1fr;gap:2px;padding:10px 0 10px 18px;border-left:2px solid var(--line);position:relative;font-size:14px;line-height:1.5}
.timeline li:before{content:"";position:absolute;left:-6px;top:15px;width:10px;height:10px;border-radius:50%;background:var(--accent)}
.timeline time{font-size:12px;color:var(--muted)}
.order-actions .button{flex:1 1 160px;justify-content:center}
.recent-orders{margin-top:34px;max-width:560px}
.recent-orders ul{list-style:none;margin:0;padding:0;border-top:1px solid var(--line)}
.recent-orders a{display:flex;align-items:center;gap:12px;min-height:56px;border-bottom:1px solid var(--line);font-size:14px;text-decoration:none;color:var(--ink)}
.recent-orders a span:nth-child(2){color:var(--muted);flex:1}
.track-card{margin-top:20px}
.next-steps{font-size:14px;line-height:1.8;padding-left:20px;margin:0 0 10px}
.return-item{display:flex;justify-content:space-between;align-items:center;gap:12px;border-bottom:1px solid var(--line)}
.qty-pick{font-size:13px;color:var(--muted);display:flex;align-items:center;gap:6px}
.qty-pick select{font:inherit;min-height:36px;border:1px solid #c9d1d8;border-radius:6px;padding:4px 8px}
.fee-note{font-size:13px;color:#7a5a00;background:#fff6dc;border-radius:6px;padding:8px 10px}

@media (max-width:767.98px){
  .product-purchase .button-dark{flex:1 1 0;justify-content:space-between}
  .product-purchase .buy-now{flex:1 1 100%;justify-content:space-between}
  .is-checkout-view .mobile-tabbar{display:none}
  body.is-checkout-view{padding-bottom:calc(78px + env(safe-area-inset-bottom,0px))}
  .checkout-bar{display:flex;position:fixed;inset:auto 0 0;z-index:36;align-items:center;justify-content:space-between;gap:14px;padding:10px 16px calc(10px + env(safe-area-inset-bottom,0px));background:#fffffff2;-webkit-backdrop-filter:blur(14px);backdrop-filter:blur(14px);border-top:1px solid var(--line)}
  .checkout-bar small{display:block;font-size:11px;color:var(--muted)}
  .checkout-bar strong{font-size:18px}
  .checkout-bar .button{min-height:50px;padding-inline:18px;font-size:14px;flex:0 1 auto}
  .shop-page{padding-top:18px;padding-bottom:40px}
  .order-steps li{font-size:10px}
  .collection-note{display:none}
}
@media (min-width:560px){
  .field-row{grid-template-columns:1fr 1fr;gap:0 14px}
}
@media (min-width:900px){
  .checkout-layout{grid-template-columns:minmax(0,1fr) 380px;gap:28px;align-items:start}
  .checkout-summary{order:2;position:sticky;top:96px}
  .checkout-form{order:1}
  .checkout-summary details{padding:0 20px}
  .checkout-summary summary{pointer-events:none}
  .checkout-summary summary span:after{content:none}
  .checkout-section{padding:22px 22px 24px}
  .order-grid{grid-template-columns:1.4fr 1fr}
}
@media (prefers-reduced-motion:reduce){.spinner{animation-duration:2s}}
