/* ================================================== */
/* ========== PRODUCT DETAIL PAGE STYLES ========== */
/* ================================================== */

/* 
  Override body styles from main CSS specifically for product pages.
  This ensures normal scrolling behavior ONLY on these pages.
*/
body.product-page-body {
    overflow-y: auto; /* Allow normal vertical scrolling */
    overflow-x: hidden; /* Prevent horizontal scrolling */
    background-color: #f8f9fa; /* Light grey background */
}

.product-header {
    background-color: #ffffff;
    padding: 15px 50px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.product-header .logo {
    height: 50px;
}

.btn-back {
    text-decoration: none;
    background-color: var(--dark-text);
    color: #fff;
    padding: 10px 20px;
    border-radius: 5px;
    font-weight: bold;
    transition: background-color 0.3s ease;
}

.btn-back:hover {
    background-color: var(--highlight-green);
}

.product-container {
    max-width: 900px;
    margin: 40px auto;
    padding: 20px;
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    min-height: calc(100vh - 220px); /* Ensures content pushes footer down */
}

.product-container h1 {
    font-size: 2.5em;
    color: var(--dark-text);
    margin-bottom: 20px;
    text-align: center;
    border-bottom: 2px solid #eee;
    padding-bottom: 15px;
}

.product-description {
    margin-bottom: 40px; /* Add space between description and gallery */
}

.product-description h2 {
    font-size: 1.8em;
    color: var(--dark-text);
    margin-top: 0;
    margin-bottom: 15px;
}

.product-description p {
    line-height: 1.7;
    margin-bottom: 15px;
    text-align: justify;
}

.product-description h3 {
    font-size: 1.4em;
    margin-top: 25px;
    margin-bottom: 10px;
    color: var(--dark-text);
}

.product-description ul {
    list-style-type: disc;
    padding-left: 20px;
    line-height: 1.8;
}

.product-footer {
    text-align: center;
    padding: 40px 20px;
    background-color: #f1f3f5; /* Slightly different color to distinguish */
    color: #888;
    border-top: 1px solid #ddd;
}

.product-footer p {
    margin: 5px 0;
}

/* Basic responsiveness for the product page */
@media (max-width: 768px) {
    .product-header {
        padding: 15px 20px;
        flex-direction: column;
        gap: 15px;
    }
    .product-container h1 {
        font-size: 2em;
    }
    .product-description h2 {
        font-size: 1.5em;
    }
}

.gallery-section {
    margin-top: 2rem;
}

.gallery-section h2 {
    font-size: 2em;
    color: var(--dark-text);
    margin-bottom: 20px;
    text-align: center;
    border-bottom: 2px solid #eee;
    padding-bottom: 15px;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
    margin-top: 1rem;
}

.gallery-item img,
.gallery-item video {
    width: 100%;
    height: 250px; /* Give a fixed height for a uniform look */
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    object-fit: cover;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.gallery-item img:hover,
.gallery-item video:hover {
    transform: scale(1.03);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}


/* ================================================== */
/* ========== ADVANCED GALLERY & VIDEO STYLES ========== */
/* ================================================== */

/* Make all gallery items clickable */
.gallery-grid a.gallery-item {
    display: block;
    position: relative;
    overflow: hidden;
    border-radius: 12px;
}

.gallery-grid .gallery-item img {
    height: 100%; /* Ensure image fills the container */
}

/* Styles for video thumbnails */
.video-thumbnail-wrapper {
    position: relative;
    width: 100%;
    height: 250px;
}

.video-thumbnail-wrapper .play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    transition: background-color 0.3s ease, transform 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
}

.video-thumbnail-wrapper .play-icon::after {
    content: '';
    display: block;
    width: 0;
    height: 0;
    border-top: 15px solid transparent;
    border-bottom: 15px solid transparent;
    border-left: 25px solid #fff;
    margin-left: 5px;
}

a.gallery-item:hover .play-icon {
    background-color: rgba(39, 174, 96, 0.8); /* Highlight green */
    transform: translate(-50%, -50%) scale(1.1);
}