/*
Theme Name: Mr Plastic Child
Theme URI: https://mrplastic.co.za/
Description: Child theme for the Mr Plastic website.
Author: Firstweb
Template: Divi
Version: 1.0.0
*/

/* ========================================
   PVC COLOUR RANGE DRAWER
======================================== */

/* Tab */

.mp-pvc-tab {
	position: fixed;
	right: 0;
	top: 50%;
	z-index: 9998;
	transform: translateY(-50%);
	width: 48px;
	padding: 18px 0;
	border: 0;
	border-radius: 8px 0 0 8px;
	background: #101c24;
	color: #fff;
	cursor: pointer;
	font: inherit;
	box-shadow: none;
	transition: background-color .2s ease;
}

.mp-pvc-tab span {
	display: inline-block;
	writing-mode: vertical-rl;
	transform: rotate(180deg);
	font-size: 13px;
	font-weight: 600;
	line-height: 1;
	letter-spacing: .03em;
	white-space: nowrap;
}

.mp-pvc-tab:hover,
.mp-pvc-tab:focus-visible {
	background: #0b91d8;
}


/* Overlay */

.mp-pvc-overlay {
	position: fixed;
	inset: 0;
	z-index: 9998;
	background: rgba(16, 28, 36, .48);
	opacity: 0;
	visibility: hidden;
	transition:
		opacity .3s ease,
		visibility .3s ease;
}

.mp-pvc-overlay.is-open {
	opacity: 1;
	visibility: visible;
}


/* Drawer */

.mp-pvc-drawer {
	position: fixed;
	top: 50%;
	right: 0;
	z-index: 9999;
	width: min(520px, 90vw);
	height: auto;
	max-height: 90vh;
	background: #fff;
	border-radius: 10px 0 0 10px;
	transform: translate(100%, -50%);
	visibility: hidden;
	overflow-y: auto;
	transition:
		transform .8s cubic-bezier(.22, 1, .36, 1),
		visibility .8s;
}

.mp-pvc-drawer.is-open {
	transform: translate(0, -50%);
	visibility: visible;
}


/* Header */

.mp-pvc-drawer__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 20px;
	padding: 24px 28px;
	border-bottom: 1px solid #d7e1e7;
}

.mp-pvc-drawer__branding {
	display: flex;
	align-items: center;
	gap: 14px;
	min-width: 0;
}

.mp-pvc-logo {
	display: block;
	width: auto;
	height: 48px;
	object-fit: contain;
	flex: 0 0 auto;
}

.mp-pvc-drawer__header h2 {
	margin: 0;
	padding: 0;
	font-size: 25px;
	line-height: 1.2;
	font-weight: 500;
	color: #101c24;
}


/* Close button */

.mp-pvc-close {
	display: flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 44px;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 0;
	background: transparent;
	color: #101c24;
	font-size: 34px;
	line-height: 1;
	cursor: pointer;
}

.mp-pvc-close:hover {
	color: #0b91d8;
}


/* Content */

.mp-pvc-drawer__content {
	padding: 18px;
}

.mp-pvc-image {
	display: block;
	width: 100%;
	height: auto;
}


/* Prevent page scrolling while drawer is open */

body.mp-pvc-open {
	overflow: hidden;
}


/* ========================================
   MOBILE
======================================== */

@media (max-width: 767px) {

	/* Keep tab vertical but make it more compact */

	.mp-pvc-tab {
		top: 50%;
		width: 40px;
		padding: 14px 0;
		border-radius: 8px 0 0 8px;
	}

	.mp-pvc-tab span {
		display: inline-block;
		writing-mode: vertical-rl;
		transform: rotate(180deg);
		font-size: 11px;
		font-weight: 600;
		line-height: 1;
		letter-spacing: .02em;
		white-space: nowrap;
	}


	/* Drawer */

	.mp-pvc-drawer {
		width: calc(100% - 24px);
	}


	/* Header */

	.mp-pvc-drawer__header {
		padding: 16px 18px;
		gap: 12px;
	}

	.mp-pvc-logo {
		height: 40px;
	}

	.mp-pvc-drawer__branding {
		gap: 10px;
	}

	.mp-pvc-drawer__header h2 {
		font-size: 21px;
	}


	/* Content */

	.mp-pvc-drawer__content {
		padding: 16px;
	}

}


/* ========================================
   ACCESSIBILITY
======================================== */

@media (prefers-reduced-motion: reduce) {

	.mp-pvc-drawer,
	.mp-pvc-overlay {
		transition: none;
	}

}