/*
 * Custom Shop Styles for Rosalynn Theme (New Method)
 */

body.woocommerce ul.products {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* 4 columns default */
    gap: 30px; /* Space between products */
    list-style: none;
    margin: 0;
    padding: 0;
}

/* Ensure no floats or pseudo-elements interfere with grid layout */
body.woocommerce ul.products::before,
body.woocommerce ul.products::after,
body.woocommerce ul.products li.product::before,
body.woocommerce ul.products li.product::after {
    content: none;
    display: none;
}

body.woocommerce ul.products li.product {
    text-align: center;
    list-style: none;
    float: none; /* Force no floats */
    width: auto; /* Ensure width is handled by grid */
    margin: 0; /* Re-assert margins to 0 */
    padding: 0; /* Re-assert padding to 0 */
    clear: none; /* Neutralize any clear:both; from other stylesheets */
}

/* Image Container Styling (adapting from .rosalynn-product-card__image) */
body.woocommerce ul.products li.product .rosalynn-product-card__image {
    display: block; /* Ensure it behaves like a block element for layout */
    position: relative;
    aspect-ratio: 4 / 5; /* For portrait aspect ratio */
    overflow: hidden;
    margin-bottom: 15px; /* Space below image */
    border-radius: 8px; /* Rounded corners */
    text-align: center; /* Center the image if it's smaller than the container */
}

/* Image itself styling (adapting from .rosalynn-product-card__image img) */
body.woocommerce ul.products li.product .rosalynn-product-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Crop to fill container */
    display: block; /* Remove extra space below image if any */
}

/* Product Info Styling (adapting from .rosalynn-product-card__info) */
body.woocommerce ul.products li.product .rosalynn-product-card__info {
    text-align: left;
    padding: 0;
}

/* Product Name Styling (adapting from .rosalynn-product-card__name) */
body.woocommerce ul.products li.product .rosalynn-product-card__name {
    margin: 0 0 4px 0;
    line-height: 0.2;
    color: #1a1a1a;
    font-family: "ClarityCity", Sans-serif; /* Assuming ClarityCity is available */
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: none;
}

/* Product Meta (Genre | Taille) Styling (adapting from RSL) */
body.woocommerce ul.products li.product .rosalynn-product-card__meta {
    font-family: "ClarityCity", Sans-serif; /* Assuming ClarityCity is available */
    font-size: 14px;
    font-weight: 400;
    color: #666;
    margin: 0;
    padding: 0;
    line-height: 1.4;
}

body.woocommerce ul.products li.product .rosalynn-product-card__meta-separator {
    margin: 0 6px;
    color: #ccc;
}

/* Product Price Styling (adapting from .rosalynn-product-card__price) */
body.woocommerce ul.products li.product .rosalynn-product-card__price {
    font-family: "ClarityCity", Sans-serif; /* Assuming ClarityCity is available */
    font-size: 18px;
    font-weight: 500;
    color: #1a1a1a;
    letter-spacing: 0.02em;
    margin: 0;
    padding: 0;
}

/* Sale price styling (adapting from RSL) */
body.woocommerce ul.products li.product .rosalynn-product-card__price del {
    color: #999;
    font-weight: 400;
    margin-right: 8px;
}

body.woocommerce ul.products li.product .rosalynn-product-card__price ins {
    text-decoration: none;
    color: #1a1a1a;
}





/* Responsive adjustments */
@media (max-width: 992px) {
    body.woocommerce ul.products {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    body.woocommerce ul.products {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    body.woocommerce ul.products {
        grid-template-columns: repeat(1, 1fr);
    }
}

/* Remove hover effects on product images/cards */
body.woocommerce ul.products li.product .woocommerce-LoopProduct-link:hover img,
body.woocommerce ul.products li.product .woocommerce-LoopProduct-link:focus img {
    opacity: 1; /* Ensure image opacity doesn't change on hover */
    transform: none; /* Remove any scale or transform on image */
}

body.woocommerce ul.products li.product .woocommerce-LoopProduct-link:hover,
body.woocommerce ul.products li.product .woocommerce-LoopProduct-link:focus {
    opacity: 1; /* Ensure entire link opacity doesn't change on hover */
    transform: none; /* Remove any scale or transform on link */
    box-shadow: none; /* Remove any shadow on hover */
}
