/*
    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;
}