/**
 * SPA إعلانات جنوب — بطاقات، مودال، شريط عاجل.
 *
 * @package Janoob
 */

/* ── سياق ── */
.janoob-ads-context-strip {
	margin-top: 0.5rem;
	padding: 0.35rem 0.5rem;
	border-radius: 0.65rem;
	background: hsl(0 84% 97% / 0.85);
	border: 1px solid hsl(0 72% 90% / 0.9);
}

.dark .janoob-ads-context-strip {
	background: hsl(0 40% 12% / 0.55);
	border-color: hsl(0 50% 22% / 0.6);
}

.janoob-ads-context-strip__text {
	margin: 0;
	font-family: Cairo, sans-serif;
	font-size: 0.68rem;
	font-weight: 700;
	line-height: 1.45;
	color: rgb(71 85 105);
}

.dark .janoob-ads-context-strip__text {
	color: rgb(203 213 225);
}

.janoob-ads-context-strip__link {
	color: #e3000f;
	font-weight: 900;
	text-decoration: underline;
	text-underline-offset: 2px;
}

.janoob-ads-context-strip__link:hover {
	color: #b8000d;
}

/* ── شريط typewriter أحمر ── */
.janoob-ads-typewriter {
	display: flex;
	align-items: center;
	gap: 0.55rem;
	min-height: 2.15rem;
	margin-top: 0.5rem;
	padding: 0.4rem 0.7rem;
	border-radius: 0.75rem;
	border: 1px solid rgba(255, 255, 255, 0.14);
	background: linear-gradient(118deg, #5c0008 0%, #e3000f 48%, #9a0010 100%);
	box-shadow:
		0 8px 24px -12px rgba(227, 0, 15, 0.55),
		inset 0 1px 0 rgba(255, 255, 255, 0.12);
	overflow: hidden;
	position: relative;
}

.janoob-ads-typewriter::after {
	content: '';
	position: absolute;
	inset: 0;
	background: linear-gradient(105deg, transparent 38%, rgba(255, 255, 255, 0.12) 50%, transparent 62%);
	transform: translateX(120%);
	animation: janoob-ads-typewriter-shimmer 5.5s ease-in-out infinite;
	pointer-events: none;
}

@keyframes janoob-ads-typewriter-shimmer {
	0%,
	70% {
		transform: translateX(120%);
	}
	100% {
		transform: translateX(-120%);
	}
}

.janoob-ads-typewriter__brand {
	position: relative;
	flex-shrink: 0;
	width: 3.25rem;
	height: 1.45rem;
	border-radius: 0.45rem;
	background: rgba(255, 255, 255, 0.1);
	border: 1px solid rgba(255, 255, 255, 0.22);
	overflow: hidden;
}

.janoob-ads-typewriter__brand-word {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 0.62rem;
	font-weight: 900;
	font-family: Cairo, sans-serif;
	color: #fff;
	opacity: 0;
	transform: scale(0.55) translateY(8px) rotateX(48deg);
	filter: blur(2px);
	transition:
		opacity 0.45s cubic-bezier(0.22, 1, 0.36, 1),
		transform 0.55s cubic-bezier(0.22, 1, 0.36, 1),
		filter 0.4s ease;
}

.janoob-ads-typewriter__brand-word.is-active {
	opacity: 1;
	transform: scale(1) translateY(0) rotateX(0);
	filter: blur(0);
	animation: janoob-ads-brand-pop 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes janoob-ads-brand-pop {
	0% {
		transform: scale(0.7) translateY(6px);
	}
	60% {
		transform: scale(1.06) translateY(-1px);
	}
	100% {
		transform: scale(1) translateY(0);
	}
}

.janoob-ads-typewriter__text-wrap {
	flex: 1;
	min-width: 0;
	font-size: 0.72rem;
	font-weight: 800;
	font-family: Cairo, sans-serif;
	color: rgba(255, 255, 255, 0.95);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.janoob-ads-typewriter__link {
	color: inherit;
	text-decoration: none;
}

.janoob-ads-typewriter__link.is-typing,
.janoob-ads-typewriter__link.is-intro {
	pointer-events: none;
	cursor: default;
}

.janoob-ads-typewriter__link.is-ready {
	pointer-events: auto;
	cursor: pointer;
}

.janoob-ads-typewriter__link.is-ready:hover,
.janoob-ads-typewriter__link.is-ready:focus-visible {
	color: #fecaca;
	outline: none;
	text-decoration: underline;
}

.janoob-ads-typewriter__cursor {
	color: rgba(255, 255, 255, 0.85);
	animation: janoob-ads-cursor-blink 1s step-end infinite;
}

@keyframes janoob-ads-cursor-blink {
	50% {
		opacity: 0;
	}
}

/* ── قائمة + بطاقة أفقية (مثل دليل الأعمال) ── */
.negev-ad-list {
	display: flex;
	flex-direction: column;
	gap: 0.55rem;
}

.negev-ad-card--row {
	position: relative;
	display: flex;
	align-items: stretch;
	border-radius: 1rem;
	border: 1px solid rgb(226 232 240);
	background: linear-gradient(118deg, rgb(255 255 255) 0%, rgb(248 250 252) 100%);
	box-shadow: 0 8px 22px -16px rgb(15 23 42 / 0.2);
	cursor: pointer;
	overflow: hidden;
	transition:
		transform 0.22s ease,
		box-shadow 0.22s ease,
		border-color 0.22s ease;
	font-family: Cairo, sans-serif;
}

.dark .negev-ad-card--row {
	border-color: rgb(51 65 85);
	background: linear-gradient(118deg, rgb(30 41 59) 0%, rgb(15 23 42) 100%);
}

.negev-ad-card--row::before {
	content: '';
	position: absolute;
	inset: 0 auto 0 0;
	width: 3px;
	background: linear-gradient(180deg, #e3000f, #9a0010);
	opacity: 0.85;
}

.negev-ad-card--row:hover,
.negev-ad-card--row:focus-within {
	transform: translateY(-2px);
	border-color: rgb(227 0 15 / 0.35);
	box-shadow: 0 14px 32px -12px rgb(227 0 15 / 0.2);
}

.negev-ad-card__media {
	position: relative;
	flex: 0 0 auto;
	width: 5.25rem;
	align-self: stretch;
	min-height: 5rem;
	background: rgb(241 245 249);
	overflow: hidden;
}

@media (min-width: 640px) {
	.negev-ad-card__media {
		width: 6rem;
		min-height: 5.35rem;
	}
}

.dark .negev-ad-card__media {
	background: rgb(51 65 85);
}

.negev-ad-card__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.negev-ad-card__media-ph {
	display: flex;
	height: 100%;
	min-height: 5rem;
	align-items: center;
	justify-content: center;
	color: rgb(148 163 184);
}

.negev-ad-card__pill--corner {
	position: absolute;
	top: 0.3rem;
	inset-inline-end: 0.3rem;
	z-index: 2;
	padding: 0.12rem 0.35rem;
	font-size: 0.52rem;
}

.negev-ad-card__body {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 0.2rem;
	padding: 0.5rem 0.55rem 0.55rem;
	justify-content: center;
}

.negev-ad-card__row-top {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.3rem 0.45rem;
}

.negev-ad-card__loc {
	display: inline-flex;
	align-items: center;
	gap: 0.15rem;
	font-size: 0.58rem;
	font-weight: 800;
	color: rgb(100 116 139);
	max-width: 100%;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.negev-ad-card__days-mini {
	display: inline-flex;
	align-items: center;
	gap: 0.15rem;
	font-size: 0.58rem;
	font-weight: 900;
	color: #b8000d;
	background: rgb(254 226 226 / 0.85);
	border-radius: 9999px;
	padding: 0.1rem 0.4rem;
}

.negev-ad-card__days-mini--urgent {
	animation: negev-ad-urgent-pulse 1.4s ease-in-out infinite;
}

@keyframes negev-ad-urgent-pulse {
	50% {
		opacity: 0.65;
	}
}

.negev-ad-card__pill {
	display: inline-flex;
	align-items: center;
	padding: 0.12rem 0.4rem;
	border-radius: 0.4rem;
	font-size: 0.58rem;
	font-weight: 900;
	line-height: 1.2;
}

.negev-ad-card__pill--ad {
	background: rgb(227 0 15 / 0.92);
	color: #fff;
}

.negev-ad-card__title {
	margin: 0;
	font-size: 0.78rem;
	font-weight: 900;
	line-height: 1.35;
	color: rgb(15 23 42);
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

@media (min-width: 640px) {
	.negev-ad-card__title {
		font-size: 0.85rem;
	}
}

.dark .negev-ad-card__title {
	color: rgb(248 250 252);
}

.negev-ad-card__publisher {
	display: flex;
	align-items: center;
	gap: 0.25rem;
	font-size: 0.6rem;
	font-weight: 800;
	color: rgb(100 116 139);
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.negev-ad-card__publisher a {
	color: #e3000f;
	text-decoration: none;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.negev-ad-card__publisher a:hover {
	text-decoration: underline;
}

.negev-ad-card__publisher--vip a {
	font-weight: 900;
}

.negev-ad-card__price {
	font-size: 0.72rem;
	font-weight: 900;
	color: rgb(5 150 105);
	line-height: 1.2;
}

.dark .negev-ad-card__price {
	color: rgb(52 211 153);
}

.negev-ad-card__meta {
	display: flex;
	flex-wrap: wrap;
	gap: 0.35rem 0.5rem;
	font-size: 0.58rem;
	font-weight: 700;
	color: rgb(100 116 139);
}

.negev-ad-card__meta i {
	vertical-align: middle;
	margin-inline-end: 0.1rem;
	font-size: 0.65rem;
}

.negev-ad-card__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.35rem;
	margin-top: 0.15rem;
}

.negev-ad-card__act {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.25rem;
	min-height: 2rem;
	padding: 0.25rem 0.55rem;
	border-radius: 0.5rem;
	font-size: 0.62rem;
	font-weight: 900;
	font-family: Cairo, sans-serif;
	border: 1px solid transparent;
	transition: transform 0.2s ease, box-shadow 0.2s ease;
	touch-action: manipulation;
}

.negev-ad-card--row:hover .negev-ad-card__act--open,
.negev-ad-card--row:focus-within .negev-ad-card__act--open {
	transform: scale(1.04);
	box-shadow: 0 4px 14px -4px rgb(227 0 15 / 0.45);
}

.negev-ad-card__act--open {
	background: rgb(227 0 15 / 0.1);
	border-color: rgb(227 0 15 / 0.35);
	color: #e3000f;
}

.negev-ad-card__act--wa {
	min-width: 2rem;
	background: rgb(245 158 11);
	color: rgb(15 23 42);
}

.negev-ad-card__act--edit {
	min-width: 2rem;
	border-color: rgb(226 232 240);
	background: rgb(248 250 252);
	color: rgb(71 85 105);
}

.negev-ad-card__cta {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	padding-inline: 0.35rem 0.45rem;
	color: rgb(148 163 184);
}

.negev-ad-card__cta-inner {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 1.5rem;
	height: 1.5rem;
	border-radius: 9999px;
	background: rgb(241 245 249);
}

.negev-ad-card--row:hover .negev-ad-card__cta-inner {
	background: rgb(254 226 226);
	color: #e3000f;
}

/* ── مودال — ملء الشاشة على الجوال، لوحة متناسبة على الشاشات الأكبر ── */
#negev-modal.negev-modal {
	z-index: 200;
	padding: 0;
	align-items: stretch;
	justify-content: stretch;
	overflow: hidden;
}

#negev-modal.negev-modal.flex {
	display: flex;
}

#negev-modal.negev-modal.hidden {
	display: none;
}

.negev-modal__panel {
	display: flex;
	flex-direction: column;
	width: 100%;
	max-width: 100%;
	height: 100dvh;
	max-height: 100dvh;
	min-height: 0;
	margin: 0;
	border-radius: 0;
	border: none;
	background: rgb(255 255 255);
	box-shadow: none;
	overflow: hidden;
}

@media (min-width: 640px) {
	#negev-modal.negev-modal {
		align-items: center;
		justify-content: center;
		padding:
			max(0.65rem, env(safe-area-inset-top, 0.65rem))
			0.75rem
			max(0.65rem, env(safe-area-inset-bottom, 0.65rem));
	}

	.negev-modal__panel {
		width: 100%;
		max-width: 26rem;
		height: auto;
		max-height: min(92dvh, 42rem);
		border-radius: 1rem;
		border: 1px solid rgb(226 232 240);
		box-shadow: 0 24px 48px -16px rgb(15 23 42 / 0.45);
	}
}

.dark .negev-modal__panel {
	background: rgb(15 23 42);
}

.negev-modal__head {
	flex-shrink: 0;
	z-index: 10;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	padding: max(0.65rem, env(safe-area-inset-top, 0.65rem)) 0.85rem 0.65rem;
	border-bottom: 1px solid rgb(241 245 249);
	background: rgb(255 255 255 / 0.98);
	backdrop-filter: blur(10px);
}

@media (min-width: 640px) {
	.negev-modal__head {
		padding-top: 0.75rem;
		border-start-start-radius: 1rem;
		border-start-end-radius: 1rem;
	}
}

.dark .negev-modal__head {
	border-bottom-color: rgb(51 65 85);
	background: rgb(15 23 42 / 0.98);
}

.negev-modal__title {
	margin: 0;
	flex: 1;
	font-size: 0.9rem;
	font-weight: 900;
	line-height: 1.35;
	color: rgb(15 23 42);
	font-family: Cairo, sans-serif;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

@media (min-width: 640px) {
	.negev-modal__title {
		font-size: 1rem;
	}
}

.dark .negev-modal__title {
	color: rgb(248 250 252);
}

.negev-modal__close {
	flex-shrink: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.35rem;
	min-width: 3rem;
	height: 3rem;
	padding: 0 0.75rem;
	border-radius: 9999px;
	border: none;
	background: #e3000f;
	color: #fff;
	cursor: pointer;
	font-family: Cairo, sans-serif;
	font-size: 0.75rem;
	font-weight: 900;
	box-shadow: 0 4px 14px -4px rgb(227 0 15 / 0.55);
	transition: transform 0.15s ease, background 0.15s ease;
}

.negev-modal__close:hover {
	background: #b8000d;
}

.negev-modal__close-label {
	display: none;
}

@media (min-width: 400px) {
	.negev-modal__close-label {
		display: inline;
	}
}

.negev-modal__scroll {
	flex: 1 1 auto;
	min-height: 0;
	overflow-x: hidden;
	overflow-y: auto;
	padding: 0.85rem 1rem 1rem;
	display: flex;
	flex-direction: column;
	gap: 0.65rem;
	-webkit-overflow-scrolling: touch;
	overscroll-behavior: contain;
	touch-action: pan-y;
	scrollbar-gutter: stable;
}

.negev-modal__img {
	display: block;
	width: 100%;
	max-height: 9.5rem;
	object-fit: cover;
	border-radius: 0.75rem;
}

.negev-modal__img.hidden {
	display: none;
}

.negev-modal__badges {
	display: flex;
	flex-wrap: wrap;
	gap: 0.35rem;
	font-size: 0.6875rem;
	font-weight: 800;
}

.negev-modal__badges > span {
	font-size: inherit;
}

.negev-modal__body-row {
	display: flex;
	flex-direction: row;
	align-items: flex-start;
	gap: 0.75rem;
	direction: ltr;
}

.negev-modal__countdown {
	flex: 0 0 auto;
}

.negev-modal__countdown.hidden {
	display: none;
}

.negev-modal__body-copy {
	flex: 1 1 auto;
	min-width: 0;
	direction: rtl;
	display: flex;
	flex-direction: column;
	gap: 0.45rem;
}

.negev-modal__price {
	margin: 0;
	font-size: 1.05rem;
	font-weight: 900;
	line-height: 1.35;
	color: rgb(5 150 105);
	font-family: Cairo, sans-serif;
	font-variant-numeric: tabular-nums;
}

.dark .negev-modal__price {
	color: rgb(52 211 153);
}

.negev-modal__excerpt {
	margin: 0;
	font-size: 0.8125rem;
	line-height: 1.65;
	color: rgb(71 85 105);
	font-family: Cairo, sans-serif;
	white-space: pre-wrap;
	word-break: break-word;
}

.dark .negev-modal__excerpt {
	color: rgb(203 213 225);
}

.negev-modal__publisher {
	padding: 0.65rem 0.75rem;
	border-radius: 0.75rem;
	border: 1px solid rgb(227 0 15 / 0.2);
	background: rgb(254 242 242 / 0.7);
	font-size: 0.75rem;
	font-weight: 800;
	font-family: Cairo, sans-serif;
}

.dark .negev-modal__publisher {
	background: rgb(69 10 10 / 0.35);
	border-color: rgb(248 113 113 / 0.25);
}

.negev-modal__publisher a {
	color: #e3000f;
	font-weight: 900;
}

.negev-modal__meta {
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
	font-size: 0.75rem;
	font-weight: 700;
	color: rgb(71 85 105);
	font-family: Cairo, sans-serif;
}

.dark .negev-modal__meta {
	color: rgb(203 213 225);
}

.negev-modal__meta-row {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.35rem 0.5rem;
}

.negev-modal__meta-row i {
	color: #e3000f;
}

.negev-modal__foot {
	flex-shrink: 0;
	z-index: 10;
	padding: 0.75rem 1rem max(0.85rem, env(safe-area-inset-bottom, 0.85rem));
	border-top: 1px solid rgb(241 245 249);
	background: rgb(255 255 255 / 0.98);
	backdrop-filter: blur(10px);
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

@media (min-width: 640px) {
	.negev-modal__foot {
		padding-bottom: 0.85rem;
		border-end-start-radius: 1rem;
		border-end-end-radius: 1rem;
	}
}

.dark .negev-modal__foot {
	border-top-color: rgb(51 65 85);
	background: rgb(15 23 42 / 0.96);
}

.negev-modal__actions {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.55rem;
	flex-wrap: wrap;
}

.negev-modal__action {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.75rem;
	height: 2.75rem;
	border-radius: 9999px;
	border: 1px solid rgb(226 232 240);
	background: rgb(248 250 252);
	color: rgb(51 65 85);
	font-size: 1.2rem;
	line-height: 1;
	cursor: pointer;
	transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
	text-decoration: none;
}

.negev-modal__action:hover {
	background: rgb(241 245 249);
}

.negev-modal__action:focus-visible {
	outline: 2px solid #e3000f;
	outline-offset: 2px;
}

.negev-modal__action--wa {
	color: #128c7e;
	border-color: rgb(18 140 126 / 0.28);
	background: rgb(236 253 245);
}

.negev-modal__action--wa:hover {
	background: rgb(209 250 229);
}

.negev-modal__action--calendar {
	color: #0369a1;
	border-color: rgb(3 105 161 / 0.28);
	background: rgb(224 242 254);
}

.negev-modal__action--calendar:hover {
	background: rgb(186 230 253);
}

.negev-modal__action--share {
	color: #1e40af;
	border-color: rgb(30 64 175 / 0.22);
	background: rgb(239 246 255);
}

.negev-modal__action--share:hover {
	background: rgb(219 234 254);
}

.negev-modal__action--story {
	color: #a21caf;
	border-color: rgb(162 28 175 / 0.25);
	background: rgb(253 244 255);
}

.negev-modal__action--story:hover {
	background: rgb(250 232 255);
}

.negev-modal__action.is-disabled,
.negev-modal__action[aria-disabled="true"] {
	opacity: 0.38;
	pointer-events: none;
	cursor: not-allowed;
}

.dark .negev-modal__action {
	border-color: rgb(51 65 85);
	background: rgb(30 41 59);
	color: rgb(226 232 240);
}

.negev-modal__full-link {
	display: block;
	text-align: center;
	font-size: 0.8125rem;
	font-weight: 800;
	color: #1e3a8a;
	text-decoration: underline;
	font-family: Cairo, sans-serif;
}

.dark .negev-modal__full-link {
	color: rgb(251 191 36);
}

body.negev-modal-open {
	overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
	.janoob-ads-typewriter__brand-word.is-active,
	.janoob-ads-typewriter::after,
	.negev-ad-card--row {
		animation: none !important;
		transition: none !important;
	}

	.negev-ad-card--row:hover {
		transform: none;
	}
}

@media (min-width: 640px) {
	.janoob-ads-typewriter__text-wrap {
		font-size: 0.78rem;
	}

	.negev-ad-card__title {
		font-size: 0.95rem;
	}
}
