/* =========================================
   PRODUCT LAYOUT & IMAGES
========================================= */
main {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 50px 100px 50px 20px; /*  top - right - bottom - left */
    padding-top: 105px;
    gap: 100px;
}

/* Carousal container */
.product-left {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;  /* aligns images vertically to top */
    align-items: flex-start;      /* aligns images to the left */
}

.carousal {
    position: relative;
	display: flex;
	flex-direction: column;   /* stack main image on top of thumbnails */
    justify-content: center;
    align-items: center;
	width: 100%;
    max-width: 400px;
	margin: 0 auto;
	text-align: center;
    max-height: 100%;     /* maximum height allowed */
    overflow: visible;      /* crop if image is taller than container */
	z-index: 40;
}

/* Main image itself */
.pic-main {
    width: 100%;
	max-width: 400px;
    height: auto; 
    max-height: 400px;
	object-fit: contain;
	margin-bottom: 12px;
	user-select: none;
}

/* Thumbnail container */
.thumb-cont {
    display: flex;
	justify-content: space-between;
	align-items: center;
    width: 100%;
    gap: 0;
    flex-wrap: wrap;
    margin-top: 10px;
	padding: 0 0;
}

/* Thumbnail images themselves */
.thumbs {
	flex: 0 1 auto;
	width: 60px;
    max-width: 60px;       /* max width for each thumbnail */
    max-height: 40px;      /* max height for each thumbnail */
    object-fit: cover;     /* crops proportionally if necessary */
	border: 2px solid transparent; 
    border-radius: 5px;
    transition: border 0.3s;
	cursor: pointer;
	z-index: 30;
}

.thumbs.active-thumb {
    border: 2px solid #007bff;
}

.thumbs:hover {
	border: 2px solid rgba(0,123,255,0.7);
}

.carousal-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.3);
    border: none;
    padding: 0.5em 1em;
    z-index: 50;
	cursor: pointer;
	pointer-events: auto;
}

.carousal-arrow.prev { left: -30px; top: 442px; cursor: pointer; }
.carousal-arrow.next { right: -30px; top: 442px; cursor: pointer; }

/* Info container */
.product-right {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
	margin-top: -50px;
}

/*  Product Info */
.product-details {
    display: flex;
    flex-direction: column;
    max-width: 350px;
}

.product-info h2 {
	font-family: sans-serif;
	margin-top: 0px;
	margin-bottom: 125px;
}

.product-info .price {
	font-family: sans-serif;
	font-size: 20px;
	margin-top: -110px;
	margin-bottom: 30px;
}

.product-options {
    margin-top: 10px;
    margin-bottom: 45px;
	z-index: 50;
}

.pick-label {
	font-family: sans-serif;
    color: black;
}

.fancy-select { 
    background: white;
	border: 2px solid #80BBF7;
	border-radius: 5px;
    padding: 10px;
	margin-top: 10px;
	font-size: 16px;
	cursor: pointer;
	width: 100%;
}
.fancy-select:hover { border-color: #0066D4; transition: border-color 0.3s ease; }
.fancy-select:focus { border-color: #0056b3; transition: border-color 0.3s ease; }

/* Quantity Counter Styles */
.quantity-wrapper {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin-bottom: 15px;
}

/* The word "Quantity" */
.quantity-label {
	font-family: sans-serif;
    color: black;
    margin-bottom: 5px;
}

/* The actual number styles */
.quantity-counter {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* The actual number */
#quantity {
    min-width: 24px;
    text-align: center;
    font-weight: 600;
    color: #111;
}

/* + and - Buttons */
#decreaseQty, #increaseQty {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    font-size: 18px;
}

#addToCartBtn {
    width: auto;
    min-width: 120px;
    padding: 5px 10px;
	margin-bottom: 75px;
    align-self: flex-start;
}

.fancy-button, .fancy-button-2 {
    background-color: #C9E4FF; color: #161616; border: none; border-radius: 5px;
    padding: 5px; cursor: pointer;
    transition: background-color 0.3s ease, color 0.3s ease, all 0.2s ease;
}
.fancy-button:hover, .fancy-button-2:hover { background-color: #AED6FF; }

.description-container {
	font-family: sans-serif;
	margin-top: 25px;
	margin-bottom: -30px;
	display: flex;
	flex-direction: column; /* stack vertically */
}

/* =========================================
   TOAST NOTIFICATIONS
========================================= */
.toast-container {
	position: fixed;
	bottom: 20px;
	right: 20px;
	z-index: 200;
	display: flex;
	flex-direction: column-reverse;
	gap: 10px;
	pointer-events: none;
}

.toast {
	min-width: 250px;
	max-width: 300px;
	padding: 12px 16px 12px 45px;
	border-radius: 5px;
	background: #555;
	color: white;
	font-size: 14px;
	box-shadow: 0 2px 8px rgba(0,0,0,0.3);
	opacity: 0;
	transform: translateY(20px);
	transition: transform 0.3s ease, opacity 0.3s ease;
	pointer-events: auto;
	position: fixed;
	bottom: 20px;
	right: 20px;
}

.toast.main-toast {
	background: #555;
}

.toast.success-toast {
	background: #3CC235;
	color: #fff;
}

.toast.bag-toast {
	background: #94A7B0;
	z-index: 110;
}

.toast.trash-toast {
	background: #4BAC46;
	color: #fff;
	z-index: 110;
}

.toast.hide {
	opacity: 0;
	transform: translateY(50px);
}

@keyframes toastSlideUp {
	0% {opacity:0;
	transform:translateY(40px);}
	25% {opacity:1; transform:translateY(0);}
	75% {opacity:1; transform:translateY(0);}
	100% {opacity:0; transform:translateY(40px);}
}

.toast.show {
	animation: toastSlideUp 2.8s ease forwards;
}
/* =========================================
   RESPONSIVE MEDIA QUERIES
========================================= */

/* --------- TABLET ≤900px --------- */
@media (max-width: 900px) {
    main, .carousal { flex-direction: row; align-items: flex-start; gap: 30px; }
    .cart-item { flex-direction: row; gap: 12px; padding: 8px; min-height: 60px; max-height: 100px; }
    .cart-item-img { width: 50px; height: 50px; }
    .cart-item-info { font-size: 12px; }
    .pic-main { max-width: 350px; }
    .thumb-cont { max-width: 350px; gap: 6px; }
    .thumbs { width: 60px; }
    .toast { min-width: 220px; font-size: 13px; }
}

/* --------- MOBILE ≤600px --------- */
@media (max-width: 600px) {
    main {
		margin: 5px 50px 50px 50px; /*  top - right - bottom - left */
		gap: 50px;
		}
		
	.product-left {
		margin-top: 5px;
	}
	
	.carousal {
		flex-direction: column;
		align-items: center;
		gap: 35px;
		padding-top: 50px;
		}

    .pic-main {
		max-width: 250px;
		height: auto;
		}
	
    .thumb-cont {
		justify-content: space-between;
		gap: 5px;
		width: 90%;
		margin-top: -20px;
		}
		
	.product-right {
		margin-top: 55px;
	}
	
    .thumbs {
		width: 22%;
		max-width: 60px;
		max-height: 30px;
		}
	
	.carousal-arrow.prev { left: -25px; top: 380px; }
	.carousal-arrow.next { right: -25px; top: 380px; }
	
    .product-info h2 {
		max-width: 100%;
		font-size: 14px;
		margin-top: 0px;
	}
	
	.product-info .price {
		font-size: 14px;
		line-height: 1;
		margin-top: -115px;
		margin-bottom: 15px;
	}
	
	.product-options {
		margin-top: 0px;
		margin-bottom: 30px;
	}
	
	.fancy-select {
		max-width: 80%;
	}

#addToCartBtn {
	margin-bottom: 50px;
	}

    .fancy-button, .fancy-button-2 { font-size: 0.8em; width: auto; }
	
	.description-container {
	font-size: 12px;
	text-align: left;
	margin-top: -5px;
	}

    .toast { min-width: 200px; font-size: 12px; }
}

/* --------- SMALL MOBILE ≤400px --------- */
@media (max-width: 400px) {
    .pic-main { max-width: 200px; height: auto; }
	.thumb-cont { width: 85%; gap: 4px; }
    .thumbs { width: 20%; max-width: 50px; }
    .product-details { font-size: 12px; }
    .fancy-button, .fancy-button-2 { font-size: 0.7em; width: auto; }
    .toast { min-width: 180px; font-size: 11px; }
}
