.ews{--ews-border:#dfe2e9;--ews-muted:#6b7280;font:14px/1.4 Arial,sans-serif;color:#171717;width:100%;background:white;border:1px solid var(--ews-border);border-radius:6px;overflow:hidden}.ews *{box-sizing:border-box}.ews-top{display:flex;gap:16px;align-items:center;padding:16px 24px;border-bottom:1px solid var(--ews-border)}.ews-search{flex:1;max-width:650px;margin:auto}.ews input[type=search]{width:100%;padding:12px 16px;border:1px solid var(--ews-border);border-radius:7px;background:#f8f9fb;color:#111;font-size:17px}.ews a{color:inherit;text-decoration:none}.ews a:hover{text-decoration:underline}.ews-cart{background:#444;color:#fff!important;padding:10px 18px;border-radius:24px;white-space:nowrap}.ews-status{padding:8px 20px;color:var(--ews-muted);min-height:36px}.ews-layout{display:grid;grid-template-columns:260px minmax(0,1fr)}.ews-filters{padding:18px;background:#f3f4f6;border-right:1px solid var(--ews-border);max-height:680px;overflow:auto}.ews-filters fieldset{border:0;margin:0 0 22px;padding:0}.ews-filters legend{font-size:15px;margin:0 0 8px;font-weight:600}.ews-filter{display:flex;align-items:center;gap:7px;padding:5px 8px;margin:4px 0;background:white;border:1px solid var(--ews-border);border-radius:8px;cursor:pointer;width:fit-content}.ews-filter input{margin:0;accent-color:#634076}.ews-results{max-height:680px;overflow:auto;overscroll-behavior:contain}.ews-row{display:flex;gap:16px;padding:13px 18px;border-bottom:1px solid var(--ews-border);min-height:125px}.ews-image{width:78px;flex-shrink:0;display:flex;align-items:center;justify-content:center}.ews-image img{width:78px;height:95px;object-fit:contain}.ews-body{min-width:0}.ews-title{font-size:14px;font-weight:600;display:block;margin-bottom:6px}.ews-cards{display:flex;flex-wrap:wrap;gap:5px}.ews-card{width:146px;background:#f3f4f6;border:1px solid #e8e9ee;border-radius:4px;padding:4px}.ews-label{font-size:12px;text-align:center;min-height:18px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ews-controls{display:flex;gap:3px}.ews button{cursor:pointer;font:inherit;border:1px solid var(--ews-border);border-radius:4px;background:white;color:#344054;padding:5px 8px;box-shadow:none;text-transform:none;min-height:0}.ews-controls button{width:28px;padding:4px}.ews-controls input{min-width:0;width:72px;border:1px solid #cbd1dc;border-radius:3px;padding:3px;text-align:center;background:white;color:#111;font-size:13px;-moz-appearance:textfield}.ews-controls input::-webkit-inner-spin-button{appearance:none}.ews-meta{display:flex;justify-content:space-between;gap:4px;font-size:11px;padding-top:4px;align-items:center}.ews-stock{color:var(--ews-muted);font-size:10px}.ews-price{font-weight:600;text-align:right}.ews-price del{font-weight:400}.ews .ews-add{width:100%;margin-top:5px;font-size:11px;padding:3px;background:#fff}.ews .ews-add:hover{background:#634076;color:white}.ews button:disabled{opacity:.45;cursor:not-allowed}.ews button:focus-visible,.ews a:focus-visible,.ews input:focus-visible{outline:2px solid #634076;outline-offset:2px}.ews .ews-clear{margin-bottom:18px;font-size:12px}.ews .ews-more{margin:14px}.ews [hidden]{display:none!important}@media(max-width:700px){.ews-layout{grid-template-columns:1fr}.ews-filters{border-right:0;border-bottom:1px solid var(--ews-border);max-height:190px;display:flex;gap:18px;align-items:flex-start;padding:12px}.ews-filters fieldset{flex:0 0 150px}.ews-top{padding:12px;gap:8px}.ews-cart{font-size:12px;padding:8px}.ews-row{padding:12px 8px;gap:8px}.ews-image,.ews-image img{width:52px}.ews-image img{height:80px}.ews-card{width:136px}.ews-results{max-height:600px}}

/* v1.0.2: responsive product grid in shortcode and header results. */
.ews-layout>div{min-width:0;container-type:inline-size;container-name:ews-products}
.ews-results{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;padding:14px;align-items:start;align-content:start}
.ews-row{min-width:0;min-height:0;display:flex;flex-direction:column;gap:12px;padding:16px;border:1px solid var(--ews-border);border-radius:6px;background:#fff;height:100%}
.ews-image{width:100%;height:140px;flex-shrink:0}
.ews-image img{width:100%;height:140px;max-width:160px;object-fit:contain}
.ews-body{width:100%;display:flex;flex-direction:column;flex:1}
.ews-title{white-space:normal;overflow-wrap:anywhere;line-height:1.45;min-height:40px;margin-bottom:10px}
.ews-cards{gap:7px;align-items:start}
.ews-card{flex:1 1 140px;min-width:0;max-width:100%;width:auto;padding:6px}
.ews-controls{width:100%}
.ews-controls input{flex:1;width:0;min-width:0}
.ews-controls button{flex:0 0 28px}
.ews-meta{flex-wrap:wrap}
@container ews-products (max-width:850px){.ews-results{grid-template-columns:repeat(2,minmax(0,1fr))}}
@container ews-products (max-width:520px){.ews-results{grid-template-columns:minmax(0,1fr)}}
@media(max-width:700px){.ews-results{grid-template-columns:minmax(0,1fr);gap:10px;padding:10px}.ews-row{padding:14px;gap:10px}.ews-image,.ews-image img{width:100%;height:120px}.ews-title{min-height:0}.ews-card{width:auto}}

/* v1.2: filters, results and product preview */
.ews-layout{grid-template-columns:230px minmax(0,1fr) 280px}
.ews-results{grid-template-columns:repeat(2,minmax(0,1fr))}
.ews-preview{min-width:0;padding:20px;border-left:1px solid var(--ews-border);overflow:auto;max-height:680px;background:#fafafa}
.ews-preview>img{display:block;width:100%;height:220px;object-fit:contain;background:white}
.ews-preview h3{font:600 17px/1.5 Arial,sans-serif;margin:16px 0}
.ews-preview-detail{padding:8px 0;border-bottom:1px solid var(--ews-border)}
.ews-preview-link{display:block;margin-top:18px;font-weight:bold}
.ews .ews-preview-button{margin-top:10px}
@media(max-width:1000px){.ews-layout,#ews-header-panel .ews-layout{grid-template-columns:190px minmax(0,1fr) 220px}.ews-results{grid-template-columns:1fr}}
@media(max-width:700px){.ews-layout,#ews-header-panel .ews-layout{grid-template-columns:1fr}.ews-preview{border-left:0;border-top:1px solid var(--ews-border);max-height:340px}.ews-preview>img{height:140px}#ews-header-panel .ews-results{max-height:40dvh}.ews input[type=search]{font-size:16px}}

.ews-preview-description{white-space:pre-line;overflow-wrap:anywhere;font-size:13px;line-height:1.65;margin:12px 0;color:#444}.ews .ews-preview-buy{display:block;width:100%;margin-top:10px;padding:10px 12px;background:#634076;color:#fff;border-color:#634076;font-weight:600}.ews .ews-preview-buy:hover{background:#4d315d}

/* Three product columns on desktop; responsive on smaller screens. */
.ews .ews-results{grid-template-columns:repeat(3,minmax(0,1fr))}
@media(max-width:1000px){.ews .ews-results{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:700px){.ews .ews-results{grid-template-columns:minmax(0,1fr)}}

.ews .ews-filter-toggle,.ews .ews-preview-back{display:none}
@media(max-width:1024px){
#ews-header-panel.ews-mobile-panel{top:0!important;bottom:0;left:0;right:0;max-height:100dvh!important;border-radius:0;overflow-y:auto;overscroll-behavior:contain;padding-bottom:env(safe-area-inset-bottom)}
#ews-header-panel.ews-mobile-panel .ews-top{position:sticky;top:0;z-index:3;background:#fff;padding:12px 48px 12px 12px}
#ews-header-panel.ews-mobile-panel .ews-header-close{position:fixed!important;top:10px;right:8px;z-index:5;min-width:40px;min-height:40px!important}
#ews-header-panel .ews-layout,.ews .ews-layout{display:block}
#ews-header-panel .ews-results,.ews .ews-results{max-height:none;overflow:visible;grid-template-columns:repeat(2,minmax(0,1fr));padding:10px;gap:10px}
#ews-header-panel .ews-filters,.ews .ews-filters{display:none;max-height:none;overflow:visible;border-right:0;padding:12px}
.ews .ews-filter-toggle{display:block;min-height:44px;margin:0 10px 8px;padding:8px 16px}
.ews.ews-filters-open .ews-filters{display:block!important}
.ews .ews-preview{display:none;max-height:none;overflow:visible;border-left:0;padding:16px}
.ews.ews-detail-open .ews-preview{display:block}
.ews.ews-detail-open .ews-results,.ews.ews-detail-open .ews-more,.ews.ews-detail-open .ews-filters,.ews.ews-detail-open .ews-filter-toggle{display:none!important}
.ews .ews-preview-back{display:block;min-height:44px;margin-bottom:14px;width:100%}
.ews .ews-add,.ews .ews-preview-button,.ews .ews-preview-buy{min-height:44px;font-size:14px;padding:10px}
.ews .ews-title{font-size:14px;min-height:0}.ews .ews-row{padding:12px}.ews .ews-image,.ews .ews-image img{height:130px}
.ews .ews-preview>img{height:200px}.ews .ews-preview-description{font-size:14px}.ews .ews-price{font-size:14px}
}
@media(max-width:479px){#ews-header-panel .ews-results,.ews .ews-results{grid-template-columns:minmax(0,1fr)}}

/* Keep checkout actions in view; only product information scrolls. */
.ews .ews-preview{padding:12px;overflow:hidden;max-height:none;min-height:0;flex-direction:column}
.ews-preview-content{flex:1 1 0;min-height:0;overflow-y:auto;overscroll-behavior:contain;padding:4px 6px 8px;scrollbar-gutter:stable}
.ews-preview-content>img{display:block;width:100%;height:clamp(100px,22dvh,200px);object-fit:contain;background:white}
.ews-preview-content h3{margin:12px 0}.ews-preview-description{margin-bottom:0}
.ews-preview-actions{flex:0 0 auto;max-height:45%;overflow-y:auto;background:#fafafa;border-top:1px solid var(--ews-border);padding:8px 6px 2px}
.ews-preview-actions .ews-preview-detail{padding:4px 0}.ews-preview-actions .ews-preview-link{margin-top:8px}.ews-preview-back{flex:0 0 auto}
@media(min-width:1025px){.ews .ews-preview{display:flex}}
@media(max-width:1024px){.ews.ews-detail-open .ews-preview{display:flex}.ews .ews-preview-back{margin-bottom:8px}.ews-preview-content>img{height:150px}.ews-preview-actions{max-height:45%}}
