@import url('https://fonts.googleapis.com/css2?family=Dancing+Script&display=swap');

#sort-section {
	margin: 0 auto;
	width: fit-content;
	display: flex;
	flex-direction: column;
	align-items: center;
	margin-bottom: 15px;
}

#sort-section p {
	width: fit-content;
	color: var(--gray);
	margin-bottom: 5px;
}

#sort-buttons {
	display: flex;
	justify-content: center;
	flex-wrap: wrap;
	gap: 5px;
}

#sort-buttons button {
	background-color: var(--darkgray);
	color: var(--gray);
	border: none;
	border-radius: 20px;
	padding: 4px 8px;
	cursor: pointer;
}

#patches {
	width: 80%;
  	margin: 0 auto;
	display: flex;
	flex-direction: column;
}

#sort-by {
	width: fit-content;
	margin: 0 auto;
	margin-bottom: 15px;
	display: flex;
	flex-direction: row;
	align-items: center;
	gap: 5px;
	color: var(--gray);
}

#sort-by select {
	padding: 4px 4px;
	background-color: var(--backdrop);
	border: 1px solid var(--gray);
	color: var(--gray);
	border-radius: 5px;
}

.available-patches, .designed-patches, .sold-out-patches {
  	margin: 0 auto;
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 20px;
	flex: 0 0 0.25;
}

.available-patches h1, .designed-patches h1, .sold-out-patches h1 {
  	font-size: 18px;
  	text-align: center;
  	margin-top: 20px;
  	color: white;
  	width: 100%;
}

.available-patches > div {
	border-top-left-radius: var(--border-radius);
	border-top-right-radius: var(--border-radius);
	border-bottom-left-radius: var(--border-radius);
	border-bottom-right-radius: var(--border-radius);
	margin-bottom: 10px;
}

.patch-name {
	font-size: 16px;
	font-weight: bold;
	text-transform: uppercase;
	font-style: italic;
	max-width: 210px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.patch-cost {
	text-transform: uppercase;
}

.patch-title {
  	margin: 0 auto;
	margin-top: 6px;
	margin-bottom: 2px;
	gap: 5px;
	display: flex;
	flex-direction: column;
  	align-items: center;
	color: white;
}

.patch-box {
	position: relative;
	display: inline-block;
	flex-wrap: wrap;
	border-top-left-radius: var(--border-radius);
	border-top-right-radius: var(--border-radius);
	cursor: pointer;
}

.new-patch-tag {
	color: white;
}

.new-patch-tag {
	position: absolute;
	top: -10px;
	right: -10px;
}

.new-patch-tag-content {
	width: 64px;
	height: 64px;
	position: relative;
	display: flex;
	justify-content: center;
	align-items: center;
}

.new-patch-tag-content p {
	z-index: 12;
	text-transform: uppercase;
	font-weight: bold;
	letter-spacing: 0.02rem;
}

.new-patch-tag-content img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	position: absolute;
	z-index: 11;
}

.img-container {
	width: 210px;
	height: 210px;
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: calc(var(--border-radius) / 1.5);
	overflow: hidden;
}

.img-container .patch-img {
	width: 100%;
	height: 100%;
	transition: transform 0.2s ease;
}

.blur-load::before {
	content: "";
	position: absolute;
	inset: 0;
	animation: pulse 2.5s infinite;
}

.blur-load.loaded::before {
	content: none;
}

@keyframes pulse {
	0% {
		background: rgb(255 255 255 / 0);
	}
	50% {
		background: rgb(255 255 255 / 0.2);  
	}
	100% {
		background: rgb(255 255 255 / 0);
	}
}

.blur-load {
	position: relative;
	background-size: cover;
	background-position: center;
}

.blur-load.loaded > img {
	opacity:  1;
}

.blur-load > img {
	opacity: 0;
	transition: opacity 0.15s ease-in-out;
}

.patch-box:hover .patch-img {
	transform: scale(1.2);
}

.rating-wrapper {
	/* position: absolute;
	top: 0;
	left: 0; */
	width: fit-content;
	margin: 0 auto;
	margin-block: 3px;
	display: flex;
	gap: 5px;
	justify-content: center;
	align-items: center;
	font-size: 12px;
	color: white;
	/* background: rgb(101 113 126 / 0.3); */
	backdrop-filter: blur(4px);
	/* border-radius: 100vw; */
	padding: 4px 8px;
}

.review-stars {
	display: flex;
	gap: 2px;
}

.review-star-img {
	width: 12px;
	height: 12px;
}

.review-star-img img {
	width: 100%;
	height: 100%;
}

.coming-soon-label {
	position: absolute;
  	bottom: 3px;
  	right: 0;
	text-align: right;
	padding: 4px 8px;
	font-size: 14px;
	z-index: 4;
	color: white;
	border-radius: var(--border-radius);
	background: var(--warning-gradient);
}

.pack-deal, .low-in-stock, .new-patch {
	position: absolute;
  	bottom: 0;
  	right: 0;
	text-align: right;
	padding: 4px 8px;
	font-size: 14px;
	z-index: 4;
	color: white;
	border-radius: var(--border-radius);
	background-color: rgb(101 113 126 / 0.4);
}

#in-production {
	background-color: var(--teal);
}
.sold-out {
  	background-color: var(--warning-red);
}

.item-info {
	display: flex;
	flex-direction: row;
	align-items: center;
	justify-content: space-between;
  	padding-bottom: 5px;
}

#canvas {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	backdrop-filter: blur(12px);
	filter: brightness(40%);
	z-index: 5;
}

#display-image {
	position: fixed;
	left: 50%;
	top: 50%;
	width: 600px;
	transform: translate(-50%, -50%);
	z-index: 6;
}

.buy-patch-button {
	width: 100%;
	height: 30px;
	display: block;
	margin: 0 auto;
	margin-top: 5px;
	border: 0px solid transparent;
	border-radius: var(--border-radius);
	background: var(--button-gradient);
	color: white;
	cursor: pointer;
	text-transform: uppercase;
	font-size: 16px;
	font-weight: bold;
	padding-bottom: 2px;
}

.buy-patch-button:hover {
	border-width: 1px;
	border-color: white;
	color: white;
	background: var(--backdrop);
}

.sold-out-button {
	width: 85%;
	height: 30px;
	display: block;
	margin: 0 auto;
	margin-top: 5px;
	border-radius: var(--border-radius);
	background-color: var(--backdrop);
	color: rgb(173, 173, 173);
	border: 0;
	cursor: pointer;
	text-transform: uppercase;
	font-size: 16px;
	font-weight: bold;
	padding-bottom: 2px;
}

.buy-patch-button.flow-out:hover {
	letter-spacing: 0.05rem;
}

.buy-patch-button.already-added {
	border: 1px solid var(--greyed-out);
	background: none;
	background-color: var(--backdrop);
	color: white;
	padding-bottom: 4px;
}

.buy-patch-button.already-added.flow-out:hover {
	color: white;
}

#patch-form {
	margin-bottom: -1px;
	overflow: hidden;
	cursor: pointer;
	border-radius: var(--border-radius);
}

.old-price {
	color: gray;
}

@media screen and (max-width: 1100px) {
	.buy-patch-button.flow-out:not(.already-added):hover {
		background: var(--button-gradient);
		border: 0px solid transparent;
	}
}

@media screen and (max-width: 1000px) {
	.patch-box:hover .patch-img {
		transform: none;
	}
}

@media screen and (max-width: 940px) {
    #patches {
		width: 90%;
    }
}

@media screen and (max-width: 838px) {
	#patch-popup {
		width: 70%;
		padding-bottom: 5%;
	}
	#patch-popup img {
		width: 90%;
	}
}

@media screen and (max-width: 653px) {
    #patches {
		width: 85%;
    }

    .patch-name {
		text-align: center;
    }
  
  	.img-container img {
      	display: block;
      	margin: 0 auto;
    }
  	
    #display-image {
		width: 400px;
    }

	.pack-deal {
		bottom: 0;
	}
}

@media screen and (max-width: 580px) {
	.patch-title {
		height: 60px;
	}

	.patch-cost {
		font-size: 15px;
	}

	.patch-name {
		font-size: 14px;
		overflow: auto;
		white-space: wrap;
		text-overflow: initial;
		max-width: 150px;
	}

	.buy-patch-button, .sold-out-button {
		padding-top: 2px;
		padding-bottom: -2px;
		font-size: 14px;
	}

	.img-container {
		width: 170px;
		height: 170px;
	}

	.img-container img {
		width: 100%;
		height: 100%;
	}

	.new-patch-tag {
		top: 0;
		right: 0;
	}

	.new-patch-tag-content {
		width: 52px;
		height: 52px;
	}

	.new-patch-tag-content p {
		font-size: 14px;
	}
}

@media screen and (max-width: 520px) {
	.flow-out:hover {
		letter-spacing: normal !important;
		font-weight: bold;
	}

	#sort-section {
		width: 80%;
	}
}

@media screen and (max-width: 450px) {
	#patches {
		width: 100%;
	}
	
	.available-patches {
		gap: 10px;
	}
}

@media screen and (max-width: 380px) {
	.patch-info {
		display: none;
	}
}

@media screen and (max-width: 356px) {
	.img-container {
		width: 150px;
		height: 150px;
	}
	
	.buy-patch-button {
		width: 100%;
	}
}