/* ==========================================================================
   MAStore: Премиальный виджет «Долями» (Официальный стиль Т-Банк)
   ========================================================================== */

.ms-dolyame-widget {
	--ms-dolyame-yellow: #FFDD2D;
	--ms-dolyame-yellow-hover: #ffea5c;
	--ms-dolyame-black: #111111;
	--ms-dolyame-dark: #1c1c1e;
	--ms-dolyame-gray-bg: #f5f5f7;
	--ms-dolyame-border: rgba(0, 0, 0, 0.08);
	--ms-dolyame-sub: #71717a;
	--ms-dolyame-ease: cubic-bezier(0.16, 1, 0.3, 1);
	margin: 14px 0 18px;
	width: 100%;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	-webkit-font-smoothing: antialiased;
}

/* --------------------------------------------------------------------------
   1. ДЕСКТОП БЛОК (Виджет в теле карточки товара)
   -------------------------------------------------------------------------- */
.ms-dolyame-desktop {
	display: block;
	padding: 14px 16px 14px;
	border-radius: 16px;
	background: #ffffff;
	border: 1px solid var(--ms-dolyame-border);
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03), 0 1px 2px rgba(0, 0, 0, 0.02);
	cursor: pointer;
	transition: all 0.22s var(--ms-dolyame-ease);
	user-select: none;
	position: relative;
	overflow: hidden;
}

.ms-dolyame-desktop:hover {
	border-color: #d4d4d8;
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.06);
	transform: translateY(-1px);
}

.ms-dolyame-dk-top {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 10px;
}

.ms-dolyame-brand-group {
	display: inline-flex;
	align-items: center;
	gap: 8px;
}

.ms-dolyame-tag {
	font-size: 11px;
	font-weight: 700;
	color: #111;
	background: var(--ms-dolyame-yellow);
	padding: 2px 7px;
	border-radius: 999px;
	letter-spacing: -0.01em;
	text-transform: uppercase;
}

.ms-dolyame-dk-cta {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	font-size: 12.5px;
	font-weight: 600;
	color: #71717a;
	transition: color 0.15s ease;
}

.ms-dolyame-desktop:hover .ms-dolyame-dk-cta {
	color: #000000;
}

.ms-dolyame-dk-price-row {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	margin-bottom: 12px;
}

.ms-dolyame-dk-lead {
	display: flex;
	align-items: baseline;
	gap: 8px;
}

.ms-dolyame-dk-lead > span {
	font-size: 13px;
	color: #71717a;
}

.ms-dolyame-val-badge {
	display: inline-flex;
	align-items: baseline;
	gap: 5px;
}

.ms-dolyame-val-badge b {
	font-size: 17px;
	font-weight: 800;
	color: #09090b;
	letter-spacing: -0.02em;
}

.ms-dolyame-mult {
	font-size: 12px;
	font-weight: 500;
	color: #a1a1aa;
}

/* Мини-таймлайн в блоке ПК */
.ms-dolyame-dk-timeline {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 6px;
	padding-top: 6px;
	border-top: 1px solid #f4f4f5;
}

.ms-dk-step {
	display: flex;
	flex-direction: column;
	gap: 5px;
}

.ms-dk-bar {
	height: 4px;
	border-radius: 999px;
	background: #e4e4e7;
	transition: background 0.2s ease;
}

.ms-dk-step.is-active .ms-dk-bar {
	background: #111111;
}

.ms-dk-step-meta {
	display: flex;
	flex-direction: column;
	font-size: 11px;
	line-height: 1.25;
}

.ms-dk-when {
	color: #71717a;
}

.ms-dk-step.is-active .ms-dk-when {
	color: #111;
	font-weight: 600;
}

.ms-dk-step-meta b {
	font-size: 11.5px;
	font-weight: 700;
	color: #18181b;
}

/* --------------------------------------------------------------------------
   2. МОБИЛЬНАЯ КНОПКА (Приметная, премиальная кнопка-плашка)
   -------------------------------------------------------------------------- */
.ms-dolyame-mobile-btn {
	display: none; /* скрыта на ПК */
	width: 100%;
	align-items: center;
	justify-content: space-between;
	padding: 12px 14px;
	border-radius: 14px;
	background: linear-gradient(135deg, #ffffff 0%, #fafafa 100%);
	border: 1.5px solid rgba(255, 221, 45, 0.6);
	box-shadow: 0 4px 14px rgba(255, 221, 45, 0.12), 0 1px 3px rgba(0, 0, 0, 0.04);
	color: inherit;
	cursor: pointer;
	font-family: inherit;
	text-align: left;
	transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
	-webkit-tap-highlight-color: transparent;
	position: relative;
	overflow: hidden;
}

.ms-dolyame-mobile-btn:active {
	transform: scale(0.985);
	background: #f4f4f5;
	border-color: #FFDD2D;
}

.ms-dolyame-mb-left {
	display: flex;
	align-items: center;
	gap: 8px;
}

.ms-dolyame-mb-badge {
	line-height: 0;
	flex-shrink: 0;
	display: flex;
	align-items: center;
}

.ms-dolyame-mb-badge .ms-dolyame-icon-box {
	width: 20px !important;
	height: 20px !important;
}

.ms-dolyame-mb-info {
	display: flex;
	flex-direction: column;
	gap: 1px;
}

.ms-dolyame-mb-brand {
	display: flex;
	align-items: center;
	gap: 6px;
}

.ms-dolyame-mb-pill {
	font-size: 9.5px;
	font-weight: 800;
	color: #111;
	background: var(--ms-dolyame-yellow);
	padding: 1px 5px;
	border-radius: 4px;
	text-transform: uppercase;
}

.ms-dolyame-mb-calc {
	font-size: 13.5px;
	color: #27272a;
	line-height: 1.25;
}

.ms-dolyame-mb-calc b {
	font-size: 14.5px;
	font-weight: 800;
	color: #000000;
}

.ms-dolyame-mb-right {
	display: flex;
	align-items: center;
	gap: 4px;
	flex-shrink: 0;
}

.ms-dolyame-mb-btn-pill {
	font-size: 12px;
	font-weight: 600;
	color: #18181b;
	background: rgba(0, 0, 0, 0.05);
	padding: 5px 9px;
	border-radius: 8px;
}

.ms-dolyame-mb-chevron {
	color: #71717a;
}

/* Адаптив переключения: ПК / Мобильный */
@media (max-width: 767px) {
	.ms-dolyame-desktop {
		display: none;
	}
	.ms-dolyame-mobile-btn {
		display: flex;
	}
}

/* --------------------------------------------------------------------------
   3. NATIVE BOTTOM SHEET & POPUP
   -------------------------------------------------------------------------- */
.ms-dolyame-sheet {
	position: fixed;
	inset: 0;
	z-index: 2147483030;
	display: flex;
	align-items: flex-end;
	justify-content: center;
	pointer-events: none;
	visibility: hidden;
	transition: visibility 0.28s ease;
}

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

.ms-dolyame-scrim {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.5);
	backdrop-filter: blur(4px);
	-webkit-backdrop-filter: blur(4px);
	opacity: 0;
	transition: opacity 0.28s var(--ms-dolyame-ease);
}

.ms-dolyame-sheet.is-open .ms-dolyame-scrim {
	opacity: 1;
}

.ms-dolyame-panel {
	position: relative;
	width: 100%;
	max-width: 520px;
	background: #ffffff;
	color: #111111;
	border-radius: 26px 26px 0 0;
	box-shadow: 0 -20px 50px rgba(0, 0, 0, 0.25);
	max-height: 88vh;
	display: flex;
	flex-direction: column;
	transform: translate3d(0, 105%, 0);
	transition: transform 0.38s var(--ms-dolyame-ease);
	padding: 0 20px calc(20px + env(safe-area-inset-bottom, 0px));
	box-sizing: border-box;
}

.ms-dolyame-sheet.is-open .ms-dolyame-panel {
	transform: translate3d(0, 0, 0);
}

.ms-dolyame-handle {
	display: flex;
	justify-content: center;
	padding: 12px 0 8px;
}

.ms-dolyame-handle i {
	width: 40px;
	height: 4.5px;
	border-radius: 999px;
	background: #d4d4d8;
}

.ms-dolyame-head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	padding: 8px 0 16px;
	border-bottom: 1px solid #f4f4f5;
}

.ms-dolyame-logo-tag {
	display: inline-flex;
	align-items: center;
	gap: 10px;
}

.ms-dolyame-sub {
	margin: 6px 0 0;
	font-size: 13.5px;
	color: #71717a;
	line-height: 1.35;
}

.ms-dolyame-close {
	background: #f4f4f5;
	border: none;
	width: 34px;
	height: 34px;
	border-radius: 50%;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	color: #71717a;
	cursor: pointer;
	transition: all 0.15s ease;
	flex-shrink: 0;
}

.ms-dolyame-close:hover {
	background: #e4e4e7;
	color: #000;
}

.ms-dolyame-body {
	overflow-y: auto;
	padding: 18px 0 10px;
	flex: 1 1 auto;
}

/* Вертикальный красивый таймлайн шагов */
.ms-dolyame-sheet-steps {
	display: flex;
	flex-direction: column;
	background: #fafafa;
	border: 1px solid #f4f4f5;
	border-radius: 18px;
	padding: 16px 16px;
	margin-bottom: 20px;
}

.ms-sh-step {
	display: flex;
	align-items: flex-start;
	gap: 14px;
	position: relative;
}

.ms-sh-node {
	display: flex;
	flex-direction: column;
	align-items: center;
	width: 26px;
	flex-shrink: 0;
}

.ms-sh-num {
	width: 26px;
	height: 26px;
	border-radius: 50%;
	background: #e4e4e7;
	color: #71717a;
	font-size: 12.5px;
	font-weight: 700;
	display: flex;
	align-items: center;
	justify-content: center;
}

.ms-sh-step.is-active .ms-sh-num {
	background: var(--ms-dolyame-yellow);
	color: #000000;
	box-shadow: 0 2px 8px rgba(255, 221, 45, 0.5);
}

.ms-sh-line {
	width: 2px;
	min-height: 34px;
	background: #e4e4e7;
	margin: 4px 0;
}

.ms-sh-body {
	flex: 1 1 auto;
	padding-bottom: 16px;
}

.ms-sh-step:last-child .ms-sh-body {
	padding-bottom: 0;
}

.ms-sh-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
}

.ms-sh-amt {
	font-size: 15px;
	font-weight: 800;
	color: #111111;
}

.ms-sh-badge.is-today {
	font-size: 11px;
	font-weight: 700;
	color: #111;
	background: var(--ms-dolyame-yellow);
	padding: 2px 7px;
	border-radius: 6px;
}

.ms-sh-date {
	font-size: 12.5px;
	font-weight: 600;
	color: #71717a;
}

.ms-sh-hint {
	margin: 2px 0 0;
	font-size: 12px;
	color: #a1a1aa;
}

/* Особенности */
.ms-dolyame-features {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.ms-feat {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	padding: 12px 14px;
	border-radius: 14px;
	background: #ffffff;
	border: 1px solid #f4f4f5;
}

.ms-feat-icon {
	width: 32px;
	height: 32px;
	border-radius: 10px;
	background: #f4f4f5;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #111;
	flex-shrink: 0;
}

.ms-feat-desc b {
	display: block;
	font-size: 13.5px;
	font-weight: 700;
	color: #18181b;
}

.ms-feat-desc span {
	display: block;
	margin-top: 2px;
	font-size: 12px;
	color: #71717a;
	line-height: 1.35;
}

.ms-dolyame-footer {
	padding-top: 14px;
}

.ms-dolyame-ok-btn {
	width: 100%;
	padding: 14px;
	border-radius: 14px;
	background: var(--ms-dolyame-yellow);
	color: #111111;
	border: none;
	font-size: 15px;
	font-weight: 700;
	cursor: pointer;
	transition: background 0.15s ease, transform 0.1s ease;
	font-family: inherit;
	box-shadow: 0 4px 14px rgba(255, 221, 45, 0.4);
}

.ms-dolyame-ok-btn:hover {
	background: var(--ms-dolyame-yellow-hover);
}

.ms-dolyame-ok-btn:active {
	transform: scale(0.985);
}

/* Десктопная модалка по центру */
@media (min-width: 768px) {
	.ms-dolyame-sheet {
		align-items: center;
	}
	.ms-dolyame-panel {
		border-radius: 24px;
		max-height: 84vh;
		transform: scale(0.94);
		opacity: 0;
		transition: transform 0.28s var(--ms-dolyame-ease), opacity 0.28s var(--ms-dolyame-ease);
		padding: 24px 26px;
	}
	.ms-dolyame-sheet.is-open .ms-dolyame-panel {
		transform: scale(1);
		opacity: 1;
	}
	.ms-dolyame-handle {
		display: none;
	}
}
