/* ===========================================================================
   CARDS — Product listing cards, badges, hover effects
   Petz.gr

   !important kept on: .product-card, .card-body, .product-image,
   .product-title, .product-image-container (all defined in Modesy L2811-2950)
   !important removed from: petz-card-*, card-paw-watermark (petz-exclusive)
   Merged: 4 duplicate selectors into single blocks
   =========================================================================== */

/* ── Card base ───────────────────────────────────────────── */

.petz-product-card {
	border-radius: var(--petz-radius-lg);
	overflow: hidden;
	background: var(--petz-bg-cream, #fefdfb);
	box-shadow: var(--petz-shadow-card);
	transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
	height: 100%;
	display: flex;
	flex-direction: column;
	border-left: 3px solid transparent;
	position: relative;
	animation: cardFadeIn 0.4s ease forwards;
}

.petz-product-card .card-image-column {
	position: relative;
	width: 100%;
	/* Ensures inner image respects card boundaries */
	border-radius: var(--petz-radius-lg) var(--petz-radius-lg) 0 0;
	overflow: hidden;
}

.petz-product-card .product-image-container {
	border-radius: 0 !important;
}

.petz-product-card:hover {
	box-shadow: var(--petz-shadow-card-hover), inset 0 0 20px rgba(76, 175, 80, 0.03);
	transform: translateY(-6px);
	border-left-color: var(--mds-color-main, var(--petz-primary));
}

/* ── Badges ──────────────────────────────────────────────── */

.petz-card-badge {
	position: absolute;
	top: 12px;
	right: 12px;
	padding: 6px 14px 6px;
	border-radius: 7px;
	font-size: 0.7rem;
	font-weight: 700;
	letter-spacing: 0.05em;
	z-index: 10;
	text-transform: uppercase;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	line-height: 1.2;
	animation: badgePop 0.35s ease forwards;
}

.petz-card-badge-available {
	background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
	color: white;
}

.petz-card-badge-sold {
	background: linear-gradient(135deg, #17a2b8 0%, #6f42c1 100%);
	color: white;
}

.petz-card-badge-pending {
	background: linear-gradient(135deg, #fd7e14 0%, #ffc107 100%);
	color: white;
}

.petz-card-badge-lost {
	background: linear-gradient(135deg, #ee0000 0%, #7d0101 100%);
	color: white;
}

.petz-card-badge-found {
	background: linear-gradient(135deg, #28a745 0%, #1e7e34 100%);
	color: white;
}

.petz-card-badge-reunited {
	background: linear-gradient(135deg, #00d6f7 0%, #00b0cf 100%);
	color: white;
}

.petz-card-badge-open {
	background: #ffffff;
	color: #28a745;
	box-shadow: 0 2px 8px rgba(0,0,0,0.15);
	top: 12px;
	left: 12px;
	right: auto;
}

.petz-card-badge-emergency {
	background: #2563eb;
	color: white;
	box-shadow: 0 2px 8px rgba(37, 99, 235, 0.4);
	top: 12px;
	left: 12px;
	right: auto;
}

.petz-card-badge-emergency + .petz-card-badge-open,
.petz-card-featured + .petz-card-badge-open,
.petz-card-featured + .petz-card-badge-emergency {
	top: 42px;
}

.petz-card-badge-reward {
	background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
	color: white;
	top: 12px;
	left: 12px;
	right: auto;
	width: 32px;
	height: 32px;
	padding: 6px;
	border-radius: 6px;
}

.petz-card-badge-reward svg {
	width: 20px;
	height: 20px;
	fill: white;
	stroke: white;
}

.petz-card-featured {
	position: absolute;
	top: 12px;
	left: 12px;
	padding: 4px 10px;
	border-radius: 4px;
	font-size: 0.65rem;
	font-weight: 700;
	background: var(--petz-secondary);
	color: white;
	z-index: 10;
}

/* ── Card body & text ────────────────────────────────────── */

.petz-product-card .card-content-wrapper {
	display: flex;
	flex-direction: column;
	flex-grow: 1;
}

.petz-product-card .card-body {
	padding: 16px;
	display: flex;
	flex-direction: column;
	gap: 8px;
	flex-grow: 1;
}

.petz-product-card .product-title {
	font-size: 1.1rem;
	font-weight: 700;
	margin: 0 0 4px;
	line-height: 1.3;
}

.petz-product-card .product-title a {
	color: var(--petz-text-dark);
	text-decoration: none;
	transition: color 0.2s ease;
}

.petz-product-card .product-title a:hover {
	color: var(--mds-color-main, var(--petz-primary));
}

/* Location — merged from 2 blocks */
.petz-card-location {
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: 0.85rem;
	color: var(--petz-primary);
	font-weight: 500;
}

.petz-card-location svg {
	color: var(--petz-primary);
	flex-shrink: 0;
	width: 14px;
	height: 14px;
}

/* Date banner directly under image */
.petz-card-date-banner {
	background: transparent;
	border-bottom: 1px solid var(--petz-border);
	padding: 8px 12px;
	font-size: 0.8rem;
	color: var(--petz-text-medium);
	margin-left: 0;
	margin-right: 0;
	margin-bottom: 0;
	border-radius: 0;
	display: flex;
	align-items: center;
	gap: 6px;
}

.petz-card-date-banner svg {
	width: 12px;
	height: 12px;
}

.petz-card-divider {
	display: none;
}

.petz-card-lostfound-info {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-top: 4px;
	font-size: 0.75rem;
}

.petz-card-lostfound-info svg {
	color: #17a2b8;
}

.petz-card-breed {
	font-size: 0.8rem;
	color: var(--petz-primary);
	font-weight: 500;
	text-decoration: none;
}

.petz-card-breed:hover {
	color: var(--petz-primary-dark);
	text-decoration: underline;
}

.petz-card-attributes {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.petz-attr {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 0.78rem;
	color: var(--petz-text-black);
}

.petz-attr svg {
	width: 14px;
	height: 14px;
	flex-shrink: 0;
	color: var(--petz-text-medium);
}

.petz-attr span {
	line-height: 1.2;
}

/* ── Card details grid ───────────────────────────────────── */

.petz-card-details {
	display: flex;
	gap: 12px;
	margin-top: 8px;
	padding-top: 8px;
	border-top: 1px solid var(--petz-border);
}

.petz-card-column {
	flex: 1;
	min-width: 0;
}

.petz-card-column-header {
	display: block;
	font-size: 0.7rem;
	font-weight: 600;
	color: var(--petz-text-medium);
	text-transform: uppercase;
	letter-spacing: 0.03em;
	margin-bottom: 4px;
	padding-bottom: 2px;
	border-bottom: 1px solid rgba(0,0,0,0.05);
}

/* ── Meta row (location + date inline on desktop) ───────── */

.petz-meta-row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 8px;
	margin-top: 4px;
	padding-top: 4px;
	border-top: 1px solid rgba(0,0,0,0.05);
}

.petz-meta-row .petz-attr {
	font-size: 0.75rem;
	color: var(--petz-text-medium);
}

/* ── Card footer ─────────────────────────────────────────── */

.petz-card-footer {
	margin-top: auto;
	padding: 10px 0 4px;
	border-top: 1px solid rgba(0,0,0,0.05);
	display: flex;
	align-items: center;
	gap: 6px;
}

.petz-card-footer svg {
	width: 14px;
	height: 14px;
	flex-shrink: 0;
}

.petz-card-date {
	font-size: 0.78rem;
	color: var(--petz-text-medium);
	font-weight: 500;
}

/* ── Actions overlay & buttons ───────────────────────────── */

.petz-product-card .product-actions-overlay {
	position: absolute;
	top: 12px;
	bottom: auto;
	right: 12px;
	display: flex;
	flex-direction: column;
	gap: 8px;
	z-index: 10;
}

.petz-product-card .action-btn {
	width: 36px;
	height: 36px;
	border-radius: 50%;
	background: rgba(255,255,255,0.9);
	border: none;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	box-shadow: 0 2px 8px rgba(0,0,0,0.15);
	transition: all 0.2s ease;
}

.petz-product-card .action-btn:hover {
	background: var(--petz-primary);
	color: white;
}

.petz-product-card .action-btn .icon-heart {
	color: #e74c3c;
}

/* ── Image container ─────────────────────────────────────── */

.petz-product-card .product-image-container {
	position: relative;
	overflow: hidden;
	background-color: #f0f0f0;
	border-radius: 12px 12px 0 0;
	aspect-ratio: 4 / 3;
	display: flex;
	align-items: center;
	justify-content: center;
}

/* !important — overrides Modesy .product-card .product-image (L2839) */
.petz-product-card .product-image-container .product-image,
.petz-product-card .product-image-container img.product-image {
	position: relative !important;
	z-index: 1 !important;
	max-width: 100% !important;
	max-height: 100% !important;
	width: auto !important;
	height: auto !important;
	object-fit: contain !important;
	display: block !important;
	transition: filter 0.15s ease-out, transform 0.15s ease-out !important;
}

.petz-product-card .product-image-container .product-image {
	transition: transform 0.4s ease;
}

.petz-product-card:hover .product-image-container .product-image {
	transform: scale(1.03);
}

.petz-product-card .product-image-container::after {
	content: '';
	position: absolute;
	bottom: 0;
	left: 0;
	right: 0;
	height: 60px;
	background: linear-gradient(to top, rgba(0,0,0,0.15), transparent);
	z-index: 3;
	pointer-events: none;
	border-radius: 0 0 var(--petz-radius-lg) var(--petz-radius-lg);
}

.petz-product-card .product-image-container.has-gallery {
	cursor: pointer;
}

.petz-product-card .product-image-container > a {
	position: relative;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
}

/* ── Modesy product-card overrides — !important needed (L2811-2950) ── */

.section-related-products .petz-product-card,
.section-related-products .product-card,
.row-product .petz-product-card,
.row-product .product-card,
.col-product .petz-product-card,
.col-product .product-card,
div.product-card.petz-product-card {
	background-color: #ffffff !important;
	background: #ffffff !important;
	border-radius: 12px !important;
	box-shadow: 0 2px 8px rgba(0,0,0,0.08) !important;
	position: relative !important;
	z-index: 1 !important;
}

.product-card .card-body,
.petz-product-card .card-body {
	background-color: #ffffff !important;
	border-radius: 0 0 12px 12px !important;
}

.product-card .product-image-container,
.petz-product-card .product-image-container {
	background-color: #f8f9fa !important;
	border-radius: 12px 12px 0 0 !important;
}

/* !important — overrides Modesy .product-card .product-title (L2931) */
.petz-product-card .product-title,
.petz-product-card .product-title a,
.product-card .product-title,
.product-card .product-title a,
h3.product-title,
h3.product-title a {
	display: block !important;
	overflow: hidden !important;
	text-overflow: ellipsis !important;
	white-space: nowrap !important;
	max-width: 100% !important;
}

.related-scroll-item .product-item,
.related-scroll-item .petz-product-card {
	margin: 0;
	width: 100%;
	height: 100%;
}

/* ── Staggered animation delays ──────────────────────────── */

.product-list-content .col-product:nth-child(1) .petz-product-card { animation-delay: 0.02s; }
.product-list-content .col-product:nth-child(2) .petz-product-card { animation-delay: 0.04s; }
.product-list-content .col-product:nth-child(3) .petz-product-card { animation-delay: 0.06s; }
.product-list-content .col-product:nth-child(4) .petz-product-card { animation-delay: 0.08s; }
.product-list-content .col-product:nth-child(5) .petz-product-card { animation-delay: 0.10s; }
.product-list-content .col-product:nth-child(6) .petz-product-card { animation-delay: 0.12s; }

/* ── Paw watermark ───────────────────────────────────────── */

.card-paw-watermark {
	position: absolute;
	bottom: -5px;
	right: -5px;
	width: 80px;
	height: 80px;
	opacity: 0.06;
	color: var(--petz-primary);
	pointer-events: none;
	z-index: 1;
	transition: opacity 0.3s ease;
}

.card-paw-watermark svg {
	width: 100%;
	height: 100%;
	fill: currentColor;
}

.petz-product-card:hover .card-paw-watermark {
	opacity: 0.12;
}

/* ══════════════════════════════════════════════════════════════
   SERVICE ROW — Horizontal card layout for service listings
   ══════════════════════════════════════════════════════════════ */

.petz-service-row {
	flex-direction: row !important;
	align-items: stretch;
	border-left: none;
	transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.petz-service-row:hover {
	border-left-color: transparent;
	transform: translateY(-3px);
}

/* Force full-width column for service rows */
.col-product:has(.petz-service-row) {
	flex: 0 0 100% !important;
	max-width: 100% !important;
}

/* Image column — compact square thumbnail */
.petz-service-row .card-image-column {
	flex: 0 0 180px;
	width: 180px;
	border-radius: var(--petz-radius-lg) 0 0 var(--petz-radius-lg);
}

.petz-service-row .product-image-container {
	aspect-ratio: 1 / 1 !important;
	border-radius: var(--petz-radius-lg) 0 0 var(--petz-radius-lg) !important;
	height: 100%;
}

.petz-service-row .product-image-container::after {
	display: none; /* No gradient overlay on service rows */
}

/* Content side */
.petz-service-row .card-content-wrapper {
	flex: 1;
	min-width: 0;
}

.petz-service-row .card-body {
	padding: 10px 14px;
	gap: 4px;
}

/* Service card footer (location at bottom) */
.petz-svc-footer {
	grid-template-columns: 1fr;
	margin-top: auto;
	padding-top: 6px;
}

/* Title row: title (truncated) + rating (right) */
.petz-svc-title-row {
	display: flex;
	align-items: baseline;
	gap: 10px;
	margin-bottom: 2px;
}

.petz-svc-title-row .product-title {
	flex: 1;
	min-width: 0;
	margin-bottom: 0;
}

.petz-svc-title-row .product-title a {
	display: block;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.petz-service-row .product-title {
	font-size: 1.05rem;
	margin-bottom: 2px;
}

/* Service row highlights: vertical list with labels */
.petz-service-row .petz-card-attributes {
	flex-direction: column;
	gap: 3px;
}

.petz-attr-label {
	display: none; /* hidden by default (adoption cards) */
}

.petz-service-row .petz-attr .petz-attr-label {
	display: inline;
	color: var(--petz-text-medium, #6b7280);
	font-weight: 600;
	margin-right: 2px;
}

/* Short labels: hidden by default (desktop), shown on mobile */
.petz-attr-label-short {
	display: none;
	color: var(--petz-text-medium, #6b7280);
	font-weight: 400;
	margin-left: 2px;
}

/* ── Two-column service card body ──────────────────── */

.petz-svc-card-columns {
	display: flex;
	gap: 24px;
	margin-top: 6px;
}

.petz-svc-col-left {
	flex: 0 0 55%;
	min-width: 0;
}

.petz-svc-col-right {
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 8px;
	border-left: 1px solid var(--petz-border, #e5e7eb);
	padding-left: 20px;
}

/* Category extras (specialties, services offered, etc.) */
.petz-svc-extras {
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.petz-svc-extras-label {
	font-size: 0.7rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--petz-text-medium, #6b7280);
}

/* Two-column list for extras values */
.petz-svc-extras-list {
	list-style: none;
	padding: 0;
	margin: 0;
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 1px 12px;
}

.petz-svc-extras-list li {
	font-size: 0.78rem;
	color: var(--petz-text-black, #1f2937);
	line-height: 1.5;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.petz-svc-extras-list li::before {
	content: '•';
	color: var(--petz-primary, #36b37e);
	margin-right: 4px;
	font-weight: 700;
}

/* Rating */
.petz-svc-rating {
	display: flex;
	align-items: center;
	gap: 4px;
	color: #f59e0b;
	font-weight: 600;
	font-size: 0.9rem;
}

.petz-svc-rating svg {
	width: 16px;
	height: 16px;
	fill: #f59e0b;
}

.petz-svc-rating-count {
	font-weight: 400;
	font-size: 0.78rem;
	color: var(--petz-text-medium, #6b7280);
}

/* Location — inline in pills row */
.petz-svc-location {
	display: flex;
	align-items: center;
	gap: 5px;
	font-size: 0.82rem;
	color: var(--petz-text-medium, #6b7280);
	white-space: nowrap;
}

.petz-svc-location svg {
	width: 14px;
	height: 14px;
	flex-shrink: 0;
}

/* Paw watermark: slightly smaller for rows */
.petz-service-row .card-paw-watermark {
	width: 60px;
	height: 60px;
}

/* ── Inline Service Pills (Open/Emergency in card body) ──── */

.petz-svc-pills {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 6px;
	margin-top: 2px;
	margin-bottom: 2px;
}

.petz-svc-pills-left {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	align-items: center;
}

.petz-svc-pill {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	padding: 3px 10px;
	border-radius: 20px;
	font-size: 0.7rem;
	font-weight: 600;
	letter-spacing: 0.02em;
	line-height: 1.3;
}

.petz-svc-pill svg {
	width: 12px;
	height: 12px;
	flex-shrink: 0;
}

.petz-svc-pill-dot {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: currentColor;
	flex-shrink: 0;
}

.petz-svc-pill-open {
	background: #ecfdf5;
	color: #16a34a;
	border: 1px solid #bbf7d0;
}

.petz-svc-pill-emergency {
	background: #eff6ff;
	color: #2563eb;
	border: 1px solid #bfdbfe;
}

.petz-svc-pill-emergency svg {
	fill: #2563eb;
	color: #2563eb;
}

/* ── Image overlay badges (Open Now / Emergency) ────────── */
.petz-svc-image-badges {
	position: absolute;
	top: 8px;
	left: 8px;
	z-index: 15;
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.petz-svc-badge {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	padding: 4px 10px;
	border-radius: 6px;
	font-size: 0.68rem;
	font-weight: 700;
	letter-spacing: 0.02em;
	line-height: 1.2;
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
	white-space: nowrap;
}

.petz-svc-badge svg {
	width: 11px;
	height: 11px;
	flex-shrink: 0;
}

.petz-svc-badge-dot {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	flex-shrink: 0;
	animation: petz-pulse 2s ease-in-out infinite;
}

.petz-svc-badge-open {
	background: rgba(255, 255, 255, 0.92);
	color: #16a34a;
}

.petz-svc-badge-open .petz-svc-badge-dot {
	background: #16a34a;
}

.petz-svc-badge-emergency {
	background: rgba(37, 99, 235, 0.9);
	color: #fff;
}

.petz-svc-badge-emergency svg {
	fill: #fff;
	color: #fff;
}

@keyframes petz-pulse {
	0%, 100% { opacity: 1; }
	50% { opacity: 0.4; }
}

/* Mobile: icon-only badges, hide labels, tighter padding */
@media (max-width: 575px) {
	.petz-svc-image-badges {
		flex-direction: row;
	}
	.petz-svc-badge {
		width: 26px;
		height: 26px;
		padding: 0;
		border-radius: 50%;
		font-size: 0;
		gap: 0;
		justify-content: center;
	}
	.petz-svc-badge-dot {
		width: 10px;
		height: 10px;
	}
	.petz-svc-badge svg {
		width: 14px;
		height: 14px;
	}
	/* Hide full labels, show short labels */
	.petz-service-row .petz-attr-label {
		display: none !important;
	}
	.petz-service-row .petz-attr-label-short {
		display: inline !important;
	}
	/* Tighter mobile card body */
	.petz-service-row .card-body {
		padding: 8px 10px;
		gap: 3px;
	}
}

/* ── Location row (standalone, below title) ─────────────── */
.petz-svc-location-row {
	margin-bottom: 4px;
}

/* ── Narrow recommendation cards: single-column, truncated ──── */
/* Service cards inside related/recommendation grids */
.section-related-services .petz-svc-card-columns {
	flex-direction: column;
	gap: 8px;
}

.section-related-services .petz-svc-col-right {
	display: none; /* hide extras in narrow cards */
}

.section-related-services .petz-svc-col-left {
	flex: 1 1 100%;
}

/* Truncate highlight lines in narrow cards */
.section-related-services .petz-attr {
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* General: truncation safety for highlight attributes */
.petz-service-row .petz-attr {
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	max-width: 100%;
}

.petz-service-row .petz-attr > span {
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	min-width: 0;
}

/* ── Related products grid override ──────────────────────── */
/* Force 3-per-row regardless of Modesy global grid settings */
.section-related-services .row-product .col-product {
	flex: 0 0 33.333% !important;
	max-width: 33.333% !important;
}

@media (max-width: 767px) {
	.section-related-services .row-product .col-product {
		flex: 0 0 50% !important;
		max-width: 50% !important;
	}
}
