/*==----------------------------------------====
    CSS Reset
====----------------------------------------==*/

:root {
	--font-system-ui: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}

*, *::before, *::after {
    box-sizing: border-box;
}

* {
    margin: 0;
    padding: 0;
    font: inherit;
}

html {
    height: 100%;
	&:focus-within {
        scroll-behavior: smooth;
    }
}

body {
    height: 100%;
    text-rendering: optimizeSpeed;
    font-size: 16px;
    line-height: 1.5rem;
	font-family: var(--font-system-ui);
}

h1, h2, h3, h4, h5, h6 {
    text-wrap: balance;
}

h1, h2, h3, h4, h5, h6, p {
    overflow-wrap: break-word;
    hyphens: manual;
}

p {
    text-wrap: pretty;

    main & {
        max-width: 80ch;
    }
}

img, picture, svg, video {
    display: block;
    width: 100%;
    font-style: italic;
    background-repeat: no-repeat;
    background-size: cover;
    shape-margin: 1rem;
    height: auto;
}

ul[class],
ol[class] {
    list-style: none;
}

a:not([class]) {
    text-decoration-skip-ink: auto;
}

@media (prefers-reduced-motion: no-preference) {
    :has(:target) {
        scroll-behavior: smooth;
        scroll-padding-top: 3rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    html:focus-within {
        scroll-behavior: auto;
    }
    
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
:root {
	--theme-primary-bg: #740c50;
	--theme-secondary-bg: #1f1f1f;

	--theme-light-bg: #fff;
	--theme-light-text: #1f1f1f;

	--theme-dark-bg: #1f1f1f;
	--theme-dark-text: #eee;
}

/*==----------------------------------------====
    Layout
====----------------------------------------==*/
.theme-wrapper {
	display: grid;
	grid-template-rows: auto auto 1fr auto;
	height: 100%;
	
	header {
		display: grid;
		grid-template-columns: [fullwidth-start] 1fr [content-start] min(90%, 1400px) [content-end] 1fr [fullwidth-end];
		align-items: start;
		color: var(--theme-light-text);
		height: 110px;
		background-image: url("/images/oir-header.svg");
		background-position: 300px 0;
		background-repeat: no-repeat;
		background-color: var(--theme-light-bg);

		@media (width > 767px) {
			background-position: 100% 0;
		}

		> * {
			grid-column: content;
		}

		.header {
			display: flex;
			align-items: center;
			justify-content: space-between;
			height: 100%;

			.logo {
				display: grid;
				gap: 0.5rem;
				align-content: center;
				height: 100%;

				img {
					width: 300px;
				}

				a {
					color: var(--theme-light-text);
					font-size: 1.125rem;
					font-weight: 500;
					line-height: 1;
					text-decoration: none;

					&:hover {
						text-decoration: underline;
						text-underline-offset: 0.25rem;
					}
				}
			}
			.user-panel {
				display: flex;
				gap: 1.25rem;
				align-items: center;

				.basket-icons {
					position: relative;
					font-size: 1.25rem;
					padding: 0.75rem;
					list-style: none;
					display: flex;
					gap: 0.325rem;
					align-items: center;
					color: inherit;
					text-decoration: none !important;

					&:hover {
						color: #6d3871;
					}

					.basket-count:not(:empty) {
						position: absolute;
						border-radius: 100px;
						display: grid;
						width: 1rem;
						height: 1rem;
						align-items: center;
						justify-content: center;
						color: #fff;
						background-color: #d00;
						font-size: 0.5rem;
						font-weight: 500;
						top: 0;
						right: 0;
						line-height: 1;
					}					
				}


				.shopping-basket {
					position: relative;

					.basket-icons {
						font-size: 1.25rem;
						padding: 0.75rem;
						list-style: none;
						display: flex;
						gap: 0.325rem;
						align-items: center;

						.fa-caret-down {
							font-size: 0.75rem;
							transition: rotate 0.1s ease-out;
						}
						.basket-count {
							position: absolute;
							display: grid;
							width: 1.25rem;
							height: 1.25rem;
							align-items: center;
							justify-content: center;
							color: #fff;
							background-color: #d00;
							font-size: 0.9rem;
							top: 0;
							right: 0;
						}					
					}

					&[open] {
						.basket-icons {
							background-color: #6d3871;
							color: #fff;
							border-radius: 0.25rem 0.25rem 0 0;
							padding-bottom: 0.5rem;
							position: relative;

							.fa-caret-down {
								rotate: 180deg;				   
							}
						}

						.basket-summary {
							width: 250px;
							position: absolute;
							top: 100%;
							right: 0;
							border: 2px solid #6d3871;
							background-color: #fff;
							padding: 0.5rem 1rem;
							z-index: 500;
							box-shadow: 2px 3px 5px rgb(0 0 0 / 15%);
							border-radius: 0.25rem 0 0.25rem;

							ul {
								padding: 0;
								margin: 0;
								display: grid;
								gap: 0.5rem;
								font-size: 0.9rem;

							    > li {
									display: flex;
									justify-content: space-between;
									gap: 1rem;
								}
					        }
							button {
								margin: 0.5rem 0;
								width: 100%;
								background-color: #222;
								color: #fff;

								&:hover {
									background-color: #000;
								}
							}
						}
					}
				}

				.user-options {
					.nav-item:first-child {
						display: none;
					}
				}
			}
		}
	}

	nav.navbar {
		display: grid;
		grid-template-columns: [fullwidth-start] 1fr [content-start] min(90%, 1400px) [content-end] 1fr [fullwidth-end];
		align-items: start;

		background-color: var(--theme-primary-bg);
		padding: unset;

		.nav-container {
			grid-column: content;
		}		               }

		.navbar-collapse {
			display: flex;
			justify-content: space-between;
		}

		.navbar-nav {
			display: flex;
			flex-wrap: wrap;
			margin: unset;

			.nav-item {
				> a,
				.dropdown > a,
				.dropdown > button {
					color: var(--theme-dark-text);
					display: flex;
					align-items: center;
					gap: 0.25rem;
					padding: 0.75rem 1.25rem;
					text-decoration: none;
					transition: all 0.1s ease;

					&:hover {
						background-color: var(--theme-dark-bg);
						color: var(--theme-dark-text);
					}
				}
			}

			.dropdown {
				.dropdown-submenu {
					a {
						display: flex;
						align-items: center;
						gap: 0.25rem;

						&:hover {
							background-color: #e9ecef;
						}
					}
					.dropdown-toggle::after {
						top: unset;
					}
				}
				.dropdown-item {
					display: flex;
					align-items: center;
					gap: 0.25rem;
				}
			}
		}
	}

	main {
		display: grid;
		grid-template-columns: [fullwidth-start] 1fr [content-start] min(90%, 1400px) [content-end] 1fr [fullwidth-end];
		align-content: start;
		padding: 0 0 3rem 0;

		> * {
			grid-column: content;
			
			&:not(.smart-container.shade) {
				margin-top: 1.25rem !important;
			}
		}

		.btn-primary {
			background-color: var(--theme-secondary-bg);
			border: 2px solid rgb(0 0 0 / 15%);

			&:hover {				
				background-color: #3e3e3e;
				text-shadow: 1px 2px 3px rgb(0 0 0 / 15%);
			}
         }
		 
		.btn-outline-primary {
			border: 2px solid var(--theme-secondary-bg);
			color: var(--theme-secondary-bg);
			background-color: #fff;

			&:hover {
				background-color: var(--theme-secondary-bg);
				color: #fff;
			}
		}

		.btn-secondary {
			background-color: var(--theme-primary-bg);
			border: 2px solid rgb(0 0 0 / 15%);

			&:hover {
				border-color: var(--theme-primary-bg);
				color: var(--theme-primary-bg);
				background-color: #fff;
			}
         }
	}

	footer {
		background-color: var(--theme-dark-bg);
		color: var(--theme-dark-text);
		padding: 0.75rem 1rem;
		font-size: 0.8125rem;
		
		.container {
			display: flex;
			justify-content: center;
			align-items: center;
			gap: 1.5rem;
		}
	}
}

h1 {
	font-size: 2rem;
	margin-bottom: 0.75em;
}

.dashboard-cards {
	display: grid;
	gap: 1.25rem;
	grid-template-columns: repeat(4, 1fr);
	margin-top: 0;

	> div {
		min-height: 200px;

		a {
			background-color: #fff;
			box-shadow: inset 0 0 0 1px #740c5030;			
			display: grid;
			grid-template-columns: 1fr, 3rem;
			gap: 1rem;
			text-decoration: none;
			text-align: center;
			height: 100%;
			transition: all 0.15s ease;
		    border-radius: 0.5rem;

			i {
				display: grid;
				align-items: end;
				font-size: 3rem;
				transition: color 0.1s ease;
			}

			span {
				display: grid;
				align-items: start;
				font-size: 1.25rem;
			}

			&:hover {
				box-shadow: inset 0 0 0 5px #740c50, 0 3px 5px rgb(0 0 0 / 15%);

				i {
					  color: #db7a86;
				}
				
				span {
					text-decoration: underline;
					text-decoration-thickness: 2px;
					text-underline-offset: 0.25rem;
				}
			}
		}
	}
}

.smart-container {
	display: grid;
	grid-template-columns: subgrid;
	grid-column: fullwidth;
	
	&:not(:empty) {
		padding: 2rem 0;
	}

	> * {		
		grid-column: content;
	}

	> .fullwidth {
		grid-column: fullwidth;
	}

	&.shade {
		/*background-image: linear-gradient(to right, #ffecee 70%, #d46674aa 85%, #825398aa);*/
		background-color: #ffecee;
		box-shadow: 0 -1px 0 0 #740c5030, 0 1px 0 0 #740c5025;
	}

	h1 {
		font-size: 2rem;
		margin-bottom: 0.75em;
	}
}

.entry-row {
	display: flex;
	align-items: center;

	h1,
	.breadcrumb {
		margin: 0;
	}

	.col-auto:has(.content-header-title) {
		padding-right: 2rem;
	}
}

.product-listing {
	margin: 0;
	padding: 0;
	list-style-type: none;
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr));
    grid-auto-rows: auto auto auto auto;
	gap: 1.5rem;
	margin-bottom: 2rem;

	.product-item {
		display: grid;
		grid-row: span 4;
		grid-template-rows: subgrid;
		border: 1px solid #e6e6e6;
		border-radius: 0.25rem;
		overflow: hidden;
		gap: 0.5rem;
		transition: border 0.1s ease;

		.image {
			background-color: #f6f6f6;
			box-shadow: inset 0 -1px 0 0 #e6e6e6;
			min-height: 175px;
			padding: 0;
			margin-bottom: 0;
			overflow: hidden;

			img {
				aspect-ratio: 4 / 2.5;
				object-fit: contain;
				width: 100%;
				height: 100%;
				transition: all 0.5s ease-in;
			}

			&.missing {
				display: grid;
				align-items: center;
				justify-content: center;
				
				img {
					width: 75px;
					height: unset;
					aspect-ratio: unset;
					opacity: 0.15;
				}
			}
		}

		.title {
			color: var(--theme-primary-bg);
			padding: 0 1rem;
			font-weight: 500;
			line-height: 1.4;
			text-decoration: none;
			text-wrap: pretty;
		}

		.inline {
			display: flex;
			flex-wrap: wrap;
			gap: 0.125rem;
			align-items: center;
			justify-content: space-between;
			font-size: 0.9rem;
			line-height: 1.1;
			padding: 0 1rem;
		}

		.category {
			color: dodgerblue;
			text-transform: uppercase;
		}
		.count:not(:empty) {
			color: #666;
			white-space: nowrap;
			border: 1px solid #e6e6e6;
			background-color: #f6f6f6;
			border-radius: 0.25rem;
			padding: 0.125rem 0.5rem;
		}
		p {
			margin-bottom: 0;
		}
		
		&:hover {
			border-color: #969696;
			box-shadow: 2px 3px 5px rgb(0 0 0 / 15%);

			.image:not(.missing) {
				img {
					scale: 1.1;
				}
			}

			.title {
				text-decoration: underline;
				text-underline-offset: 2px;
			}			
		}

		.tile-button {
			background-color: var(--theme-primary-bg);
			color: #fff;
			margin: 0.25rem 1rem 1rem 1rem;
		}
	}
}

.product-listing-compact {
	display: grid;
	gap: 0.5rem;
	padding: 0;

	.product-item {
		display: flex;
		align-items: center;
		gap: 1rem;
		border: 1px solid #e6e6e6;
		border-radius: 0.25rem;
		padding: 0.5rem;

		.image {
			overflow: hidden;
		}

		.inline {
			display: flex;
			gap: 1rem;
			align-items: center;
		}

		.category {
			color: dodgerblue;
			font-size: 0.9rem;
		}

		.count:not(:empty) {
			color: #666;
			font-size: 0.9rem;
			white-space: nowrap;
			border: 1px solid #e6e6e6;
			background-color: #f6f6f6;
			border-radius: 0.25rem;
			padding: 0.125rem 0.5rem;
		}

		.tile-button {
			background-color: var(--theme-primary-bg);
			color: #fff;
			margin-left: auto;
			white-space: nowrap;
		}
	}
}

.product-view {
	display: grid;
	gap: 2rem;
	align-content: start;
	
	@media (width > 767px) {
		grid-template-columns: 2fr 3fr;
	}

	h2 {
		font-size: 1.5rem;
		margin-bottom: 1em;
	}

	.product-image {
		background-color: #f6f6f6;
		box-shadow: inset 0 -1px 0 0 #e6e6e6;
		min-height: 175px;
		padding: 0;
		margin-bottom: 0;
		overflow: hidden;
		aspect-ratio: 4 / 2.5;

		img {
			object-fit: contain;
			width: 100%;
			height: 100%;
			transition: all 0.5s ease-in;
		}

		&.missing {
			display: grid;
			align-items: center;
			justify-content: center;
				
			img {
				width: 75px;
				height: unset;
				aspect-ratio: unset;
				opacity: 0.15;
			}
		}
	}

	.product-description {
		list-style-type: none;
		margin: 0;
		padding: 0;
		display: grid;
		gap: 0.5rem;

		li {			   
			display: grid;
			grid-template-columns: 2fr 10fr;
			gap: 0 1rem;

			label {
				font-weight: 500;
			}
		}
	}

	.product-quantity {
		input {
			min-width: 75px;
			width: 75px;
		}
	}

	p,
	label {
		margin-bottom: 0;
	}
}

.product-layout {
	display: flex;
	margin-left: auto;
	margin-bottom: 0;

	button {
		aspect-ratio: 1;
		width: 2.5rem;
		font-size: 1.25rem;
		padding: 0.25rem;
		background-color: #f6f6f6;
		color: #999;

		&.active {
			color: #fff;
			background-color: var(--theme-secondary-bg);
			pointer-events: none;
		}
	}
}

.checkout {
	--table-padding: 0.75rem;
	padding: 2rem 3rem;

	.product-list {
		margin-bottom: 3rem;

		.no-items {
			text-align: center;
			padding: 3rem;
		}


		thead {
			tr {
				border-bottom: 2px solid #414141;

				th {
					font-weight: 500;
					padding: var(--table-padding);
				}
			}
		}
		tbody {
			tr {
				border-bottom: 1px solid #e1e1e1;

				&:hover {
					background-color: #f6f6f6;
				}
			
				td {
					padding: var(--table-padding);
				}
			}
		}
				 
		.action {
			width: 5%;
		}
		.qty {
			width: 5%;
		}

		.cart-remove {
			color: #d00;
			font-size: 1.25rem;
			cursor: pointer;
		}

		tbody td:nth-child(3) {
			text-align: center;
		}

		input[type="number"] {
			min-width: 50px !important;
			width: 100% !important;
			padding: 0.25rem;
		}
	}

	.checkout-options {
		display: grid;
		gap: 1rem;

		label {
		  display: block;
		  font-weight: 500;
		}
	
		input[type="text"] {
			width: 30rem;
			padding: 0.5rem;
		}
	}
}



.stocktake,
.product-admin,
.product-listing-compact {
	.product-image {
		aspect-ratio: 1;
		width: 4rem;
		height: 4rem;
		object-fit: contain;

		&.missing {
			opacity: 0.25;
		}
	}
}

.image-actions {
	display: flex;
	gap: 0.5rem;
	align-items: center;
}
.table-primary {
	--bs-table-bg: #f1f1f1;
	border-color: #d1d1d1;
}

.card {
	box-shadow: 1px 2px 2px rgba(0 0 0 / 7.5%);
}