/*
    MerchStudio version 0.01 - Core CSS File
    Copyright (c) 2025 Michael Lewis White and MerchStudio Inc.
    Client-side CSS for the single Item page.
    @version tpl/core/client/css/item.css - 0.01 - 2025-10-14 - totaltec

    # included by client/css_load.tpl
*/

.item_page_container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 0;
}

/* --- Product View Specific Styles --- */
.product_view_grid {
    display: grid;
    /* We create two equal columns, one for images, one for details. */
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}

/* Image Gallery Styles */
.product_gallery .main_image_wrap {
    border: 1px solid var(--base);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 15px;
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product_gallery .main_image_wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.thumbnail_gallery {
    display: grid;
    /* This creates a responsive grid of thumbnails. */
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 10px;
}

.thumbnail_gallery .thumb_wrap {
    border: 2px solid var(--base);
    border-radius: 4px;
    cursor: pointer;
    overflow: hidden;
    aspect-ratio: 1 / 1;
    transition: border-color 0.2s ease-in-out;
}

.thumbnail_gallery .thumb_wrap:hover {
    border-color: var(--middle_grey);
}

.thumbnail_gallery .thumb_image.active + .thumb_wrap,
.thumbnail_gallery .thumb_wrap.active {
    border-color: var(--highlight);
    box-shadow: 0 0 5px var(--highlight);
}

.thumbnail_gallery .thumb_image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.7;
    transition: opacity 0.2s ease-in-out;
}
.thumbnail_gallery .thumb_image:hover,
.thumbnail_gallery .thumb_image.active {
    opacity: 1;
}

/* Product Info Styles */
.product_info .item_title {
    text-align: left;
    margin-bottom: 15px;
    font-size: 2em;
    padding: 0;
    line-height: 1;
}

.product_info .item_details {
    margin-bottom: 20px;
}

.product_info .item_detail {
    font-size: 0.9em;
    color: var(--middle_grey);
}

.product_info .item_price {
    font-size: 2.2em;
    font-weight: bold;
    color: var(--highlight);
    margin-bottom: 20px;
}

.product_info .item_description {
    line-height: 1.6;
    margin-bottom: 30px;
}

.add_to_cart_form {
    border-top: 1px solid var(--line);
    padding-top: 20px;
}

/* --- Default Content View Styles (for posts, blocks) --- */
.content_view .item_title {
    text-align: center;
    margin-bottom: 25px;
}

.content_view .item_featured_image {
    max-width: 800px;
    margin: 0 auto 30px auto;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--base);
}

.content_view .item_featured_image img {
    width: 100%;
    display: block;
}

.content_view .item_description {
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.7;
}

/* Responsive adjustments for smaller screens */
@media (max-width: 768px) {
    .product_view_grid {
        /* We stack the columns vertically on mobile. */
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .product_info .item_title,
    .product_info .item_price,
    .product_info .item_detail {
        text-align: center;
    }
}