/**
 * GroSpace Seller Workspace
 * A restrained, institutional dashboard layer for Dokan 5 and legacy views.
 */

body.grospace-seller-workspace {
	--gsd-ink: #12382f;
	--gsd-muted: #60736c;
	--gsd-green-950: #082f27;
	--gsd-green-900: #0b4437;
	--gsd-green-800: #105342;
	--gsd-green-700: #176b50;
	--gsd-green-600: #1f805c;
	--gsd-green-100: #dceee5;
	--gsd-green-50: #edf7f2;
	--gsd-surface: #ffffff;
	--gsd-canvas: #f4f7f5;
	--gsd-border: #d8e3de;
	--gsd-shadow: 0 16px 44px rgba( 12, 63, 50, 0.08 );
	background: var( --gsd-canvas );
	color: var( --gsd-ink );
}

body.grospace-seller-workspace .gsd-ad-hidden,
body.grospace-seller-workspace ins.adsbygoogle,
body.grospace-seller-workspace .google-auto-placed,
body.grospace-seller-workspace iframe[id^="google_ads_iframe"],
body.grospace-seller-workspace iframe[id^="aswift_"] {
	display: none !important;
	width: 0 !important;
	height: 0 !important;
	min-height: 0 !important;
	margin: 0 !important;
	padding: 0 !important;
	overflow: hidden !important;
}

/* Storefront conversion controls should never overlap seller work. */
body.grospace-seller-workspace .gsq-action-dock,
body.grospace-seller-workspace .gsq-floating-actions,
body.grospace-seller-workspace .grospace-floating-wallet,
body.grospace-seller-workspace .grospace-wallet-float,
body.grospace-seller-workspace [class*="floating"][class*="cart"],
body.grospace-seller-workspace [class*="floating"][class*="quote"] {
	display: none !important;
}

/* Shared dashboard canvas. */
body.grospace-seller-workspace .dokan-dashboard-wrap,
body.grospace-seller-workspace #dokan-vendor-dashboard-root {
	box-sizing: border-box;
	width: min( 100% - 32px, 1500px );
	max-width: 1500px;
	margin: 28px auto 64px;
}

body.grospace-seller-workspace .dokan-dashboard-wrap *,
body.grospace-seller-workspace #dokan-vendor-dashboard-root * {
	box-sizing: border-box;
}

body.grospace-seller-workspace .dokan-dashboard-wrap h1,
body.grospace-seller-workspace .dokan-dashboard-wrap h2,
body.grospace-seller-workspace .dokan-dashboard-wrap h3,
body.grospace-seller-workspace .dokan-dashboard-wrap h4,
body.grospace-seller-workspace #dokan-vendor-dashboard-root h1,
body.grospace-seller-workspace #dokan-vendor-dashboard-root h2,
body.grospace-seller-workspace #dokan-vendor-dashboard-root h3,
body.grospace-seller-workspace #dokan-vendor-dashboard-root h4 {
	color: var( --gsd-ink );
	letter-spacing: -0.025em;
	line-height: 1.18;
}

body.grospace-seller-workspace .dokan-dashboard-wrap h1,
body.grospace-seller-workspace #dokan-vendor-dashboard-root h1 {
	font-size: clamp( 2rem, 3.4vw, 2.85rem );
}

body.grospace-seller-workspace .dokan-dashboard-wrap h2,
body.grospace-seller-workspace #dokan-vendor-dashboard-root h2 {
	font-size: clamp( 1.55rem, 2.2vw, 2.1rem );
}

body.grospace-seller-workspace .dokan-dashboard-wrap p,
body.grospace-seller-workspace .dokan-dashboard-wrap label,
body.grospace-seller-workspace #dokan-vendor-dashboard-root p,
body.grospace-seller-workspace #dokan-vendor-dashboard-root label {
	color: var( --gsd-muted );
}

/* Dokan 5 React workspace colours and shell. */
body.grospace-seller-workspace .dokan-frontend-layout,
body.grospace-seller-workspace .dokan-layout {
	--dokan-sidebar-background-color: var( --gsd-green-950 );
	--dokan-sidebar-hover-background-color: var( --gsd-green-600 );
	--dokan-sidebar-text-color: #cce1d8;
	--dokan-sidebar-hover-text-color: #ffffff;
	--dokan-button-border-color: var( --gsd-green-600 );
	--dokan-button-secondary-text-color: var( --gsd-green-700 );
	--dokan-button-tertiary-hover-background-color: var( --gsd-green-50 );
}

body.grospace-seller-workspace .dokan-frontend-layout {
	min-height: clamp( 720px, 78vh, 1100px );
	background: var( --gsd-surface );
	border: 1px solid var( --gsd-border );
	border-radius: 22px;
	box-shadow: var( --gsd-shadow );
	overflow: clip;
}

body.grospace-seller-workspace .dokan-frontend-sidebar {
	background: linear-gradient( 180deg, var( --gsd-green-900 ) 0%, var( --gsd-green-950 ) 100% ) !important;
	border-radius: 18px;
	margin: 12px;
	height: calc( 100% - 24px );
	box-shadow: 0 12px 28px rgba( 3, 35, 28, 0.18 );
}

body.grospace-seller-workspace .dokan-frontend-sidebar .site-icon,
body.grospace-seller-workspace .dokan-frontend-sidebar li a {
	border-radius: 10px;
}

body.grospace-seller-workspace .dokan-frontend-sidebar li a {
	margin: 3px 8px;
	min-height: 48px;
	transition: background-color 160ms ease, transform 160ms ease;
}

body.grospace-seller-workspace .dokan-frontend-sidebar li a:hover {
	transform: translateX( 2px );
}

body.grospace-seller-workspace .dokan-frontend-sidebar li a.active {
	box-shadow: inset 3px 0 0 #b8dfcd;
}

body.grospace-seller-workspace .dokan-frontend-layout-header {
	min-height: 72px;
	background: rgba( 255, 255, 255, 0.96 );
	border-bottom: 1px solid var( --gsd-border );
	box-shadow: none;
}

body.grospace-seller-workspace .dokan-frontend-layout-header .visit-store {
	border: 1px solid var( --gsd-border );
	border-radius: 999px;
	padding: 9px 14px;
	font-weight: 700;
	text-decoration: none;
}

body.grospace-seller-workspace .dokan-layout {
	background: var( --gsd-canvas );
	padding: clamp( 18px, 2.2vw, 34px ) !important;
}

/* Standardise the cards emitted by Dokan's utility classes without relying on
 * a single generated class name. */
body.grospace-seller-workspace .dokan-layout :is( section, article, [class*="card"] ) {
	border-color: var( --gsd-border );
}

body.grospace-seller-workspace .dokan-layout [class*="rounded"] {
	border-radius: 14px;
}

body.grospace-seller-workspace .dokan-layout [class*="shadow"] {
	box-shadow: 0 8px 26px rgba( 12, 63, 50, 0.07 );
}

/* Forms, selects and tables on both React and legacy pages. */
body.grospace-seller-workspace .dokan-dashboard-wrap :is( input:not([type="checkbox"]):not([type="radio"]), select, textarea ),
body.grospace-seller-workspace #dokan-vendor-dashboard-root :is( input:not([type="checkbox"]):not([type="radio"]), select, textarea ) {
	min-height: 46px;
	border: 1px solid #bdcec6 !important;
	border-radius: 10px !important;
	background-color: #ffffff;
	color: var( --gsd-ink );
	box-shadow: none !important;
	transition: border-color 150ms ease, box-shadow 150ms ease;
}

body.grospace-seller-workspace .dokan-dashboard-wrap :is( input, select, textarea ):focus,
body.grospace-seller-workspace #dokan-vendor-dashboard-root :is( input, select, textarea ):focus {
	border-color: var( --gsd-green-600 ) !important;
	box-shadow: 0 0 0 3px rgba( 31, 128, 92, 0.14 ) !important;
	outline: none !important;
}

body.grospace-seller-workspace .dokan-dashboard-wrap :is( button, .button, .dokan-btn ),
body.grospace-seller-workspace #dokan-vendor-dashboard-root :is( button, .button, .dokan-btn ) {
	min-height: 44px;
	border-radius: 10px !important;
	font-weight: 750;
	transition: transform 150ms ease, box-shadow 150ms ease, background-color 150ms ease;
}

body.grospace-seller-workspace .dokan-dashboard-wrap :is( button, .button, .dokan-btn ):hover,
body.grospace-seller-workspace #dokan-vendor-dashboard-root :is( button, .button, .dokan-btn ):hover {
	transform: translateY( -1px );
}

body.grospace-seller-workspace .dokan-dashboard-wrap table,
body.grospace-seller-workspace #dokan-vendor-dashboard-root table {
	width: 100%;
	background: #ffffff;
	border: 1px solid var( --gsd-border );
	border-collapse: separate;
	border-spacing: 0;
	border-radius: 14px;
	overflow: hidden;
}

body.grospace-seller-workspace .dokan-dashboard-wrap :is( th, td ),
body.grospace-seller-workspace #dokan-vendor-dashboard-root :is( th, td ) {
	padding: 14px 16px;
	border-color: #e3ebe7;
	vertical-align: middle;
}

body.grospace-seller-workspace .dokan-dashboard-wrap th,
body.grospace-seller-workspace #dokan-vendor-dashboard-root th {
	background: #f2f7f4;
	color: var( --gsd-ink );
	font-size: 0.78rem;
	font-weight: 800;
	letter-spacing: 0.055em;
	text-transform: uppercase;
}

/* Legacy Dokan dashboard pages, including GroBoost. */
body.grospace-seller-workspace .dokan-dashboard-wrap:has( > .dokan-dash-sidebar ) {
	display: grid;
	grid-template-columns: 230px minmax( 0, 1fr );
	gap: 24px;
	align-items: start;
}

body.grospace-seller-workspace .dokan-dashboard-wrap > .dokan-dash-sidebar {
	position: sticky;
	top: 20px;
	float: none !important;
	width: auto !important;
	background: linear-gradient( 180deg, var( --gsd-green-900 ), var( --gsd-green-950 ) ) !important;
	border-radius: 18px;
	box-shadow: 0 12px 28px rgba( 3, 35, 28, 0.15 );
	overflow: hidden;
}

body.grospace-seller-workspace .dokan-dashboard-wrap > .dokan-dash-sidebar ul.dokan-dashboard-menu {
	background: transparent !important;
	padding: 10px !important;
}

body.grospace-seller-workspace .dokan-dashboard-wrap > .dokan-dash-sidebar ul.dokan-dashboard-menu li {
	border: 0 !important;
	margin: 3px 0 !important;
}

body.grospace-seller-workspace .dokan-dashboard-wrap > .dokan-dash-sidebar ul.dokan-dashboard-menu li a {
	padding: 13px 14px !important;
	border-radius: 10px;
	color: #d7e8e1 !important;
	font-weight: 650;
}

body.grospace-seller-workspace .dokan-dashboard-wrap > .dokan-dash-sidebar ul.dokan-dashboard-menu li:is( .active, :hover ) a {
	background: var( --gsd-green-600 ) !important;
	color: #ffffff !important;
}

body.grospace-seller-workspace .dokan-dashboard-wrap > .dokan-dashboard-content {
	float: none !important;
	width: auto !important;
	min-width: 0;
	padding: 0 !important;
}

body.grospace-seller-workspace .dokan-dashboard-content .dashboard-content-area,
body.grospace-seller-workspace .dokan-dashboard-content article {
	min-width: 0;
}

body.grospace-seller-workspace .dokan-dashboard-content > :is( article, section ),
body.grospace-seller-workspace .dokan-dashboard-content .dokan-settings-content,
body.grospace-seller-workspace .dokan-dashboard-content .dokan-product-listing-area {
	background: var( --gsd-surface );
	border: 1px solid var( --gsd-border );
	border-radius: 18px;
	box-shadow: var( --gsd-shadow );
	padding: clamp( 18px, 2.4vw, 34px );
}

@media ( max-width: 1024px ) {
	body.grospace-seller-workspace .dokan-dashboard-wrap,
	body.grospace-seller-workspace #dokan-vendor-dashboard-root {
		width: min( 100% - 24px, 1500px );
		margin-top: 18px;
	}

	body.grospace-seller-workspace .dokan-dashboard-wrap:has( > .dokan-dash-sidebar ) {
		grid-template-columns: 190px minmax( 0, 1fr );
		gap: 16px;
	}
}

@media ( max-width: 782px ) {
	body.grospace-seller-workspace .dokan-dashboard-wrap,
	body.grospace-seller-workspace #dokan-vendor-dashboard-root {
		width: min( 100% - 20px, 1500px );
		margin: 12px auto 36px;
	}

	body.grospace-seller-workspace .dokan-frontend-layout {
		min-height: 640px;
		border-radius: 16px;
	}

	body.grospace-seller-workspace .dokan-frontend-sidebar {
		margin: 8px;
		border-radius: 14px;
	}

	body.grospace-seller-workspace .dokan-layout {
		padding: 14px !important;
	}

	body.grospace-seller-workspace .dokan-dashboard-wrap:has( > .dokan-dash-sidebar ) {
		display: block;
	}

	body.grospace-seller-workspace .dokan-dashboard-wrap > .dokan-dash-sidebar {
		position: relative;
		top: auto;
		width: 100% !important;
		margin: 0 0 14px !important;
		border-radius: 14px;
	}

	body.grospace-seller-workspace .dokan-dashboard-wrap > .dokan-dash-sidebar ul.dokan-dashboard-menu {
		display: flex;
		gap: 6px;
		overflow-x: auto;
		scroll-snap-type: x proximity;
	}

	body.grospace-seller-workspace .dokan-dashboard-wrap > .dokan-dash-sidebar ul.dokan-dashboard-menu li {
		flex: 0 0 auto;
		scroll-snap-align: start;
	}

	body.grospace-seller-workspace .dokan-dashboard-wrap > .dokan-dash-sidebar ul.dokan-dashboard-menu li a {
		white-space: nowrap;
	}

	body.grospace-seller-workspace .dokan-dashboard-content > :is( article, section ),
	body.grospace-seller-workspace .dokan-dashboard-content .dokan-settings-content,
	body.grospace-seller-workspace .dokan-dashboard-content .dokan-product-listing-area {
		border-radius: 14px;
		padding: 16px;
	}

	body.grospace-seller-workspace .dokan-dashboard-wrap table,
	body.grospace-seller-workspace #dokan-vendor-dashboard-root table {
		display: block;
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
	}

	body.grospace-seller-workspace .dokan-dashboard-wrap :is( th, td ),
	body.grospace-seller-workspace #dokan-vendor-dashboard-root :is( th, td ) {
		padding: 12px;
		white-space: nowrap;
	}
}

@media ( prefers-reduced-motion: reduce ) {
	body.grospace-seller-workspace *,
	body.grospace-seller-workspace *::before,
	body.grospace-seller-workspace *::after {
		scroll-behavior: auto !important;
		transition-duration: 0.01ms !important;
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
	}
}
