/**
 * Service Plans Page Styles
 *
 * 4-tier pricing plans with FAQ and CTAs.
 * Reuses: step-card.css, check-list.css, faq.css
 */

/* ==========================================================================
   Page Container
   ========================================================================== */

.service-plans-page {
	overflow-x: hidden;
}

/* ==========================================================================
   Plans Section
   ========================================================================== */

.plans-section {
	padding: var(--section-padding) 0;
}

.plans-section h2 {
	margin-bottom: 0.75rem;
}

.plans-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 1rem;
	max-width: 1200px;
	margin: 2.5rem auto 0;
	align-items: stretch;
}

/* ==========================================================================
   Plan Card
   ========================================================================== */

.plan-card {
	display: flex;
	flex-direction: column;
	background: var(--wp--preset--color--base);
	border: 1px solid var(--wp--preset--color--border);
	border-radius: var(--card-radius);
	padding: 1.5rem 1.25rem;
	text-align: center;
	transition: transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast);
	box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.plan-card:hover {
	transform: translateY(-4px);
	box-shadow: var(--card-shadow-hover);
	border-color: var(--wp--preset--color--primary);
}

/* Featured Plan (Most Popular) */
.plan-card--featured {
	border: 2px solid var(--wp--preset--color--primary);
	position: relative;
	background: linear-gradient(180deg, #fff 0%, #fef8f7 100%);
	box-shadow: 0 8px 32px rgba(223, 59, 38, 0.15);
	z-index: 2;
}

.plan-card--featured::before {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 4px;
	background: var(--wp--preset--color--primary);
	border-radius: calc(var(--card-radius) - 2px) calc(var(--card-radius) - 2px) 0 0;
}

.plan-card--featured:hover {
	transform: translateY(-4px);
	box-shadow: 0 12px 40px rgba(223, 59, 38, 0.2);
}

/* Plan Header */
.plan-header {
	margin-bottom: 0.75rem;
}

.plan-badge {
	display: inline-block;
	background: var(--wp--preset--color--primary);
	color: #ffffff;
	font-size: 0.7rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	padding: 0.375rem 0.75rem;
	border-radius: 9999px;
	margin-bottom: 0.5rem;
	box-shadow: 0 2px 8px rgba(223, 59, 38, 0.3);
}

.plan-name {
	font-size: 1.125rem;
	margin: 0;
	color: var(--wp--preset--color--contrast);
	line-height: 1.3;
}

.plan-card--featured .plan-name {
	font-size: 1.25rem;
}

/* Visits & Price */
.plan-visits {
	font-size: 0.9rem;
	color: var(--wp--preset--color--text);
	margin-bottom: 0.25rem;
	opacity: 0.8;
}

.plan-price {
	font-size: 1.25rem;
	font-weight: 700;
	letter-spacing: -0.02em;
	color: var(--wp--preset--color--contrast);
	margin-bottom: 0.25rem;
	line-height: 1.2;
}

.plan-card--featured .plan-price {
	font-size: 1.5rem;
}

.plan-price span {
	font-size: 0.75rem;
	font-weight: 400;
	color: var(--wp--preset--color--text);
}

/* Enhanced styling for tiered pricing spans */
.plan-card:first-child .plan-price span {
	font-size: 0.8125rem;
	opacity: 0.7;
	margin-top: 0.25rem;
}

/* Support for multi-line pricing (Gutter Protection Plan) */
.plan-price br {
	display: block;
	content: "";
	margin-bottom: 0.625rem;
}

/* Tiered pricing improvements */
.plan-card:first-child .plan-price {
	font-size: 0.9375rem;
	font-weight: 600;
	line-height: 1.6;
	padding: 0.75rem;
	background: rgba(0, 0, 0, 0.02);
	border-radius: 8px;
	margin-bottom: 0.5rem;
}

.plan-price a {
	color: var(--wp--preset--color--primary);
	text-decoration: none;
	font-weight: 600;
	font-size: 0.9375rem;
	border-bottom: 2px solid var(--wp--preset--color--primary);
	transition: border-color 0.2s ease;
}

.plan-price a:hover {
	color: #c4301f;
	border-bottom-color: #c4301f;
}

/* ==========================================================================
   Tiered Pricing Structure (Gutter Protection Plan)
   ========================================================================== */

.pricing-tiers {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	margin-bottom: 1rem;
}

.pricing-tier {
	padding: 0.5rem 0;
	border-left: 2px solid var(--wp--preset--color--primary);
	padding-left: 0.625rem;
	text-align: left;
}

.tier-label {
	font-size: 0.8125rem;
	font-weight: 600;
	color: var(--wp--preset--color--text);
	opacity: 0.75;
	display: block;
	margin-bottom: 0.125rem;
}

.tier-price {
	font-size: 1.1875rem;
	font-weight: 800;
	color: var(--wp--preset--color--contrast);
	display: block;
	white-space: nowrap;
}

.tier-period {
	font-size: 0.75rem;
	font-weight: 400;
	color: var(--wp--preset--color--text);
	display: inline;
	opacity: 1;
}

.tier-custom-link {
	font-size: 0.875rem;
	font-weight: 600;
	color: var(--wp--preset--color--primary);
	text-decoration: none;
	transition: color 0.2s ease;
	display: block;
}

.tier-custom-link:hover {
	color: #c4301f;
}

.plan-agreement {
	font-size: 0.625rem;
	font-weight: 500;
	color: var(--wp--preset--color--text);
	opacity: 0.65;
	font-style: italic;
	text-align: center;
	margin-bottom: 0.75rem;
}

/* Override generic span rules for tiered pricing */
.plan-card:first-child .tier-price {
	opacity: 1;
	font-weight: 800;
}

.plan-card:first-child .tier-period {
	opacity: 1;
}

/* Remove border from custom pricing link */
.plan-price .tier-custom-link {
	border-bottom: none;
}

/* Feature List */
.plan-features {
	list-style: none;
	padding: 0;
	margin: 0 0 1rem;
	text-align: left;
	flex: 1;
	border-top: 1px solid var(--wp--preset--color--border);
	padding-top: 0.75rem;
}

.plan-features li {
	position: relative;
	padding: 0.375rem 0 0.375rem 1.375rem;
	font-size: 0.8125rem;
	color: var(--wp--preset--color--text);
	line-height: 1.4;
}

.plan-features li:last-child {
	border-bottom: none;
}

/* Checkmark icon */
.plan-features li::before {
	content: '';
	position: absolute;
	left: 0;
	top: 0.5rem;
	width: 12px;
	height: 12px;
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23df3b26' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E") no-repeat center;
	background-size: contain;
}

/* Best For tagline */
.plan-best-for {
	font-size: 0.75rem;
	font-style: italic;
	color: var(--wp--preset--color--text);
	margin-bottom: 1rem;
	padding-top: 0.75rem;
	border-top: 1px solid var(--wp--preset--color--border);
	line-height: 1.5;
	opacity: 0.85;
}

/* CTA Button */
.plan-cta {
	margin-top: auto;
}

.plan-button {
	display: block;
	width: 100%;
	padding: 0.75rem 0.5rem;
	font-size: 0.8125rem;
	font-weight: 600;
	color: #ffffff;
	background: var(--wp--preset--color--primary);
	border-radius: 9999px;
	text-decoration: none;
	text-align: center;
	transition: background-color var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast);
	box-shadow: 0 4px 14px rgba(223, 59, 38, 0.35);
	box-sizing: border-box;
}

.plan-button:hover {
	background: #c4301f;
	transform: translateY(-2px);
	box-shadow: 0 6px 20px rgba(223, 59, 38, 0.45);
	color: #ffffff;
}

.plan-button:focus {
	outline: 2px solid var(--wp--preset--color--contrast);
	outline-offset: 2px;
}

/* ==========================================================================
   Image Section
   ========================================================================== */

.service-plans-image-section {
	padding: 3rem 0 2.5rem;
}

.service-plans-photo {
	max-width: 900px;
	margin: 0 auto;
	position: relative;
}

/* Decorative corner accents */
.service-plans-photo::before,
.service-plans-photo::after {
	content: '';
	position: absolute;
	width: 60px;
	height: 60px;
	border: 3px solid var(--wp--preset--color--primary);
	opacity: 0.6;
	pointer-events: none;
	z-index: 1;
}

.service-plans-photo::before {
	top: -12px;
	left: -12px;
	border-right: none;
	border-bottom: none;
	border-radius: 8px 0 0 0;
}

.service-plans-photo::after {
	bottom: -12px;
	right: -12px;
	border-left: none;
	border-top: none;
	border-radius: 0 0 8px 0;
}

.service-plans-photo img {
	display: block;
	width: 100%;
	height: auto;
	border-radius: var(--card-radius);
	box-shadow: 0 8px 40px rgba(0, 0, 0, 0.12);
}

.service-plans-photo figcaption {
	text-align: center;
	color: var(--wp--preset--color--text);
	margin-top: 1.5rem;
	font-style: italic;
	font-size: 0.9375rem;
	background: var(--wp--preset--color--neutral);
	padding: 1rem 1.5rem;
	border-radius: 8px;
}

/* ==========================================================================
   How It Works Section (uses step-card pattern)
   ========================================================================== */

.service-plans-how {
	padding: var(--section-padding) 0;
}

.service-plans-how h2 {
	margin-bottom: var(--section-header-spacing);
}

/* Override step-grid for 4 columns in a single row */
.service-plans-how .step-grid {
	margin-bottom: 0;
	position: relative;
	flex-wrap: nowrap;
	max-width: 1080px;
	align-items: stretch;
}

.service-plans-how .step-card {
	flex: 1 1 0;
	min-width: 0;
	display: flex;
	flex-direction: column;
}

.service-plans-how .step-desc {
	flex: 1;
}

/* Horizontal connector line between steps on desktop */
@media (min-width: 768px) {
	.service-plans-how .step-grid::before {
		content: '';
		position: absolute;
		top: 56px;
		left: 10%;
		right: 10%;
		height: 2px;
		background: var(--wp--preset--color--border);
		z-index: 0;
	}

	.service-plans-how .step-card {
		position: relative;
		z-index: 1;
	}
}

/* On tablet, allow 2x2 grid */
@media (max-width: 900px) {
	.service-plans-how .step-grid {
		flex-wrap: wrap;
	}

	.service-plans-how .step-card {
		flex: 1 1 calc(50% - 0.75rem);
		min-width: 200px;
	}
}

/* ==========================================================================
   Who This Is For Section (uses check-list pattern)
   ========================================================================== */

.who-section {
	padding: var(--section-padding) 0 2rem;
	/* No grey background - maintain white/grey rhythm with adjacent sections */
}

.who-section h2 {
	margin-bottom: var(--section-header-spacing);
}

.who-section .check-list {
	margin: 0 auto;
	max-width: 560px;
}

/* Remove hover effect since items are not clickable */
.who-section .check-item {
	transition: none;
}

.who-section .check-item:hover {
	box-shadow: none;
}

/* ==========================================================================
   FAQ Section (uses faq.css styles)
   ========================================================================== */

.service-plans-faq {
	padding: 2rem 0 var(--section-padding);
}

.service-plans-faq h2 {
	text-align: center;
	margin-bottom: var(--section-header-spacing);
}

.service-plans-faq .faq-list {
	max-width: 720px;
	margin: 0 auto;
}

.service-plans-faq .faq-question {
	transition: background-color var(--transition-fast);
}

.service-plans-faq .faq-question:hover {
	background: rgba(0, 0, 0, 0.02);
}

/* ==========================================================================
   Final CTA Section
   ========================================================================== */

.service-plans-final-cta {
	padding: 4rem 0;
	background: var(--wp--preset--color--neutral);
	text-align: center;
}

.service-plans-final-cta h2 {
	margin-bottom: 1rem;
}

.service-plans-final-cta .section-intro {
	max-width: 540px;
	margin: 0 auto 2rem;
}

.service-plans-final-cta .wp-block-button__link {
	padding: 1rem 2rem;
	font-size: 1rem;
	font-weight: 600;
}

.service-plans-final-cta .wp-block-button:not(.is-style-outline) .wp-block-button__link {
	box-shadow: 0 4px 14px rgba(223, 59, 38, 0.4);
	transition: background-color var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast);
}

.service-plans-final-cta .wp-block-button:not(.is-style-outline) .wp-block-button__link:hover {
	background: #c4301f;
	transform: translateY(-2px);
	box-shadow: 0 8px 24px rgba(223, 59, 38, 0.45);
	color: #ffffff;
}

.service-plans-final-cta .wp-block-button.is-style-outline .wp-block-button__link {
	border-width: 2px;
	transition: background-color var(--transition-fast), color var(--transition-fast), transform var(--transition-fast);
}

.service-plans-final-cta .wp-block-button.is-style-outline .wp-block-button__link:hover {
	background: var(--wp--preset--color--primary);
	color: #ffffff;
	transform: translateY(-2px);
}

/* ==========================================================================
   Animations
   ========================================================================== */

.service-plans-hero h1,
.service-plans-hero .page-hero-subtitle {
	animation: fadeInUp 0.6s ease-out both;
}

.service-plans-hero .page-hero-subtitle {
	animation-delay: 0.1s;
}

/* ==========================================================================
   Tablet Styles (2-column grid)
   ========================================================================== */

@media (max-width: 1023px) {
	.plans-grid {
		grid-template-columns: repeat(2, 1fr);
		gap: 1rem;
		max-width: 640px;
	}

	.plan-card {
		padding: 1.25rem 1rem;
	}

	.plan-name {
		font-size: 1.0625rem;
	}

	.plan-card--featured .plan-name {
		font-size: 1.125rem;
	}

	.plan-price {
		font-size: 1.125rem;
	}

	.plan-card--featured .plan-price {
		font-size: 1.25rem;
	}
}

/* ==========================================================================
   Mobile Styles (single column, featured first)
   ========================================================================== */

@media (max-width: 767px) {
	.service-plans-how .step-grid {
		align-items: center;
	}

	.plans-grid {
		grid-template-columns: 1fr;
		gap: 1rem;
		max-width: 400px;
	}

	/* Reorder: Featured plan first on mobile */
	.plan-card--featured {
		order: -1;
	}

	.plan-card {
		padding: 1.25rem 1rem;
	}

	.plan-name {
		font-size: 1.125rem;
	}

	.plan-card--featured .plan-name {
		font-size: 1.25rem;
	}

	.plan-price {
		font-size: 1.125rem;
	}

	.plan-card--featured .plan-price {
		font-size: 1.375rem;
	}

	.plan-features li {
		font-size: 0.8125rem;
		padding: 0.375rem 0 0.375rem 1.375rem;
	}

	.plan-features li::before {
		width: 12px;
		height: 12px;
		top: 0.5rem;
	}

	.plan-best-for {
		font-size: 0.8125rem;
	}

	.plan-button {
		padding: 0.875rem 1rem;
		font-size: 0.9375rem;
	}

	/* How It Works - 2x2 on mobile handled by step-card.css */

	/* Hide decorative corners on mobile */
	.service-plans-photo::before,
	.service-plans-photo::after {
		display: none;
	}

	/* CTA buttons stack on mobile */
	.service-plans-final-cta .wp-block-buttons {
		flex-direction: column;
		align-items: center;
	}

	.service-plans-final-cta .wp-block-button {
		width: 100%;
		max-width: 300px;
	}
}

/* ==========================================================================
   Reduced Motion
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
	.service-plans-hero h1,
	.service-plans-hero .page-hero-subtitle {
		animation: none;
	}

	.plan-card,
	.plan-button,
	.service-plans-final-cta .wp-block-button__link {
		transition: none;
	}

	.plan-card:hover,
	.plan-button:hover,
	.service-plans-final-cta .wp-block-button__link:hover {
		transform: none;
	}
}
