/*
 * Arestomed Auctions — frontend (EPIC 7).
 * Zgodność z Woodmart: bez resetów globalnych, kolory/typografia dziedziczone z motywu, przyciski dostają klasy
 * `button`/`alt` (stylowane przez motyw), a własne reguły używają :where() o zerowej specyficzności, żeby motyw
 * zawsze mógł je nadpisać. Wszystkie selektory są w przestrzeni `.aresto`.
 */
.aresto {
	--aresto-accent: var(--wd-primary-color, var(--btn-accented-bgcolor, #1d6fa5));
	--aresto-border: var(--brdcolor-gray-300, rgba(128, 128, 128, 0.3));
	--aresto-muted: var(--wd-text-color, inherit);
	--aresto-gap: clamp(12px, 2vw, 24px);
	box-sizing: border-box;
	max-width: 100%;
}

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

.aresto :where(img) { max-width: 100%; height: auto; display: block; }
.aresto :where(h1, h2, h3) { margin: 0 0 0.5em; }
.aresto :where(p, dl, dd, ul) { margin: 0 0 0.75em; }
.aresto :where(ul) { padding: 0; list-style: none; }

.aresto .aresto-title { font-size: clamp(1.4rem, 3vw, 2rem); line-height: 1.2; }
.aresto .aresto-h { font-size: clamp(1.15rem, 2.2vw, 1.5rem); margin-bottom: 0.75em; }
.aresto .aresto-section { margin: 0 0 2em; }
.aresto .aresto-back { margin-bottom: 1em; }
.aresto .aresto-subtle, .aresto .aresto-hint, .aresto .aresto-count { font-size: 0.875em; opacity: 0.8; }
.aresto .aresto-label { display: block; font-size: 0.8125em; text-transform: uppercase; letter-spacing: 0.04em; opacity: 0.75; margin-bottom: 0.2em; }

/* Odznaki statusu */
.aresto .aresto-badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 0.8125em; font-weight: 600; line-height: 1.6; background: rgba(128, 128, 128, 0.15); }
.aresto .aresto-badge--live { background: #dff5e3; color: #14622a; }
.aresto .aresto-badge--upcoming { background: #e1ecfb; color: #1b4f93; }
.aresto .aresto-badge--paused { background: #fdf0d2; color: #7a5200; }
.aresto .aresto-badge--ended { background: #ececec; color: #444; }
.aresto .aresto-badge--extended { background: #fde3d6; color: #8a3000; }

/* Powiadomienia */
.aresto .aresto-notice { padding: 10px 14px; border-left: 4px solid var(--aresto-border); background: rgba(128, 128, 128, 0.08); border-radius: 2px; }
.aresto .aresto-notice--warn { border-left-color: #d88c00; }
.aresto .aresto-notice--info { border-left-color: var(--aresto-accent); }
.aresto .aresto-notice > :last-child { margin-bottom: 0; }

/* Siatki i karty */
.aresto .aresto-grid { display: grid; gap: var(--aresto-gap); grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }
.aresto .aresto-card { display: flex; flex-direction: column; border: 1px solid var(--aresto-border); border-radius: 6px; overflow: hidden; background: inherit; }
.aresto .aresto-card__media { display: block; aspect-ratio: 4 / 3; background: rgba(128, 128, 128, 0.1); overflow: hidden; }
.aresto .aresto-card__media img { width: 100%; height: 100%; object-fit: cover; }
.aresto .aresto-card__placeholder { display: block; width: 100%; height: 100%; min-height: 160px; background: repeating-linear-gradient(45deg, rgba(128, 128, 128, 0.08), rgba(128, 128, 128, 0.08) 10px, rgba(128, 128, 128, 0.14) 10px, rgba(128, 128, 128, 0.14) 20px); }
.aresto .aresto-card__body { display: flex; flex-direction: column; gap: 4px; padding: 14px; flex: 1; }
.aresto .aresto-card__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 0.875em; margin: 0; }
.aresto .aresto-card__title { font-size: 1.05rem; line-height: 1.3; margin: 0.2em 0; }
.aresto .aresto-card__title a { color: inherit; text-decoration: none; }
.aresto .aresto-card__title a:hover { text-decoration: underline; }
.aresto .aresto-card__facts { display: grid; gap: 4px; margin: 6px 0 12px; }
.aresto .aresto-card__facts > div { display: flex; justify-content: space-between; gap: 8px; }
.aresto .aresto-card__facts dt { opacity: 0.75; }
.aresto .aresto-card__facts dd { font-weight: 600; margin: 0; text-align: right; }
.aresto .aresto-card .aresto-btn { margin-top: auto; text-align: center; }

/* Filtry */
.aresto .aresto-filters { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); align-items: end; margin-bottom: 1.25em; padding: 14px; border: 1px solid var(--aresto-border); border-radius: 6px; }
.aresto .aresto-filters .aresto-field { margin: 0; min-width: 0; }
.aresto .aresto-filters :where(input, select) { max-width: 100%; min-width: 0; }
.aresto .aresto-filters .aresto-field--grow { grid-column: span 2; }
.aresto .aresto-filters label { display: block; font-size: 0.8125em; margin-bottom: 4px; }
.aresto .aresto-filters :where(input, select) { width: 100%; }
.aresto .aresto-field--actions { display: flex; gap: 12px; align-items: center; }
.aresto .aresto-pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px; margin-top: 1.5em; }

/* Nagłówek aukcji */
.aresto .aresto-auction-head { display: grid; gap: var(--aresto-gap); grid-template-columns: minmax(0, 1fr); margin-bottom: 1.5em; }
.aresto .aresto-auction-head__img { border-radius: 6px; width: 100%; max-height: 320px; object-fit: cover; }
@media (min-width: 768px) {
	.aresto .aresto-auction-head:has(.aresto-auction-head__img) { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
}
.aresto .aresto-dates { display: flex; flex-wrap: wrap; gap: 4px 20px; font-size: 0.9em; }

/* Karta lotu */
.aresto .aresto-lot { display: grid; gap: calc(var(--aresto-gap) * 1.5); grid-template-columns: minmax(0, 1fr); margin-bottom: 2em; }
@media (min-width: 900px) {
	.aresto .aresto-lot { grid-template-columns: minmax(0, 1.2fr) minmax(320px, 1fr); align-items: start; }
	.aresto .aresto-lot__side { position: sticky; top: 90px; }
}
.aresto .aresto-lot__main { display: block; border: 1px solid var(--aresto-border); border-radius: 6px; overflow: hidden; }
.aresto .aresto-lot__main img { width: 100%; max-height: 560px; object-fit: contain; background: rgba(128, 128, 128, 0.06); }
.aresto .aresto-lot__thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 0; }
.aresto .aresto-thumb { padding: 0; border: 2px solid var(--aresto-border); border-radius: 4px; background: none; cursor: pointer; width: 72px; height: 72px; overflow: hidden; line-height: 0; min-height: 0; }
.aresto .aresto-thumb:hover, .aresto .aresto-thumb:focus-visible { border-color: var(--aresto-accent); }
.aresto .aresto-thumb img { width: 100%; height: 100%; object-fit: cover; }

.aresto .aresto-specs { display: grid; gap: 0; border-top: 1px solid var(--aresto-border); }
.aresto .aresto-specs > div { display: grid; grid-template-columns: minmax(120px, 1fr) 2fr; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--aresto-border); }
.aresto .aresto-specs dt { font-weight: 600; }
.aresto .aresto-specs dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 520px) { .aresto .aresto-specs > div { grid-template-columns: 1fr; gap: 2px; } }

/* Panel licytacji */
.aresto .aresto-panel { display: grid; gap: 12px; padding: clamp(14px, 2.5vw, 22px); border: 1px solid var(--aresto-border); border-radius: 6px; margin-top: 1em; }
.aresto .aresto-panel > * { margin: 0; }
.aresto .aresto-panel[hidden], .aresto [hidden] { display: none !important; }
.aresto .aresto-panel__prices { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.aresto .aresto-price__value { display: block; font-size: clamp(1.6rem, 4vw, 2.1rem); line-height: 1.15; color: var(--aresto-accent); font-variant-numeric: tabular-nums; }
.aresto .aresto-price__min { font-size: 1.15em; font-weight: 600; font-variant-numeric: tabular-nums; }
.aresto .aresto-timer { display: block; font-size: 1.5rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.aresto .aresto-reserve { font-weight: 600; }
.aresto .aresto-viewer { font-weight: 600; }
.aresto .aresto-form { display: grid; gap: 4px; padding-top: 12px; border-top: 1px solid var(--aresto-border); }
.aresto .aresto-form__row { display: flex; gap: 8px; }
.aresto .aresto-form__row .aresto-input { flex: 1 1 auto; min-width: 0; }
.aresto .aresto-form__row .aresto-btn { flex: 0 0 auto; white-space: nowrap; }
.aresto .aresto-input { min-height: 44px; }
.aresto .aresto-btn { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.aresto .aresto-btn[disabled] { opacity: 0.6; cursor: wait; }
.aresto .aresto-hint { margin: 0; }
.aresto .aresto-msg { padding: 10px 14px; border-radius: 4px; font-weight: 600; }
.aresto .aresto-msg--error { background: #fde8e8; color: #8a1c1c; border-left: 4px solid #c62828; }
.aresto .aresto-msg--success { background: #e3f5e8; color: #14622a; border-left: 4px solid #2e7d32; }
.aresto .aresto-link { text-decoration: underline; }

.aresto .aresto-prose { overflow-wrap: anywhere; }
.aresto .aresto-prose :where(ul, ol) { list-style: revert; padding-left: 1.4em; }

/* Na stronie produktu WooCommerce panel mieści się w kolumnie podsumowania. */
.aresto--product .aresto-panel { margin: 1em 0; }

@media (prefers-reduced-motion: reduce) {
	.aresto * { transition: none !important; animation: none !important; }
}

/* Panel klienta, historia ofert, obserwowane (EPIC 8) */
.aresto .aresto-panel__row--watch { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.aresto .aresto-watch[aria-pressed="true"] { border-color: var(--aresto-accent); color: var(--aresto-accent); }
.aresto .aresto-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.aresto .aresto-table { width: 100%; border-collapse: collapse; }
.aresto .aresto-table :where(th, td) { padding: 8px 10px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--aresto-border); }
.aresto .aresto-table td { font-variant-numeric: tabular-nums; }
.aresto .aresto-table__actions { text-align: right; white-space: nowrap; }
.aresto .aresto-history__mine { font-weight: 700; }
.aresto .aresto-history__events { margin: 12px 0 0; padding-left: 1.2em; list-style: disc; }
.aresto .aresto-watched { display: grid; gap: 8px; align-content: start; }
.aresto .aresto-watched__remove { justify-self: start; }
.aresto .aresto-badge[class*="aresto-badge--mybid-"], .aresto .aresto-badge[class*="aresto-badge--pay-"] { white-space: normal; }
.aresto .aresto-badge--mybid-leading, .aresto .aresto-badge--mybid-won, .aresto .aresto-badge--pay-paid { background: #e3f5e8; color: #14622a; }
.aresto .aresto-badge--mybid-outbid, .aresto .aresto-badge--mybid-lost, .aresto .aresto-badge--pay-payment_failed, .aresto .aresto-badge--pay-order_cancelled { background: #fde8e8; color: #8a1c1c; }
.aresto .aresto-badge--pay-awaiting_payment, .aresto .aresto-badge--pay-verifying, .aresto .aresto-badge--pay-preparing, .aresto .aresto-badge--mybid-awaiting_result, .aresto .aresto-badge--mybid-awaiting_decision { background: #fff4d6; color: #7a5200; }
@media (max-width: 767px) {
	/* Tabele konta: układ kartowy zgodny z klasą WooCommerce shop_table_responsive (Woodmart ma własny, ten jest zapasowy). */
	.aresto--account .aresto-table.shop_table_responsive thead { display: none; }
	.aresto--account .aresto-table.shop_table_responsive tr { display: block; margin-bottom: 14px; border: 1px solid var(--aresto-border); border-radius: 6px; }
	.aresto--account .aresto-table.shop_table_responsive td { display: flex; justify-content: space-between; gap: 12px; text-align: right; border-bottom: 1px solid var(--aresto-border); }
	.aresto--account .aresto-table.shop_table_responsive td::before { content: attr(data-title); font-weight: 600; text-align: left; }
	.aresto--account .aresto-table.shop_table_responsive td.aresto-table__actions { justify-content: flex-end; }
	.aresto--account .aresto-table.shop_table_responsive td:last-child { border-bottom: 0; }
}
