/* START: Product Carousel CSS (Updated for vertical thumbnails and left alignment) */

/* Wrapper for the entire product page content (carousel + details) */
.product-page-content-wrapper {
    display: flex; /* Use flexbox to arrange carousel and details side-by-side */
    justify-content: flex-start; /* Align content to the left */
    align-items: flex-start; /* Align items to the top */
    gap: 30px; /* Space between the carousel and the product details */
    padding: 20px; /* Overall padding for the product section */
    width: 100%; /* Ensure it takes full width */
    box-sizing: border-box; /* Include padding in width */
}

.carousel-container {
    border: 1px solid #ddd;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    background-color: #fff;
    padding: 15px;
    box-sizing: border-box;
    width: auto; /* Allow content to determine width initially */
    min-width: 400px; /* Minimum width for the carousel section */
    max-width: 600px; /* Maximum width for the carousel section */
}

/* New wrapper to hold vertical thumbnails and main image horizontally */
.image-gallery-wrapper {
    display: flex; /* Arrange thumbnails and main image side-by-side */
    flex-direction: row; /* Horizontal arrangement */
    align-items: flex-start; /* Align items to the top (thumbnails and main image) */
    gap: 15px; /* Space between thumbnails column and main image */
    max-width: 600px; /* Adjust as needed, e.g., 500px for main image + 80px for thumbnails + gap */
    width: 100%; /* Ensure it takes full available width within its parent */
}

.thumbnail-container {
    display: flex;
    flex-direction: column; /* Arrange thumbnails vertically */
    gap: 8px; /* Space between vertical thumbnails */
    flex-shrink: 0; /* Prevent thumbnails from shrinking too much */
}

.thumbnail {
    width: 80px; /* Thumbnail width */
    height: 60px; /* Thumbnail height */
    object-fit: cover;
    border: 2px solid transparent;
    cursor: pointer;
    transition: border-color 0.2s ease-in-out;
}

.thumbnail.active {
    border-color: #007185;
}

.thumbnail:hover {
    border-color: #007185;
}

.main-image-display {
    position: relative;
    flex-grow: 1; /* Allow the main image section to take up available space */
    flex-basis: 400px; /* Suggested base width for the main image area. Adjust as needed. */
    height: 400px; /* Fixed height for consistency of main image */
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    background-color: #eee;
}

.main-image-display img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
    transition: opacity 0.3s ease-in-out;
}

.prev-btn, .next-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 1.2em;
    z-index: 10;
    border-radius: 5px;
    user-select: none;
}

.prev-btn {
    left: 5px;
}

.next-btn {
    right: 5px;
}

.prev-btn:hover, .next-btn:hover {
    background-color: rgba(0, 0, 0, 0.7);
}

/* Styling for the product details section on the right */
.product-details {
    flex-grow: 1; /* Allows product details to take up remaining horizontal space */
    padding: 20px;
    background-color: #fff;
    border: 1px solid #ddd;
    box-shadow: 0 0 10px rgba(0,0,0,0.05);
}

.product-details h2 { margin-top: 0; }

/* Add responsive adjustments */
@media (max-width: 768px) {
    .product-page-content-wrapper {
        flex-direction: column; /* Stack carousel and details vertically on smaller screens */
        align-items: center; /* Center them when stacked */
    }

    .carousel-container {
        width: 100%; /* Take full width */
        margin-right: 0; /* No margin when stacked */
    }

    .image-gallery-wrapper {
        flex-direction: column; /* Stack thumbnails and main image vertically on very small screens */
        align-items: center; /* Center them when stacked */
    }

    .thumbnail-container {
        flex-direction: row; /* Make thumbnails horizontal on small screens to save vertical space */
        flex-wrap: wrap; /* Allow them to wrap horizontally */
        justify-content: center; /* Center thumbnails when horizontal */
    }

    .main-image-display {
        flex-basis: auto; /* Auto width when stacked */
        width: 100%; /* Take full width available */
        height: 250px; /* Adjust height for smaller screens */
    }
}

/* END: Product Carousel CSS */

/* General styles moved from inline <style> tag in HTML */
body { 
    background-color: #f8f9fa; 
    padding-top: 100px; /* Adjust this value as needed based on your header's actual height */
}
.product-info h1 { 
    font-size: 1.75rem; 
}
.price { 
    font-size: 1.5rem; 
    color: #2c7a00; 
}
.return-policy { 
    font-size: 0.9rem; 
    color: #666; 
}
.specs-tabs .nav-link.active { 
    border-color: #0d6efd; 
}

#header {
    margin-top: 0 !important; /* Force remove any top margin */
    top: 0; /* Ensure it sticks to the very top */
    width: 100%; /* Ensure it spans full width */
    z-index: 1030; /* Ensure it stays on top of other content, standard Bootstrap z-index for fixed navbars */
}

/* Styles for the new Similar Products carousel */
.similar-products-section {
    margin-top: 40px;
}
.similar-products-section h2 {
    margin-bottom: 25px;
    font-size: 1.8rem;
    text-align: center;
}
.swiper-container-similar {
    width: 100%;
    padding-bottom: 30px; /* Space for pagination */
}
.swiper-slide-similar {
    display: flex;
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
    padding: 10px;
}
.product-card {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    background-color: #fff;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    max-width: 250px; /* Adjust as needed */
    width: 100%;
}
.product-card:hover {
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transform: translateY(-5px);
}
.product-card img {
    max-width: 100%;
    height: 180px; /* Fixed height for consistent look */
    object-fit: contain; /* Ensures entire image is visible */
    padding: 15px;
    background-color: #f5f5f5;
    border-bottom: 1px solid #eee;
}
.product-card-body {
    padding: 15px;
}
.product-card h5 {
    font-size: 1rem;
    margin-bottom: 10px;
    height: 45px; /* Fixed height for title */
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2; /* Limit to 2 lines */
    -webkit-box-orient: vertical;
}
.product-card .price {
    font-size: 1.2rem;
    font-weight: bold;
    color: #2c7a00;
    margin-bottom: 10px;
    display: block;
}
.product-card .btn {
    width: 80%;
    margin-top: 10px;
    background-color: #0d6efd;
    border-color: #0d6efd;
    font-size: 0.9rem;
}
.product-card .btn:hover {
    background-color: #0b5ed7;
    border-color: #0a58ca;
}
.swiper-button-prev-similar, .swiper-button-next-similar {
    color: #000;
    background-color: rgba(255,255,255,0.8);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    top: 40%; /* Adjust vertical position */
    transform: translateY(-50%);
}
.swiper-button-prev-similar:after, .swiper-button-next-similar:after {
    font-size: 1.2rem !important;
}
.swiper-pagination-similar .swiper-pagination-bullet {
    background-color: #0d6efd;
}