/* Abbas Elementor Widgets — shared styles.
   Mobile rules baked in: 16px inputs (no iOS zoom), 44px touch targets on touch devices only,
   no-wrap prices that shrink on phones, safe-area padding on bottom-fixed UI. */

:root {
	--aew-primary: #2563eb;
	--aew-primary-dark: #1d4ed8;
	--aew-text: #111827;
	--aew-muted: #6b7280;
	--aew-border: #e5e7eb;
	--aew-surface: #ffffff;
	--aew-radius: 12px;
}

.aew-sr {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}

/* ---------- Button ---------- */
.aew-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 12px 24px;
	font: inherit;
	font-weight: 600;
	line-height: 1.2;
	color: #fff;
	text-decoration: none;
	background: var(--aew-primary);
	border: 0;
	border-radius: 8px;
	cursor: pointer;
	transition: background-color .15s ease, transform .1s ease;
}
.aew-btn:hover,
.aew-btn:focus-visible { background: var(--aew-primary-dark); color: #fff; }
.aew-btn:focus-visible { outline: 3px solid color-mix(in srgb, var(--aew-primary) 40%, transparent); outline-offset: 2px; }
.aew-btn:active { transform: translateY(1px); }
.aew-btn[disabled] { opacity: .6; cursor: not-allowed; }

/* ---------- Form ---------- */
.aew-form__fields { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 16px; }
.aew-field { flex: 1 1 100%; min-width: 0; }
.aew-w-50 { flex-basis: calc(50% - 8px); }
.aew-w-33 { flex-basis: calc(33.333% - 11px); }
.aew-field label { display: block; margin-bottom: 6px; font-weight: 600; font-size: .95em; color: var(--aew-text); }
.aew-req { color: #dc2626; }

.aew-form input[type="text"],
.aew-form input[type="email"],
.aew-form input[type="tel"],
.aew-form input[type="number"],
.aew-form textarea,
.aew-form select {
	width: 100%;
	box-sizing: border-box;
	padding: 12px 14px;
	font: inherit;
	font-size: 16px; /* prevents iOS focus-zoom */
	line-height: 1.4;
	color: var(--aew-text);
	background: #fff;
	border: 1px solid var(--aew-border);
	border-radius: 8px;
	transition: border-color .15s ease, box-shadow .15s ease;
}
.aew-form textarea { resize: vertical; min-height: 120px; }
.aew-form input:focus-visible,
.aew-form textarea:focus-visible,
.aew-form select:focus-visible {
	outline: none;
	border-color: var(--aew-primary);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--aew-primary) 25%, transparent);
}
.aew-check { display: flex !important; align-items: flex-start; gap: 10px; font-weight: 400 !important; }
.aew-check input { width: 20px; height: 20px; margin-top: 2px; flex: none; accent-color: var(--aew-primary); }

.aew-hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.aew-form__msg { margin-top: 12px; font-weight: 500; }
.aew-form__msg:empty { display: none; }
.aew-form__msg.is-success { color: #166534; }
.aew-form__msg.is-error { color: #b91c1c; }
.aew-form.is-loading .aew-btn { opacity: .7; }
.aew-btn-full-yes .aew-form .aew-btn { width: 100%; }

@media (max-width: 640px) {
	.aew-w-50, .aew-w-33 { flex-basis: 100%; }
	.aew-form .aew-btn { width: 100%; }
}

/* ---------- Testimonial slider ---------- */
.aew-ts { --aew-per-view: 3; --aew-gap: 20px; position: relative; }
.aew-ts__track {
	display: flex;
	gap: var(--aew-gap);
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
	-webkit-overflow-scrolling: touch;
	overscroll-behavior-x: contain;
	padding: 4px 2px 8px;
}
.aew-ts__track::-webkit-scrollbar { display: none; }
.aew-ts__track:focus-visible { outline: 2px solid var(--aew-primary); outline-offset: 2px; border-radius: 8px; }
.aew-ts__slide {
	flex: 0 0 calc((100% - (var(--aew-per-view) - 1) * var(--aew-gap)) / var(--aew-per-view));
	min-width: 0;
	margin: 0;
	scroll-snap-align: start;
}
.aew-ts__card {
	display: flex;
	flex-direction: column;
	gap: 14px;
	height: 100%;
	box-sizing: border-box;
	padding: 24px;
	background: var(--aew-surface);
	border: 1px solid var(--aew-border);
	border-radius: var(--aew-radius);
}
.aew-ts__stars { color: #d1d5db; letter-spacing: 2px; font-size: 18px; line-height: 1; }
.aew-ts__stars .is-on { color: #f59e0b; }
.aew-ts__quote { margin: 0; flex: 1; font-size: 1.05em; line-height: 1.6; color: var(--aew-text); }
.aew-ts__quote p { margin: 0; }
.aew-ts__who { display: flex; align-items: center; gap: 12px; }
.aew-ts__avatar { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; flex: none; }
.aew-ts__meta { display: flex; flex-direction: column; min-width: 0; }
.aew-ts__name { font-weight: 700; color: var(--aew-text); }
.aew-ts__role { font-size: .9em; color: var(--aew-muted); }

.aew-ts__nav { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 16px; }
.aew-ts__btn {
	display: inline-flex; align-items: center; justify-content: center;
	width: 40px; height: 40px; padding: 0;
	color: var(--aew-text); background: var(--aew-surface);
	border: 1px solid var(--aew-border); border-radius: 50%; cursor: pointer;
}
.aew-ts__btn:hover { border-color: var(--aew-primary); color: var(--aew-primary); }
.aew-ts__btn:focus-visible { outline: 3px solid color-mix(in srgb, var(--aew-primary) 40%, transparent); outline-offset: 2px; }
.aew-ts__btn[disabled] { opacity: .35; cursor: default; }
.aew-ts__dots { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; }
.aew-ts__dot { position: relative; width: 24px; height: 24px; padding: 0; background: none; border: 0; cursor: pointer; }
.aew-ts__dot::before {
	content: ""; position: absolute; top: 50%; left: 50%; width: 10px; height: 10px;
	transform: translate(-50%, -50%); border-radius: 50%; background: #d1d5db;
	transition: background-color .15s ease, transform .15s ease;
}
.aew-ts__dot.is-active::before { background: var(--aew-primary); transform: translate(-50%, -50%) scale(1.25); }
.aew-ts__dot:focus-visible { outline: 2px solid var(--aew-primary); border-radius: 50%; }

@media (max-width: 1024px) { .aew-ts { --aew-per-view: 2; } }
@media (max-width: 767px)  { .aew-ts { --aew-per-view: 1; } }
@media (prefers-reduced-motion: reduce) { .aew-ts__track { scroll-behavior: auto; } }

/* ---------- Pricing table ---------- */
.aew-pt {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 14px;
	box-sizing: border-box;
	padding: 32px 28px;
	background: var(--aew-surface);
	border: 1px solid var(--aew-border);
	border-radius: 16px;
}
.aew-pt--featured { border: 2px solid var(--aew-primary); box-shadow: 0 12px 32px rgba(17, 24, 39, .12); }
.aew-pt__badge {
	position: absolute; top: -13px; left: 50%; transform: translateX(-50%);
	padding: 4px 14px; font-size: 13px; font-weight: 700; white-space: nowrap;
	color: #fff; background: var(--aew-primary); border-radius: 999px;
}
.aew-pt__title { margin: 0; font-size: 1.35em; color: var(--aew-text); }
.aew-pt__sub { margin: 0; color: var(--aew-muted); }
.aew-price { display: flex; align-items: baseline; gap: 4px; white-space: nowrap; color: var(--aew-text); }
.aew-price__cur { font-size: 1.5rem; font-weight: 700; }
.aew-price__amt { font-size: clamp(2rem, 9vw, 3.25rem); font-weight: 800; line-height: 1; }
.aew-price__per { color: var(--aew-muted); font-size: 1rem; }
.aew-pt__features { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.aew-pt__features li { position: relative; padding-left: 28px; line-height: 1.4; }
.aew-pt__features li::before { position: absolute; left: 0; top: 0; font-weight: 800; }
.aew-pt__features .is-yes::before { content: "\2713"; color: #16a34a; }
.aew-pt__features .is-no { color: var(--aew-muted); text-decoration: line-through; }
.aew-pt__features .is-no::before { content: "\2715"; color: #9ca3af; }
.aew-pt .aew-btn { width: 100%; margin-top: auto; }

/* ---------- Post grid ---------- */
.aew-pg { --aew-cols: 3; --aew-gap: 24px; }
.aew-pg__grid { display: grid; grid-template-columns: repeat(var(--aew-cols), minmax(0, 1fr)); gap: var(--aew-gap); }
.aew-pg__item {
	display: flex; flex-direction: column; overflow: hidden;
	background: var(--aew-surface); border: 1px solid var(--aew-border); border-radius: var(--aew-radius);
}
.aew-pg__thumb { display: block; aspect-ratio: 16 / 10; overflow: hidden; background: #f3f4f6; }
.aew-pg__thumb img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease; }
.aew-pg__item:hover .aew-pg__thumb img { transform: scale(1.04); }
.aew-pg__body { display: flex; flex-direction: column; gap: 8px; flex: 1; padding: 18px 20px 20px; }
.aew-pg__meta { font-size: .85em; color: var(--aew-muted); }
.aew-pg__title { margin: 0; font-size: 1.15em; line-height: 1.3; }
.aew-pg__title a { color: var(--aew-text); text-decoration: none; }
.aew-pg__title a:hover { color: var(--aew-primary); }
.aew-pg__excerpt { margin: 0; color: var(--aew-muted); line-height: 1.55; }
.aew-pg__more { margin-top: auto; padding-top: 4px; font-weight: 600; color: var(--aew-primary); text-decoration: none; }
.aew-pg__more:hover { text-decoration: underline; }
.aew-pg__pagination { margin-top: 28px; }
.aew-pg__pagination ul { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 0; padding: 0; list-style: none; }
.aew-pg__pagination .page-numbers {
	display: inline-flex; align-items: center; justify-content: center; min-width: 40px; height: 40px; padding: 0 12px;
	color: var(--aew-text); text-decoration: none; border: 1px solid var(--aew-border); border-radius: 8px;
}
.aew-pg__pagination .current { color: #fff; background: var(--aew-primary); border-color: var(--aew-primary); }

@media (max-width: 1024px) { .aew-pg { --aew-cols: 2; } }
@media (max-width: 767px)  { .aew-pg { --aew-cols: 1; } }

/* ---------- Popup ---------- */
.aew-popup { display: none; position: fixed; inset: 0; z-index: 99999; padding: 16px; box-sizing: border-box; }
.aew-popup.is-open { display: flex; }
.aew-popup--center { align-items: center; justify-content: center; }
.aew-popup--bottom { align-items: flex-end; justify-content: center; padding: 0; }
.aew-popup__overlay { position: absolute; inset: 0; background: rgba(17, 24, 39, .6); animation: aew-fade .2s ease; }
.aew-popup__box {
	position: relative; box-sizing: border-box; width: 100%; max-width: 560px;
	max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px);
	overflow: auto; overscroll-behavior: contain;
	background: #fff; border-radius: 16px;
	box-shadow: 0 24px 60px rgba(0, 0, 0, .3);
	animation: aew-pop .22s ease;
}
.aew-popup--bottom .aew-popup__box {
	max-width: none; border-radius: 16px 16px 0 0;
	max-height: 85vh; max-height: 85dvh;
	padding-bottom: env(safe-area-inset-bottom, 0px); /* keep content clear of the home indicator */
	animation: aew-rise .25s ease;
}
.aew-popup__content { padding: 28px; }
.aew-popup__content > :first-child { margin-top: 0; }
.aew-popup__content > :last-child { margin-bottom: 0; }
.aew-popup__close {
	position: absolute; top: 8px; right: 8px; z-index: 2;
	display: inline-flex; align-items: center; justify-content: center;
	width: 36px; height: 36px; padding: 0; font-size: 26px; line-height: 1;
	color: #374151; background: rgba(255, 255, 255, .85); border: 0; border-radius: 50%; cursor: pointer;
}
.aew-popup__close:hover { background: #f3f4f6; }
.aew-popup__close:focus-visible { outline: 3px solid color-mix(in srgb, var(--aew-primary) 45%, transparent); }
html.aew-lock { overflow: hidden; }

/* Editor preview: show the popup box inline instead of as a fixed overlay. */
.aew-popup--editor { display: block !important; position: relative; inset: auto; padding: 12px; background: #f3f4f6; border: 1px dashed #9ca3af; border-radius: 8px; }
.aew-popup--editor .aew-popup__overlay { display: none; }
.aew-popup--editor .aew-popup__box { margin: 0 auto; animation: none; }
.aew-popup--editor .aew-popup__close { display: none; }

@keyframes aew-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes aew-pop { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes aew-rise { from { transform: translateY(100%); } to { transform: none; } }
@media (prefers-reduced-motion: reduce) {
	.aew-popup__overlay, .aew-popup__box { animation: none !important; }
	.aew-btn, .aew-pg__thumb img { transition: none; }
}

/* ---------- Touch devices only: 44px minimum targets ---------- */
@media (pointer: coarse) {
	.aew-btn,
	.aew-ts__btn,
	.aew-popup__close,
	.aew-ts__dot,
	.aew-pg__pagination .page-numbers { min-width: 44px; min-height: 44px; }
	.aew-ts__dot { width: 44px; height: 44px; }
	.aew-ts__btn { width: 44px; height: 44px; }
	.aew-popup__close { width: 44px; height: 44px; }
	.aew-form input[type="checkbox"] { width: 24px; height: 24px; }
	.aew-pg__more { display: inline-flex; align-items: center; min-height: 44px; }
}
