:root { --bsu-accent: #24bdae; }
body.bsu-open { overflow: hidden; }
.bsu-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 100000; display: flex; align-items: center; justify-content: center; padding: 16px; }
.bsu-modal { background: #fff; width: 100%; max-width: 860px; max-height: 92vh; overflow-y: auto; border-radius: 10px; box-shadow: 0 20px 60px rgba(0,0,0,.35); font-size: 15px; color: #222; }
.bsu-modal__header { display: flex; align-items: center; gap: 12px; padding: 14px 18px; background: var(--bsu-accent); color: #fff; position: sticky; top: 0; z-index: 2; }
.bsu-modal__check { width: 28px; height: 28px; border-radius: 50%; background: rgba(255,255,255,.25); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; }
.bsu-modal__title { flex: 1; font-weight: 600; font-size: 16px; }
.bsu-modal__close { background: transparent; border: 0; color: #fff; font-size: 28px; line-height: 1; cursor: pointer; padding: 0 4px; }
.bsu-modal__summary { display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between; align-items: center; padding: 16px 18px; border-bottom: 1px solid #eee; }
.bsu-summary__product { display: flex; align-items: center; gap: 12px; }
.bsu-summary__product img { width: 64px; height: 64px; object-fit: cover; border-radius: 6px; }
.bsu-summary__name { font-weight: 600; }
.bsu-summary__cart { text-align: right; display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.bsu-summary__cart-line { font-size: 14px; color: #555; }
.bsu-btn { display: inline-block; border: 0; border-radius: 6px; padding: 10px 18px; font-weight: 600; cursor: pointer; text-decoration: none; text-align: center; transition: background .15s; }
.bsu-btn--primary { background: #222; color: #fff !important; }
.bsu-btn--primary:hover { background: #000; }
.bsu-btn--add { background: var(--bsu-accent); color: #fff; width: 100%; margin-top: 8px; }
.bsu-btn--add:hover { filter: brightness(.92); }
.bsu-btn--add:disabled { opacity: .7; cursor: default; }
.bsu-btn--add.is-added { background: #2e9e4f; }
.bsu-link { font-size: 13px; color: #555; text-decoration: underline; }
.bsu-modal__offers { padding: 16px 18px 22px; }
.bsu-offers__title { margin: 0 0 14px; font-size: 18px; text-align: center; }
.bsu-offers__list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.bsu-offers__list--1 { grid-template-columns: minmax(0, 320px); justify-content: center; }
.bsu-offers__list--2 { grid-template-columns: repeat(2, minmax(0, 320px)); justify-content: center; }
.bsu-offer { border: 1px solid #e6e6e6; border-radius: 8px; padding: 12px; display: flex; flex-direction: column; }
.bsu-offer--added { border-color: #2e9e4f; }
.bsu-offer__image img { width: 100%; height: auto; border-radius: 6px; display: block; }
.bsu-offer__body { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; flex: 1; }
.bsu-offer__name { font-weight: 600; color: #222; text-decoration: none; line-height: 1.3; }
.bsu-offer__price { font-size: 15px; }
.bsu-offer__attrs { display: flex; flex-direction: column; gap: 6px; }
.bsu-offer__attr span { display: block; font-size: 12px; color: #666; margin-bottom: 2px; }
.bsu-offer__attr select { width: 100%; padding: 6px 8px; border: 1px solid #ccc; border-radius: 5px; font-size: 14px; }
.bsu-offer__attr select.bsu-invalid { border-color: #d63638; }
.bsu-offer__hint { font-size: 12px; color: #2e7d32; }
.bsu-offer__hint--manual { color: #b26a00; }
.bsu-offer__reason { color: #999; font-style: normal; }
.bsu-offer__msg { font-size: 12px; min-height: 14px; }
.bsu-offer__msg.is-error { color: #d63638; }
@media (max-width: 720px) {
	.bsu-offers__list, .bsu-offers__list--2, .bsu-offers__list--1 { grid-template-columns: 1fr; }
	.bsu-modal { max-height: 95vh; }
	.bsu-summary__cart { align-items: flex-start; text-align: left; }
}
.bsu-modal:focus { outline: none; }
.bsu-modal a:focus-visible, .bsu-modal button:focus-visible, .bsu-modal select:focus-visible { outline: 2px solid var(--bsu-accent); outline-offset: 2px; }
@media (max-width: 400px) {
	.bsu-overlay { padding: 8px; }
	.bsu-modal__summary, .bsu-modal__offers { padding-left: 12px; padding-right: 12px; }
}

/* ---------- Compact layout (1.1.7): the "Add to cart" buttons fit on a 768 px high laptop screen ---------- */
.bsu-modal__header { padding: 10px 16px; }
.bsu-modal__title { font-size: 15px; line-height: 1.3; }
.bsu-modal__check { width: 24px; height: 24px; flex: 0 0 auto; }
.bsu-modal__summary { padding: 10px 16px; gap: 10px; }
.bsu-summary__product img { width: 48px; height: 48px; }
.bsu-summary__name { font-size: 14px; }
.bsu-summary__price { font-size: 14px; }
.bsu-summary__cart { gap: 4px; }
.bsu-summary__cart .bsu-btn--primary { padding: 8px 16px; }
.bsu-modal__offers { padding: 12px 16px 16px; }
.bsu-offers__title { margin: 0 0 10px; font-size: 16px; }
.bsu-offers__list { gap: 12px; }
.bsu-offer { padding: 10px; }
.bsu-offer__image { display: block; }
.bsu-modal .bsu-offer__image img { width: 100%; height: 150px; object-fit: contain; border-radius: 6px; background: #fafafa; }
.bsu-offer__body { gap: 5px; margin-top: 8px; }
.bsu-offer__name { font-size: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.bsu-offer__price { font-size: 14px; }
.bsu-offer__attrs { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 6px; }
.bsu-offer__attr { margin: 0; min-width: 0; }
.bsu-modal .bsu-offer__attr span { font-size: 11px; margin-bottom: 1px; }
.bsu-modal .bsu-offer__attr select { height: 34px; min-height: 0; padding: 4px 6px; margin: 0; font-size: 13px; line-height: 1.2; background-color: #fff; border: 1px solid #ccc; border-radius: 5px; }
.bsu-offer__hint { font-size: 11px; line-height: 1.3; }
.bsu-offer__body .bsu-btn--add { margin-top: auto; padding: 9px 12px; }
.bsu-offer__msg { min-height: 0; }
.bsu-offer__msg:empty { display: none; }

/* Low laptop screens: smaller photos. */
@media (max-height: 760px) and (min-width: 721px) {
	.bsu-modal .bsu-offer__image img { height: 120px; }
	.bsu-modal { max-height: 96vh; }
}

/* Phones: horizontal cards (photo left, details right), so all offers are visible after a short scroll. */
@media (max-width: 720px) {
	.bsu-overlay { padding: 8px; align-items: flex-end; }
	.bsu-modal { max-height: 94vh; border-radius: 12px 12px 0 0; }
	.bsu-modal__summary { flex-wrap: nowrap; }
	.bsu-summary__product img { width: 40px; height: 40px; }
	.bsu-summary__cart { align-items: flex-end; text-align: right; }
	.bsu-summary__cart-line { display: none; }
	.bsu-offer { display: grid; grid-template-columns: 88px 1fr; column-gap: 10px; align-items: start; }
	.bsu-modal .bsu-offer__image img { height: 110px; }
	.bsu-offer__body { margin-top: 0; }
}