/*
 * style.css — EscBay Live Auction
 */

@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@400;500;600;700;800&display=swap');

.escbay-auction {
	--au-orange: #f4732a;
	--au-orange-dark: #d95d14;
	--au-lime: #b7db4b;
	--au-lime-dark: #7fa524;
	--au-cream: #fffbf2;
	--au-ink: #2b2420;
	--au-ink-soft: #706558;
	--au-line: #efe6d6;
	--au-danger: #d64545;
	--au-radius-lg: 20px;
	--au-radius-md: 12px;
	--au-shadow: 0 10px 30px -14px rgba(43, 36, 32, 0.22);

	font-family: 'Vazirmatn', Tahoma, Arial, sans-serif;
	color: var(--au-ink);
	background: var(--au-cream);
	border-radius: var(--au-radius-lg);
	padding: clamp(16px, 3vw, 32px);
	direction: rtl;
}

.escbay-auction *,
.escbay-auction *::before,
.escbay-auction *::after { box-sizing: border-box; }

.escbay-au-empty {
	background: #fff4e8;
	border: 1px dashed var(--au-orange);
	color: var(--au-orange-dark);
	border-radius: 10px;
	padding: 14px;
	font-size: 14px;
}

.escbay-au-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 24px;
}

@media (min-width: 780px) {
	.escbay-au-grid { grid-template-columns: 1.2fr 1fr; align-items: start; }
}

/* -------- رسانه: عکس اصلی + نوار بندانگشتی -------- */
.escbay-au-media { display: flex; flex-direction: column; gap: 10px; }
.escbay-au-image-wrap {
	position: relative;
	border-radius: var(--au-radius-lg);
	overflow: hidden;
	background: #fff;
	border: 1px solid var(--au-line);
	cursor: zoom-in;
}

.escbay-au-image,
.escbay-au-image-wrap img { width: 100%; height: 100%; object-fit: cover; display: block; aspect-ratio: 4/3; }

.escbay-au-thumbs {
	display: flex;
	gap: 8px;
	overflow-x: auto;
	padding: 2px;
}
.escbay-au-thumb {
	flex-shrink: 0;
	width: 62px;
	height: 62px;
	padding: 0;
	border-radius: 8px;
	overflow: hidden;
	border: 2px solid transparent;
	background: none;
	cursor: pointer;
}
.escbay-au-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.escbay-au-thumb.is-active { border-color: var(--au-orange); }

.escbay-au-image-placeholder {
	aspect-ratio: 4/3;
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--au-orange);
}
.escbay-au-image-placeholder svg { width: 64px; height: 64px; }

.escbay-au-status-badge {
	position: absolute;
	top: 14px;
	inset-inline-start: 14px;
	background: var(--au-lime-dark);
	color: #fff;
	font-size: 12px;
	font-weight: 700;
	padding: 5px 14px;
	border-radius: 999px;
}
.escbay-au-status-badge.is-ended { background: var(--au-danger); }

/* -------- ستون قیمت + مشخصات، کنار عکس -------- */
.escbay-au-price-col { display: flex; flex-direction: column; gap: 16px; }

/* -------- لایت‌باکس (نمایش تمام‌صفحهٔ عکس‌ها) -------- */
.escbay-au-lightbox {
	position: fixed;
	inset: 0;
	z-index: 99999;
	background: rgba(0, 0, 0, 0.9);
	display: flex;
	align-items: center;
	justify-content: center;
}
.escbay-au-lightbox[hidden] { display: none; }
.escbay-au-lightbox__img { max-width: 92vw; max-height: 88vh; object-fit: contain; border-radius: 8px; }
.escbay-au-lightbox__close,
.escbay-au-lightbox__prev,
.escbay-au-lightbox__next {
	position: absolute;
	background: rgba(255, 255, 255, 0.12);
	color: #fff;
	border: none;
	border-radius: 50%;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
}
.escbay-au-lightbox__close { top: 18px; inset-inline-end: 18px; width: 40px; height: 40px; font-size: 22px; }
.escbay-au-lightbox__prev,
.escbay-au-lightbox__next { top: 50%; transform: translateY(-50%); width: 48px; height: 48px; font-size: 26px; }
.escbay-au-lightbox__prev { inset-inline-start: 18px; }
.escbay-au-lightbox__next { inset-inline-end: 18px; }

/* -------- اطلاعات (زیر گرید، تمام‌عرض) -------- */
.escbay-au-info { display: flex; flex-direction: column; gap: 16px; margin-top: 24px; }

.escbay-au-title { font-size: 22px; font-weight: 800; margin: 0; }

.escbay-au-timer {
	background: #fff;
	border: 1px solid var(--au-line);
	border-radius: var(--au-radius-md);
	padding: 10px 16px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	font-size: 14px;
}
.escbay-au-timer-value {
	font-weight: 800;
	font-variant-numeric: tabular-nums;
	color: var(--au-orange-dark);
}
.escbay-au-timer-value.is-ending { color: var(--au-danger); }

.escbay-au-price-box {
	background: linear-gradient(155deg, #fff4e6 0%, var(--au-cream) 100%);
	border: 2px solid var(--au-orange);
	border-radius: var(--au-radius-lg);
	box-shadow: 0 0 0 4px rgba(255, 138, 61, 0.12), var(--au-shadow);
	padding: 20px 22px;
	position: relative;
	overflow: hidden;
}
.escbay-au-current-label { font-size: 13px; color: var(--au-ink-soft); }
.escbay-au-current-amount {
	font-size: 40px;
	font-weight: 900;
	background: linear-gradient(135deg, var(--au-orange-dark), var(--au-orange));
	-webkit-background-clip: text;
	background-clip: text;
	-webkit-text-fill-color: transparent;
	margin: 4px 0 8px;
	font-variant-numeric: tabular-nums;
	text-shadow: 0 2px 18px rgba(255, 138, 61, 0.25);
}
.escbay-au-meta-row {
	display: flex;
	justify-content: space-between;
	font-size: 12.5px;
	color: var(--au-ink-soft);
	flex-wrap: wrap;
	gap: 6px;
}

.escbay-au-winner-banner {
	background: #eef7d9;
	border: 1px solid var(--au-lime-dark);
	color: #4a6113;
	border-radius: var(--au-radius-md);
	padding: 14px 16px;
	font-size: 14px;
	font-weight: 600;
}

/* -------- فرم پیشنهاد -------- */
.escbay-au-bid-panel {
	background: #fff;
	border: 1px solid var(--au-line);
	border-radius: var(--au-radius-md);
	padding: 16px;
	display: flex;
	flex-direction: column;
	gap: 8px;
}
.escbay-au-bid-panel[hidden] { display: none; }

.escbay-au-label { font-size: 13px; font-weight: 600; }

.escbay-au-bid-row { display: flex; gap: 10px; }

.escbay-au-amount-input {
	flex: 1;
	font-family: inherit;
	font-size: 15px;
	font-weight: 700;
	border: 1.5px solid var(--au-line);
	border-radius: var(--au-radius-md);
	padding: 10px 14px;
	min-width: 0;
}
.escbay-au-amount-input:focus-visible { outline: 2.5px solid var(--au-orange); outline-offset: 1px; }

.escbay-au-min-hint { font-size: 12px; color: var(--au-ink-soft); }

.escbay-au-form-status { font-size: 13px; min-height: 18px; margin: 2px 0 0; }
.escbay-au-form-status.success { color: #5b7a17; }
.escbay-au-form-status.error { color: var(--au-danger); }

/* -------- ورود/ثبت‌نام -------- */
.escbay-au-auth-panel {
	background: #fff8ef;
	border: 1px solid #fde4c8;
	border-radius: var(--au-radius-md);
	padding: 16px;
	display: flex;
	flex-direction: column;
	gap: 10px;
}
.escbay-au-auth-panel[hidden] { display: none; }

.escbay-au-auth-notice { font-size: 13px; font-weight: 600; color: var(--au-orange-dark); margin: 0; }

.escbay-au-tabs { display: flex; gap: 8px; }
.escbay-au-tab {
	flex: 1;
	font-family: inherit;
	font-size: 13px;
	font-weight: 700;
	background: #fff;
	border: 1.5px solid var(--au-line);
	border-radius: 999px;
	padding: 8px 10px;
	cursor: pointer;
	color: var(--au-ink-soft);
}
.escbay-au-tab.is-active { background: var(--au-orange); border-color: var(--au-orange); color: #fff; }

.escbay-au-auth-form { display: flex; flex-direction: column; gap: 8px; }
.escbay-au-auth-form[hidden] { display: none; }
.escbay-au-auth-form input {
	font-family: inherit;
	font-size: 14px;
	border: 1.5px solid var(--au-line);
	border-radius: var(--au-radius-md);
	padding: 10px 14px;
}
.escbay-au-auth-form input:focus-visible { outline: 2.5px solid var(--au-orange); outline-offset: 1px; }

/* -------- دکمه‌ها -------- */
.escbay-btn {
	font-family: inherit;
	font-size: 14px;
	font-weight: 700;
	border-radius: 999px;
	padding: 11px 20px;
	border: none;
	cursor: pointer;
	transition: filter 0.15s ease, transform 0.1s ease;
	white-space: nowrap;
}
.escbay-btn:active { transform: scale(0.98); }
.escbay-btn-primary { background: var(--au-orange); color: #fff; }
.escbay-btn-primary:hover { filter: brightness(1.06); }
.escbay-btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }
.escbay-btn:focus-visible { outline: 2.5px solid var(--au-ink); outline-offset: 2px; }

/* -------- توضیحات -------- */
.escbay-au-description { font-size: 13.5px; line-height: 2; color: var(--au-ink-soft); }
.escbay-au-description p { margin: 0 0 8px; }

/* -------- تاریخچه -------- */
.escbay-au-history-title { font-size: 14px; font-weight: 700; margin: 0 0 8px; }
.escbay-au-history-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; max-height: 240px; overflow-y: auto; }
.escbay-au-history-list li {
	display: flex;
	justify-content: space-between;
	gap: 8px;
	font-size: 12.5px;
	background: #fff;
	border: 1px solid var(--au-line);
	border-radius: 10px;
	padding: 8px 12px;
}
.escbay-au-history-empty { color: var(--au-ink-soft); background: transparent !important; border: none !important; justify-content: flex-start !important; }
.escbay-au-history-name { font-weight: 700; }
.escbay-au-history-amount { color: var(--au-orange-dark); font-weight: 700; font-variant-numeric: tabular-nums; }
.escbay-au-history-time { color: var(--au-ink-soft); }
.escbay-au-history-list li.escbay-au-history-top {
	background: linear-gradient(135deg, #fff4e6, #fff);
	border: 2px solid var(--au-orange);
	font-size: 13.5px;
}
.escbay-au-history-top .escbay-au-history-amount { color: var(--au-orange-dark); font-size: 15px; }
.escbay-au-history-crown, .escbay-au-history-hammer { flex-shrink: 0; }

.escbay-au-specs { margin-top: 18px; }
.escbay-au-specs-title { font-size: 14px; font-weight: 700; margin: 0 0 10px; }
.escbay-au-specs-grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 6px 16px;
}
@media (max-width: 480px) {
	.escbay-au-specs-grid { grid-template-columns: 1fr; }
}
.escbay-au-specs-row {
	display: flex;
	justify-content: space-between;
	gap: 8px;
	font-size: 12.5px;
	padding: 6px 10px;
	background: #fff;
	border: 1px solid var(--au-line);
	border-radius: 8px;
}
.escbay-au-specs-label { color: var(--au-ink-soft); }
.escbay-au-specs-value { font-weight: 700; }

/* لیست حراج‌های فعال (شورت‌کد [escbay_active_auctions]) */
.escbay-au-list-empty {
	text-align: center;
	color: var(--au-ink-soft);
	padding: 40px 20px;
	background: var(--au-cream);
	border: 1px dashed var(--au-line);
	border-radius: var(--au-radius-lg);
}
.escbay-au-list-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
	gap: 18px;
}
.escbay-au-list-card {
	display: block;
	text-decoration: none;
	/* عمداً از رنگ ثابت خودِ افزونه استفاده می‌شه (نه inherit) — چون
	   پس‌زمینهٔ کارت همیشه سفیده، ولی اگه صفحه توی حالت شب سایت باشه،
	   inherit رنگ روشن سایت رو می‌گرفت و نوشته‌ها روی زمینهٔ سفید
	   ناخوانا می‌شدن. */
	color: var(--au-ink);
	background: #fff;
	border: 1px solid var(--au-line);
	border-radius: var(--au-radius-lg);
	overflow: hidden;
	box-shadow: var(--au-shadow);
	transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.escbay-au-list-card:hover {
	transform: translateY(-3px);
	box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12);
}
.escbay-au-list-card__media {
	position: relative;
	aspect-ratio: 4/3;
	background: var(--au-cream);
}
.escbay-au-list-card__media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.escbay-au-list-card__placeholder {
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--au-ink-soft);
}
.escbay-au-list-card__placeholder svg { width: 40px; height: 40px; }
.escbay-au-list-card__badge {
	position: absolute;
	top: 10px;
	inset-inline-start: 10px;
	background: var(--au-orange);
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	padding: 3px 10px;
	border-radius: 999px;
}
.escbay-au-list-card__body { padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; }
.escbay-au-list-card__title { font-size: 14px; font-weight: 700; }
.escbay-au-list-card__price { font-size: 16px; font-weight: 800; color: var(--au-orange-dark); }
.escbay-au-list-card__meta { font-size: 12px; color: var(--au-ink-soft); }

@media (prefers-reduced-motion: reduce) {
	.escbay-btn, .escbay-au-tab { transition: none !important; }
}
