/* General Styling */
body {
    font-family: 'Poppins', Arial, sans-serif;
    scroll-behavior: smooth;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    overflow-x: hidden;
    background-color: #ffffff;
    color: #333;
}

*::before, *::after {
    padding: 0;
    margin: 0;
    box-sizing: border-box;
}

.section-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 80px 16px;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, #fff5e6, #ffe0b2);
    height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    overflow: hidden;
    border: none;
}

.hero-content {
    z-index: 1;
    padding: 20px;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    color: #333;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 1.5rem;
    color: #666;
    margin-bottom: 2rem;
}

.hero-btn {
    display: inline-block;
    padding: 12px 30px;
    background-color: #000000;
    color: #fff;
    text-decoration: none;
    border-radius: 0;
    font-weight: 600;
    transition: background-color 0.3s;
    cursor: pointer;
}

.hero-btn:hover {
    background-color: #a60b00;
}

/* Product Detail */
.product-detail {
    background: #fff;
    overflow: hidden;
    border: none;
    margin: 0 auto;
}

.product-layout {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    padding: 0; /* No padding to ensure edge-to-edge */
}

.product-image {
    flex: 1 1 100%;
    width: 100%; /* Full-width */
    max-width: 100%; /* Prevent overflow */
    padding: 0; /* No padding */
    margin: 0; /* No margin */
    overflow: hidden;
    border-radius: 0; /* Sharp corners */
}

.product-image img {
    width: 100%; /* Full-width */
    max-width: 100%;
    height: auto; /* Natural height by default */
    object-fit: contain; /* Show full image, no cropping */
    border-radius: 0; /* Sharp corners */
    display: block; /* Remove inline-block gaps */
}

.no-image {
    font-size: 1rem;
    color: #888;
    text-align: center;
    padding: 5%;
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f0f0f0;
    border-radius: 0; /* Sharp corners */
    width: 100%; /* Full-width */
    max-width: 100%;
}

.product-info {
    flex: 1;
    min-width: 300px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.product-info h2 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: #333;
}

.product-info .category {
    font-size: 1rem;
    color: #666;
    margin-bottom: 0.5rem;
}

.product-info .price {
    font-size: 1.5rem;
    font-weight: bold;
    color: #000;
    margin-bottom: 0.5rem;
}

.product-info .rating {
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.product-info .rating a {
    color: #a60b00;
}

.product-info .rating a:hover {
    color: #000;
    text-decoration: underline;
}

.product-info .stock {
    font-size: 1rem;
    margin-bottom: 0.5rem;
    color: #666;
}

.product-info .stock.low-stock {
    color: #ff6f61;
}

.product-info .description {
    font-size: 1rem;
    color: #666;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.add-to-cart-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
}

.quantity-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.quantity-group label {
    font-weight: 500;
    color: #333;
}

.quantity-group input[type="number"] {
    width: 60px;
    padding: 0.5rem;
    border-radius: 0;
    text-align: center;
}

.btn {
    padding: 0.75rem 1.5rem;
    outline: none;
    border: none;
    font-size: 1rem;
    color: #ffffff;
    white-space: nowrap;
    background-color: #000000;
    border-radius: 0;
    transition: background-color 0.3s;
    cursor: pointer;
    width: 100%;
}

.btn:hover {
    background-color: #a60b00;
}

.add-to-cart-btn:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

.favorite-btn {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    background-color: #a60b00;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border-radius: 0;
    width: 100%;
}

.favorite-btn:hover {
    background-color: #000000;
    color: #fff;
}

.favorite-btn.favorited {
    background-color: #a60b00; /* Updated to desired color */
    color: #fff;
}

.favorite-btn.favorited:hover {
    background-color: #8a0900; /* Darker shade for hover */
}

.favorite-btn i {
    font-size: 1rem;
}

.back-link {
    display: block;
    text-align: right;
    color: #ff6f61;
    font-size: 1rem;
    text-decoration: none;
    margin-top: 1rem;
}

.back-link:hover {
    color: #a60b00;
    text-decoration: underline;
}

.no-items {
    text-align: center;
    color: #888;
    font-style: italic;
    font-size: 1rem;
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: none;
    padding: 10px 20px;
    font-size: 0.9rem;
    background-color: #000000;
    color: #fff;
    border-radius: 0;
    transition: background-color 0.3s;
    z-index: 10;
}

.back-to-top:hover {
    background-color: #a60b00;
}

/* Responsive */
@media (max-width: 768px) {
    .hero {
        height: 50vh;
    }
    .hero-title {
        font-size: 2.5rem;
    }
    .hero-subtitle {
        font-size: 1.2rem;
    }
    .hero-content {
        padding: 10px;
    }
    .product-layout {
        flex-direction: column;
    }
    .product-image, .product-info {
        flex: 1 1 100%;
        max-width: 100%;
    }
    .product-image {
        height: 500px; /* Fixed height for mobile */
    }
    .product-image img {
        width: 100%;
        height: 100%; /* Fill container */
        object-fit: contain; /* Show full image, no cropping */
    }
    .back-link {
        text-align: center;
    }
}

@media (min-width: 768px) {
    .product-detail {
        max-width: 1200px;
    }
    .product-layout {
        flex-wrap: nowrap;
    }
    .product-image {
        flex: 1;
        max-width: 50%;
        height: auto; /* Allow natural height */
        max-height: 800px; /* Cap to prevent overflow */
    }
    .product-image img {
        width: 100%;
        height: 100%; /* Fill container */
        object-fit: contain; /* Show full image, no cropping */
        max-height: 800px; /* Match container */
    }
    .product-info {
        flex: 1;
        max-width: 50%;
        min-width: 0;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 2rem;
    }
    .product-info h2 {
        font-size: 1.5rem;
    }
    .product-info .category, .product-info .price, .product-info .rating, .product-info .stock, .product-info .description {
        font-size: 0.9rem;
    }
    .btn, .favorite-btn {
        font-size: 0.8rem;
        padding: 0.5rem 1rem;
    }
    .quantity-group input[type="number"] {
        width: 50px;
    }
}