/* ELMED shop, cart, checkout, order tracking, account status and error pages,
   in Sophia's style. Loaded by base_site.html after elmed.css. */

.shop-hero{padding-bottom:40px}
.shop-hero .split{margin-top:26px}
.shop-hero .page-portrait{max-height:300px}
.shop-section{padding:48px 0 80px}
.shop-section .notice{margin-bottom:18px}

/* search with live suggestions */
.shop-toolbar{align-items:flex-start}
.shop-search{flex:1;max-width:none}
.shop-search form{display:flex;gap:8px;position:relative}
.shop-search form .icon{top:13px}
.shop-search input[type=search]{flex:1;min-width:0}
.shop-search .btn{min-height:47px;padding:10px 20px}
.search-dropdown{position:absolute;left:0;right:0;top:calc(100% + 6px);z-index:30;background:#fff;border:1px solid var(--line);border-radius:14px;box-shadow:var(--shadow);max-height:70vh;overflow-y:auto}
.sd-item{display:flex;align-items:center;gap:12px;padding:10px 14px;border-bottom:1px solid #eef4f1}
.sd-item:hover,.sd-item:focus{background:var(--pale)}
.sd-thumb{width:40px;height:40px;border-radius:8px;background:var(--pale);flex-shrink:0;overflow:hidden;display:flex;align-items:center;justify-content:center}
.sd-thumb img{width:100%;height:100%;object-fit:contain;padding:3px}
.sd-text{flex:1;min-width:0}
.sd-text strong,.sd-text small{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.sd-text strong{font-size:13px}
.sd-text small{font-size:11px;color:var(--teal)}
.sd-price{font-size:13px;font-weight:700;color:var(--teal);flex-shrink:0}
.sd-all{width:100%;border:0;background:#fff;color:var(--teal);font-weight:700;font-size:13px;padding:12px;min-height:44px}

/* filters */
.filter-panel{position:relative;flex-shrink:0}
.filter-panel>summary{list-style:none;display:flex;align-items:center;gap:8px;min-height:47px;padding:10px 16px;border:1px solid #cbded4;border-radius:8px;background:#fff;font-size:14px;font-weight:600;cursor:pointer;white-space:nowrap}
.filter-panel>summary::-webkit-details-marker{display:none}
.filter-panel>summary .icon{width:18px;height:18px;color:var(--teal)}
.filter-panel[open]>summary{border-color:var(--teal);background:var(--pale)}
.filter-on{background:var(--teal);color:#fff;font-size:10px;padding:2px 7px;border-radius:10px}
.filter-body{position:absolute;right:0;top:calc(100% + 8px);z-index:25;width:340px;background:#fff;border:1px solid var(--line);border-radius:14px;box-shadow:var(--shadow);padding:20px;display:grid;grid-template-columns:1fr 1fr;gap:0 14px}
.filter-body .field{margin-bottom:14px}
.filter-body .field:nth-child(-n+2){grid-column:1/-1}
.filter-check,.filter-actions{grid-column:1/-1}
.filter-check{margin:0 0 16px}
.filter-actions{display:flex;gap:10px}
.filter-actions .btn{flex:1;min-height:44px;padding:10px}

.pill-row{display:flex;gap:8px;overflow-x:auto;padding:4px 0 10px;margin-bottom:12px;scrollbar-width:none;-webkit-overflow-scrolling:touch}
.pill-row::-webkit-scrollbar{display:none}
.pill{flex-shrink:0;display:inline-flex;align-items:center;min-height:40px;padding:8px 16px;border:1px solid var(--line);border-radius:30px;font-size:13px;font-weight:600;background:#fff;white-space:nowrap}
.pill:hover{border-color:var(--teal);color:var(--teal)}
.pill[aria-current="page"]{background:var(--teal);border-color:var(--teal);color:#fff}

.results-bar{display:flex;gap:16px;align-items:baseline;flex-wrap:wrap;margin-bottom:18px}
.results-bar strong{color:var(--ink)}

/* product cards: a real photo sits over the placeholder icon */
.product-card{display:flex;flex-direction:column;background:#fff}
.product-image{position:relative;overflow:hidden}
.product-image img{position:absolute;inset:0;width:100%;height:100%;object-fit:contain;padding:14px;background:#fff}
.product-info{display:flex;flex-direction:column;flex:1}
.product-info h3{font-size:16px;line-height:1.35;margin-bottom:4px}
.product-info h3 a:hover{color:var(--teal)}
.product-generic{font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.product-uses{font-size:12px;color:var(--teal)!important;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;margin-top:4px}
.product-info .product-price{margin:auto 0 12px;padding-top:14px}
.product-info .btn{margin-top:0;min-height:44px}
.out-of-stock{font-size:13px;font-weight:600;color:#b42318!important;padding:10px 0}

.pagination{display:flex;flex-wrap:wrap;justify-content:center;gap:6px;margin-top:36px}
.pagination a,.pagination span{min-width:44px;min-height:44px;display:inline-flex;align-items:center;justify-content:center;padding:0 14px;border:1px solid var(--line);border-radius:8px;font-size:14px;font-weight:600;background:#fff}
.pagination span{border:0;background:none}
.pagination a:hover{border-color:var(--teal);color:var(--teal)}
.pagination a[aria-current="page"]{background:var(--teal);border-color:var(--teal);color:#fff}

.empty-state{text-align:center;padding:56px 24px;border:1px solid var(--line);border-radius:22px;background:#fff}
.empty-state .icon-box{margin:0 auto 20px;width:60px;height:60px}
.empty-state h2{font-size:26px;margin-bottom:10px}
.empty-state p{max-width:460px;margin:0 auto;font-size:15px}
.empty-state .actions{justify-content:center}

.cart-toast{position:fixed;left:16px;right:16px;bottom:24px;z-index:60;max-width:420px;margin:0 auto;display:flex;align-items:center;gap:14px;justify-content:space-between;background:var(--ink);color:#fff;padding:14px 18px;border-radius:12px;box-shadow:0 12px 34px #0f2a254d;font-size:14px}
.cart-toast a{color:var(--mint);font-weight:700;white-space:nowrap;text-decoration:underline;text-underline-offset:3px}
.cart-toast[hidden]{display:none}
.has-tabbar .cart-toast{bottom:calc(76px + env(safe-area-inset-bottom))}

/* product page extras */
.product-gallery>img{display:block}
.buy-row{display:flex;gap:10px}
.buy-row .btn{flex:1}
.qty-stepper{display:inline-flex;align-items:center;border:1px solid #cbded4;border-radius:8px;background:#fff;overflow:hidden;flex-shrink:0}
.qty-stepper button{width:46px;min-height:50px;border:0;background:#fff;font-size:20px;color:var(--ink)}
.qty-stepper button:hover{background:var(--pale)}
.qty-stepper input{width:52px;min-height:50px;border:0;border-radius:0;text-align:center;padding:0;-moz-appearance:textfield}
.qty-stepper input::-webkit-inner-spin-button{-webkit-appearance:none}
.qty-stepper span{min-width:34px;text-align:center;font-weight:700}
.small-stepper button{width:40px;min-height:40px}
.tag-list{list-style:none;padding:0;margin:14px 0 0;display:flex;flex-wrap:wrap;gap:8px}
.tag-list li{font-size:12px;background:var(--pale);border:1px solid var(--line);border-radius:20px;padding:4px 12px}
.review-bars{display:grid;gap:10px;margin-top:12px;max-width:380px}
.review-bars>div{display:grid;grid-template-columns:72px 1fr 44px;gap:10px;align-items:center;font-size:13px}
.review-bars .bar{height:10px;border-radius:6px;background:var(--line);overflow:hidden}
.review-bars .bar span{display:block;height:100%;border-radius:6px}
.review-bars .good{background:#059669}
.review-bars .mid{background:#d97706}
.review-bars .bad{background:#dc2626}

/* cart / checkout / tracking pages */
.shop-page{background:linear-gradient(180deg,#f5faf7,#fff 420px);padding:28px 0 80px}
.shop-page .breadcrumb{padding-top:0;margin-bottom:22px;flex-wrap:wrap}
.shop-page-head{display:flex;justify-content:space-between;align-items:flex-end;gap:20px;margin-bottom:24px}
.shop-page-head .eyebrow{margin-bottom:8px}
.shop-page-head h1{font-size:clamp(34px,4vw,50px);letter-spacing:-.045em}
.shop-page .notice{margin-bottom:18px}
.wrap.narrow{max-width:760px}
.order-layout{display:grid;grid-template-columns:minmax(0,1fr) 340px;gap:32px;align-items:start}
.order-main{min-width:0}
.order-summary{position:sticky;top:110px;background:#fff;border:1px solid var(--line);border-radius:18px;padding:24px;box-shadow:var(--shadow)}
.order-summary h2{font-size:22px;margin-bottom:16px}
.order-summary dl,.checkout-card dl{margin:0}
.order-summary dl>div,.checkout-card dl>div{display:flex;justify-content:space-between;gap:12px;padding:8px 0;font-size:14px}
.order-summary dt,.checkout-card dt{color:var(--muted)}
.order-summary dd,.checkout-card dd{margin:0;font-weight:600}
.summary-total{border-top:1px solid var(--line);margin-top:6px;padding-top:12px!important;font-size:17px!important}
.summary-total dt{color:var(--ink)!important;font-weight:700}
.order-summary .btn{margin-top:18px}
.summary-lines{list-style:none;padding:0 0 10px;margin:0 0 6px;border-bottom:1px solid var(--line)}
.summary-lines li{display:flex;justify-content:space-between;gap:12px;font-size:13px;padding:5px 0;color:var(--muted)}
.summary-lines li span:last-child{color:var(--ink);font-weight:600;white-space:nowrap}
.link-button{border:0;background:none;color:var(--teal);font-weight:600;font-size:13px;padding:10px 0;min-height:44px;text-decoration:underline;text-underline-offset:3px}
.link-button.danger{color:#b42318;width:100%}

.cart-lines{list-style:none;padding:0;margin:0;display:grid;gap:12px}
.cart-line{display:grid;grid-template-columns:64px minmax(0,1fr) auto auto;gap:16px;align-items:center;background:#fff;border:1px solid var(--line);border-radius:16px;padding:14px 16px}
.cart-thumb{position:relative;width:64px;height:64px;border-radius:12px;background:var(--pale);display:flex;align-items:center;justify-content:center;overflow:hidden;color:#5c9f89}
.cart-thumb img{position:absolute;inset:0;width:100%;height:100%;object-fit:contain;padding:6px;background:#fff}
.cart-line-info h3{font-size:16px;line-height:1.3}
.cart-line-info h3 a:hover{color:var(--teal)}
.cart-unit{font-size:13px;margin-top:2px}
.cart-line-total{text-align:right}
.cart-line-total strong{display:block;font-size:16px}
.cart-remove{border:0;background:none;color:#b42318;font-size:12px;font-weight:600;padding:6px 0;min-height:36px}
.rx-tag{display:inline-block;background:#fef3c7;color:#92400e;font-size:11px;font-weight:700;padding:1px 7px;border-radius:5px}

.checkout-card{border:1px solid var(--line);border-radius:18px;background:#fff;padding:22px 24px;margin:0 0 16px;min-width:0}
fieldset.checkout-card{padding-top:16px}
.checkout-card legend,.checkout-card .card-title{font-size:19px;font-weight:600;letter-spacing:-.02em;color:var(--ink);padding:0 6px;margin-left:-6px}
.checkout-card .card-title{display:block;margin:0 0 14px;padding:0}
.checkout-card legend+*{margin-top:12px}
.checkout-card .field:last-child{margin-bottom:0}
.muted-card{background:var(--pale)}
.muted-card h2{font-size:19px;margin-bottom:8px}
.choice-list{display:grid;gap:10px}
.choice{display:flex;align-items:center;gap:14px;margin:0;padding:14px 16px;border:1.5px solid var(--line);border-radius:12px;cursor:pointer;font-weight:400;font-size:14px}
.choice:hover{border-color:#8cc5b6}
.choice:has(input:checked){border-color:var(--teal);background:var(--pale);box-shadow:inset 0 0 0 1px var(--teal)}
.choice input{width:20px;height:20px;min-height:0;margin:0;flex-shrink:0;accent-color:var(--teal)}
.choice-text{flex:1;min-width:0}
.choice-text strong{display:block;font-size:15px}
.choice-text small{display:block;font-size:12px;color:var(--muted);line-height:1.5;margin-top:2px}
.choice-price{font-weight:700;white-space:nowrap}
.tag{display:inline-block;font-size:10px;font-weight:700;background:var(--mint);color:var(--teal-dark);padding:2px 8px;border-radius:10px;vertical-align:middle;margin-left:4px}
.saved-address{display:flex;justify-content:space-between;align-items:flex-start;gap:12px;background:var(--pale);border-radius:10px;padding:12px 14px;margin-bottom:16px;font-size:14px;color:var(--ink)}
.secure-note{margin-top:12px}

.track-steps{list-style:none;padding:0;margin:0;display:grid}
.track-steps li{display:grid;grid-template-columns:40px 1fr;gap:16px;position:relative;padding-bottom:22px}
.track-steps li:last-child{padding-bottom:0}
.track-steps li:not(:last-child)::after{content:"";position:absolute;left:19px;top:42px;bottom:2px;border-left:2px dashed #cfe2d9}
.track-steps li.done:not(:last-child)::after{border-left:2px solid var(--teal)}
.track-dot{width:40px;height:40px;border-radius:50%;display:flex;align-items:center;justify-content:center;background:#eef4f1;color:var(--muted);font-weight:700;font-size:14px}
.track-steps li.done .track-dot{background:var(--teal);color:#fff}
.track-steps li.current .track-dot{background:#fff;color:var(--teal);box-shadow:0 0 0 2px var(--teal)}
.track-steps strong{display:block;font-size:16px;padding-top:8px}
.track-steps li:not(.done):not(.current) strong{color:var(--muted)}
.track-steps p{font-size:13px}
.track-time{color:var(--teal)!important;font-weight:600}
.driver-line{font-size:15px;color:var(--ink);margin-bottom:12px}

/* account status pages */
.status-icon{width:56px;height:56px;border-radius:16px;background:#e3f5ec;color:var(--teal);display:flex;align-items:center;justify-content:center;margin-bottom:22px}
.status-icon .icon{width:28px;height:28px}
.status-icon.warn{background:#fef3c7;color:#b45309}
.status-icon.bad{background:#fee2e2;color:#b42318}
.detail-list{margin:22px 0;border-top:1px solid var(--line)}
.detail-list>div{display:flex;justify-content:space-between;gap:16px;padding:12px 0;border-bottom:1px solid var(--line);font-size:14px}
.detail-list dt{color:var(--muted)}
.detail-list dd{margin:0;font-weight:600;text-align:right}
.compact-steps{margin-top:26px}
.compact-steps .step h3{font-size:16px}
.compact-steps .step p{font-size:13px}

/* error pages */
.error-card{position:relative;overflow:hidden}
.error-code{position:absolute;right:20px;top:4px;font-size:110px;font-weight:700;letter-spacing:-.06em;color:#eef6f2!important;line-height:1;z-index:0;pointer-events:none}
.error-card>*:not(.error-code){position:relative;z-index:1}
.bug-report{margin-top:28px;border-top:1px solid var(--line);padding-top:16px}
.bug-report summary{cursor:pointer;font-size:13px;font-weight:600;color:var(--muted);min-height:36px;display:flex;align-items:center}
.bug-report form{margin-top:14px}

@media(max-width:1000px){
  .order-layout{grid-template-columns:minmax(0,1fr)}
  .order-summary{position:static}
}
@media(max-width:900px){
  .shop-hero .page-portrait{display:none}
  .shop-hero .split{grid-template-columns:1fr}
}
@media(max-width:680px){
  .shop-hero{padding-bottom:28px}
  .shop-section{padding:28px 0 56px}
  .shop-toolbar{flex-direction:column;align-items:stretch;gap:10px}
  .filter-panel>summary{justify-content:center}
  .filter-body{position:static;width:auto;margin-top:10px;box-shadow:none}
  .product-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
  .product-image{height:130px}
  .product-info{padding:14px}
  .product-info h3{font-size:14px}
  .product-uses{display:none}
  .product-info .product-price{font-size:17px;padding-top:10px;margin-bottom:10px}
  .product-info .btn{font-size:12px;padding:10px 8px;min-height:44px}
  .shop-page{padding:18px 0 56px}
  .shop-page-head{flex-direction:column;align-items:flex-start;gap:8px}
  .shop-page-head h1{font-size:36px}
  .cart-line{grid-template-columns:56px minmax(0,1fr);grid-template-areas:"thumb info" "qty total";row-gap:12px;padding:14px}
  .cart-thumb{grid-area:thumb;width:56px;height:56px}
  .cart-line-info{grid-area:info}
  .cart-line .qty-stepper{grid-area:qty;justify-self:start}
  .cart-line-total{grid-area:total;align-self:center}
  .checkout-card{padding:18px 16px;border-radius:16px}
  .choice{padding:12px;gap:12px}
  .saved-address{flex-direction:column;gap:4px}
  .buy-row{flex-direction:column}
  .buy-row .qty-stepper{align-self:flex-start}
  .order-summary{padding:20px 16px}
  .error-code{font-size:80px}
}
@media(max-width:360px){
  .product-grid{grid-template-columns:minmax(0,1fr)}
}

/* full-width buttons anywhere, not only inside forms */
.btn.block{width:100%}

/* chosen-pharmacy header and prescription prompt (2026-10-16) */
.shop-hero-actions{margin-top:20px}
.shop-hero-actions .btn{min-height:44px;padding:10px 18px}
.pref-prompt{flex-direction:column;align-items:stretch}
.pref-actions{display:flex;flex-wrap:wrap;gap:10px;margin-top:12px}
.pref-actions .btn{min-height:44px;padding:10px 16px;font-size:13px}
@media(max-width:680px){.pref-actions .btn{flex:1 1 100%}}
