/* MedSkill – mini cart din header */

.ms-minicart {
	position: relative;
	display: inline-flex;
	z-index: 210;
	font-family: "DM Sans", system-ui, sans-serif;
}

/* z-index-ul panoului contează doar în stiva rândului Divi care îl conține.
   Rândul meniului din header (dedesubt) are z-index 100 și s-ar desena peste
   panou. Cât timp panoul e deschis, ridicăm părinții Divi peste el.
   .ms-strat-sus e pusă din JS pentru browserele fără :has(). */
.et_pb_module:has(.ms-minicart.este-deschis),
.et_pb_column:has(.ms-minicart.este-deschis),
.et_pb_row:has(.ms-minicart.este-deschis),
.et_pb_section:has(.ms-minicart.este-deschis),
.ms-strat-sus {
	position: relative;
	z-index: 100000 !important;
}

/* Temele și layout-urile de header pun uneori line-height:0 pe modulul care
   găzduiește mini cart-ul, ca să nu adauge înălțime. Îl readucem la normal
   înăuntru, altfel textele din panou se suprapun. */
.ms-minicart,
.ms-minicart * {
	line-height: normal;
}

/* ---- butonul ---- */
.ms-minicart__trigger {
	position: relative;
	width: 34px;
	height: 34px;
	padding: 0;
	border: 0;
	background: none;
	color: #0e1b4d;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: color .18s;
}

.ms-minicart__trigger:hover { color: #e5232e; }
.ms-minicart__trigger svg { width: 19px; height: 19px; display: block; }

.ms-minicart__count {
	position: absolute;
	top: -2px;
	right: -4px;
	min-width: 17px;
	height: 17px;
	padding: 0 4px;
	border-radius: 50%;
	background: #e5232e;
	color: #fff;
	font-size: 10px;
	font-weight: 700;
	line-height: 17px;
	text-align: center;
}

.ms-minicart__count.este-gol { background: #525d7d; }

/* mică pulsație când se schimbă numărul */
.ms-minicart__count.ms-puls { animation: msPuls .45s ease; }

@keyframes msPuls {
	0%   { transform: scale(1); }
	45%  { transform: scale(1.35); }
	100% { transform: scale(1); }
}

/* ---- panoul ---- */
.ms-minicart__panel {
	position: absolute;
	top: calc(100% + 12px);
	right: 0;
	z-index: 99999;
	width: 330px;
	max-width: calc(100vw - 32px);
	background: #fff;
	border: 1px solid #e4e9f5;
	border-radius: 12px;
	box-shadow: 0 14px 38px rgba(0, 0, 0, .14);
	opacity: 0;
	transform: translateY(-8px);
	transition: opacity .2s, transform .2s;
}

.ms-minicart__panel[hidden] { display: none; }
.ms-minicart.este-deschis .ms-minicart__panel { opacity: 1; transform: translateY(0); }

/* punte invizibilă peste golul de 12px dintre iconiță și panou (hover) */
.ms-minicart__panel::after {
	content: "";
	position: absolute;
	top: -14px;
	right: 0;
	left: 0;
	height: 14px;
}

/* săgeata */
.ms-minicart__panel::before {
	content: "";
	position: absolute;
	top: -7px;
	right: 12px;
	width: 12px;
	height: 12px;
	background: #fff;
	border-left: 1px solid #e4e9f5;
	border-top: 1px solid #e4e9f5;
	transform: rotate(45deg);
}

.ms-minicart__cap {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 14px 16px;
	border-bottom: 1px solid #e4e9f5;
	font-size: 12px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .08em;
	color: #0e1b4d;
}

/* Confirmarea „Produsul a fost adăugat în coș.” — vizibilă doar când panoul
   s-a deschis în urma unei adăugări (clasa .este-adaugat, pusă din JS). */
.ms-minicart__adaugat {
	display: none;
}

.ms-minicart.este-adaugat .ms-minicart__adaugat {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 0;
	padding: 11px 16px;
	background: #EDF7EE;
	border-bottom: 1px solid #CFE8D2;
	font-size: 13px;
	font-weight: 600;
	line-height: 1.4;
	color: #1E6B2D;
}

.ms-minicart.este-adaugat .ms-minicart__adaugat::before {
	content: "";
	flex: none;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: #2E8B3E url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 11px 11px no-repeat;
}

.ms-minicart__inchide {
	border: 0;
	background: none;
	color: #525d7d;
	font-size: 22px;
	line-height: 1;
	padding: 0;
	cursor: pointer;
	transition: color .18s;
}

.ms-minicart__inchide:hover { color: #e5232e; }

/* ---- conținutul randat de WooCommerce ---- */
.ms-minicart .widget_shopping_cart_content { padding: 4px 16px 16px; }

.ms-minicart ul.cart_list {
	list-style: none;
	margin: 0;
	padding: 0;
	max-height: 300px;
	overflow-y: auto;
}

.ms-minicart .widget_shopping_cart_content,
.ms-minicart .widget_shopping_cart_content p {
	line-height: 1.5;
}

.ms-minicart ul.cart_list li {
	position: relative;
	display: flex;
	gap: 12px;
	padding: 14px 0 14px 26px;
	margin: 0;
	border-bottom: 1px solid #eef1f8;
	font-size: 13px;
	line-height: 1.45;
	color: #333d5c;
}

.ms-minicart ul.cart_list li:last-child { border-bottom: 0; }

.ms-minicart ul.cart_list li a {
	color: #0e1b4d;
	font-weight: 500;
	text-decoration: none;
}

.ms-minicart ul.cart_list li a:hover { color: #e5232e; }

.ms-minicart ul.cart_list li img {
	width: 52px !important;
	height: 52px !important;
	object-fit: cover;
	border-radius: 8px;
	margin: 0 !important;
	float: none !important;
	order: 2;
	flex: none;
}

.ms-minicart ul.cart_list li .quantity {
	display: block;
	font-size: 12px;
	color: #3f4a6b;
}

.ms-minicart ul.cart_list li .amount { color: #0e1b4d; font-weight: 600; }

/* butonul de ștergere */
.ms-minicart ul.cart_list li a.remove {
	position: absolute;
	top: 16px;
	left: 0;
	width: 18px !important;
	height: 18px !important;
	border-radius: 50% !important;
	background: #eef1f8 !important;
	color: #3f4a6b !important;
	font-size: 14px !important;
	line-height: 18px !important;
	text-align: center;
	transition: background .18s, color .18s;
}

.ms-minicart ul.cart_list li a.remove:hover {
	background: #e5232e !important;
	color: #fff !important;
}

.ms-minicart .total {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	margin: 0;
	padding: 14px 0;
	border-top: 1px solid #e4e9f5;
	border-bottom: 0;
	font-size: 13px;
	color: #3f4a6b;
}

.ms-minicart .total strong { font-weight: 600; color: #0e1b4d; }
.ms-minicart .total .amount { font-size: 17px; font-weight: 700; color: #0e1b4d; }

.ms-minicart .woocommerce-mini-cart__empty-message {
	margin: 0;
	padding: 26px 0;
	text-align: center;
	font-size: 13px;
	color: #3f4a6b;
}

/* ---- butoanele de jos ---- */
.ms-minicart .woocommerce-mini-cart__buttons {
	display: flex;
	gap: 8px;
	margin: 0;
	padding: 0;
}

.ms-minicart .woocommerce-mini-cart__buttons a {
	flex: 1;
	margin: 0 !important;
	padding: 14px 18px !important;
	border-radius: 12px !important;
	font-size: 11.5px !important;
	font-weight: 600 !important;
	text-transform: uppercase;
	letter-spacing: .06em;
	text-align: center;
	line-height: 1.3 !important;
	transition: background .18s, color .18s, border-color .18s;
}

.ms-minicart .woocommerce-mini-cart__buttons a:first-child {
	background: #fff !important;
	color: #0e1b4d !important;
	border: 1px solid #e4e9f5 !important;
}

.ms-minicart .woocommerce-mini-cart__buttons a:first-child:hover {
	border-color: #0e1b4d !important;
}

.ms-minicart .woocommerce-mini-cart__buttons a.checkout {
	background: #e5232e !important;
	color: #fff !important;
	border: 1px solid #e5232e !important;
}

.ms-minicart .woocommerce-mini-cart__buttons a.checkout:hover {
	background: #c4141f !important;
	border-color: #c4141f !important;
}

/* fără săgeata pe care Divi o adaugă la hover pe butoanele WooCommerce */
.ms-minicart .woocommerce-mini-cart__buttons a::before,
.ms-minicart .woocommerce-mini-cart__buttons a::after,
.ms-minicart .woocommerce-mini-cart__buttons a:hover::before,
.ms-minicart .woocommerce-mini-cart__buttons a:hover::after {
	display: none !important;
	content: none !important;
}

/* ---- mobil: panoul devine o fereastră centrată ---- */
@media (max-width: 600px) {
	.ms-minicart__panel {
		position: fixed;
		top: auto;
		right: 12px;
		left: 12px;
		bottom: 12px;
		width: auto;
		max-width: none;
	}

	.ms-minicart__panel::before { display: none; }
	.ms-minicart ul.cart_list { max-height: 50vh; }
}

/* ---------- notificare jos-dreapta ----------
 * Apare după adăugarea în coș când header-ul nu e pe ecran (desktop).
 */
.ms-toast {
	position: fixed;
	right: 24px;
	bottom: 24px;
	z-index: 100001;
	display: flex;
	align-items: center;
	gap: 12px;
	max-width: calc(100vw - 48px);
	padding: 14px 14px 14px 16px;
	background: #fff;
	border: 1px solid #CFE8D2;
	border-left: 4px solid #2E8B3E;
	border-radius: 12px;
	box-shadow: 0 14px 38px rgba(0, 0, 0, .16);
	font-family: "DM Sans", system-ui, sans-serif;
	font-size: 14px;
	line-height: 1.4;
	color: #0e1b4d;
	opacity: 0;
	visibility: hidden;
	transform: translateY(12px);
	transition: opacity .25s, transform .25s, visibility .25s;
}

.ms-toast.este-vizibil {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}

.ms-toast__text {
	display: flex;
	align-items: center;
	gap: 10px;
	font-weight: 600;
	color: #1E6B2D;
}

.ms-toast__text::before {
	content: "";
	flex: none;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background: #2E8B3E url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 12px 12px no-repeat;
}

.ms-toast__link {
	flex: none;
	padding: 11px 20px;
	background: #e5232e;
	border-radius: 12px;
	color: #fff !important;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: .06em;
	text-transform: uppercase;
	text-decoration: none !important;
	transition: background .18s;
}

.ms-toast__link:hover { background: #c4141f; }

.ms-toast__x {
	flex: none;
	width: 28px;
	height: 28px;
	padding: 0;
	border: 0;
	background: none;
	color: #525d7d;
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
}

.ms-toast__x:hover { color: #0e1b4d; }

@media (prefers-reduced-motion: reduce) {
	.ms-toast { transition: none; }
}

/* MedSkill header: round button, same size as the search button */
.ms-minicart__trigger {
	width: 42px;
	height: 42px;
	border: 1px solid #e4e9f5;
	border-radius: 50%;
	background: #fff;
	color: #0e1b4d;
	transition: background .2s, color .2s, border-color .2s;
}
.ms-minicart__trigger:hover,
.ms-minicart.este-deschis .ms-minicart__trigger {
	border-color: #0b1f6e;
	background: #0b1f6e;
	color: #fff;
}
.ms-minicart__trigger svg {
	width: 20px;
	height: 20px;
}
.ms-minicart__count {
	top: -4px;
	right: -4px;
	min-width: 19px;
	height: 19px;
	border: 2px solid #fff;
	border-radius: 999px;
	line-height: 15px;
	box-sizing: border-box;
}
.ms-minicart__panel {
	width: 360px;
	box-shadow: 0 24px 60px rgba(14, 27, 77, .18);
}
.ms-minicart__trigger:focus-visible,
.ms-minicart__inchide:focus-visible {
	outline: 2px solid #e5232e;
	outline-offset: 2px;
}
