@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@100;300;400;500;600&display=swap');

:root {
    --orange: #ff7800;
    --black: #130f40;
    --light-color: #666;
    --box-shadow: 0 .5rem 1.5rem rgba(0,0,0,.1);
    --border: .2rem solid rgba(0,0,0,.1);
    --outline: .1rem solid rgba(0,0,0,.1);
    --outline-hover: .2rem solid var(--black);
}

* {
    font-family: 'Poppins', sans-serif;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    outline: none;
    border: none;
    text-decoration: none;
    text-transform: capitalize;
    transition: all .2s linear;
}

html {
    font-size: 62.5%;
    overflow-x: hidden;
    scroll-behavior: smooth;
    scroll-padding-top: 7rem;
}

body {
    background: #eee;
}

section {
    padding: 2rem 9%;
}

.heading {
    text-align: center;
    padding: 2rem 0;
    padding-bottom: 3rem;
    font-size: 3.5rem;
    color: var(--black);
}

.heading span {
    background: var(--orange);
    color: #fff;
    display: inline-block;
    padding: .5rem 3rem;
    clip-path: polygon(100% 0, 93% 50%, 100% 99%, 0% 100%, 7% 50%, 0% 0%);
}

.btn {
    margin-top: 1rem;
    display: inline-block;
    padding: .8rem 3rem;
    font-size: 1.7rem;
    border-radius: .5rem;
    border: .2rem solid var(--black);
    color: var(--black);
    cursor: pointer;
    background: none;
}

.btn:hover {
    background: var(--orange);
    color: #fff;
}

/* Product Page Styling */
.product {
    padding-top: 10rem;
}

.product-container {
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    gap: 2rem;
    background: #fff;
    border-radius: 1rem;
    box-shadow: var(--box-shadow);
    padding: 2rem;
}

/* Title */
.product-title {
    grid-column: 1 / -1;
    text-align: center;
    margin-bottom: 2rem;
}

.product-title h1 {
    font-size: 3rem;
    color: var(--black);
}

/* Left Part: Product Image */
.product-left {
    display: flex;
    justify-content: center;
    align-items: center;
}

.product-image {
    max-width: 100%;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: var(--box-shadow);
}

.product-image img {
    width: 100%;
    height: auto;
    transition: transform 0.3s ease;
}

.product-image img:hover {
    transform: scale(1.05);
}

/* Middle Part: Product Details */
.product-middle {
    padding: 2rem;
    min-width: -webkit-fill-available;
    max-width: 100%; /* Prevents overflow beyond its container */
    word-wrap: break-word; /* Ensures text wraps properly */
    overflow: hidden; /* Prevents content from escaping padding */
}

.product-description {
    font-size: 1.6rem;
    color: var(--light-color);
    line-height: 1.5;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    max-height: 7.2rem; /* (1.6rem * 1.5 line-height * 3 lines) */
    white-space: normal; /* Ensures proper word wrapping */
    transition: max-height 0.3s ease-in-out; /* Smooth transition */
}

.product-description.expanded {
    display: block;
    max-height: none;
    overflow: visible;
}

.show-more-btn {
    display: none;
    margin-top: 1rem;
    font-size: 1.6rem;
    color: var(--orange);
    background: none;
    border: none;
    cursor: pointer;
}

.info-item span {
    font-size: 2rem;
    color: var(--light-color);
}

.info-item {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
}

.info-item i {
    font-size: 2rem;
    margin-right: 1rem;
}

.values {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.value-box {
    padding: 0.5rem 1rem;
    background: var(--orange);
    color: #fff;
    border-radius: 0.5rem;
    font-size: 1.4rem;
    text-decoration: none;
    transition: background 0.3s ease;
}

.value-box:hover {
    background: var(--black);
}

.current-value {
    background: var(--black);
}

/* Right Part: Price and Add to Cart */
.product-right {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: #f9f9f9;
    border-radius: 1rem;
    box-shadow: var(--box-shadow);
}

.price {
    font-size: 2rem;
    color: var(--black);
    margin-bottom: 1rem;
}

.old-price {
    text-decoration: line-through;
    color: gray;
}

.new-price {
    color: var(--orange);
    font-weight: bold;
}

.current-price {
    font-size: 2rem;
    font-weight: bold;
    color: var(--black);
}

.add-to-cart {
    background: var(--black);
    color: #fff;
    padding: 1rem 2rem;
    border-radius: 0.5rem;
    text-decoration: none;
    transition: background 0.3s ease;
}

.add-to-cart:hover {
    background: var(--orange);
}

/* Media Queries */
@media (max-width: 991px) {
    html {
        font-size: 55%;
    }

    .header {
        padding: 2rem;
    }

    section {
        padding: 2rem;
    }

    .product-container {
        grid-template-columns: 1fr;
    }

    .product-left, 
    .product-middle, 
    .product-right {
        max-width: 100%;
    }
}

@media (max-width: 450px) {
    html {
        font-size: 50%;
    }

    .heading {
        display: block;
        font-size: 2.5rem;
    }
}

/* Add these styles at the end of the file */

/* Section Titles */
.section-title {
    font-size: 2.5rem;
    color: var(--black);
    text-align: center;
    margin-bottom: 2rem;
}

/* Related Products Section */
.related-products .products-container,
.frequently-bought-together .products-container {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    justify-content: center;
}

.product-card {
    background: #fff;
    border-radius: 1rem;
    box-shadow: var(--box-shadow);
    overflow: hidden;
    transition: transform 0.3s ease;
    width: calc(20% - 2rem);
    text-align: center;
}

@media (max-width: 991px) {
    .product-card {
        width: calc(33.33% - 2rem);
    }
}

@media (max-width: 767px) {
    .product-card {
        width: calc(50% - 2rem);
    }
}

.product-card img {
    width: 100%;
    height: auto;
}

.product-card .product-info {
    padding: 1rem;
}

.product-card .product-info h3 {
    font-size: 1.8rem;
    color: var(--black);
    margin-bottom: 0.5rem;
}

.product-card .product-info p {
    font-size: 1.6rem;
    color: var(--light-color);
}

.product-card .product-info .price {
    font-size: 1.6rem;
    color: var(--black);
    margin-bottom: 0.5rem;
}

.product-card .product-info .price .old-price {
    text-decoration: line-through;
    color: var(--black);
    margin-top: 10px;
}

.product-card .product-info .price .new-price {
    color: var(--orange);
    font-weight: bold;
}

.product-card .product-info .price .current-price {
    font-weight: bold;
    color: var(--black);
    font-size: 1.6rem;
    margin-top: 10px;
}

/* Customer Reviews Section */
.customer-reviews .reviews-container {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    justify-content: center;
}

.review-card {
    background: #fff;
    border-radius: 1rem;
    box-shadow: var(--box-shadow);
    padding: 1.5rem;
    width: 30rem;
}

.review-card h3 {
    font-size: 1.8rem;
    color: var(--black);
    margin-bottom: 0.5rem;
}

.review-card p {
    font-size: 1.6rem;
    color: var(--light-color);
    margin-bottom: 1rem;
}

.review-card .rating i {
    color: var(--orange);
}

/* Savings information */
.savings {
    font-size: 1.6rem;
    color: #ff0000; /* Red text color */
    background-color: #ffffff; /* White background */
    border: 2px solid #ff0000; /* Red border */
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    font-weight: bold;
    text-align: center;
}
