/**
 * DAF Marketplace — Header Offcanvas
 * Location: /wp-content/plugins/daf-marketplace/assets/css/header/header-offcanvas.css
 *
 * Purpose:
 * - Style the premium mobile/tablet off-canvas menu.
 * - Keep off-canvas styling isolated from header-mobile.css.
 * - Match the DAF Marketplace mobile drawer design language.
 */

.daf-mp-lock-scroll {
	overflow: hidden !important;
}

.daf-mp-offcanvas[hidden] {
	display: none !important;
}

.daf-mp-offcanvas {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: block;
	pointer-events: none;
}

.daf-mp-offcanvas__overlay {
	position: fixed;
	inset: 0;
	z-index: 1;
	background: rgba(15, 23, 42, 0.58);
	backdrop-filter: blur(4px);
	opacity: 0;
	pointer-events: auto;
	transition: opacity 0.24s ease;
}

.daf-mp-mobile-open .daf-mp-offcanvas__overlay {
	opacity: 1;
}

.daf-mp-offcanvas__dialog {
	position: fixed;
	top: 0;
	left: 0;
	z-index: 2;
	width: min(86vw, 380px);
	height: 100vh;
	max-width: none;
	display: flex;
	flex-direction: column;
	background: #ffffff;
	border-radius: 0 22px 22px 0;
	box-shadow: 24px 0 70px rgba(15, 23, 42, 0.22);
	transform: translateX(-104%);
	transition: transform 0.28s cubic-bezier(0.2, 0.78, 0.28, 1);
	overflow: hidden;
	pointer-events: auto;
}

.daf-mp-mobile-open .daf-mp-offcanvas__dialog {
	transform: translateX(0);
}

.daf-mp-offcanvas__header {
	flex: 0 0 auto;
	min-height: 72px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 14px;
	padding: 16px 18px;
	border-bottom: 1px solid #e8eef5;
	background: #ffffff;
}

.daf-mp-offcanvas__branding {
	min-width: 0;
	display: flex;
	align-items: center;
}

.daf-mp-offcanvas__branding .daf-mp-header-logo,
.daf-mp-offcanvas__branding .daf-mp-header-logo a {
	display: inline-flex;
	align-items: center;
	min-width: 0;
}

.daf-mp-offcanvas__branding .daf-mp-header-logo__image {
	max-height: 34px;
	width: auto;
}

.daf-mp-offcanvas__branding .daf-mp-header-logo__text {
	color: #0f172a;
	font-size: 21px;
	font-weight: 850;
	letter-spacing: -0.035em;
	line-height: 1;
	white-space: nowrap;
}

.daf-mp-offcanvas__close {
	flex: 0 0 auto;
	width: 40px;
	height: 40px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border: 1px solid #e2e8f0;
	border-radius: 13px;
	background: #ffffff;
	color: #0f172a;
	cursor: pointer;
	transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.daf-mp-offcanvas__close:hover {
	background: #f8fafc;
	border-color: #cbd5e1;
	color: #7fb238;
	transform: translateY(-1px);
}

.daf-mp-offcanvas__close svg {
	width: 18px;
	height: 18px;
	display: block;
	fill: currentColor;
}

.daf-mp-offcanvas__content {
	flex: 1 1 auto;
	min-height: 0;
	padding: 16px;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	background:
		linear-gradient(180deg, rgba(127, 178, 56, 0.06) 0%, rgba(255, 255, 255, 0) 230px),
		#ffffff;
}

.daf-mp-offcanvas__content::-webkit-scrollbar {
	width: 6px;
}

.daf-mp-offcanvas__content::-webkit-scrollbar-track {
	background: transparent;
}

.daf-mp-offcanvas__content::-webkit-scrollbar-thumb {
	background: rgba(148, 163, 184, 0.5);
	border-radius: 999px;
}

.daf-mp-offcanvas__profile {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 12px;
	border: 1px solid #e8eef5;
	border-radius: 18px;
	background: #f8fbf5;
	box-shadow: 0 12px 28px rgba(15, 23, 42, 0.06);
}

.daf-mp-offcanvas__avatar {
	position: relative;
	flex: 0 0 auto;
	width: 52px;
	height: 52px;
	border-radius: 17px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: #ffffff;
	border: 1px solid rgba(127, 178, 56, 0.24);
	overflow: visible;
	box-shadow: 0 10px 22px rgba(127, 178, 56, 0.12);
}

.daf-mp-offcanvas__avatar img {
	width: 100%;
	height: 100%;
	border-radius: 16px;
	object-fit: cover;
	display: block;
}

.daf-mp-offcanvas__avatar span {
	font-size: 18px;
	font-weight: 850;
	color: #7fb238;
}

.daf-mp-offcanvas__avatar i {
	position: absolute;
	right: -2px;
	bottom: -2px;
	width: 13px;
	height: 13px;
	border: 2px solid #ffffff;
	border-radius: 50%;
	background: #7fb238;
	box-shadow: 0 0 0 3px rgba(127, 178, 56, 0.18);
}

.daf-mp-offcanvas__profile-meta {
	min-width: 0;
	flex: 1 1 auto;
}

.daf-mp-offcanvas__profile-row {
	display: flex;
	align-items: center;
	gap: 8px;
	min-width: 0;
	margin-bottom: 3px;
}

.daf-mp-offcanvas__profile-row strong {
	min-width: 0;
	color: #0f172a;
	font-size: 15px;
	font-weight: 850;
	line-height: 1.2;
	letter-spacing: -0.02em;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.daf-mp-offcanvas__profile-row span {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	height: 20px;
	padding: 0 8px;
	border-radius: 999px;
	background: #7fb238;
	color: #ffffff;
	font-size: 10px;
	font-weight: 800;
	line-height: 1;
	white-space: nowrap;
}

.daf-mp-offcanvas__profile-meta p {
	margin: 0;
	color: #64748b;
	font-size: 12px;
	font-weight: 600;
	line-height: 1.35;
}

.daf-mp-offcanvas__stats {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 7px;
	margin: 12px 0 14px;
}

.daf-mp-offcanvas__stat {
	min-width: 0;
	min-height: 58px;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 8px 4px;
	border: 1px solid #e8eef5;
	border-radius: 15px;
	background: #ffffff;
	box-shadow: 0 8px 22px rgba(15, 23, 42, 0.045);
}

.daf-mp-offcanvas__stat strong {
	color: #0f172a;
	font-size: 16px;
	font-weight: 850;
	line-height: 1;
	letter-spacing: -0.02em;
}

.daf-mp-offcanvas__stat span {
	margin-top: 5px;
	color: #64748b;
	font-size: 10px;
	font-weight: 750;
	line-height: 1;
	white-space: nowrap;
}

.daf-mp-offcanvas__section {
	display: flex;
	flex-direction: column;
	gap: 6px;
	padding: 8px 0;
	border-top: 1px solid #eef2f7;
}

.daf-mp-offcanvas__section--main {
	border-top: 0;
	padding-top: 0;
}

.daf-mp-offcanvas__section-title {
	margin: 10px 0 6px;
	color: #94a3b8;
	font-size: 10px;
	font-weight: 850;
	line-height: 1;
	letter-spacing: 0.11em;
	text-transform: uppercase;
}

.daf-mp-offcanvas__link {
	min-height: 44px;
	display: grid;
	grid-template-columns: 36px minmax(0, 1fr) 18px;
	align-items: center;
	gap: 10px;
	padding: 7px 9px 7px 7px;
	border-radius: 14px;
	color: #0f172a;
	text-decoration: none;
	background: transparent;
	transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.daf-mp-offcanvas__link:hover,
.daf-mp-offcanvas__link:focus {
	background: #f5faef;
	color: #111827;
	text-decoration: none;
	transform: translateX(2px);
	outline: none;
}

.daf-mp-offcanvas__link-icon {
	width: 36px;
	height: 36px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 12px;
	background: rgba(127, 178, 56, 0.11);
	color: #7fb238;
}

.daf-mp-offcanvas__link-icon svg {
	width: 17px;
	height: 17px;
	display: block;
	fill: currentColor;
}

.daf-mp-offcanvas__link-label {
	min-width: 0;
	color: inherit;
	font-size: 14px;
	font-weight: 750;
	line-height: 1.2;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.daf-mp-offcanvas__link-chevron {
	width: 18px;
	height: 18px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	color: #94a3b8;
}

.daf-mp-offcanvas__link-chevron svg {
	width: 16px;
	height: 16px;
	display: block;
	fill: currentColor;
}

.daf-mp-offcanvas__cta {
	display: flex;
	flex-direction: column;
	gap: 9px;
	padding: 14px 0 2px;
	border-top: 1px solid #eef2f7;
	margin-top: 8px;
}

.daf-mp-offcanvas__cta-primary,
.daf-mp-offcanvas__cta-secondary {
	min-height: 46px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 9px;
	border-radius: 15px;
	font-size: 14px;
	font-weight: 850;
	line-height: 1;
	text-decoration: none;
	transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.daf-mp-offcanvas__cta-primary {
	background: #7fb238;
	color: #ffffff;
	box-shadow: 0 14px 26px rgba(127, 178, 56, 0.24);
}

.daf-mp-offcanvas__cta-primary:hover,
.daf-mp-offcanvas__cta-primary:focus {
	background: #72a332;
	color: #ffffff;
	transform: translateY(-1px);
	box-shadow: 0 16px 30px rgba(127, 178, 56, 0.3);
	text-decoration: none;
	outline: none;
}

.daf-mp-offcanvas__cta-secondary {
	border: 1px solid rgba(127, 178, 56, 0.35);
	background: #ffffff;
	color: #6f9f2f;
}

.daf-mp-offcanvas__cta-secondary:hover,
.daf-mp-offcanvas__cta-secondary:focus {
	background: #f5faef;
	border-color: rgba(127, 178, 56, 0.56);
	color: #5f8e25;
	transform: translateY(-1px);
	text-decoration: none;
	outline: none;
}

.daf-mp-offcanvas__cta-primary span,
.daf-mp-offcanvas__cta-secondary span {
	width: 17px;
	height: 17px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.daf-mp-offcanvas__cta-primary svg,
.daf-mp-offcanvas__cta-secondary svg {
	width: 17px;
	height: 17px;
	display: block;
	fill: currentColor;
}

/*
 * Compatibility with old mobile panel class names.
 * The new off-canvas keeps these classes in markup so header.js continues
 * to control open/close without a second interaction system.
 */
.daf-mp-mobile-panel__dialog.daf-mp-offcanvas__dialog {
	max-width: none;
	background: #ffffff;
}

@media (min-width: 768px) and (max-width: 1199px) {
	.daf-mp-offcanvas__dialog {
		width: min(78vw, 410px);
	}

	.daf-mp-offcanvas__header {
		min-height: 76px;
		padding: 17px 20px;
	}

	.daf-mp-offcanvas__content {
		padding: 18px;
	}
}

@media (max-width: 767px) {
	.daf-mp-offcanvas__dialog {
		width: min(88vw, 360px);
		border-radius: 0 20px 20px 0;
	}

	.daf-mp-offcanvas__header {
		min-height: 66px;
		padding: 13px 15px;
	}

	.daf-mp-offcanvas__content {
		padding: 14px;
	}

	.daf-mp-offcanvas__profile {
		padding: 11px;
		border-radius: 17px;
	}

	.daf-mp-offcanvas__avatar {
		width: 48px;
		height: 48px;
		border-radius: 16px;
	}

	.daf-mp-offcanvas__avatar img {
		border-radius: 15px;
	}

	.daf-mp-offcanvas__stats {
		gap: 6px;
	}

	.daf-mp-offcanvas__stat {
		min-height: 55px;
		border-radius: 14px;
	}

	.daf-mp-offcanvas__stat strong {
		font-size: 15px;
	}

	.daf-mp-offcanvas__stat span {
		font-size: 9.5px;
	}

	.daf-mp-offcanvas__link {
		min-height: 43px;
		grid-template-columns: 34px minmax(0, 1fr) 18px;
		gap: 9px;
	}

	.daf-mp-offcanvas__link-icon {
		width: 34px;
		height: 34px;
	}
}

@media (max-width: 389px) {
	.daf-mp-offcanvas__dialog {
		width: min(92vw, 330px);
	}

	.daf-mp-offcanvas__content {
		padding: 12px;
	}

	.daf-mp-offcanvas__profile-row {
		align-items: flex-start;
		flex-direction: column;
		gap: 5px;
	}

	.daf-mp-offcanvas__stats {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.daf-mp-offcanvas__stat {
		min-height: 52px;
	}
}