/* @import url('/css/main.css'); removed to prevent cascade conflicts */

/* Responsive grid for pet cards: 1 column on small, 2 on small tablets, 3 on desktop, 4 on large */
.grid {
	display: grid;
	gap: 1rem;
	grid-template-columns: repeat(1, 1fr);
}

@media (min-width: 600px) {
	.grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (min-width: 900px) {
	.grid {
		grid-template-columns: repeat(3, 1fr);
	}
}

@media (min-width: 1200px) {
	.grid {
		grid-template-columns: repeat(4, 1fr);
	}
}

.card {
	background: #fff;
	padding: 1.25rem;
	border-radius: 12px;
	box-shadow: 0 2px 12px rgba(139, 92, 246, 0.08), 0 1px 4px rgba(0, 0, 0, 0.04);
	display: flex;
	flex-direction: column;
	transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	position: relative;
	overflow: hidden;
}

.card::before {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 4px;
	background: linear-gradient(90deg, #8B5CF6 0%, #EC4899 100%);
	opacity: 0;
	transition: opacity 0.3s ease;
}

.card:hover::before {
	opacity: 1;
}

.card h3 {
	margin: 0 0 8px 0;
	font-size: 1.2rem;
	color: #1F2937;
	/* Line clamping for uniform title height */
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	height: 3rem;
	/* 1.5rem x 2 lines */
	line-height: 1.5rem;
}

.card p {
	margin: 4px 0;
	color: #6B7280;
	font-size: 0.9rem;
	/* Fixed height for breed/type info */
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	height: 1.2rem;
}

.card img {
	width: 100%;
	height: 200px;
	object-fit: cover;
	border-radius: 6px;
	margin-bottom: 12px;
}

/* Filter Styles */
.filter-container {
	background: white;
	padding: 20px;
	border-radius: 12px;
	box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
	margin-bottom: 2rem;
	display: flex;
	flex-wrap: wrap;
	gap: 16px;
	align-items: center;
}

.search-box {
	flex: 1;
	min-width: 250px;
	position: relative;
}

.search-box input {
	width: 100%;
	padding: 12px 16px 12px 40px;
	border: 1px solid #e5e7eb;
	border-radius: 8px;
	font-size: 0.95rem;
	transition: all 0.2s;
}

.search-box input:focus {
	border-color: #8B5CF6;
	outline: none;
	box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.search-box i {
	position: absolute;
	left: 12px;
	top: 50%;
	transform: translateY(-50%);
	color: #9CA3AF;
}

.filter-group {
	display: flex;
	gap: 12px;
	flex-wrap: wrap;
}

.filter-select {
	padding: 12px 36px 12px 16px;
	border: 1px solid #e5e7eb;
	border-radius: 8px;
	background-color: white;
	font-size: 0.95rem;
	cursor: pointer;
	appearance: none;
	background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
	background-position: right 0.5rem center;
	background-repeat: no-repeat;
	background-size: 1.5em 1.5em;
	min-width: 140px;
}

.filter-select:focus {
	border-color: #8B5CF6;
	outline: none;
}

/* Button styles for pet cards */
.btn {
	border: none;
	border-radius: 8px;
	padding: 10px 16px;
	font-weight: 500;
	font-size: 0.95rem;
	cursor: pointer;
	transition: all 0.2s;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
}

.btn-primary {
	background: linear-gradient(135deg, #8B5CF6 0%, #EC4899 100%);
	color: #fff;
	box-shadow: 0 4px 12px rgba(139, 92, 246, 0.25);
	position: relative;
	overflow: hidden;
}

.btn-primary::before {
	content: '';
	position: absolute;
	top: 0;
	left: -100%;
	width: 100%;
	height: 100%;
	background: linear-gradient(135deg, #EC4899 0%, #8B5CF6 100%);
	transition: left 0.3s ease;
}

.btn-primary:hover::before {
	left: 0;
}

.btn-primary span,
.btn-primary i {
	position: relative;
	z-index: 1;
}

.btn-primary:hover {
	box-shadow: 0 6px 20px rgba(139, 92, 246, 0.4);
	transform: translateY(-2px);
}

/* Pet modal styles */
/* Pet modal styles */
.pet-modal {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.6);
	backdrop-filter: blur(10px) !important;
	/* "Blur all" as requested */
	display: flex;
	align-items: flex-start;
	/* Prevent top-clipping */
	justify-content: center;
	z-index: 11000 !important;
	/* "On top of all" - above header (10000) */
	padding: 2rem 1rem;
	overflow-y: auto;
	/* Ensure vertical access to content */
}

.pet-modal-content {
	background: white;
	width: 100%;
	max-width: 900px;
	border-radius: 16px;
	overflow: hidden;
	box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
	display: flex;
	flex-direction: column;
	margin: auto 0;
	/* Centered unless taller than viewport */
	max-height: 90vh;
	/* Fixed max height to force internal scrolling */
}

.pet-modal-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 16px 24px;
	border-bottom: 1px solid #eee;
	flex-shrink: 0;
	/* Header doesn't shrink */
}

.pet-modal-body {
	display: flex;
	gap: 24px;
	padding: 24px;
	flex-direction: row;
	flex-shrink: 1;
	/* Allow body to shrink if needed */
	overflow: hidden;
	/* Prevent body form scrolling, unless specific design needed */
	height: 100%;
	/* Ensure body takes full available height below header */
	min-height: 0;
}

@media (max-width: 768px) {
	.pet-modal-content {
		height: 95vh;
		/* Fixed height on mobile */
		max-height: 95vh;
		display: flex;
		flex-direction: column;
	}

	/* Top Half: 50% height, scrollable */
	.pet-modal-body {
		flex-direction: column;
		flex-wrap: nowrap;
		height: 50%;
		overflow-y: auto;
		/* Enable scrolling for top half */
		padding: 8px;
		gap: 8px;
		flex-shrink: 0;
		/* Strict 50% */
		border-bottom: 1px solid #eee;
	}

	.pet-modal-image {
		width: 100%;
		height: auto;
		flex-shrink: 0;
		text-align: center;
	}

	.pet-modal-image img,
	.pet-modal-image .slide,
	.pet-carousel {
		height: 80px !important;
		max-width: 100%;
		object-fit: contain !important;
	}

	.pet-modal-details {
		flex-shrink: 0;
		min-width: 0;
		max-height: none;
		/* Let body handle scrolling */
		overflow-y: visible;
		/* Scroll is on parent (.pet-modal-body) */
		padding-right: 0;
	}

	.pet-info-grid {
		display: grid;
		grid-template-columns: 1fr 1fr;
		gap: 8px;
		/* Gap between grid items */
		margin-bottom: 8px;
	}

	/* Target direct children of grid to ensure they behave well */
	.pet-info-grid .detail-row {
		margin-bottom: 0 !important;
		background: #f9fafb;
		/* Slight bg to distinguish grid items */
		padding: 6px;
		border-radius: 4px;
		flex-direction: column;
		/* Stack label and value for compactness */
		gap: 2px !important;
		align-items: flex-start;
	}

	.pet-info-grid .detail-label {
		font-size: 0.75rem;
		/* Smaller label */
		color: #6B7280;
		width: auto;
		/* Allow auto width */
	}

	.pet-info-grid .detail-description {
		font-size: 0.9rem;
		font-weight: 600;
		color: #111827;
	}

	.detail-row {
		margin-bottom: 2px !important;
		/* Tighter spacing */
		gap: 4px !important;
	}

	/* Tighter spacing for description/documents on mobile */
	.description-row,
	.documents-row {
		margin-top: 8px !important;
	}

	.documents-row {
		padding-top: 8px !important;
	}

	.detail-description {
		margin-top: 4px !important;
	}

	.document-item {
		padding: 6px !important;
	}

	/* Bottom Half: Remaining height (approx 50%), scrollable */
	.pet-modal-reserve {
		padding: 12px;
		height: 50%;
		flex: 1;
		/* Take remaining space */
		overflow-y: auto;
		min-height: 0;
	}

	.reserve-form .form-group {
		margin-bottom: 8px;
		/* Tighter form spacing */
	}
}

.pet-modal-image {
	width: 360px;
	flex-shrink: 0;
}

.pet-modal-image img {
	width: 100%;
	height: 320px;
	/* Default desktop height */
	/* Fixed height for consistency */
	border-radius: 8px;
	object-fit: contain;
	/* Ensure full image is visible without cropping */
	background: #f3f4f6;
	/* Background for non-square images */
}

/* Description and Documents styles */
.description-row,
.documents-row {
	flex-direction: column;
	margin-top: 16px;
}

.detail-description {
	margin-top: 8px;
}

.documents-row {
	border-top: 1px solid #f3f4f6;
	padding-top: 16px;
}

.documents-list {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.document-item {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 10px;
	background: #f9fafb;
	border-radius: 6px;
	border: 1px solid #e5e7eb;
}

.document-link {
	background: #8B5CF6;
	color: white;
	border: none;
	border-radius: 6px;
	padding: 6px 12px;
	cursor: pointer;
	font-size: 0.85rem;
	display: flex;
	align-items: center;
	gap: 6px;
	text-decoration: none;
	transition: background 0.2s;
}

/* Ensure slides in carousel follow same rules */
.pet-modal-image .slide {
	width: 100%;
	height: 100%;
	/* Fill container */
	/* Force height */
	object-fit: contain !important;
	border-radius: 8px;
	background: #f3f4f6;
}

.pet-modal-details {
	flex: 1;
	max-height: 100%;
	/* Limit to parent height */
	overflow-y: auto;
	/* Enable scrolling if content overflows */
	padding-right: 8px;
	/* Space for scrollbar */
	min-height: 0;
	/* Allow flex shrinking */
}

.detail-row {
	display: flex;
	gap: 12px;
	margin-bottom: 12px;
}

.detail-label {
	font-weight: 600;
	width: 120px;
	color: #374151;
	flex-shrink: 0;
}

.detail-description {
	margin: 0;
	color: #6B7280;
	line-height: 1.5;
}

.pet-modal-reserve {
	padding: 24px;
	border-top: 1px solid #f3f4f6;
	background: #fafafa;
	flex: 1;
	/* Take remaining space */
	overflow-y: auto;
	/* Scrollable area */
	min-height: 0;
	/* Important for flex scrolling */
}

.reserve-form .form-group {
	margin-bottom: 12px;
}

.reserve-form input,
.reserve-form select,
.reserve-form textarea {
	width: 100%;
	padding: 10px;
	border: 1px solid #d1d5db;
	border-radius: 6px;
	font-size: 14px;
}

.reserve-form input:focus,
.reserve-form textarea:focus {
	border-color: #8B5CF6;
	outline: none;
	box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.modal-close {
	background: none;
	border: 0;
	font-size: 24px;
	cursor: pointer;
	color: #9CA3AF;
	transition: color 0.2s;
}

.modal-close:hover {
	color: #EF4444;
}