/* Responsive styles for mobile and tablet devices */

/* Ensure the base styles are mobile-first */
@media only screen and (max-width: 600px) {
	body {
		font-size: 14px;
	}

	/* Adjust the design tray for smaller screens */
	.design-tray {
		bottom: 0;
		width: 100%;
		overflow-x: auto;
		white-space: nowrap;
	}

	/* Make the image pattern items smaller to fit more on the screen */
	.pattern-item {
		min-width: 30vmin;
		width: 30vmin;
		background-size: 30vmin;
	}

	.pattern-item.selected.active .inner-pattern {
		background-size: 40vmin;
	}

	.pattern-item.selected.active .inner-pattern .overlay, #design-tray .pattern-item .inner-pattern .overlay {
		top: 1pt;
		left: 1pt;
		right: 1pt;
		flex-wrap: wrap;
	}
	.pattern-item .inner-pattern .overlay .button {
		padding: 0.75rem 0.2rem;
		font-size: 0.75rem;
		margin: 0.5rem 0.3rem;
	}
	.pattern-item.favorite .inner-pattern::after {
		font-size: 1rem;
		bottom: 2px;
		left: 2px;
	}

	#design-tray .pattern-item.selected .inner-pattern {
		left: -2vw;
		right: -2vw;
		top: -2vh;
		bottom: -2vh;
	}

	#design-tray .pattern-item.favorite .inner-pattern {
		border: 1px solid #000;
		margin: -1px;
	}

	#design-tray .button .text {
		display: none;
	}

	#design-tray .pattern-item .inner-pattern .overlay .button {
		padding: 0.75rem 0.5rem;
		margin: 0.5rem;
	}

	#design-tray .pattern-item {
		min-width: 75px;
		max-width: 75px;
	}

	/* Adjust the navigation for touch screens */
	.navigation {
		position: fixed;
		bottom: 0;
		left: 0;
		right: 0;
		z-index: 1000;
	}

	/* Hide unnecessary elements to save space */
	.desktop-only {
		display: none;
	}

	#toolbar a {
		padding: 5px 5px;
		margin: 2px 3px;
		font-size: 12px;
		box-shadow: 1px 2px 2px 0px rgba(0, 0, 0, 0.3);
	}

	#design-tray-header h2 {
		display: block;
	}

	.toolbar svg {
		height: 12px;
	}

	
	.pattern-item.selected.active.zoom .inner-pattern .overlay {
		flex-direction: row;
		margin-bottom: 40px;
	}
	.pattern-item.selected.active.zoom .inner-pattern .overlay .button {
		padding: 1rem 0.75rem;
		margin: 0.75rem;
	}
	
}

/* Tablet devices (portrait and landscape) */
@media only screen and (min-width: 601px) and (max-width: 900px) {
	body {
		font-size: 16px;
	}

	/* Adjust the design tray for medium screens */
	.design-tray {
		bottom: 0;
		width: 100%;
		overflow-x: scroll;
	}

	/* Adjust the size of the pattern items */
	.pattern-item {
		min-width: 25vmin;
		width: 25vmin;
		background-size: 25vmin;
	}

	.pattern-item.favorite .inner-pattern {
		border: 0.75rem solid #fff;
		margin: -0.75rem;
	}

	.pattern-item.selected.active {
		background-size: 35vmin;
	}

	.pattern-item.selected.active .inner-pattern .overlay, #design-tray .pattern-item .inner-pattern .overlay {
		top: 1pt;
		left: 1pt;
		right: 1pt;
		flex-wrap: wrap;
	}
	.pattern-item .inner-pattern .overlay .button {
		padding: 1rem 0.75rem;
		font-size: 1rem;
		margin: 0.75rem;
	}
	.pattern-item.favorite .inner-pattern::after {
		font-size: 1.5rem;
		bottom: 3px;
		left: 3px;
	}

	#design-tray .pattern-item.favorite .inner-pattern {
		border: 1px solid #000;
		margin: -1px;
	}

	#design-tray .button .text {
		display: none;
	}

	#design-tray .pattern-item {
		min-width: 100px;
		max-width: 100px;
	}

	
	#design-tray-header h2 {
		display: block;
	}



	/* Adjust navigation for larger touch screens */
	.navigation {
		position: fixed;
		bottom: 0;
		left: 0;
		right: 0;
		z-index: 1000;
	}
}

/* Desktop and larger devices */
@media only screen and (min-width: 901px) and (max-width: 1200px) {
	body {
		font-size: 18px;
	}

	/* Design tray adjustments for larger screens */
	.design-tray {
		position: fixed;
		bottom: 0;
		left: 0;
		right: 0;
		height: 100px;
		overflow-x: scroll;
		background-color: #f8f8f8;
		border-top: 1px solid #e7e7e7;
	}

	/* Larger pattern items for larger screens */
	.pattern-item {
		min-width: 20vw;
		max-width: 400px;
		width: 400px;
		max-height: 400px;
		background-size: 20vw;
	}

	.pattern-item.selected.active {
		background-size: 30vmin;
	}

	/* Show desktop-only elements */
	.desktop-only {
		display: block;
	}

	.pattern-item.selected.active.favorite .inner-pattern {
		left: -20vw;
		right: -20vw;
		top: -20vh;
		bottom: -20vh;
	}

	#design-tray .pattern-item {
		min-width: 125px;
		max-width: 125px;
	}


	#design-tray-header {
		float: right;
		margin: 0 1rem;
	}
	#design-tray-header .toolbar {
		text-align: left;
		display: flex;
		flex-direction: column;
		align-items: stretch;
	}
	#design-tray-header .toolbar a {
		margin: 0.3rem;
	}
}

/* Desktop and larger devices */
@media only screen and (min-width: 1201px) {
	body {
		font-size: 18px;
	}

	/* Design tray adjustments for larger screens */
	.design-tray {
		position: fixed;
		bottom: 0;
		left: 0;
		right: 0;
		height: 100px;
		overflow-x: scroll;
		background-color: #f8f8f8;
		border-top: 1px solid #e7e7e7;
	}

	/* Larger pattern items for larger screens */
	.pattern-item {
		min-width: 12vw;
		width: 400px;
		background-size: 12vw;
	}

	.pattern-item.selected.active {
		background-size: 15vmin;
	}

	/* Show desktop-only elements */
	.desktop-only {
		display: block;
	}

	.pattern-item.selected.active.favorite .inner-pattern {
		left: -20vw;
		right: -20vw;
		top: -20vh;
		bottom: -20vh;
	}

	#design-tray .pattern-item {
		min-width: 150px;
		max-width: 150px;
	}

	#design-tray-header {
		float: right;
		margin: 0 1rem;
	}
	#design-tray-header .toolbar {
		text-align: left;
		display: flex;
		flex-direction: column;
		align-items: stretch;
	}
	#design-tray-header .toolbar a {
		margin: 0.3rem;
	}

}

/* Print styles */
@media print {
	body {
		font-size: 12pt;
	}

	/* Hide elements not necessary for print */
	.design-tray,
	.navigation,
	.desktop-only {
		display: none;
	}

	/* Ensure patterns are displayed in a grid for printing */
	.pattern-grid {
		display: grid;
		grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
		grid-gap: 10px;
	}
}
