/*
 * Minimal Bootstrap 4 contract for high-traffic storefront routes.
 * Covers grid, display/flex utilities, buttons/forms, and modal primitives
 * used by home, catalog/category/search, and product templates.
 */

*,
*::before,
*::after {
	box-sizing: border-box;
}

.container,
.container-fluid {
	margin-left: auto;
	margin-right: auto;
	padding-left: 15px;
	padding-right: 15px;
	width: 100%;
}

@media (min-width: 576px) {
	.container {
		max-width: 540px;
	}
}

@media (min-width: 768px) {
	.container {
		max-width: 720px;
	}
}

@media (min-width: 992px) {
	.container {
		max-width: 960px;
	}
}

@media (min-width: 1200px) {
	.container {
		max-width: 1140px;
	}
}

.row {
	display: flex;
	flex-wrap: wrap;
	margin-left: -15px;
	margin-right: -15px;
}

.no-gutters {
	margin-left: 0;
	margin-right: 0;
}

.no-gutters > .col,
.no-gutters > [class*="col-"] {
	padding-left: 0;
	padding-right: 0;
}

.col,
.col-1,
.col-2,
.col-3,
.col-4,
.col-5,
.col-6,
.col-7,
.col-8,
.col-9,
.col-10,
.col-11,
.col-12,
.col-xs-6,
.col-xs-12,
.col-sm-12,
.col-md-3,
.col-md-4,
.col-md-5,
.col-md-6,
.col-md-7,
.col-md-8,
.col-md-12,
.col-lg-6 {
	min-height: 1px;
	padding-left: 15px;
	padding-right: 15px;
	position: relative;
	width: 100%;
}

.col {
	flex-basis: 0;
	flex-grow: 1;
	max-width: 100%;
}

.col-1 { flex: 0 0 8.333333%; max-width: 8.333333%; }
.col-2 { flex: 0 0 16.666667%; max-width: 16.666667%; }
.col-3 { flex: 0 0 25%; max-width: 25%; }
.col-4 { flex: 0 0 33.333333%; max-width: 33.333333%; }
.col-5 { flex: 0 0 41.666667%; max-width: 41.666667%; }
.col-6,
.col-xs-6 { flex: 0 0 50%; max-width: 50%; }
.col-7 { flex: 0 0 58.333333%; max-width: 58.333333%; }
.col-8 { flex: 0 0 66.666667%; max-width: 66.666667%; }
.col-9 { flex: 0 0 75%; max-width: 75%; }
.col-10 { flex: 0 0 83.333333%; max-width: 83.333333%; }
.col-11 { flex: 0 0 91.666667%; max-width: 91.666667%; }
.col-12,
.col-xs-12 { flex: 0 0 100%; max-width: 100%; }

@media (min-width: 576px) {
	.col-sm-12 { flex: 0 0 100%; max-width: 100%; }
}

@media (min-width: 768px) {
	.col-md-3 { flex: 0 0 25%; max-width: 25%; }
	.col-md-4 { flex: 0 0 33.333333%; max-width: 33.333333%; }
	.col-md-5 { flex: 0 0 41.666667%; max-width: 41.666667%; }
	.col-md-6 { flex: 0 0 50%; max-width: 50%; }
	.col-md-7 { flex: 0 0 58.333333%; max-width: 58.333333%; }
	.col-md-8 { flex: 0 0 66.666667%; max-width: 66.666667%; }
	.col-md-12 { flex: 0 0 100%; max-width: 100%; }
}

@media (min-width: 992px) {
	.col-lg-6 { flex: 0 0 50%; max-width: 50%; }
}

.d-none { display: none !important; }
.d-inline { display: inline !important; }
.d-inline-block { display: inline-block !important; }
.d-block { display: block !important; }
.d-flex { display: flex !important; }
.d-inline-flex { display: inline-flex !important; }

.flex-row { flex-direction: row !important; }
.flex-column { flex-direction: column !important; }
.flex-wrap { flex-wrap: wrap !important; }
.flex-nowrap { flex-wrap: nowrap !important; }
.align-items-start { align-items: flex-start !important; }
.align-items-center { align-items: center !important; }
.align-items-baseline { align-items: baseline !important; }
.justify-content-start { justify-content: flex-start !important; }
.justify-content-center { justify-content: center !important; }
.justify-content-between { justify-content: space-between !important; }

@media (min-width: 768px) {
	.justify-content-md-start { justify-content: flex-start !important; }
}

.w-100 { width: 100% !important; }
.h-100 { height: 100% !important; }
.m-0 { margin: 0 !important; }
.mb-0 { margin-bottom: 0 !important; }
.mb-2,
.my-2 { margin-bottom: .5rem !important; }
.mt-2,
.my-2 { margin-top: .5rem !important; }
.mt-3 { margin-top: 1rem !important; }
.mb-4 { margin-bottom: 1.5rem !important; }
.mt-4 { margin-top: 1.5rem !important; }
.ml-2 { margin-left: .5rem !important; }
.mr-2 { margin-right: .5rem !important; }
.ml-3 { margin-left: 1rem !important; }
.p-0 { padding: 0 !important; }
.pt-1 { padding-top: .25rem !important; }
.pr-1 { padding-right: .25rem !important; }
.pl-1 { padding-left: .25rem !important; }
.text-center { text-align: center !important; }
.text-danger { color: #dc3545 !important; }

.fade {
	transition: opacity .15s linear;
}

.fade:not(.show) {
	opacity: 0;
}

.collapse:not(.show) {
	display: none;
}

.collapsing {
	height: 0;
	overflow: hidden;
	position: relative;
	transition: height .35s ease;
}

.btn {
	background-color: transparent;
	border: 1px solid transparent;
	border-radius: .25rem;
	color: #212529;
	cursor: pointer;
	display: inline-block;
	font-size: 1rem;
	font-weight: 400;
	line-height: 1.5;
	padding: .375rem .75rem;
	text-align: center;
	text-decoration: none;
	transition: color .15s ease-in-out, background-color .15s ease-in-out, border-color .15s ease-in-out, box-shadow .15s ease-in-out;
	user-select: none;
	vertical-align: middle;
}

.btn:hover,
.btn:focus {
	text-decoration: none;
}

.btn:focus {
	box-shadow: 0 0 0 .2rem rgba(0, 123, 255, .25);
	outline: 0;
}

.btn:disabled,
.btn.disabled {
	opacity: .65;
	pointer-events: none;
}

.btn-primary {
	background-color: #007bff;
	border-color: #007bff;
	color: #fff;
}

.btn-secondary {
	background-color: #6c757d;
	border-color: #6c757d;
	color: #fff;
}

.btn-success {
	background-color: #28a745;
	border-color: #28a745;
	color: #fff;
}

.btn-lg {
	border-radius: .3rem;
	font-size: 1.25rem;
	line-height: 1.5;
	padding: .5rem 1rem;
}

.btn-block {
	display: block;
	width: 100%;
}

.btn-block + .btn-block {
	margin-top: .5rem;
}

.btn-group {
	display: inline-flex;
	position: relative;
	vertical-align: middle;
}

.btn-group > .btn {
	flex: 1 1 auto;
	position: relative;
}

.form-group {
	margin-bottom: 1rem;
}

.form-control {
	background-clip: padding-box;
	background-color: #fff;
	border: 1px solid #ced4da;
	border-radius: .25rem;
	color: #495057;
	display: block;
	font-size: 1rem;
	font-weight: 400;
	line-height: 1.5;
	padding: .375rem .75rem;
	transition: border-color .15s ease-in-out, box-shadow .15s ease-in-out;
	width: 100%;
}

.form-control:focus {
	background-color: #fff;
	border-color: #80bdff;
	box-shadow: 0 0 0 .2rem rgba(0, 123, 255, .25);
	color: #495057;
	outline: 0;
}

textarea.form-control {
	height: auto;
}

select.form-control:focus::-ms-value {
	background-color: #fff;
	color: #495057;
}

.form-row {
	display: flex;
	flex-wrap: wrap;
	margin-left: -5px;
	margin-right: -5px;
}

.form-row > .col,
.form-row > [class*="col-"] {
	padding-left: 5px;
	padding-right: 5px;
}

.input-group {
	align-items: stretch;
	display: flex;
	flex-wrap: wrap;
	position: relative;
	width: 100%;
}

.input-group > .form-control {
	flex: 1 1 auto;
	margin-bottom: 0;
	min-width: 0;
	position: relative;
	width: 1%;
}

.modal-open {
	overflow: hidden;
}

.modal-open .modal {
	overflow-x: hidden;
	overflow-y: auto;
}

.modal {
	display: none;
	height: 100%;
	left: 0;
	outline: 0;
	overflow: hidden;
	position: fixed;
	top: 0;
	width: 100%;
	z-index: 1050;
}

.modal-dialog {
	margin: .5rem;
	pointer-events: none;
	position: relative;
	width: auto;
}

.modal.fade .modal-dialog {
	transform: translate(0, -50px);
	transition: transform .3s ease-out;
}

.modal.show .modal-dialog {
	transform: none;
}

.modal-dialog-centered {
	align-items: center;
	display: flex;
	min-height: calc(100% - 1rem);
}

.modal-dialog-centered::before {
	content: "";
	display: block;
	height: calc(100vh - 1rem);
}

.modal-dialog-scrollable {
	display: flex;
	max-height: calc(100% - 1rem);
}

.modal-dialog-scrollable .modal-content {
	max-height: calc(100vh - 1rem);
	overflow: hidden;
}

.modal-dialog-scrollable .modal-body {
	overflow-y: auto;
}

.modal-content {
	background-clip: padding-box;
	background-color: #fff;
	border: 1px solid rgba(0, 0, 0, .2);
	border-radius: .3rem;
	display: flex;
	flex-direction: column;
	outline: 0;
	pointer-events: auto;
	position: relative;
	width: 100%;
}

.modal-backdrop {
	background-color: #000;
	height: 100vh;
	left: 0;
	position: fixed;
	top: 0;
	width: 100vw;
	z-index: 1040;
}

.modal-backdrop.fade {
	opacity: 0;
}

.modal-backdrop.show {
	opacity: .5;
}

.modal-header {
	align-items: flex-start;
	border-bottom: 1px solid #dee2e6;
	border-top-left-radius: .3rem;
	border-top-right-radius: .3rem;
	display: flex;
	justify-content: space-between;
	padding: 1rem;
}

.modal-title {
	line-height: 1.5;
	margin-bottom: 0;
}

.modal-body {
	flex: 1 1 auto;
	padding: 1rem;
	position: relative;
}

.modal-footer {
	align-items: center;
	border-top: 1px solid #dee2e6;
	border-bottom-left-radius: .3rem;
	border-bottom-right-radius: .3rem;
	display: flex;
	flex-wrap: wrap;
	justify-content: flex-end;
	padding: .75rem;
}

.modal-footer > * {
	margin: .25rem;
}

@media (min-width: 576px) {
	.modal-dialog {
		margin: 1.75rem auto;
		max-width: 500px;
	}

	.modal-dialog-centered {
		min-height: calc(100% - 3.5rem);
	}

	.modal-dialog-centered::before {
		height: calc(100vh - 3.5rem);
	}

	.modal-dialog-scrollable {
		max-height: calc(100% - 3.5rem);
	}

	.modal-dialog-scrollable .modal-content {
		max-height: calc(100vh - 3.5rem);
	}
}

@media (min-width: 992px) {
	.modal-lg,
	.modal-xl {
		max-width: 800px;
	}
}

@media (min-width: 1200px) {
	.modal-xl {
		max-width: 1140px;
	}
}
