/*
Theme Name: MecaPrime Store
Theme URI: https://mecaprime.com
Author: Google AI Studio
Description: MecaPrime Premium Car Accessories WooCommerce Theme. Designed with Tailwind CSS. Ready for Hostinger deployment.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.4
Requires PHP: 7.4
Text Domain: mecaprime
*/

/* We are using Tailwind CSS via CDN in functions.php for this starter theme. */
body {
    margin: 0;
    font-family: "Montserrat", "Cairo", sans-serif;
    background-color: #ffffff;
    color: #111827;
}

/* Basic WooCommerce Reset Overrides for Tailwind Compatibility */
.woocommerce ul.products,
.woocommerce-page ul.products {
    display: grid !important;
    grid-template-columns: repeat(1, minmax(0, 1fr)) !important;
    gap: 1.5rem !important;
    padding: 0 !important;
    margin: 2rem 0 !important;
    list-style: none !important;
}

@media (min-width: 640px) {
    .woocommerce ul.products,
    .woocommerce-page ul.products {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

@media (min-width: 1024px) {
    .woocommerce ul.products,
    .woocommerce-page ul.products {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }
}

.woocommerce ul.products li.product, 
.woocommerce-page ul.products li.product {
    width: 100% !important;
    float: none !important;
    margin: 0 !important;
    background-color: #ffffff;
    border-radius: 1rem !important;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1) !important;
    border: 1px solid #e1e4e8 !important;
    padding: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    transition: all 0.3s ease !important;
    position: relative;
    box-sizing: border-box !important;
    overflow: hidden !important;
}

.woocommerce ul.products li.product:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1) !important;
    border-color: #f77f00 !important; /* Using primary orange tint match */
}

/* Fix product image sizing */
.woocommerce ul.products li.product a img {
    width: 100% !important;
    height: 256px !important;
    object-fit: cover !important;
    border-radius: 0 !important;
    margin-bottom: 0 !important;
    transition: transform 0.7s ease !important;
}

.woocommerce ul.products li.product:hover a img {
    transform: scale(1.05) !important;
}

/* Padding for text content */
.woocommerce ul.products li.product > a > .woocommerce-loop-product__title,
.woocommerce ul.products li.product > a > h2,
.woocommerce ul.products li.product > a > .price,
.woocommerce ul.products li.product > .star-rating {
    padding-left: 1.5rem !important;
    padding-right: 1.5rem !important;
}

.woocommerce ul.products li.product > a > .price {
    padding-bottom: 1rem !important;
}

/* Title Styling */
.woocommerce ul.products li.product .woocommerce-loop-product__title {
    font-size: 1.125rem !important;
    font-weight: 700 !important;
    color: #111827 !important;
    margin: 1.5rem 0 0.5rem 0 !important;
    line-height: 1.4 !important;
}

/* Star Rating Overrides to fix floats */
.woocommerce .star-rating {
    font-size: 0.85rem !important;
    color: #f77f00 !important;
    margin: 1rem 0 0.5rem 1.5rem !important;
    float: none !important;
}
[dir="rtl"] .woocommerce .star-rating {
    margin: 1rem 1.5rem 0.5rem 0 !important;
}

/* Badge Styling */
.woocommerce span.onsale {
    background-color: #10b981 !important; /* Emerald-500 matching Available badge in React */
    color: white !important;
    font-weight: 700 !important;
    padding: 0.25rem 0.5rem !important;
    font-size: 0.65rem !important;
    border-radius: 0.375rem !important; /* rounded-md */
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
    position: absolute !important;
    top: 1rem !important;
    right: 1rem !important;
    left: auto !important;
    min-height: auto !important;
    min-width: auto !important;
    line-height: 1.5 !important;
    z-index: 10 !important;
}
[dir="rtl"] .woocommerce span.onsale {
    right: auto !important;
    left: 1rem !important;
}

/* Orderby Dropdown Styling */
.woocommerce-ordering-container .woocommerce-ordering {
    margin: 0 !important;
}

.woocommerce-ordering-container select.orderby {
    background-color: #f9fafb !important; /* bg-gray-50 */
    border: 1px solid #e5e7eb !important; /* border-gray-200 */
    border-radius: 0.75rem !important; /* rounded-xl */
    padding: 0.75rem 1rem !important; /* py-3 px-4 */
    font-size: 0.875rem !important; /* text-sm */
    font-weight: 700 !important; /* font-bold */
    color: #374151 !important; /* text-gray-700 */
    outline: none !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    box-shadow: none !important;
}

.woocommerce-ordering-container select.orderby:hover {
    background-color: #f3f4f6 !important; /* hover:bg-gray-100 */
}

/* Hide native result count since it looks a bit plain, or style it */
.woocommerce-ordering-container .woocommerce-result-count {
    margin: 0 !important;
    font-size: 0.875rem !important;
    font-weight: 700 !important;
    color: #6b7280 !important; /* text-gray-500 */
    padding: 0.75rem 0 !important;
}

.woocommerce ul.products li.product a {
    text-decoration: none !important;
    display: block !important;
    width: 100% !important;
}

/* Price & Star Rating alignment */
.woocommerce ul.products li.product .price {
    color: #111827 !important;
    font-weight: 900 !important;
    font-size: 1.5rem !important;
    margin-bottom: 0 !important;
    display: block !important;
}

/* Button override to look like a premium pill button */
.woocommerce ul.products li.product .button,
.woocommerce a.button {
    background-color: #f77f00 !important;
    color: white !important;
    border-radius: 0.75rem !important; /* rounded-xl to match QuickAdd */
    font-weight: 700 !important;
    padding: 0.75rem 1.25rem !important;
    text-align: center !important;
    display: block !important;
    margin: 0 1.5rem 1.5rem 1.5rem !important;
    transition: all 0.2s ease !important;
    border: none !important;
    text-decoration: none !important;
    width: calc(100% - 3rem) !important;
    box-sizing: border-box !important;
    box-shadow: 0 4px 6px -1px rgba(247, 127, 0, 0.1) !important;
}

.woocommerce ul.products li.product .button:hover,
.woocommerce a.button:hover {
    background-color: #df7300 !important; /* primary-dark */
    transform: scale(0.98) !important;
}
