/* LKS Motor Price Widget — Frontend styles */

/* ─── WordPress block wrapper constraint ────────────────────────────────────── */
/* The theme may set widths on .wp-block-* — override to stay in the content column */
.wp-block-lks-motor-price-widget {
	max-width: 100% !important;
	overflow-x: hidden !important;
	display: block !important;
	box-sizing: border-box !important;
}

/* ─── Widget root ───────────────────────────────────────────────────────────── */
.lks-pw {
	--lks-blue:        #0041e5;
	--lks-blue-hover:  #002fba;
	--lks-border:      rgba(0,51,153,.15);
	--lks-text-dark:   #002266;
	--lks-text-mid:    #5a6780;
	--lks-text-muted:  #737f99;
	--lks-radius-card: 12px;
	--lks-radius-btn:  10px;
	--lks-shadow-card: 1px 1px 2px 0 rgba(54,61,77,.12);

	box-sizing: border-box;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
	background: #fcfeff;
	border: 1px solid var(--lks-border);
	border-radius: 12px;
	padding: 0 !important;
	margin: 16px 0;
	color: var(--lks-text-dark);
	width: 100%;
	max-width: 100%;
	overflow-x: hidden;
}

.lks-pw *, .lks-pw *::before, .lks-pw *::after {
	box-sizing: inherit;
}

.lks-pw p,
.lks-pw-modal p {
	margin-bottom: 0;
}

/* ─── States ────────────────────────────────────────────────────────────────── */
.lks-pw--empty,
.lks-pw--error {
	padding: 16px;
	text-align: center;
	color: var(--lks-text-muted);
	font-size: 14px;
}
.lks-pw--error { color: #b91c1c; }

/* ─── Header ────────────────────────────────────────────────────────────────── */
.lks-pw__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 10px;
	margin-bottom: 14px;
	padding: 16px 16px 0;
}

.lks-pw__title {
	font-size: 20px;
	font-weight: 700;
	color: var(--lks-text-dark);
	margin: 0;
	line-height: 1.2;
}

/* ─── Tabs ──────────────────────────────────────────────────────────────────── */
.lks-pw__tabs {
	display: flex;
	align-items: center;
	gap: 3px;
	background: #f3f4f6;
	padding: 3px;
	border-radius: 8px;
}

.lks-pw__tab {
	padding: 6px 14px;
	border-radius: 6px;
	border: none;
	background: transparent;
	font-size: 13px;
	font-weight: 500;
	color: var(--lks-text-muted);
	cursor: pointer;
	transition: background .15s, color .15s;
	white-space: nowrap;
	line-height: 1.4;
}

.lks-pw__tab:hover:not(.lks-pw__tab--active) {
	background: rgba(255,255,255,.8);
	color: var(--lks-text-mid);
}

.lks-pw__tab--active {
	background: var(--lks-blue);
	color: #fff;
	box-shadow: 0 1px 3px rgba(26,86,219,.3);
}

/* ─── Panels ────────────────────────────────────────────────────────────────── */
.lks-pw__panel          { display: none; }
.lks-pw__panel--active  { display: block; }

/* ─── Grid ──────────────────────────────────────────────────────────────────── */
.lks-pw__grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
	gap: 10px;
	padding: 0 16px 16px;
}

/* ─── Card ──────────────────────────────────────────────────────────────────── */
.lks-pw__card {
	background: #fff;
	border: 1px solid var(--lks-border);
	border-radius: var(--lks-radius-card);
	padding: 12px;
	display: flex;
	flex-direction: column;
	gap: 10px;
	box-shadow: var(--lks-shadow-card);
	transition: box-shadow .15s, transform .15s;
	min-width: 0;
	overflow: hidden;
}

.lks-pw__card:hover {
	box-shadow: 0 4px 12px rgba(0,0,0,.09);
	transform: translateY(-1px);
}

/* ─── Provider row (logo + name) ────────────────────────────────────────────── */
.lks-pw__provider {
	display: flex;
	align-items: center;
	gap: 8px;
	min-width: 0;
}

.lks-pw__logo-wrap {
	width: 52px;
	height: 52px;
	border-radius: 50%;
	background-color: #dff0ff;
	background-size: contain;
	background-repeat: no-repeat;
	background-position: center;
	flex-shrink: 0;
}

/* name + badge stacked vertically, side-by-side with logo */
.lks-pw__provider-info {
	display: flex;
	flex-direction: column;
	gap: 4px;
	flex: 1;
	min-width: 0;
}

.lks-pw__provider-name {
	font-size: 14px;
	font-weight: 500;
	color: var(--lks-text-dark);
	line-height: 1.57;
	word-break: break-word;
	min-width: 0;
}

.lks-pw__cat-badge {
	display: inline-block;
	align-self: flex-start;
	font-size: 12px;
	font-weight: 500;
	color: var(--lks-text-dark);
	background: rgba(54,61,77,.08);
	border-radius: 8px;
	padding: 4px 8px;
	white-space: nowrap;
}

/* ─── Divider ───────────────────────────────────────────────────────────────── */
.lks-pw__divider {
	height: 1px;
	background: var(--lks-border);
	margin: 0;
}

/* ─── Benefits ──────────────────────────────────────────────────────────────── */
.lks-pw__benefits {
	display: flex;
	flex-direction: column;
	gap: 5px;
}

.lks-pw__benefits-label {
	font-size: 11px;
	font-weight: 500;
	color: #60789e;
}

.lks-pw__benefit-list {
	display: flex;
	flex-wrap: nowrap;
	overflow-x: scroll;
	gap: 4px;
	scrollbar-width: none;
	-ms-overflow-style: none;
	-webkit-overflow-scrolling: touch;
	cursor: grab;
	user-select: none;
}

.lks-pw__benefit-list::-webkit-scrollbar {
	display: none;
}

.lks-pw__benefit-list--dragging {
	cursor: grabbing;
}

.lks-pw__benefit {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	font-size: 11px;
	font-weight: 500;
	border-radius: 20px;
	padding: 3px 8px;
	line-height: 1.4;
	flex-shrink: 0;
	white-space: nowrap;
}

.lks-pw__benefit-icon {
	display: inline-block;
	width: 12px;
	height: 12px;
	flex-shrink: 0;
}

/* ─── Price row ─────────────────────────────────────────────────────────────── */
.lks-pw__price-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	margin-top: auto;
	flex-wrap: wrap;
}

.lks-pw__price-info {
	display: flex;
	flex-direction: column;
	gap: 1px;
}

.lks-pw__price-label {
	font-size: 10px;
	color: var(--lks-text-muted);
	font-weight: 500;
	white-space: nowrap;
}

.lks-pw__price {
	font-size: 20px;
	font-weight: 600;
	color: var(--lks-text-dark);
	line-height: 1.4;
	white-space: nowrap;
}

html[dir="rtl"] .lks-pw__price {
	direction: ltr;
}

html[dir="rtl"] .lks-pw__install-price-btn {
	direction: rtl;
}

.lks-pw__currency {
	font-size: 12px;
	font-weight: 600;
	color: var(--lks-text-muted);
	margin-right: 1px;
}

/* ─── CTA button ────────────────────────────────────────────────────────────── */
.lks-pw__cta-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0 16px;
	height: 54px;
	background: var(--lks-blue);
	color: #fff !important;
	font-size: 14px;
	font-weight: 600;
	border-radius: var(--lks-radius-btn);
	text-decoration: none !important;
	border: none;
	cursor: pointer;
	white-space: nowrap;
	flex-shrink: 0;
	transition: background .15s;
	line-height: 1;
}

.lks-pw__cta-btn:hover {
	background: var(--lks-blue-hover);
	box-shadow: 0 3px 8px rgba(26,86,219,.4);
	color: #fff !important;
	text-decoration: none !important;
}

/* ─── Dirham sign ───────────────────────────────────────────────────────────── */
.lks-pw__dirham {
	display: inline-block;
	height: 0.82em;
	width: auto;
	vertical-align: -0.08em;
	flex-shrink: 0;
	fill: currentColor;
}

/* ─── Installment row ───────────────────────────────────────────────────────── */
.lks-pw__installment {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 6px;
	font-size: 11px;
	line-height: 1.4;
	/* bleed to card edges → footer strip */
	margin: 0 -12px -12px;
	padding: 8px 12px;
	background: #eef2f6;
	border-top: 1px solid rgba(0,51,153,.1);
	border-radius: 0 0 var(--lks-radius-card) var(--lks-radius-card);
}

.lks-pw__install-price-btn {
	display: inline-flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 3px;
	flex: 1;
	min-width: 0;
	background: none;
	border: none;
	padding: 0;
	cursor: pointer;
	font-size: 11px;
	font-weight: 600;
	color: var(--lks-blue);
	line-height: 1.4;
	font-family: inherit;
	transition: color .15s;
	text-align: start;
}

.lks-pw__install-price-btn:hover {
	color: var(--lks-blue-hover);
	text-decoration: underline;
}

.lks-pw__install-price-amt {
	font-weight: 700;
}

.lks-pw__install-label {
	font-weight: 400;
	color: var(--lks-text-muted);
}

.lks-pw__install-logos {
	display: flex;
	align-items: center;
	gap: 6px;
	flex-shrink: 0;
}

.lks-pw__install-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: none;
	border: none;
	padding: 0;
	cursor: pointer;
	border-radius: 3px;
	line-height: 1;
	transition: opacity .15s;
}

.lks-pw__install-btn:hover { opacity: .7; }

.lks-pw__install-logo-img {
	display: block;
	max-height: 16px;
	width: auto;
	height: auto;
	object-fit: contain;
}

/* ─── Installment modal ─────────────────────────────────────────────────────── */
.lks-pw-modal {
	display: none;
	position: fixed;
	inset: 0;
	z-index: 99999;
	align-items: flex-end;
	justify-content: center;
}

.lks-pw-modal--open {
	display: flex;
}

.lks-pw-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0,0,0,.45);
}

.lks-pw-modal__dialog {
	position: relative;
	background: #fcfeff;
	border-radius: 20px 20px 0 0;
	width: 100%;
	max-width: 560px;
	max-height: 92vh;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	box-shadow: 0 -4px 32px rgba(0,0,0,.18);
}

@media (min-height: 500px) and (min-width: 600px) {
	.lks-pw-modal {
		align-items: center;
	}
	.lks-pw-modal__dialog {
		border-radius: 20px;
		max-height: 86vh;
	}
}

/* Header */
.lks-pw-modal__header {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 16px 20px;
	border-bottom: 1px solid #e9edf3;
	flex-shrink: 0;
}

.lks-pw-modal__close {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: none;
	border: none;
	padding: 4px;
	cursor: pointer;
	border-radius: 50%;
	flex-shrink: 0;
	transition: background .15s;
}

.lks-pw-modal__close:hover { background: #f3f4f6; }

.lks-pw-modal__title {
	font-size: 15px;
	font-weight: 600;
	color: #002266;
	flex: 1;
}

/* Scrollable body */
.lks-pw-modal__body {
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	flex: 1;
}

/* Hero gradient box */
.lks-pw-modal__hero {
	position: relative;
	height: 164px;
	overflow: hidden;
	border-radius: 16px;
	background: linear-gradient(227.8deg, #0041e5 0%, #002c9c 100%);
	margin: 24px 24px 0;
	flex-shrink: 0;
}

.lks-pw-modal__hero-title {
	position: absolute;
	top: 14px;
	left: 0; right: 0;
	text-align: center;
	color: #fff;
	font-size: 20px;
	font-weight: 600;
	line-height: 1.4;
	margin: 0;
	padding: 0 12px;
	white-space: nowrap;
	pointer-events: none;
}

.lks-pw-modal__hero-video {
	position: absolute;
	width: 107px;
	height: 58px;
	left: 50%;
	transform: translateX(-50%);
	top: calc(50% - 22px);
	display: block;
}

.lks-pw-modal__hero-logo {
	position: absolute;
	bottom: 2px;
	height: 50px;
	width: auto;
	pointer-events: none;
}

.lks-pw-modal__hero-logo--tabby  { left: 13%; width: 100px; }
.lks-pw-modal__hero-logo--tamara { right: 9%; width: 100px; }

/* Content */
.lks-pw-modal__content {
	padding: 24px;
	display: flex;
	flex-direction: column;
	gap: 24px;
}

.lks-pw-modal__section {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.lks-pw-modal__section-title {
	font-size: 20px;
	font-weight: 600;
	color: #002266;
	line-height: 1.4;
	letter-spacing: -.01em;
	margin: 0;
}

.lks-pw-modal__section-body {
	font-size: 13px;
	color: #5a6780;
	margin: 0;
	line-height: 1.6;
}

/* Steps */
.lks-pw-modal__steps {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.lks-pw-modal__step {
	display: flex;
	align-items: flex-start;
	gap: 10px;
}

.lks-pw-modal__step p {
	margin: 0;
	font-size: 13px;
	color: #5a6780;
	line-height: 1.5;
}

.lks-pw-modal__step-num {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 22px;
	height: 22px;
	background: #0041e5;
	color: #fff;
	border-radius: 50%;
	font-size: 11px;
	font-weight: 700;
	flex-shrink: 0;
	margin-top: 1px;
}

/* Provider cards */
.lks-pw-modal__provider-cards {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.lks-pw-modal__provider-card {
	background: #ebf3ff;
	border-radius: 12px;
	padding: 12px;
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.lks-pw-modal__provider-top {
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.lks-pw-modal__provider-logo {
	display: block;
	max-height: 24px;
	width: auto;
}

.lks-pw-modal__provider-range {
	font-size: 13px;
	font-weight: 500;
	color: #5a6780;
	white-space: nowrap;
}

.lks-pw-modal__provider-interest {
	font-size: 13px;
	color: #5a6780;
	margin: 0 !important;
	line-height: 1.5;
}

/* Info items */
.lks-pw-modal__info-item { margin-bottom: 14px; }
.lks-pw-modal__info-item:last-child { margin-bottom: 0; }

.lks-pw-modal__info-heading {
	font-size: 13px;
	font-weight: 700;
	color: #002266;
	margin-bottom: 4px;
}

.lks-pw-modal__info-body {
	font-size: 12px;
	color: #5a6780;
	line-height: 1.6;
}

/* Sticky footer with Continue button */
.lks-pw-modal__footer {
	flex-shrink: 0;
	padding: 16px 24px;
	background: rgba(255,255,255,.8);
	backdrop-filter: blur(5px);
	-webkit-backdrop-filter: blur(5px);
	border-top: 1px solid #e9edf3;
}

.lks-pw-modal__continue {
	display: block;
	width: 100%;
	height: 56px;
	background: #0041e5;
	color: #fff;
	font-size: 15px;
	font-weight: 600;
	border: none;
	border-radius: 10px;
	cursor: pointer;
	font-family: inherit;
	transition: background .15s;
}

.lks-pw-modal__continue:hover { background: #002fba; }

/* RTL adjustments */
[dir="rtl"] .lks-pw-modal__dialog {
	font-family: 'Segoe UI', 'Noto Sans Arabic', Tahoma, Arial, sans-serif;
}

[dir="rtl"] .lks-pw-modal__header { flex-direction: row-reverse; }

[dir="rtl"] .lks-pw-modal__content { text-align: right; }

/* ─── Footer ────────────────────────────────────────────────────────────────── */
.lks-pw__footer {
	margin-top: 14px;
	padding: 12px 16px 16px;
	border-top: 1px solid var(--lks-border);
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.lks-pw__footer-line {
	font-size: 12px;
	color: var(--lks-text-mid);
	margin: 0;
	line-height: 1.5;
}

.lks-pw__footer-line--muted {
	color: var(--lks-text-muted);
	font-size: 11px;
}

/* ─── Narrow blog columns (≤600px) ─────────────────────────────────────────── */
@media (max-width: 600px) {
	.lks-pw__grid {
		grid-template-columns: 1fr;
		gap: 8px;
		padding: 0 12px 12px;
	}

	.lks-pw__header {
		padding: 12px 12px 0;
		gap: 8px;
	}

	.lks-pw__title {
		font-size: 17px;
	}

	.lks-pw__logo-wrap {
		width: 44px;
		height: 44px;
	}
}

/* ─── Mobile phones (≤420px) ───────────────────────────────────────────────── */
@media (max-width: 420px) {
	.lks-pw {
		border-radius: 8px;
	}

	.lks-pw__header {
		flex-direction: column;
		align-items: flex-start;
	}
}
