/* Magazin pe mobil — vezi inc/magazin/magazin.php */

.agb-magazin-intro {
	margin: 0 0 16px;
	color: #666;
	font-size: 15px;
}

/* ---------- Pastile categorii (doar sub 992px; pe desktop există bara laterală) ---------- */
.agb-pastile {
	display: none;
}

@media (max-width: 991px) {
	/* Bannerul „Produse” (poză de tort pe tot ecranul) împingea produsele cu un ecran mai jos și era
	   ultimul element afișat (~7,6 s pe 4G). Pe telefon rămâne doar titlul; fără fundal, poza nici nu se descarcă. */
	.post-type-archive-product #pagetitle,
	.tax-product_cat #pagetitle {
		min-height: 0;
		margin: 0;
		padding: 16px 0 0;
		background: none !important;
		text-align: left;
	}
	.post-type-archive-product #pagetitle:before,
	.post-type-archive-product #pagetitle:after,
	.tax-product_cat #pagetitle:before,
	.tax-product_cat #pagetitle:after {
		display: none;
	}
	.post-type-archive-product #pagetitle .page-title-inner,
	.tax-product_cat #pagetitle .page-title-inner {
		min-height: 0;
		padding: 0;
	}
	.post-type-archive-product #pagetitle .ct-breadcrumb,
	.tax-product_cat #pagetitle .ct-breadcrumb {
		justify-content: flex-start;
		margin: 0;
	}
	/* Magazinul n-are titlu propriu, doar breadcrumb-ul „Produse”; categoriile au <h1> (alb, pe poză). */
	.post-type-archive-product #pagetitle .ct-breadcrumb li:last-child span,
	.tax-product_cat #pagetitle h1.page-title {
		margin: 0;
		color: #1f1f1f;
		font-family: 'Lora', serif;
		font-size: 26px;
		font-weight: 700;
		line-height: 1.2;
	}
	.tax-product_cat #pagetitle .page-title-holder {
		display: block;
		margin: 0;
		padding: 0;
	}
	.tax-product_cat #pagetitle .ct-breadcrumb {
		display: none; /* „Categorii de produse » …”: pastilele de mai jos arată deja unde ești */
	}

	/* Tema pune pe mobil bara laterală (~1700px) înaintea produselor; o mutăm după ele */
	.woocommerce #primary.content-has-sidebar {
		order: 0;
	}
	.woocommerce #primary.content-has-sidebar + #secondary {
		margin-top: 40px;
	}

	/* overflow: hidden pe #content blochează position: sticky; clip taie la fel, fără container de derulare */
	.woocommerce #content.site-content {
		overflow: clip;
		padding-top: 24px;
	}

	.agb-pastile {
		display: block;
		position: sticky;
		top: var(--agb-antet, 0px);
		z-index: 102;
		margin: 0 -15px 16px;
		padding: 10px 0;
		background: #fff;
		transition: box-shadow .2s, top .2s;
	}
	.agb-pastile.este-lipita {
		box-shadow: 0 6px 14px rgba(0, 0, 0, .06);
	}
	.agb-pastile__sina {
		display: flex;
		gap: 8px;
		overflow-x: auto;
		padding: 0 15px;
		scroll-padding: 0 15px;
		scrollbar-width: none;
		-webkit-overflow-scrolling: touch;
	}
	.agb-pastile__sina::-webkit-scrollbar {
		display: none;
	}
	.agb-pastila {
		flex: 0 0 auto;
		padding: 0 16px;
		line-height: 38px;
		border: 1px solid #e3e3e3;
		border-radius: 38px;
		background: #fff;
		color: var(--secondary-color, #191919);
		font-size: 15px;
		font-weight: 500;
		white-space: nowrap;
		text-decoration: none;
	}
	.agb-pastila:hover,
	.agb-pastila:focus-visible {
		border-color: var(--primary-color);
		color: var(--primary-color);
	}
	.agb-pastila.este-activa {
		border-color: var(--primary-color);
		background: var(--primary-color);
		color: #fff;
	}

	/* Bara de sus: număr rezultate + sortare, pe un singur rând; fără comutatorul grilă/listă */
	.woocommerce .woocommerce-topbar {
		flex-wrap: nowrap;
		gap: 12px;
		margin-bottom: 16px;
	}
	.woocommerce .woocommerce-topbar div.woocommerce-result-count {
		margin: 0;
		flex: 1 1 auto;
	}
	.woocommerce .woocommerce-topbar .woocommerce-result-count {
		font-size: 14px;
	}
	.woocommerce .woocommerce-topbar .woocommerce-topbar-ordering {
		margin: 0;
	}
	.woocommerce .woocommerce-topbar .woocommerce-ordering {
		min-width: 0;
		margin: 0;
	}
	.woocommerce-archive-layout {
		display: none;
	}
}

/* ---------- Grilă pe 2 coloane (telefon) / 3 coloane (tabletă) și carduri compacte ---------- */
@media (max-width: 767px) {
	.woocommerce ul.products li.product,
	.woocommerce #primary ul.products li.product {
		width: 50% !important;
	}
}

@media (max-width: 991px) {
	.woocommerce ul.products {
		display: flex;
		flex-wrap: wrap;
		margin-left: -5px;
		margin-right: -5px;
	}
	.woocommerce ul.products li.product,
	.woocommerce #primary ul.products li.product {
		padding: 0 5px !important;
		margin: 0 0 10px !important;
		display: flex;
	}
	.woocommerce ul.products li.product .woocommerce-product-inner {
		position: relative;
		display: flex;
		flex-direction: column;
		width: 100%;
		margin: 0;
		border-radius: 12px;
		overflow: hidden;
		box-shadow: 0 1px 8px rgba(12, 12, 12, .06);
	}
	/* Chenarul decorativ de la hover rămâne „blocat” după atingere pe ecrane tactile */
	.woocommerce ul.products li.product .woocommerce-product-inner:before {
		display: none;
	}
	/* Stratul-link al pozei (::before, z-index 3) rămâne în antet, sub iconița de coș */
	.woocommerce ul.products li.product .woocommerce-product-header {
		position: relative;
		z-index: 1;
	}
	.woocommerce ul.products li.product .woocommerce-product-header img {
		display: block;
		width: 100%;
		aspect-ratio: 1;
		object-fit: cover;
	}
	/* Compară / Vizualizare rapidă / Favorite: pe telefon se deschide direct produsul */
	.woocommerce ul.products li.product .woocommerce-product-meta {
		display: none;
	}
	.woocommerce ul.products li.product .woocommerce-product-content {
		display: flex;
		flex-direction: column;
		flex: 1 1 auto;
		position: static; /* iconița de coș se raportează la card, nu la zona de text */
		padding: 10px 12px 14px;
		text-align: left;
	}
	.woocommerce ul.products li.product .woocommerce-product-content,
	.woocommerce ul.products li.product .woocommerce-product-content * {
		letter-spacing: 0;
	}
	.woocommerce ul.products li.product .woocommerce-product--title {
		margin: 0 0 6px;
		font-family: 'Barlow', sans-serif;
		font-size: 15px;
		font-weight: 600;
		line-height: 1.3;
		letter-spacing: 0;
		display: -webkit-box;
		-webkit-line-clamp: 2;
		-webkit-box-orient: vertical;
		overflow: hidden;
	}
	.woocommerce ul.products li.product .price,
	.woocommerce .woocommerce-product-inner .woocommerce-product-content > .price {
		margin: auto 0 0 !important;
		font-size: 16px;
		font-weight: 700;
		line-height: 1.3;
		letter-spacing: 0;
	}
	.woocommerce ul.products li.product .woocommerce-product--rating {
		display: none;
	}

	/* Coșul: iconiță rotundă în colțul pozei (în temă butonul apare doar la hover) */
	.woocommerce .woocommerce-product-inner .woocommerce-product-content .woocommerce-add-to-cart:not(.woocommerce-add-to-cart-grid) {
		position: absolute;
		top: 8px;
		right: 8px;
		bottom: auto;
		left: auto;
		z-index: 10;
		margin: 0;
		opacity: 1;
		visibility: visible;
		transform: none;
	}
	.woocommerce .woocommerce-product-inner .woocommerce-product-content .woocommerce-add-to-cart:not(.woocommerce-add-to-cart-grid) a {
		position: relative;
		display: block;
		width: 40px;
		height: 40px;
		padding: 0;
		border-radius: 50%;
		background: #fff;
		box-shadow: 0 2px 8px rgba(0, 0, 0, .15);
		font-size: 0;
		line-height: 0;
		color: transparent;
		overflow: hidden;
	}
	.woocommerce .woocommerce-product-inner .woocommerce-product-content .woocommerce-add-to-cart:not(.woocommerce-add-to-cart-grid) a:before {
		content: '';
		position: absolute;
		inset: 0;
		margin: auto;
		width: 20px;
		height: 20px;
		border-radius: 0;
		background: var(--primary-color);
		-webkit-mask: var(--agb-icon-cos) center / contain no-repeat;
		mask: var(--agb-icon-cos) center / contain no-repeat;
		transform: none;
		opacity: 1;
		--agb-icon-cos: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='9' cy='20' r='1.5'/%3E%3Ccircle cx='18' cy='20' r='1.5'/%3E%3Cpath d='M2 3h3l2.4 11.2a1.5 1.5 0 0 0 1.5 1.3h9.3a1.5 1.5 0 0 0 1.5-1.2L21 7H6'/%3E%3Cpath d='M13 9v4M11 11h4'/%3E%3C/svg%3E");
	}
	.woocommerce .woocommerce-product-inner .woocommerce-product-content .woocommerce-add-to-cart:not(.woocommerce-add-to-cart-grid) a:after,
	.woocommerce .woocommerce-product-inner .woocommerce-product-content .woocommerce-add-to-cart:not(.woocommerce-add-to-cart-grid) a i {
		display: none;
	}
	.woocommerce .woocommerce-product-inner .woocommerce-product-content .woocommerce-add-to-cart:not(.woocommerce-add-to-cart-grid) a.loading {
		opacity: .5;
	}
	/* După adăugare tema ascunde butonul și pune linkul „Vezi coșul”: îl arătăm ca bifă */
	.woocommerce .woocommerce-product-inner .woocommerce-product-content .woocommerce-add-to-cart a.added_to_cart {
		display: block;
		width: 40px;
		height: 40px;
		margin: 0;
		padding: 0;
		border-radius: 50%;
		background: var(--primary-color) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 20px no-repeat;
		box-shadow: 0 2px 8px rgba(0, 0, 0, .15);
		font-size: 0;
		color: transparent;
	}
}
