/* PatuPet Smart Campaigns — Frontend (sponsored unit)
   Tipografía: Poppins (headings, buttons) + ABeeZee (body). Cargadas localmente.
   Todas las medidas en px según el skill patupet-front.
*/

.patupet-front {
	--pp-blue:        #1c34c7;
	--pp-blue-dark:   #1b33a8;
	--pp-coral:       #ff8383;
	--pp-dark:        #1d1a27;
	--pp-gen-text:    #4B5563;
	--pp-grey-100:    #f5f5f5;
	--pp-grey-300:    #e0e0e0;
	--pp-grey-500:    #9e9e9e;
	--pp-grey-700:    #616161;
	--pp-amber:       #f5a623;
	--pp-soft-bg:     #f7f8ff;
	--pp-alert-green: #22c55e;

	font-family: 'ABeeZee', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
	color: var(--pp-dark);
	font-size: 15px;
	line-height: 1.5;
}

.patupet-front h1, .patupet-front h2, .patupet-front h3,
.patupet-front .heading, .patupet-front button, .patupet-front .btn,
.patupet-card-title, .patupet-cta-btn, .patupet-cart-btn,
.patupet-promo-text, .patupet-sponsored-tag {
	font-family: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ── Wrapper ─────────────────────────────────────────────────────── */
.patupet-sponsored-wrapper {
	position: relative;
	background: #fff;
	border: 1px solid var(--pp-grey-300);
	border-radius: 18px;
	padding: 20px 20px 32px; /* extra bottom for the absolute sponsored tag */
	margin: 24px 0;
	display: grid;
	grid-template-columns: 120px minmax(140px, 180px) minmax(0, 1fr);
	gap: 20px;
	align-items: center;
	box-shadow: 0 6px 22px -14px rgba(28,52,199,.18);
}

/* ── Brand column ────────────────────────────────────────────────── */
.patupet-brand-col { min-width: 0; }
.patupet-brand-block {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 10px;
}
.patupet-brand-logo { display: block; max-width: 110px; }
.patupet-brand-img {
	width: 100%;
	height: auto;
	max-height: 56px;
	object-fit: contain;
	display: block;
}
.patupet-brand-text {
	font-size: 20px;
	font-weight: 800;
	color: var(--pp-dark);
	text-decoration: none;
}
.patupet-sponsored-tag {
	position: absolute;
	left: 18px;
	bottom: 10px;
	font-size: 10px;
	font-weight: 700;
	letter-spacing: 1.4px;
	text-transform: uppercase;
	color: var(--pp-grey-500);
	pointer-events: none;
}

/* ── Promo / CTA column ──────────────────────────────────────────── */
.patupet-promo-col {
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 14px;
	justify-content: center;
}
.patupet-promo-text {
	margin: 0;
	font-size: 16px;
	font-weight: 400;
	line-height: 1.4;
	color: var(--pp-dark);
}
.patupet-cta-btn {
	align-self: flex-start;
	color: #000;
	text-decoration: underline;
	font-weight: 700;
	font-size: 14px;
	white-space: nowrap;
}
.patupet-cta-btn:hover { color: var(--pp-blue-dark); transform: translateY(-1px); }

/* ── Products carousel ──────────────────────────────────────────── */
.patupet-products-col { min-width: 0; }
.patupet-track-wrap { position: relative; }
.patupet-track {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 14px;
	padding: 6px 4px 12px; /* breathing room for hover lift + shadow */
}
.patupet-track.is-carousel {
	display: flex;
	overflow-x: auto;
	overflow-y: visible;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	gap: 14px;
	scrollbar-width: none;
	padding: 8px 4px 14px;
}
.patupet-track.is-carousel::-webkit-scrollbar { display: none; }
.patupet-track.is-carousel .patupet-card {
	flex: 0 0 calc((100% - 28px) / 3);
	scroll-snap-align: start;
}

/* Arrows */
.patupet-arrow {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: #fff;
	border: 1px solid var(--pp-grey-300);
	color: var(--pp-dark);
	font-size: 24px;
	line-height: 1;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 4px 14px -6px rgba(0,0,0,.18);
	transition: background .15s ease, color .15s ease;
	z-index: 2;
	padding-bottom: 3px;
}
.patupet-arrow:hover { background: var(--pp-blue); color: #fff; border-color: var(--pp-blue); }
.patupet-arrow--prev { left: -16px; }
.patupet-arrow--next { right: -16px; }

/* ── Product card (2-col horizontal en desktop) ─────────────────── */
.patupet-card {
	position: relative;
	background: #fff;
	border: 1px solid var(--pp-grey-300);
	border-radius: 14px;
	padding: 14px;
	display: grid;
	grid-template-columns: 96px 1fr;
	grid-template-areas:
		"image body"
		"pills pills";
	column-gap: 14px;
	row-gap: 10px;
	align-items: start;
	transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
	min-width: 0;
}
.patupet-card-thumb { grid-area: image; }
.patupet-card-body  { grid-area: body; }
.patupet-pills      { grid-area: pills; }
.patupet-card:hover {
	transform: translateY(-2px);
	box-shadow: 0 14px 28px -18px rgba(28,52,199,.25);
	border-color: var(--pp-blue);
}
.patupet-card-thumb {
	display: block;
	border-radius: 10px;
	overflow: hidden;
	background: var(--pp-grey-100);
	aspect-ratio: 1 / 1;
}
.patupet-card-img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}
.patupet-card-body {
	display: flex;
	flex-direction: column;
	gap: 8px;
	min-width: 0;
}
.patupet-card-title {
	margin: 0;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.35;
	color: var(--pp-dark);
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}
.patupet-card-title a { color: inherit; text-decoration: none; }
.patupet-card-title a:hover { color: var(--pp-blue); }

/* Rating */
.patupet-rating {
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: 13px;
	color: var(--pp-grey-700);
}
.patupet-stars { display: inline-flex; gap: 1px; line-height: 1; }
.pp-star { font-size: 16px; }
.pp-star--full  { color: var(--pp-amber); }
.pp-star--half  { color: var(--pp-amber); opacity: .5; }
.pp-star--empty { color: var(--pp-grey-300); }
.patupet-rating-count { color: var(--pp-grey-500); font-size: 12px; }

/* Price */
.patupet-card-price {
	font-size: 17px;
	font-weight: 800;
	color: var(--pp-blue);
	line-height: 1.2;
}
.patupet-card-price del {
	font-weight: 500;
	font-size: 13px;
	color: var(--pp-grey-500);
	margin-right: 6px;
}
.patupet-card-price ins {
	background: none;
	text-decoration: none;
	color: var(--pp-blue);
}
.patupet-card-price .woocommerce-Price-amount { font-weight: inherit; }

/* Variation pills — slim, neutral, full-width row under image+info */
.patupet-pills {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: nowrap;
	gap: 4px;
	overflow: hidden;
}
.patupet-pill {
	padding: 2px 6px;
	border: 1px solid #dcdcdc;
	border-radius: 4px;
	font-size: 11px;
	line-height: 1.2;
	background: #fff;
	color: #555;
	font-weight: 500;
	white-space: nowrap;
}
.patupet-pill--more {
	background: var(--pp-soft-bg);
	color: var(--pp-blue);
	border-color: #e3e8ff;
	font-weight: 700;
}

/* Add to cart button — circular icon, bottom-right of card.
   Defensive reset: many themes attach ::before/::after overlays to .button
   or to product-loop add-to-carts. We blanket-kill them on our element. */
.patupet-front .patupet-cart-btn {
	position: absolute !important;
	bottom: 12px !important;
	right: 12px !important;
	left: auto !important;
	top: auto !important;
	width: 40px !important;
	height: 40px !important;
	min-width: 40px !important;
	min-height: 40px !important;
	max-width: 40px !important;
	max-height: 40px !important;
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	padding: 0 !important;
	margin: 0 !important;
	border-radius: 50% !important;
	background: var(--pp-blue) !important;
	background-image: none !important;
	border: 1px solid var(--pp-blue) !important;
	color: #fff !important;
	text-decoration: none !important;
	cursor: pointer;
	box-shadow: 0 4px 12px -4px rgba(28,52,199,.45);
	transition: background .15s ease, transform .15s ease, box-shadow .15s ease;
	z-index: 3;
	line-height: 0 !important;
	font-size: 0 !important;
	overflow: hidden;
	text-indent: 0 !important;
}
.patupet-front .patupet-cart-btn::before,
.patupet-front .patupet-cart-btn::after {
	content: none !important;
	display: none !important;
	background: none !important;
}
.patupet-front .patupet-cart-btn:hover {
	background: var(--pp-blue-dark) !important;
	border-color: var(--pp-blue-dark) !important;
	color: #fff !important;
	transform: scale(1.08);
	box-shadow: 0 6px 16px -4px rgba(28,52,199,.55);
}
.patupet-cart-btn__icon {
	position: relative;
	z-index: 1;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 18px;
	height: 18px;
	color: inherit;
}
.patupet-cart-btn__icon svg {
	display: block;
	width: 18px;
	height: 18px;
	stroke: currentColor;
}
.patupet-cart-btn .screen-reader-text {
	position: absolute;
	width: 1px; height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}
.patupet-cart-btn.added,
.patupet-cart-btn.loading { opacity: .9; }
.patupet-cart-btn.loading {
	background-image: none;
}
.patupet-cart-btn.loading .patupet-cart-btn__icon {
	animation: pp-cart-spin .8s linear infinite;
}
@keyframes pp-cart-spin { to { transform: rotate(360deg); } }
.patupet-card .added_to_cart { display: none; }
/* Reserve space at bottom-right so price/pills don't overlap the floating btn */
.patupet-card-body { padding-right: 10px; }

/* ── Tablet ─────────────────────────────────────────────────────── */
@media (max-width: 980px) {
	.patupet-sponsored-wrapper {
		grid-template-columns: 110px 1fr;
		grid-template-areas:
			"brand promo"
			"products products";
		gap: 18px;
	}
	.patupet-brand-col   { grid-area: brand; }
	.patupet-promo-col   { grid-area: promo; }
	.patupet-products-col{ grid-area: products; }
}

/* ── Mobile ─────────────────────────────────────────────────────── */
@media (max-width: 720px) {
	.patupet-sponsored-wrapper {
		grid-template-columns: auto 1fr;
		grid-template-areas:
			"brand promo"
			"products products";
		padding: 16px 16px 28px;
		gap: 12px 14px;
		align-items: center;
	}
	.patupet-brand-block {
		flex-direction: column;
		align-items: flex-start;
		gap: 4px;
	}
	.patupet-brand-logo { max-width: 90px; }
	.patupet-brand-img { max-height: 42px; }
	.patupet-sponsored-tag { left: 14px; bottom: 8px; font-size: 9px; letter-spacing: 1.2px; }

	.patupet-promo-col { gap: 8px; }
	.patupet-promo-text { font-size: 13px; line-height: 1.35; font-weight: 400; }
	.patupet-cta-btn {
		align-self: flex-start;
		font-size: 12px;
		width: auto;
	}

	/* Vertical card on mobile */
	.patupet-card {
		grid-template-columns: 1fr;
		grid-template-areas:
			"image"
			"body"
			"pills";
		row-gap: 10px;
		padding: 12px;
	}
	.patupet-card-body { padding: 0 10px; min-height: 0; }
	.patupet-card-thumb { aspect-ratio: 4 / 3; }
	.patupet-card-title { font-size: 14px; }
	.patupet-card-price { font-size: 16px; }
	.patupet-front .patupet-cart-btn {
		width: 38px !important;
		height: 38px !important;
		min-width: 38px !important;
		min-height: 38px !important;
		max-width: 38px !important;
		max-height: 38px !important;
		bottom: 2px !important;
		right: 2px !important;
	}

	.patupet-track,
	.patupet-track.is-carousel {
		display: flex;
		overflow-x: auto;
		overflow-y: visible;
		scroll-snap-type: x mandatory;
		scroll-behavior: smooth;
		gap: 12px;
		scrollbar-width: none;
		padding: 6px 0 4px;
	}
	.patupet-track::-webkit-scrollbar,
	.patupet-track.is-carousel::-webkit-scrollbar { display: none; }
	.patupet-track .patupet-card {
		flex: 0 0 calc(50% - 6px)!important;
		scroll-snap-align: start;
	}
	.patupet-arrow { display: none; }

	.patupet-dots { display: flex; }
}

/* ── Dots paginator ─────────────────────────────────────────────── */
.patupet-dots {
	display: none;
	justify-content: center;
	align-items: center;
	gap: 6px;
	margin-top: 10px;
}
.patupet-dot {
	width: 8px;
	height: 8px;
	border: 0;
	border-radius: 999px;
	background: var(--pp-grey-300);
	padding: 0;
	cursor: pointer;
	transition: width .2s ease, background .2s ease;
}
.patupet-dot.is-active {
	width: 20px;
	background: var(--pp-blue);
}

@media (prefers-reduced-motion: reduce) {
	.patupet-sponsored-wrapper * { transition: none !important; animation: none !important; }
	.patupet-track { scroll-behavior: auto !important; }
}
