/* Meshek Daniel Omer – חלון מוצר וכפתור "הוספה לסל" הרחב */

/* ---------- כפתור "הוספה לסל" שהופך ל-"− כמות +" (חלון מוצר ועמוד מוצר) ---------- */

.mdo-stepper.mdo-single {
	position: static;
	top: auto;
	left: auto;
	right: auto;
	display: inline-flex;
	align-items: center;
	justify-content: flex-start;
	gap: 10px;
	width: auto;
	max-width: none;
	min-width: 0;
	height: 44px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 999px;
	border-top-left-radius: 999px;
	background: transparent;
	color: #1D3115;
	box-shadow: none;
	animation: none;
}

.mdo-stepper.mdo-single .mdo-btn {
	border: 0;
	outline: none;
	box-shadow: none;
}

.mdo-stepper.mdo-single .mdo-btn:focus-visible {
	outline: 2px solid var(--mdo-green);
	outline-offset: 2px;
}

.mdo-stepper.mdo-single .mdo-badge {
	display: none !important;
}

/* ---- אין בסל: כפתור "הוספה לסל" מעוגל ---- */
.mdo-stepper.mdo-single:not(.is-open) .mdo-plus {
	display: inline-flex;
	width: auto;
	min-width: 160px;
	height: 44px;
	padding: 0 24px;
	border-radius: 999px;
	background: var(--mdo-brand, #1D3115);
	color: #FFFFFF;
	font-size: 16px;
	font-weight: 700;
}

.mdo-stepper.mdo-single:not(.is-open) .mdo-plus .mdo-ico {
	display: none; /* רק הטקסט, כמו בדוגמה */
}

@media (hover: hover) {
	.mdo-stepper.mdo-single:not(.is-open) .mdo-plus:hover {
		background: #2B4520;
		color: #FFFFFF;
	}
}

.mdo-stepper.mdo-single .mdo-add-label {
	line-height: 1;
	white-space: nowrap;
}

.mdo-stepper.mdo-single.is-open .mdo-add-label,
.mdo-stepper.mdo-single .mdo-qty-wrap {
	display: none;
}

/* ---- יש בסל: "−  1  +  [אריזה]" ---- */
.mdo-stepper.mdo-single.is-open {
	background: transparent;
	box-shadow: none;
	animation: none;
}

.mdo-stepper.mdo-single.is-open .mdo-qty-wrap {
	display: contents; /* המספר והתווית נכנסים לשורה, כל אחד במקומו */
}

.mdo-stepper.mdo-single.is-open .mdo-minus { order: 1; }
.mdo-stepper.mdo-single.is-open .mdo-qty   { order: 2; }
.mdo-stepper.mdo-single.is-open .mdo-plus  { order: 3; }
.mdo-stepper.mdo-single.is-open .mdo-unit  { order: 4; }

.mdo-stepper.mdo-single.is-open .mdo-btn,
.mdo-stepper.mdo-single.is-open .mdo-btn:hover,
.mdo-stepper.mdo-single.is-open .mdo-btn:focus {
	display: inline-flex;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: #ECECEA;
	color: #1D3115;
}

@media (hover: hover) {
	.mdo-stepper.mdo-single.is-open .mdo-btn:hover {
		background: #DFDFDB;
	}
}

.mdo-stepper.mdo-single.is-open .mdo-ico {
	width: 20px;
	height: 20px;
}

/* בחלון המוצר "−" נשאר מינוס גם באריזה האחרונה */
.mdo-stepper.mdo-single.is-last .mdo-ico-minus {
	display: block;
}

.mdo-stepper.mdo-single.is-last .mdo-ico-trash {
	display: none;
}

.mdo-stepper.mdo-single.is-open .mdo-qty {
	display: inline-block;
	min-width: 26px;
	text-align: center;
	font-size: 21px;
	font-weight: 400;
	color: #1D3115;
}

.mdo-stepper.mdo-single.is-open .mdo-unit {
	display: inline-block;
	padding: 5px 11px;
	border-radius: 999px;
	background: var(--mdo-brand, #1D3115);
	color: #FFFFFF;
	font-size: 13px;
	font-weight: 700;
	line-height: 1.2;
}

/* עמוד מוצר רגיל: הטופס הישן מוסתר, הכפתור החדש במקומו */
.mdo-single-product form.cart:not(.variations_form):not(.composite_form) {
	display: none !important;
}

.mdo-single-wrap {
	margin: 12px 0 20px;
}

/* ---------- החלון ---------- */

html.mdo-sheet-open,
html.mdo-sheet-open body {
	overflow: hidden;
}

.mdo-sheet {
	position: fixed;
	z-index: 100001;
	inset: 0;
	visibility: hidden;
	pointer-events: none;
	font-family: "Rubik", sans-serif;
}

.mdo-sheet.is-open {
	visibility: visible;
	pointer-events: auto;
}

.mdo-sheet__overlay {
	position: absolute;
	inset: 0;
	background: rgba(20, 28, 16, .45);
	opacity: 0;
	transition: opacity .2s ease;
}

.mdo-sheet.is-open .mdo-sheet__overlay {
	opacity: 1;
}

.mdo-sheet__panel {
	position: absolute;
	top: 50%;
	left: 50%;
	display: flex;
	flex-direction: column;
	box-sizing: border-box;
	width: min(920px, calc(100% - 48px));
	max-height: calc(100% - 64px);
	border-radius: 24px;
	background: var(--mdo-white, #FFFFFF);
	color: var(--mdo-dark, #3E4A38);
	box-shadow: 0 20px 60px rgba(0, 0, 0, .25);
	opacity: 0;
	transform: translate(-50%, -46%);
	transition: opacity .2s ease, transform .2s ease;
	overflow: hidden;
}

.mdo-sheet.is-open .mdo-sheet__panel {
	opacity: 1;
	transform: translate(-50%, -50%);
}

.mdo-sheet__actions {
	position: absolute;
	z-index: 2;
	top: 14px;
	left: 14px;
	display: flex;
	gap: 8px;
}

.mdo-sheet__close,
.mdo-sheet__share {
	box-sizing: border-box;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 42px;
	height: 42px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, .92);
	color: #1D3115;
	box-shadow: 0 2px 8px rgba(0, 0, 0, .12);
	cursor: pointer;
	text-decoration: none;
}

.mdo-sheet__close:hover,
.mdo-sheet__close:focus,
.mdo-sheet__share:hover,
.mdo-sheet__share:focus {
	background: #FFFFFF;
	color: #1D3115;
}

.mdo-sheet__scroll {
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	overscroll-behavior: contain;
}

.mdo-sheet__main {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 32px;
	align-items: center;
	padding: 40px 40px 28px;
}

.mdo-sheet__image {
	display: flex;
	align-items: center;
	justify-content: center;
	aspect-ratio: 1 / 1;
	border-radius: 18px;
	background: #FFFFFF;
}

.mdo-sheet__image img {
	display: block;
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
	cursor: zoom-in;
}

.mdo-sheet__details {
	display: flex;
	flex-direction: column;
	gap: 12px;
	text-align: right;
}

.mdo-sheet__title {
	margin: 0;
	color: #1D3115;
	font-size: 28px;
	font-weight: 700;
	line-height: 1.2;
}

.mdo-sheet__lead {
	color: var(--mdo-green, #878652);
	font-size: 17px;
	line-height: 1.5;
}

.mdo-sheet__lead p {
	margin: 0 0 6px;
}

.mdo-sheet__loading {
	opacity: .6;
}

.mdo-sheet__price {
	color: var(--mdo-green, #878652);
	font-size: 26px;
	font-weight: 700;
}

.mdo-sheet__buy {
	margin-top: 6px;
}

.mdo-sheet__footer {
	display: none;
}

.mdo-sheet__info {
	margin: 0 40px;
	padding: 24px 0;
	border-top: 1px solid #E6E2D6;
	text-align: right;
}

.mdo-sheet__info h3,
.mdo-sheet__related h3 {
	margin: 0 0 12px;
	color: #1D3115;
	font-size: 22px;
	font-weight: 700;
}

.mdo-sheet__info-body {
	color: var(--mdo-green, #878652);
	font-size: 16px;
	line-height: 1.7;
}

.mdo-sheet__info-body p {
	margin: 0 0 8px;
}

.mdo-sheet__related {
	padding: 24px 40px 36px;
	background: #F5F1E8;
	text-align: right;
}

.mdo-sheet__grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 16px;
}

.mdo-rel-item {
	position: relative;
	box-sizing: border-box;
	padding: 14px 10px 16px;
	border-radius: 20px;
	background: #FFFFFF;
	text-align: center;
	overflow: hidden;
}

.mdo-rel-image {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 120px;
	cursor: pointer;
}

.mdo-rel-image img {
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
}

.mdo-rel-name {
	margin: 10px 0 4px;
	color: #1D3115;
	font-size: 15px;
	font-weight: 700;
	cursor: pointer;
}

.mdo-rel-price {
	color: var(--mdo-green, #878652);
	font-size: 15px;
	font-weight: 700;
}

/* הלשונית בפינת כרטיס המוצר הנלווה – כמו בכרטיסים בעמוד */
.mdo-rel-item > .mdo-stepper {
	border-top-left-radius: 20px;
}

/* ---------- נייד: חלון שעולה מלמטה ---------- */

@media (max-width: 767px) {
	.mdo-sheet__panel {
		top: auto;
		right: 0;
		bottom: 0;
		left: 0;
		width: 100%;
		max-height: 92%;
		border-radius: 24px 24px 0 0;
		transform: translateY(100%);
	}

	.mdo-sheet.is-open .mdo-sheet__panel {
		transform: translateY(0);
	}

	.mdo-sheet__panel::before {
		content: "";
		position: absolute;
		z-index: 3;
		top: 8px;
		left: 50%;
		width: 44px;
		height: 5px;
		border-radius: 3px;
		background: rgba(0, 0, 0, .18);
		transform: translateX(-50%);
	}

	.mdo-sheet__actions {
		top: 18px;
		left: 12px;
	}

	.mdo-sheet__main {
		grid-template-columns: 1fr;
		gap: 16px;
		padding: 24px 18px 20px;
	}

	.mdo-sheet__image {
		aspect-ratio: auto;
		height: 30vh;
		max-height: 260px;
	}

	.mdo-sheet__buy:empty {
		display: none;
	}

	.mdo-sheet.has-footer .mdo-sheet__footer {
		display: block;
		flex: 0 0 auto;
		padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
		background: #FFFFFF;
		box-shadow: 0 -4px 16px rgba(0, 0, 0, .08);
	}

	.mdo-sheet__title {
		font-size: 24px;
	}

	.mdo-sheet__price {
		font-size: 22px;
	}

	.mdo-stepper.mdo-single {
		max-width: none;
	}

	.mdo-sheet__info {
		margin: 0 18px;
	}

	.mdo-sheet__related {
		padding: 20px 18px calc(28px + env(safe-area-inset-bottom, 0px));
	}

	.mdo-sheet__grid {
		grid-template-columns: repeat(2, 1fr);
		gap: 12px;
	}

	.mdo-rel-image {
		height: 100px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.mdo-sheet__overlay,
	.mdo-sheet__panel {
		transition: none;
	}
}

/* נייד: בתחתית החלון הכפתור ברוחב מלא, והכמות במרכז */
.mdo-sheet__footer .mdo-stepper.mdo-single {
	display: flex;
	width: 100%;
	justify-content: center;
}

.mdo-sheet__footer .mdo-stepper.mdo-single:not(.is-open) .mdo-plus {
	width: 100%;
}
