/*
 * Public site theme.
 * Reuses the design tokens and component classes defined in dashboard.css
 * (--dash-*, .dash-panel, .dash-btn-primary, .dash-badge, .dash-pagination, ...)
 * so the storefront matches the admin dashboard look. This file only adds
 * what the dashboard doesn't already have: the horizontal public nav and a
 * couple of small page-level building blocks.
 */

body.site-body {
	background: var(--dash-bg);
	color: var(--dash-text);
	min-height: 100vh;
}

/* Topbar / public nav */
.site-topbar {
	background: var(--dash-sidebar-bg);
	border-bottom: 1px solid var(--dash-border);
	margin-bottom: 28px;
}

.site-topbar-inner {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 12px 0;
	flex-wrap: wrap;
}

.site-brand {
	display: flex;
	align-items: center;
	gap: 10px;
	text-decoration: none;
	color: var(--dash-text);
	order: 0;
	margin-right: auto;
}

.site-brand-mark {
	width: 36px;
	height: 36px;
	border-radius: 0;
	background: linear-gradient(135deg, var(--dash-primary), var(--dash-pink));
	flex-shrink: 0;
}

.site-brand-name {
	font-weight: 700;
	font-size: 1.05rem;
	letter-spacing: 0.02em;
}

.site-nav {
	display: flex;
	align-items: center;
	gap: 4px;
	flex-wrap: wrap;
	order: 3;
}

.site-nav-link {
	display: inline-flex;
	align-items: center;
	padding: 9px 16px;
	border-radius: 0;
	color: var(--dash-text-muted);
	text-decoration: none;
	font-weight: 500;
	font-size: 0.92rem;
	font-family: inherit;
	line-height: 1.2;
	border: none;
	background: transparent;
	cursor: pointer;
}

.site-nav-link:hover {
	background: var(--dash-bg);
	color: var(--dash-text);
}

.site-nav-link.active {
	background: var(--dash-primary-soft);
	color: var(--dash-primary);
	font-weight: 600;
}

/* Account dropdown (Кабінет / Вийти) — visible at every width */
.site-account,
.site-account-login {
	order: 1;
}

.site-account-btn {
	display: flex;
	align-items: center;
	gap: 6px;
	border: none;
	background: transparent;
	padding: 0;
	color: var(--dash-text-muted);
	cursor: pointer;
}

.site-account-avatar {
	width: 36px;
	height: 36px;
	border-radius: 0;
	background: linear-gradient(135deg, var(--dash-primary), var(--dash-blue));
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: 700;
	font-size: 0.9rem;
	flex-shrink: 0;
}

.site-account-caret {
	width: 14px;
	height: 14px;
}

.site-account-btn.active {
	color: var(--dash-primary);
}

.site-account-menu {
	border: 1px solid var(--dash-border);
	border-radius: 0;
	box-shadow: var(--dash-shadow);
	padding: 4px;
	min-width: 180px;
}

.site-account-menu .site-nav-link {
	width: 100%;
}

.site-account-menu form {
	margin: 0;
}

.site-toggler {
	border: none;
	background: var(--dash-bg);
	border-radius: 0;
	width: 38px;
	height: 38px;
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--dash-text);
	order: 2;
}

.site-toggler svg {
	width: 20px;
	height: 20px;
}

/* Mobile / tablet (< 992px): burger-driven collapse panel */
@media (max-width: 991.98px) {
	.site-nav {
		width: 100%;
		flex-direction: column;
		align-items: stretch;
		gap: 2px;
		margin-top: 10px;
		padding-top: 10px;
		border-top: 1px solid var(--dash-border);
		max-height: calc(100vh - 140px);
		overflow-y: auto;
	}

	.site-nav-link {
		border-radius: 0;
		padding: 12px 14px;
		font-size: 0.95rem;
	}
}

/* Desktop (>= 992px): nav always visible, no burger, single row */
@media (min-width: 992px) {
	.site-topbar-inner {
		flex-wrap: nowrap;
	}

	.site-nav.collapse {
		display: flex !important;
		flex-direction: row;
		flex-wrap: nowrap;
		align-items: center;
		gap: 0;
		order: 1;
		margin-left: auto;
	}

	.site-account {
		order: 2;
	}

	.site-toggler {
		display: none;
	}

	.site-nav-link {
		padding: 8px 10px;
		font-size: 0.84rem;
		white-space: nowrap;
	}

	.site-brand-name {
		font-size: 0.95rem;
	}
}

/* Wide desktop (>= 1200px): roomier spacing, still one row */
@media (min-width: 1200px) {
	.site-topbar-inner {
		gap: 20px;
		padding: 16px 0;
	}

	.site-nav.collapse {
		gap: 2px;
	}

	.site-nav-link {
		padding: 10px 14px;
		font-size: 0.9rem;
	}

	.site-brand-name {
		font-size: 1.05rem;
	}
}

.site-content {
	padding-bottom: 48px;
}

/* Page hero (title above catalog / contact pages) */
.site-hero {
	margin-bottom: 20px;
}

.site-hero h1 {
	font-size: 1.4rem;
	font-weight: 700;
	margin: 0;
}

/* Product card (catalog grid) */
.site-product-card {
	display: flex;
	flex-direction: column;
	height: 100%;
	background: var(--dash-sidebar-bg);
	border-radius: 0;
	box-shadow: var(--dash-shadow);
	padding: 16px;
}

.site-product-card-photo {
	width: 100%;
	aspect-ratio: 1;
	object-fit: contain;
	margin-bottom: 8px;
}

.site-product-card-photo--centered {
	width: auto;
	max-width: 100%;
	align-self: center;
}

/* Hover-to-zoom trigger on the catalog card photo (/ and /pid-zamovlennya) */
.site-product-card-photo-wrap {
	position: relative;
	align-self: center;
	padding: 0;
	border: 0;
	background: none;
	cursor: zoom-in;
}

.site-product-card-photo-magnifier {
	position: absolute;
	right: 8px;
	bottom: 16px;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.9);
	box-shadow: var(--dash-shadow);
	color: var(--dash-text);
	opacity: 0;
	transform: scale(0.85);
	transition: opacity 0.15s ease, transform 0.15s ease;
	pointer-events: none;
}

.site-product-card-photo-magnifier svg {
	width: 18px;
	height: 18px;
}

.site-product-card-photo-wrap:hover .site-product-card-photo-magnifier,
.site-product-card-photo-wrap:focus-visible .site-product-card-photo-magnifier {
	opacity: 1;
	transform: scale(1);
}

/* Hover-lens zoom on the product detail photo (/:slug and /pid-zamovlennya/:slug) —
   same inline circular lens on desktop (mouse hover) and mobile (touch),
   styled by the vendored public/vendor/drift/drift-basic.min.css. */
.site-product-zoom {
	display: inline-block;
	vertical-align: top;
	max-width: 100%;
}

.site-product-zoom-img {
	cursor: zoom-in;
}

.site-product-zoom-hint {
	display: block;
	margin-top: -8px;
	margin-bottom: 8px;
	font-size: 0.75rem;
	color: var(--dash-text-muted);
}

@media (max-width: 991.98px) {
	.site-product-zoom-hint {
		display: none;
	}
}

.site-product-card-title {
	display: block;
	margin-bottom: 6px;
	color: var(--dash-text);
	/* Reserves space for 2 lines so the availability badge below starts at
	   the same height across cards, regardless of whether this title wraps
	   to one line or two. */
	min-height: 3em;
}

.site-product-card-title:hover {
	color: var(--dash-primary);
}

/* Reserves one line even when a product has no free-delivery message, so
   the availability badge below stays level with cards that do have one. */
.site-product-card-delivery {
	min-height: 1.5em;
}

.site-product-card-footer {
	border-top: 1px solid var(--dash-border);
}

/* Inline "well" panel for sub-blocks inside a .dash-panel */
.dash-well {
	background: var(--dash-bg);
	border: 1px solid var(--dash-border);
	border-radius: 0;
	padding: 20px;
}

.dash-well.white {
	background: var(--dash-sidebar-bg);
}

/* Click-to-copy article number */
.copy-article {
	cursor: pointer;
	text-decoration: underline dotted;
}

.copy-article:hover {
	color: var(--dash-primary);
}

/* Larger badge variant (product page availability) */
.dash-badge.lg {
	font-size: 0.92rem;
	padding: 6px 16px;
}

/* Filter panel's small clear (x) buttons — match dash-action-btn.danger hover */
.filters .btn-outline-secondary {
	border-color: var(--dash-border);
	color: var(--dash-text-muted);
}

.filters .btn-outline-secondary:hover {
	background: var(--dash-pink-soft);
	color: var(--dash-pink);
	border-color: var(--dash-pink-soft);
}

/* Modal polish to match dashboard card language */
.modal-content {
	border: none;
	border-radius: 0;
	box-shadow: var(--dash-shadow);
}

.site-empty-state {
	background: var(--dash-amber-soft);
	color: #b9790a;
	border-radius: 0;
	padding: 16px 20px;
	font-weight: 500;
}

.site-footer {
	padding: 24px 0 40px;
	color: var(--dash-text-muted);
	font-size: 0.85rem;
	text-align: center;
}

.btn-reset-filters {
	display: inline-flex;
	align-items: center;
	border-radius: 0;
	padding: 10px 18px;
	font-weight: 600;
	font-size: 0.9rem;
	line-height: 1.5;
}
