/* ============================================================
   PWD Pricing Table Pro — Frontend Styles
   Version: 1.0.2
   ============================================================ */

/* ── Reset & Base ── */
.pwd-pt-wrap,
.pwd-pt-wrap * {
	box-sizing: border-box;
}

.pwd-pt-wrap {
	width: 100%;
	height: 100%;
}

/* ── Table ── */
.pwd-pt-table {
	position: relative;
	display: flex;
	flex-direction: column;
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 12px;
	padding: 30px;
	height: 100%;
	overflow: hidden;
	/* Default transition — overridden per-widget by Elementor box_hover_transition control */
	transition: background 300ms ease, border-color 300ms ease, box-shadow 300ms ease, border-radius 300ms ease;
}

/* ── Badge — Inline (default) ── */
.pwd-pt-badge {
	display: inline-block;
	background: #e8512a;
	color: #fff;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	padding: 4px 12px;
	border-radius: 40px;
	margin-bottom: 16px;
}

/* ── Badge — Corner Ribbon ── */
/*
 * The ribbon is created using a rotated element clipped by the table's
 * overflow:hidden. The table needs overflow:hidden (already set) and
 * position:relative (already set).
 *
 * Technique: a wide element is positioned in the corner and rotated 45°.
 * Width is set generously so the text always fits regardless of length.
 */
.pwd-pt-badge--corner {
	/* Reset inline styles */
	display: block;
	position: absolute;
	width: 150px;
	padding: 7px 0;
	text-align: center;
	margin-bottom: 0;
	border-radius: 0;
	font-size: 11px;
	letter-spacing: 0.08em;
	line-height: 1.2;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
	/* Ensure it sits above content */
	z-index: 10;
	pointer-events: none;
}

/* Top-Right ribbon */
.pwd-pt-badge--corner-right {
	top: 22px;
	right: -38px;
	transform: rotate(45deg);
	transform-origin: center center;
}

/* Top-Left ribbon */
.pwd-pt-badge--corner-left {
	top: 22px;
	left: -38px;
	transform: rotate(-45deg);
	transform-origin: center center;
}

/* When a corner badge is present the table must clip it */
.pwd-pt-table--has-corner-badge {
	overflow: hidden;
}

/* ── Header Icon ── */
.pwd-pt-header-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 70px;
	height: 70px;
	border-radius: 50%;
	background: #f3f4f6;
	color: #374151;
	/* NOTE: font-size is intentionally NOT set here — controlled entirely
	   by the Elementor icon_size control via {{WRAPPER}} selectors,
	   preventing conflicts when multiple widgets are on the same page. */
	margin-bottom: 16px;
	flex-shrink: 0;
}

/* Icon element inside wrapper — inherit color so SVG currentColor works */
.pwd-pt-header-icon i,
.pwd-pt-header-icon svg {
	display: block;
	/* Size is set by Elementor controls — no hardcoded values here */
	color: inherit;
	fill: currentColor;
	line-height: 1;
}

/* Prevent theme/global SVG resets from zeroing dimensions */
.pwd-pt-header-icon svg {
	overflow: visible;
	flex-shrink: 0;
}

/* ── Package Name ── */
.pwd-pt-package-name {
	font-size: 1.2rem;
	font-weight: 700;
	color: #111827;
	margin: 0 0 8px;
}

/* ── Description ── */
.pwd-pt-description {
	font-size: 0.9rem;
	color: #6b7280;
	margin: 0 0 16px;
	line-height: 1.6;
}

.pwd-pt-description p { margin: 0; }

/* ── Pricing ── */
.pwd-pt-pricing {
	display: flex;
	align-items: baseline;
	gap: 4px;
	margin-bottom: 20px;
}

.pwd-pt-price {
	font-size: 2.4rem;
	font-weight: 800;
	color: #111827;
	line-height: 1;
}

.pwd-pt-duration {
	font-size: 0.85rem;
	color: #9ca3af;
	font-weight: 500;
}

/* ── Style 2 — price top ── */
.pwd-pt--style-2 .pwd-pt-pricing {
	order: -1;
	margin-bottom: 8px;
}
.pwd-pt--style-2 .pwd-pt-package-name {
	margin-bottom: 4px;
}

/* ── Style 3 — coloured header band ── */
.pwd-pt--style-3 {
	padding: 0;
}
.pwd-pt--style-3 .pwd-pt-header-band {
	background: linear-gradient(135deg, #1e3a5f, #2563eb);
	color: #fff;
	padding: 28px 30px 24px;
	border-radius: 12px 12px 0 0;
}
.pwd-pt--style-3 .pwd-pt-header-band .pwd-pt-package-name {
	color: #fff;
}
.pwd-pt--style-3 .pwd-pt-header-band .pwd-pt-description {
	color: rgba(255,255,255,0.75);
}
.pwd-pt--style-3 .pwd-pt-header-band .pwd-pt-price {
	color: #fff;
}
.pwd-pt--style-3 .pwd-pt-header-band .pwd-pt-duration {
	color: rgba(255,255,255,0.65);
}
.pwd-pt--style-3 .pwd-pt-body {
	padding: 24px 30px 30px;
	flex: 1;
	display: flex;
	flex-direction: column;
}

/* ── Features List ── */
.pwd-pt-features-list {
	list-style: none;
	margin: 0 0 24px;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 12px;
	flex: 1;
}

.pwd-pt-feature {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	font-size: 0.9rem;
	line-height: 1.5;
}

/* ── Feature Icon ── */
.pwd-pt-feature-icon {
	flex-shrink: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	line-height: 1;
	/* font-size NOT set here — controlled by Elementor feat_icon_size control */
	color: #27ae60;
}

.pwd-pt-feature--excluded .pwd-pt-feature-icon {
	color: #aaa;
}

/* SVG icons inside feature icon — inherit color */
.pwd-pt-feature-icon i,
.pwd-pt-feature-icon svg {
	display: block;
	color: inherit;
	fill: currentColor;
	overflow: visible;
	flex-shrink: 0;
}

.pwd-pt-feature--strikethrough .pwd-pt-feature-title {
	text-decoration: line-through;
}

/* Muted style: reduces opacity on text only — Elementor colour controls take precedence */
.pwd-pt-feature--muted .pwd-pt-feature-title,
.pwd-pt-feature--muted .pwd-pt-feature-desc {
	opacity: 0.5;
}

/* Default excluded text colour — the Elementor feat_text_color_excluded control overrides this */
.pwd-pt-feature--excluded .pwd-pt-feature-title,
.pwd-pt-feature--excluded .pwd-pt-feature-desc {
	color: #9ca3af;
}

.pwd-pt-feature-text {
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.pwd-pt-feature-title {
	font-weight: 500;
	color: #374151;
}

.pwd-pt-feature-desc {
	font-size: 0.8rem;
	color: #9ca3af;
}

/* ── Tooltip ── */
.pwd-pt-feature {
	position: relative;
}

.pwd-pt-tooltip {
	display: none;
	position: absolute;
	bottom: 110%;
	left: 50%;
	transform: translateX(-50%);
	background: #1f2937;
	color: #fff;
	font-size: 12px;
	padding: 5px 10px;
	border-radius: 6px;
	white-space: nowrap;
	z-index: 100;
	pointer-events: none;
}

.pwd-pt-feature:hover .pwd-pt-tooltip {
	display: block;
}

/* ── Buttons Area ── */
.pwd-pt-buttons {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin-top: auto;
}

/* ── Base Button ── */
.pwd-pt-btn {
	display: block;
	width: 100%;
	text-align: center;
	padding: 13px 24px;
	border-radius: 8px;
	font-size: 0.95rem;
	font-weight: 600;
	cursor: pointer;
	border: 2px solid transparent;
	transition: all 0.2s ease;
	text-decoration: none;
	line-height: 1.4;
}

/* WooCommerce button */
.pwd-pt-btn--wc {
	background: #2563eb;
	color: #fff !important;
	border-color: #2563eb;
}
.pwd-pt-btn--wc:hover {
	background: #1d4ed8;
	border-color: #1d4ed8;
	color: #fff !important;
	text-decoration: none;
}

/* Enquiry / Quotation button */
.pwd-pt-btn--enquiry {
	background: transparent;
	color: #374151 !important;
	border-color: #d1d5db;
	cursor: pointer;
	font-family: inherit;
}
.pwd-pt-btn--enquiry:hover {
	background: #f3f4f6;
	border-color: #9ca3af;
}

.pwd-pt-btn--quotation {
	background: #f59e0b;
	color: #fff !important;
	border-color: #f59e0b;
}
.pwd-pt-btn--quotation:hover {
	background: #d97706;
	border-color: #d97706;
}

/* Default button */
.pwd-pt-btn--default {
	background: #111827;
	color: #fff;
	border-color: #111827;
	text-decoration: none;
}
.pwd-pt-btn--default:hover {
	background: #374151;
	border-color: #374151;
	color: #fff;
	text-decoration: none;
}

.pwd-pt-btn-icon--before { margin-right: 6px; }
.pwd-pt-btn-icon--after  { margin-left: 6px; }

.pwd-pt-btn-wrapper {
	display: block;
}

/* ── Third-Party Hooks Container ── */
.pwd-pt-tp-hooks {
	display: block;
}
.pwd-pt-tp-hooks a,
.pwd-pt-tp-hooks button {
	display: block;
	width: 100%;
	text-align: center;
	box-sizing: border-box;
	transition: all 0.2s ease;
}

/* ── Quantity Field ── */
.pwd-pt-qty-wrap {
	display: flex;
	align-items: center;
	margin-bottom: 8px;
}

.pwd-pt-qty {
	width: 70px;
	padding: 8px;
	border: 1px solid #d1d5db;
	border-radius: 6px;
	text-align: center;
	font-size: 0.95rem;
}

/* ============================================================
   MODAL
   ============================================================ */

.pwd-pt-overlay {
	display: none;
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.55);
	z-index: 99999;
	align-items: center;
	justify-content: center;
	padding: 20px;
	backdrop-filter: blur(3px);
}

.pwd-pt-overlay.is-open {
	display: flex;
	animation: pwdPtFadeIn 0.2s ease;
}

@keyframes pwdPtFadeIn {
	from { opacity: 0; }
	to   { opacity: 1; }
}

.pwd-pt-modal {
	background: #fff;
	border-radius: 14px;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
	width: 100%;
	max-width: 540px;
	max-height: 90vh;
	overflow-y: auto;
	position: relative;
	animation: pwdPtSlideUp 0.25s ease;
}

@keyframes pwdPtSlideUp {
	from { transform: translateY(20px); opacity: 0; }
	to   { transform: translateY(0);    opacity: 1; }
}

.pwd-pt-modal__close {
	position: absolute;
	top: 14px;
	right: 14px;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	border: none;
	background: #f3f4f6;
	color: #374151;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.15s ease;
	z-index: 1;
}

.pwd-pt-modal__close:hover {
	background: #e5e7eb;
}

.pwd-pt-modal__header {
	padding: 28px 28px 0;
}

.pwd-pt-modal__product-info {
	display: flex;
	align-items: center;
	gap: 14px;
	margin-bottom: 16px;
}

.pwd-pt-modal__product-img {
	width: 64px;
	height: 64px;
	object-fit: cover;
	border-radius: 8px;
	border: 1px solid #e5e7eb;
	flex-shrink: 0;
}

.pwd-pt-modal__context-label {
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: #9ca3af;
	font-weight: 600;
	display: block;
	margin-bottom: 3px;
}

.pwd-pt-modal__title {
	font-size: 1.1rem;
	font-weight: 700;
	color: #111827;
	margin: 0;
}

.pwd-pt-modal__title-fallback .pwd-pt-modal__title {
	font-size: 1.4rem;
}

.pwd-pt-modal__body {
	padding: 20px 28px 28px;
}

/* ── Form ── */
.pwd-pt-form {
	display: flex;
	flex-direction: column;
	gap: 14px;
}

.pwd-pt-form__row {
	display: flex;
	gap: 14px;
}

.pwd-pt-form__row--2col > .pwd-pt-form__field {
	flex: 1;
}

.pwd-pt-form__field {
	display: flex;
	flex-direction: column;
	gap: 5px;
	flex: 1;
}

.pwd-pt-form__label {
	font-size: 13px;
	font-weight: 600;
	color: #374151;
}

.pwd-pt-form__required { color: #ef4444; margin-left: 2px; }
.pwd-pt-form__optional { color: #9ca3af; font-weight: 400; font-size: 11px; margin-left: 4px; }

.pwd-pt-form__input {
	width: 100%;
	padding: 10px 14px;
	border: 1.5px solid #d1d5db;
	border-radius: 7px;
	font-size: 0.9rem;
	color: #111827;
	background: #fff;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
	font-family: inherit;
}

.pwd-pt-form__input:focus {
	outline: none;
	border-color: #2563eb;
	box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.pwd-pt-form__textarea {
	resize: vertical;
	min-height: 100px;
}

.pwd-pt-form__row--submit {
	margin-top: 4px;
}

.pwd-pt-submit {
	width: 100%;
	padding: 13px 24px;
	background: #2563eb;
	color: #fff;
	border: none;
	border-radius: 8px;
	font-size: 0.95rem;
	font-weight: 700;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	transition: background 0.2s ease;
	font-family: inherit;
}

.pwd-pt-submit:hover { background: #1d4ed8; }

.pwd-pt-submit__spinner {
	display: none;
	animation: pwdPtSpin 0.8s linear infinite;
}

.pwd-pt-submit__spinner svg { display: block; }

@keyframes pwdPtSpin {
	from { transform: rotate(0deg); }
	to   { transform: rotate(360deg); }
}

.pwd-pt-submit.is-loading .pwd-pt-submit__label  { opacity: 0.6; }
.pwd-pt-submit.is-loading .pwd-pt-submit__spinner { display: inline-flex; }

/* ── Success / Error States ── */
.pwd-pt-success {
	text-align: center;
	padding: 20px 0;
}

.pwd-pt-success__icon {
	color: #27ae60;
	margin-bottom: 10px;
}

.pwd-pt-success__message {
	font-size: 1rem;
	color: #374151;
}

.pwd-pt-error {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 10px 14px;
	background: #fef2f2;
	border: 1px solid #fecaca;
	border-radius: 7px;
	color: #dc2626;
	font-size: 0.88rem;
	margin-bottom: 14px;
}

/* ── Accessibility ── */
.pwd-pt-hp { display: none; }

/* ── Responsive ── */
@media (max-width: 480px) {
	.pwd-pt-form__row--2col {
		flex-direction: column;
	}
	.pwd-pt-modal__header,
	.pwd-pt-modal__body {
		padding-left: 18px;
		padding-right: 18px;
	}
}
