body {
    background-color: #f4f4f9;
}

/* Product Page Specific Styling */
.product {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    background-color: #f4f4f9;
    flex-direction: column; /* Ensure description appears below */
    padding-top: 70px;
}

.grid_product {
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    max-width: 1200px;
    width: 100%;
}

.grid_detail_product {
    flex: 1;
    padding: 30px;
    max-width: 600px; /* Standardize width */
    margin: 0 auto; /* Center the container */
    box-sizing: border-box;
}

.grid_detail_product h1 {
    font-size: 28px;
    color: #333;
    margin-bottom: 20px;
}

.grid_detail_product p {
    font-size: 16px;
    color: #555;
    margin-bottom: 20px;
    line-height: 1.8;
}

.grid_detail_product select {
    padding: 10px;
    font-size: 16px;
    margin-top: 10px;
    margin-bottom: 20px;
    border: 1px solid #ccc;
    border-radius: 4px;
    width: 100%;
}

.buy-button {
    display: inline-block;
    padding: 12px 20px;
    font-size: 16px;
    font-weight: bold;
    color: #fff;
    background-color: #007bff;
    text-align: center;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.buy-button:hover {
    background-color: #0056b3;
}

.image-container {
    position: relative;
    width: 100%;
    padding-top: 100%; /* This ensures a 1:1 aspect ratio (height = width) */
    overflow: hidden;
}

.image-container img {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%); /* Center the image */
    width: 100%;
    height: 100%;
    object-fit: cover; /* Ensure the image covers the entire area */
}

/* Quantity Function */
.variation-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 10px 0;
}

.quantity-price-wrapper {
    display: flex;
    align-items: center;
    gap: 30px;
    margin: 10px 0;
}

.quantity-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

.quantity-wrapper button {
    width: 30px;
    height: 30px;
    font-size: 16px;
    cursor: pointer;
}

#quantity {
    width: 40px;
    height: 30px;
    text-align: right;
}

/* Price */
#price-display {
    font-weight: bold;
    color: #333;
}

/* Description Section Styling */
.desc-container {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 600px; /* Match grid_detail_product max-width */
    margin: 20px auto; /* Center the container and add spacing */
    padding: 40px 20px;
}

.desc-container h2 {
    font-size: 24px;
    color: #333;
    margin: 20px;
}

.desc-container p, .desc-container ul {
    font-size: 16px;
    color: #555;
    line-height: 1.6;
    margin-bottom: 20px;
}

.desc-container ul {
    padding-left: 20px;
}

.desc-container li {
    margin-bottom: 10px;
}

.desc {
    margin: 0px 20px 20px 20px;
    overflow-x: auto; /* Allow horizontal scrolling if needed */
    white-space: pre-wrap; /* Preserve whitespace and wrap text */
    word-break: break-word; /* Ensure long words break to fit the container */
}

/* Standardized Responsive Behavior for Larger Screens */
@media (max-width: 768px) {
    .grid_detail_product,
    .desc-container {
        width: 100%;
        max-width: 100%; /* Both containers take full width on smaller screens */
        padding: 20px 10px; /* Reduced padding for smaller screens */
    }

    .desc-container {
        padding: 20px 10px; /* Adjust padding for better space usage */
    }

    .desc {
        margin: 0px 10px 10px 10px; /* Reduce margins to maximize content width */
    }
}

/* Specific Adjustments for Very Small Screens (320px) */
@media (max-width: 320px) {
    .desc-container {
        padding: 15px 5px; /* Further reduce padding to maximize content space */
    }

    .desc {
        margin: 0px 5px 5px 5px; /* Minimize margins */
        font-size: 14px; /* Slightly smaller font for better fit */
        line-height: 1.5; /* Adjust line height for readability */
        overflow-x: visible; /* Prevent horizontal scrolling by allowing content to wrap */
        word-break: break-all; /* More aggressive word breaking for very narrow screens */
    }
}