.lms-groups { margin: 0 0 1.25em; width: 100%; flex-basis: 100%; }
.lms-group { border: 0; padding: 0; margin: 0 0 1.1em; min-width: 0; }
.lms-group legend { font-weight: 600; margin-bottom: .5em; padding: 0; font-size: 1em; }
.lms-group legend .lms-chosen { font-weight: 400; }
.lms-group legend em { opacity: .6; }
.lms-optional { font-weight: 400; opacity: .6; font-size: .9em; }
.lms-group-price { margin: -.25em 0 .5em; font-size: .9em; opacity: .8; }
.lms-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(var(--lms-thumb, 64px), 1fr)); gap: 8px; }
.lms-swatch { position: relative; cursor: pointer; display: block; margin: 0; }
.lms-swatch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.lms-img { display: block; aspect-ratio: 1; border-radius: 6px; overflow: hidden; border: 1px solid rgba(0,0,0,.15); background: #f3f3f3; transition: box-shadow .15s, transform .15s; }
.lms-img img { width: 100%; height: 100%; object-fit: cover; display: block; margin: 0 !important; }
.lms-name { display: block; font-size: 11px; line-height: 1.25; margin-top: 4px; text-align: center; word-break: break-word; }
.lms-name small { display: block; opacity: .75; }
.lms-swatch:hover .lms-img { transform: translateY(-1px); box-shadow: 0 2px 6px rgba(0,0,0,.18); }
.lms-swatch input:checked + .lms-img { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--lms-accent, #1e73be); }
.lms-swatch input:focus-visible + .lms-img { outline: 2px solid var(--lms-accent, #1e73be); outline-offset: 3px; }
.lms-group.lms-missing legend { color: #b32d2e; }
.lms-group.lms-missing .lms-grid { animation: lms-shake .3s; }
@keyframes lms-shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.lms-swatch.is-unavailable, .lms-group.is-empty { display: none; }
.lms-clear { background: none; border: 0; padding: 0; margin-top: .4em; font-size: .85em; text-decoration: underline; cursor: pointer; color: inherit; }
.lms-clear[hidden] { display: none; }

/* Floating bar */
.lms-bar { position: fixed; left: 0; right: 0; top: var(--lms-bar-top, 0); z-index: 9990; background: #fff; box-shadow: 0 2px 12px rgba(0,0,0,.12); transform: translateY(-120%); transition: transform .25s ease; }
.lms-bar[hidden] { display: block; visibility: hidden; }
.lms-bar.is-visible { transform: translateY(0); visibility: visible; }
.lms-bar-inner { max-width: 1240px; margin: 0 auto; padding: 8px 16px; display: flex; align-items: center; gap: 16px; }
.lms-bar-product { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 0 1 auto; }
.lms-bar-product img { width: 44px; height: 44px; object-fit: cover; border-radius: 4px; margin: 0 !important; }
.lms-bar-product strong { display: block; font-size: 14px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 280px; }
.lms-bar-price { font-size: 13px; }
.lms-bar-chips { display: flex; gap: 10px; flex: 1 1 auto; overflow-x: auto; scrollbar-width: none; }
.lms-chip { display: flex; align-items: center; gap: 6px; font-size: 12px; white-space: nowrap; background: #f5f5f5; border-radius: 30px; padding: 3px 10px 3px 3px; cursor: pointer; border: 0; color: inherit; }
.lms-chip img, .lms-chip .lms-chip-empty { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; margin: 0 !important; }
.lms-chip .lms-chip-empty { display: inline-block; border: 1px dashed #999; }
.lms-chip.is-missing { color: #b32d2e; }
.lms-bar-btn { flex: 0 0 auto; white-space: nowrap; }
@media (max-width: 767px) {
	.lms-bar { top: auto; bottom: 0; transform: translateY(120%); }
	.lms-bar-product { display: none; }
	.lms-bar-inner { padding: 8px 10px; gap: 8px; }
}

/* Quick-add modal */
html.lms-modal-open { overflow: hidden; }
.lms-modal[hidden] { display: none; }
.lms-modal { position: fixed; inset: 0; z-index: 100000; display: flex; align-items: center; justify-content: center; padding: 16px; }
.lms-modal__backdrop { position: absolute; inset: 0; background: rgba(20,20,20,.55); }
.lms-modal__box { position: relative; background: #fff; border-radius: 12px; width: 100%; max-width: 640px; max-height: calc(100vh - 32px); display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.lms-modal__x { position: absolute; top: 8px; right: 10px; background: none; border: 0; font-size: 28px; line-height: 1; cursor: pointer; color: #555; padding: 4px 8px; }
.lms-modal__head { display: flex; gap: 14px; align-items: center; padding: 20px 48px 14px 22px; border-bottom: 1px solid #eee; }
.lms-modal__head img { width: 72px; height: 72px; object-fit: cover; border-radius: 6px; margin: 0 !important; }
.lms-modal__head h3 { margin: 0 0 4px; font-size: 18px; line-height: 1.3; }
.lms-modal__price { font-size: 14px; }
.lms-modal__body { padding: 18px 22px 6px; overflow-y: auto; }
.lms-modal__body .lms-groups { margin: 0; }
.lms-modal__loading { height: 120px; background: linear-gradient(90deg,#f3f3f3 25%,#e9e9e9 50%,#f3f3f3 75%); background-size: 200% 100%; animation: lms-load 1.2s infinite; border-radius: 8px; }
@keyframes lms-load { to { background-position: -200% 0; } }
.lms-modal__msg { margin: 0 22px 12px; padding: 12px 14px; border-radius: 8px; background: #fdecea; color: #8a1f17; font-size: 14px; }
.lms-modal__msg.is-ok { background: #edf7ed; color: #1e4620; margin-top: 18px; }
.lms-modal__done { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.lms-modal__foot { display: flex; align-items: center; gap: 10px; padding: 14px 22px 18px; border-top: 1px solid #eee; }
.lms-modal__qty { margin-right: auto; display: flex; align-items: center; gap: 8px; font-size: 14px; }
.lms-modal__qty input { width: 70px; }
@media (max-width: 600px) {
	.lms-modal { padding: 0; align-items: flex-end; }
	.lms-modal__box { border-radius: 12px 12px 0 0; max-height: 92vh; }
}

/* Edit swatches on the Order Enquiry page (theme-proof: themes often style every <button>) */
.lms-chosen-line { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.lms-chosen-name { font-weight: 500; }
img.lms-mini { width: 24px !important; height: 24px !important; border-radius: 5px; object-fit: cover; margin: 0 !important; display: block !important; border: 1px solid rgba(0,0,0,.15); flex: 0 0 24px; }
body button.lms-edit, body button.lms-edit:hover, body button.lms-edit:focus {
	all: unset;
	display: inline-flex; align-items: center; gap: 4px;
	font-size: 13px; line-height: 1.4; font-weight: 600; cursor: pointer;
	color: var(--lms-accent, #1e73be); padding: 2px 4px; margin-left: 2px; border-radius: 4px;
}
body button.lms-edit::before {
	content: ""; width: 13px; height: 13px; background: currentColor; flex: 0 0 13px;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04a1 1 0 0 0 0-1.41l-2.34-2.34a1 1 0 0 0-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z'/%3E%3C/svg%3E") center / contain no-repeat;
	        mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04a1 1 0 0 0 0-1.41l-2.34-2.34a1 1 0 0 0-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z'/%3E%3C/svg%3E") center / contain no-repeat;
}
body button.lms-edit:hover { text-decoration: underline; text-underline-offset: 3px; }
body button.lms-edit:focus-visible { outline: 2px solid var(--lms-accent, #1e73be); outline-offset: 2px; }
.lms-modal.is-edit .lms-modal__qty { visibility: hidden; }
.lms-group.lms-focus { background: #f6f9fc; box-shadow: 0 0 0 8px #f6f9fc; border-radius: 4px; }
