/* Source: tpl/core/client/css/product.css */
/*
    MerchStudio version 0.01 - Core CSS File
    Copyright (c) 2025 Michael Lewis White and MerchStudio Inc.
    Client-side CSS for Product Lists and Cards
    @version tpl/core/client/css/product.css - 0.01 - 10-10-2025 - khushi

    # included by client/css_load.tpl
*/

/* --- Product List Wrapper --- */
.product_list_wrap {
    margin: 30px 0;
    padding: 20px;
    border: 1px solid var(--base);
    border-radius: 8px;
}

.product_list_header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--line);
    flex-wrap: wrap; /* Allow wrapping on small screens */
    gap: 15px;
}

.product_sort_controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.product_sort_controls label {
    font-weight: bold;
}

.product_sort_controls .select_wrapper {
    min-width: 180px;
}

.product_view_controls {
    display: flex;
    gap: 5px;
}

.product_view_controls .view_toggle {
    background-color: var(--base);
    border: 1px solid var(--line);
    color: var(--text);
    padding: 8px;
    cursor: pointer;
    border-radius: 4px;
    line-height: 0;
}

.product_view_controls .view_toggle:hover {
    background-color: var(--hover);
}

.product_view_controls .view_toggle.active {
    background-color: var(--highlight);
    color: var(--bg);
    border-color: var(--highlight);
}

/* --- Product List Container (Grid and List Views) --- */
.product_list {
    display: grid;
    gap: 20px;
    transition: all 0.3s ease-in-out;
}

/* Grid Layout (Default) */
.product_list.grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

/* List Layout */
.product_list.list {
    grid-template-columns: 1fr; /* Single column */
}

/* --- Individual Product Card --- */
.product_card {
    border: 1px solid transparent; /* For transition */
    border-radius: 6px;
    overflow: hidden;
    background-color: var(--base);
    transition: all 0.3s ease-in-out;
}

.product_card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px var(--shadow);
    border-color: var(--line);
}

.product_card a.product_link {
    text-decoration: none;
    color: var(--text);
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* List View Specific Styles for Card */
.product_list.list .product_card {
    flex-direction: row;
}

.product_image {
    width: 100%;
    aspect-ratio: 1 / 1; /* Square images */
    background-color: var(--bg);
}

.product_image img,
.product_image .image_placeholder {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* List View Specific Styles for Image */
.product_list.list .product_image {
    width: 150px;
    height: 150px;
    flex-shrink: 0; /* Prevent image from shrinking */
}

.product_details {
    padding: 15px;
    text-align: center;
    flex-grow: 1; /* Allows footer to align */
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* List View Specific Styles for Details */
.product_list.list .product_details {
    text-align: left;
    justify-content: center;
}

.product_title {
    font-size: 1.1em;
    font-family: 'Manrope', sans-serif;
    font-weight: bold;
    margin: 0 0 10px 0;
    padding: 0;
}

.product_price {
    font-size: 1.2em;
    font-weight: bold;
    color: var(--highlight);
    margin: 0;
}


/* Source: tpl/core/client/css/item.css */
/*
    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;
}

/* --- Form Item --- */
.item.type_form {
    max-width: 650px;
    margin: 0 auto 30px auto; /* Centers the form block */
    padding: 30px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background-color: var(--header_bg);
    box-shadow: 0 4px 12px var(--shadow);
}

.item.type_form .item_title {
    text-align: center;
    margin-bottom: 15px;
    padding: 0;
    border: none; /* Removed from here to place on the form itself */
}

.item.type_form .item_desc {
    text-align: center;
    margin-bottom: 25px;
    color: var(--middle_grey);
}

.item.type_form .merch_client_form {
    border-top: 1px solid var(--line); /* Separator strictly before the form */
    padding-top: 25px;
}

.item.type_form .form_field {
    display: flex;
    flex-direction: column;
    margin-bottom: 15px;
}

.item.type_form .form_field label {
    font-weight: 600;
    margin-bottom: 5px;
    color: var(--text);
    font-size: 0.9em;
}

.item.type_form .form_field input[type="text"] {
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 4px;
    background-color: var(--base);
    color: var(--text);
    font-family: inherit;
    transition: border-color 0.2s ease;
}

.item.type_form .form_field input[type="text"]:focus {
    border-color: var(--highlight);
    outline: none;
}

.item.type_form .form_actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 20px;
}

/* Ensure the success/error messages blend well */
.item.type_form .form_status_msg {
    text-align: center;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 4px;
    font-weight: 600;
}
/* 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;
    }
}

