/* =========================================================================
   Card produs - super-magazin.ro
   Culorile se schimba din variabilele de mai jos.
   ========================================================================= */
.sm-card {
	--sm-accent: #fb5800;          /* portocaliu din logo: pret, buton */
	--sm-accent-2: #ff8a00;        /* portocaliu deschis (gradient ca in logo) */
	--sm-accent-hover: #e04e00;
	--sm-dark: #0f1726;            /* bleumarin din logo: zona iconita cos */
	--sm-cart-basket: #ff7a00;     /* cosul din iconita */
	--sm-text: #0f1726;
	--sm-muted: #7a808a;
	--sm-border: #f0ebe6;
	--sm-radius: 16px;

	position: relative;
	display: flex;
	flex-direction: column;
	height: 100%;
	padding: 14px 14px 16px;
	background: linear-gradient(180deg, #fff 55%, #fffaf6 100%);
	border: 1px solid var(--sm-border);
	border-radius: var(--sm-radius);
	box-shadow: 0 2px 10px rgba(30, 37, 48, .05);
	transition: box-shadow .25s ease, transform .25s ease;
	text-align: center;
	width: 100%;
	min-width: 0;
	max-width: 100%;
	flex: 1 1 auto;
	align-self: stretch;
	box-sizing: border-box;
}
.sm-card *, .sm-card *::before, .sm-card *::after { box-sizing: border-box; }
.sm-card:hover {
	box-shadow: 0 10px 28px rgba(30, 37, 48, .10);
	transform: translateY(-2px);
}

/* --- Wrapper-ele temei: fara chenar vechi, inaltimi egale (padding-ul ramane = spatiu intre coloane) --- */
.product:has(> .sm-card) {
	box-sizing: border-box;
	display: flex !important;
	flex-direction: column;
	align-items: stretch !important;
	align-self: stretch !important;
	border: 0 !important;
	background: transparent !important;
	box-shadow: none !important;
}
.item:has(> .product > .sm-card),
.slick-slide:has(.sm-card),
.slick-slide:has(.sm-card) > div {
	display: flex !important;
	flex-direction: column;
	height: auto;
}
.item > .product:has(> .sm-card),
.slick-slide:has(.sm-card) > div,
.slick-slide:has(.sm-card) > div > .item { flex: 1 1 auto; }
.slick-track:has(.sm-card) { display: flex !important; }
/* Spatiu intre randuri in grila de produse */
.products .row > *:has(.sm-card) { margin-bottom: 24px; }

/* --- Imagine + badge-uri --- */
.sm-card__media { position: relative; width: 100%; margin: 0 0 14px; }
.sm-card__image {
	display: flex;
	align-items: center;
	justify-content: center;
	aspect-ratio: 1 / 1;
	overflow: hidden;
	border-radius: 12px;
}
.sm-card__image img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	margin: 0 !important;
	transition: transform .35s ease;
}
.sm-card:hover .sm-card__image img { transform: scale(1.04); }

.sm-card__badge {
	position: absolute;
	top: 6px;
	z-index: 2;
	padding: 5px 11px;
	border-radius: 8px;
	font-size: 13px;
	font-weight: 800;
	line-height: 1.2;
	letter-spacing: .3px;
	color: #fff;
}
.sm-card__badge--new  { right: 6px; background: var(--sm-dark); }
.sm-card__badge--sale { left: 6px;  background: var(--sm-accent); }

/* --- Continut --- */
.sm-card__body { display: flex; flex-direction: column; flex: 1; width: 100%; }

.sm-card .sm-card__title {
	margin: 0 0 12px;
	padding: 0;
	font-size: 14.5px !important;
	font-weight: 500 !important;
	line-height: 1.45 !important;
	min-height: 2.8em;               /* mereu 2 randuri, carduri aliniate */
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}
.sm-card .sm-card__title a { color: var(--sm-text); text-decoration: none; font-weight: inherit !important; font-size: inherit !important; }
.sm-card .sm-card__title a:hover { color: var(--sm-accent); }

/* Eticheta stoc */
.sm-card__meta { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.sm-pill {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	padding: 4px 12px;
	border: 1px solid;
	border-radius: 999px;
	font-size: 13px;
	font-weight: 700;
	line-height: 1.5;
}
.sm-pill__dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.sm-pill--in        { color: #1c8a3e; background: #effaf2; border-color: #cfeeda; }
.sm-pill--low       { color: #d42a2a; background: #fff2f2; border-color: #ffd6d6; }
.sm-pill--backorder { color: #b26a00; background: #fff8ea; border-color: #ffe4b0; }
.sm-pill--out       { color: #6b7280; background: #f4f5f7; border-color: #e3e5e9; }

/* Pret */
.sm-card .sm-card__price {
	margin: 0 0 8px;
	font-size: 20px;
	font-weight: 500;
	line-height: 1.2;
	color: var(--sm-accent);
}
.sm-card .sm-card__price .woocommerce-Price-amount,
.sm-card .sm-card__price ins .woocommerce-Price-amount {
	color: var(--sm-accent);
	font-size: inherit !important;
	font-weight: inherit !important;
}
.sm-card .sm-card__price ins { text-decoration: none; background: none; }
.sm-card .sm-card__price del,
.sm-card .sm-card__price del .woocommerce-Price-amount {
	font-size: 13px;
	font-weight: 400;
	color: var(--sm-muted);
	opacity: 1;
}
.sm-card .sm-card__price del { margin-right: 6px; }

/* Rating */
.sm-card__rating {
	display: flex;
	align-items: center;
	justify-content: center;
	flex-wrap: wrap;
	gap: 2px 6px;
	margin-bottom: 14px;
	font-size: 15px;
	color: var(--sm-text);
}
.sm-card__rating strong { font-weight: 800; }
.sm-card__reviews { color: var(--sm-muted); white-space: nowrap; }
.sm-stars { position: relative; display: inline-block; font-size: 15px; line-height: 1; letter-spacing: 1px; }
.sm-stars::before { content: "★★★★★"; color: #e3e3e3; }
.sm-stars::after {
	content: "★★★★★";
	position: absolute;
	top: 0;
	left: 0;
	width: var(--sm-rating, 0%);
	overflow: hidden;
	white-space: nowrap;
	color: var(--sm-accent);
}

/* --- Cantitate + buton (un singur rand) --- */
.sm-card__actions {
	display: flex;
	flex-wrap: wrap;                /* rezerva: daca nu incape, butonul coboara */
	align-items: stretch;
	gap: 8px;
	margin-top: auto;               /* butoanele stau mereu jos */
	padding-top: 4px;
}
.sm-card__actions--noqty .sm-add { flex-basis: 100% !important; }

.sm-card .sm-qty {
	flex: 0 0 96px;
	display: flex;
	align-items: center;
	height: 40px;
	min-width: 0;
	margin: 0;
	padding: 0;
	border: 1px solid #ffd4bb;
	border-radius: 8px;
	background: #fff;
	overflow: hidden;
}
.sm-card .sm-qty .sm-qty__btn {
	flex: 0 0 28px;
	width: 28px !important;
	min-width: 0 !important;
	height: 100% !important;
	padding: 0 !important;
	margin: 0 !important;
	border: 0 !important;
	border-radius: 0 !important;
	background: transparent !important;
	color: var(--sm-accent) !important;
	font-size: 17px !important;
	font-weight: 600 !important;
	line-height: 1 !important;
	box-shadow: none !important;
	cursor: pointer;
}
.sm-card .sm-qty .sm-qty__btn:hover { background: #fff4ec !important; }
.sm-card .sm-qty .sm-qty__input {
	flex: 1 1 auto;
	width: 38px !important;
	min-width: 0 !important;
	height: 100% !important;
	padding: 0 !important;
	margin: 0 !important;
	border: 0 !important;
	border-radius: 0 !important;
	background: transparent !important;
	text-align: center;
	font-size: 15px !important;
	font-weight: 600 !important;
	color: var(--sm-text) !important;
	-moz-appearance: textfield;
	appearance: textfield;
	box-shadow: none !important;
}
.sm-card .sm-qty__input::-webkit-outer-spin-button,
.sm-card .sm-qty__input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.sm-card .sm-qty__input:focus { outline: none; background: #fff8f4 !important; }

.sm-card .button.sm-add {
	flex: 1 1 108px;
	display: flex !important;
	align-items: stretch;
	width: auto !important;
	min-width: 0 !important;
	height: 40px !important;
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	border-radius: 8px !important;
	overflow: hidden;
	background: transparent !important;
	color: #fff !important;
	font-size: 15px !important;
	font-weight: 700 !important;
	line-height: 1 !important;
	letter-spacing: 0 !important;
	text-transform: none !important;
	text-decoration: none !important;
	box-shadow: none !important;
}
/* Casuta cu cosul: fundal alb, contur portocaliu */
.sm-card .sm-add__icon {
	display: flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 44px;
	background: #fff;
	border: 1.5px solid var(--sm-accent);
	border-right: 0;
	border-radius: 8px 0 0 8px;
	color: var(--sm-dark);
	transition: background .2s ease;
}
.sm-card .sm-add__icon svg.sm-cart-icon {
	display: block;
	width: 32px !important;
	height: 27px !important;
	max-width: none !important;
	margin: 0 !important;
	transition: transform .25s ease;
}
.sm-card .sm-add__label {
	display: flex;
	align-items: center;
	justify-content: center;
	flex: 1;
	min-width: 0;
	padding: 0 10px;
	background: linear-gradient(90deg, var(--sm-accent-2), var(--sm-accent));
	border-radius: 0 8px 8px 0;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	transition: filter .2s ease;
}
.sm-card .button.sm-add:hover .sm-add__label { filter: brightness(.93); }
.sm-card .button.sm-add:hover .sm-add__icon { background: #fff4ec; }
.sm-card .button.sm-add:hover .sm-cart-icon { transform: translateX(2px); }

/* Butoane fara cos (variatii / epuizat) */
.sm-card .button.sm-add--link .sm-add__label { border-radius: 8px; }
.sm-card .button.sm-add--muted .sm-add__label { background: var(--sm-dark); }

/* Stari WooCommerce: se incarca / adaugat */
.sm-card .button.sm-add.loading { opacity: .75; pointer-events: none; }
.sm-card .button.sm-add.loading::after,
.sm-card .button.sm-add.added::after { display: none !important; }
.sm-card .button.sm-add.added .sm-add__label { background: #1c8a3e; }
.sm-card .button.sm-add.added .sm-add__icon { border-color: #1c8a3e; }
.sm-card .added_to_cart.wc-forward { display: none !important; }

/* --- Carduri inguste (2 pe rand pe mobil) --- */
@media (max-width: 767px) {
	.sm-card .sm-card__title { font-size: 13.5px !important; }
	.sm-card .sm-card__price { font-size: 18px; }
	.sm-card__rating { font-size: 13px; }
	.sm-card .sm-qty { flex: 1 1 100%; }
	.sm-card .button.sm-add { flex-basis: 100%; }
}
@media (max-width: 575px) {
	.sm-card { padding: 10px 10px 12px; border-radius: 14px; }
	.sm-card__badge { font-size: 11px; padding: 4px 8px; }
	.sm-pill { font-size: 12px; padding: 3px 10px; }
}

/* --- Randul cu cantitate + buton: mereu pe un singur rand (grila cu 4 coloane) --- */
.sm-card .sm-card__actions {
	display: grid !important;
	grid-template-columns: minmax(80px, 92px) minmax(0, 1fr);
	flex-wrap: nowrap;
	gap: 8px;
}
.sm-card .sm-card__actions--noqty { grid-template-columns: minmax(0, 1fr); }
.sm-card .sm-card__actions > .sm-qty,
.sm-card .sm-card__actions > .button.sm-add {
	flex: none !important;
	width: 100% !important;
	min-width: 0 !important;
	max-width: none !important;
}
.sm-card .sm-qty .sm-qty__btn { flex: 0 0 26px; width: 26px !important; }
.sm-card .sm-qty .sm-qty__input { width: auto !important; }
.sm-card .sm-add__icon { flex-basis: 42px; }
/* telefon (2 pe rand): cantitatea deasupra, butonul dedesubt */
@media (max-width: 767px) {
	.sm-card .sm-card__actions { grid-template-columns: minmax(0, 1fr); }
}
