:root {
	/* Primary */
	--primary-light: 255, 255, 255;
	--primary: 224, 224, 224;
	--primary-dark: 180, 180, 180;
	--on-primary: 0, 0, 0;

	/* Secondary */

	--secondary-light: 39, 165, 136;
	--secondary: 21, 92, 79;
	--secondary-dark: 15, 65, 56;
	--on-secondary: 255, 255, 255;

	/* Tertiary */
	--tertiary-light: 255, 255, 230;
	--tertiary: 255, 242, 196;
	--tertiary-dark: 200, 190, 120;
	--on-tertiary: 0, 0, 0;
}

/* ================================
   Base Styles
   ================================ */
body {
    font-family: 'Montserrat', sans-serif;
    background-color: #f9f9f9;
    color: #333;
    margin: 0;
    padding: 0;
}

/* ================================
   Products Grid Section
   ================================ */
.products_grid_wrapper {
    width: 100%;
    margin: 5em auto;
}

.products_grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2em;
}

/* ================================
   Product Item & Components
   ================================ */
.product_item {
    flex: 0 0 20em;
    position: relative;
    background-size: cover;
    background-position: center;
    height: 20em;
    border-radius: 1em;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.product_item:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    top: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 1.5em 1em;
    /* Slightly increased padding for better spacing */
    background: linear-gradient(to top, rgba(0, 0, 0, 0.6) 40%, rgba(0, 0, 0, 0) 100%);
    color: white;
}

.product_name {
    font-size: 1.3em;
    font-weight: 600;
    margin-bottom: 0.5em;
    /* Add space below the name by default */
    transform: translateY(0);
    transition: transform 0.4s ease;
}

.product_desc {
    max-height: 0;
    opacity: 0;
    margin: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, opacity 0.4s ease, margin 0.4s ease;
}

.product_item:hover .product_desc {
    max-height: 100px;
    /* Allow space for description */
    opacity: 1;
    margin-top: 0.5em;
}

/* ================================
   Fallback Messages
   ================================ */
.no_products {
    text-align: center;
    font-size: 1.2em;
    color: #999;
    margin-top: 2em;
}

/* ================================
   Foating Back Button
   ================================ */
.floating-back-btn {
    position: fixed;
    bottom: 1em;
    left: 1em;
    z-index: 99;
}

.floating-back-btn a {
    display: block;
    padding: 15px 20px;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 10px;
    color: #333;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
}

.floating-back-btn a:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: translateY(-5px);
    box-shadow: 0 10px 32px 0 rgba(31, 38, 135, 0.5);
}
.product_item.show-desc .product_desc {
    max-height: 100px;
    opacity: 1;
    margin-top: 0.5em;
}



@media (max-width: 320px) {
    .product_item {
        flex: 0 1 90%;
        height: auto;
        min-height: 15em;
    }
}
