/* =========================================
   CONTAINER & LAYOUT
========================================= */
.woocommerce .container {
    margin: 0 auto;
    padding: 3rem 1rem;
}

.shop-custom-container {
    width: 80%;
    margin: 0 auto;
}

#sidebar {
    display: none;
}

/* HIDE WC DEFAULTS */
.woocommerce-products-header__title,
.woocommerce-breadcrumb,
.woocommerce-result-count,
.custom-rating-wrapper,
.woocommerce-tabs .wc-tabs-wrapper,
.woocommerce-ordering {
    display: none !important;
}


/* =========================================
   CATEGORY NAVIGATION BUTTONS
========================================= */
.category-nav-section {
    margin-bottom: 2.5rem;
    margin-top: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.category-nav-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    list-style: none;
    padding: 0;
    margin: 0;
    justify-content: left ;
}

.category-item {
    margin: 0;
}

.category-link {
    display: inline-flex;
    align-items: center;
    padding: 0.6rem 1.25rem;
    background-color: #f3f4f6;
    color: #374151;
    border-radius: 9999px;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.category-link:hover,
.category-link.active {
    background-color: #15803d;
    color: #ffffff;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.category-link .cat-count {
    margin-left: 0.4rem;
    font-size: 0.75rem;
    opacity: 0.7;
}


/* =========================================
   PRODUCT GRID
========================================= */
.woocommerce ul.products {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1.5rem;
    list-style: none;
    padding: 0;
}

/* =========================================
   THE CUSTOM CARD
========================================= */
.woocommerce ul.products li.product-card-item {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    overflow: hidden;
    transition: box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    width: 100%;
    margin: 0;
    padding: 0; /* Overrides default WC padding */
}

.woocommerce ul.products li.product-card-item:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

/* INNER WRAPPER (Pushes content to fill height) */
.woocommerce ul.products li.product-card-item .card-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* IMAGE WRAPPER */
.woocommerce ul.products li.product-card-item .product-img-box img {
    width: 100%;
    height: auto;
    aspect-ratio: 1/1;
    object-fit: cover;
    display: block;
    background: linear-gradient(to bottom right, #f0fdf4, #f9fafb);
    margin: 0;
}

/* CONTENT CONTAINER */
.woocommerce ul.products li.product-card-item .product-info-content {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

/* BRAND TAG (Small Green Badge) */
.woocommerce ul.products li.product-card-item .brand-tag-wrapper span {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    background-color: #dcfce7;
    color: #15803d;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 0.25rem;
    margin-bottom: 0.5rem;
    align-self: flex-start;
}

/* TITLE */
.woocommerce ul.products li.product-card-item .title-link {
    text-decoration: none;
}

.woocommerce ul.products li.product-card-item .title-link h3 {
    font-size: 1rem;
    font-weight: 600;
    color: #111827;
    margin: 0 0 0.5rem 0;
    padding: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* CATEGORY TEXT */
.woocommerce ul.products li.product-card-item .product-info-content p {
    font-size: 0.875rem;
    color: #6b7280;
    margin: 0 0 1rem 0;
}

/* PRICE & BUTTON ROW */
.woocommerce ul.products li.product-card-item .product-info-content > div:last-child {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto; /* Pushes to bottom of card */
}

/* PRICE TEXT */
.woocommerce ul.products li.product-card-item .product-info-content > div:last-child span {
    font-size: 0.875rem;
    font-weight: 600;
    color: #111827;
    margin: 0;
}

/* "INQUIRE" BUTTON */
.woocommerce ul.products li.product-card-item .product-info-content > div:last-child a {
    background-color: #111827;
    color: #ffffff;
    padding: 0.4rem 0.8rem;
    border-radius: 0.25rem;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: background-color 0.2s;
}

.woocommerce ul.products li.product-card-item .product-info-content > div:last-child a:hover {
    background-color: #15803d; /* Green on hover */
}

@media screen and (max-width: 1024px) {
    .shop-custom-container {
        width: 90%;
    }

    /* Change grid from 4 columns to 3 */
    .woocommerce ul.products {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 1.25rem;
    }
}

/* Tablets Portrait & Large Mobile (max-width: 768px) */
@media screen and (max-width: 768px) {
    .shop-custom-container {
        width: 95%;
    }

    /* Change grid from 3 columns to 2 */
    .woocommerce ul.products {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 1rem;
    }

    /* Stack header elements vertically */
    .shop-header-flex {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    /* Make category buttons a bit more compact */
    .category-nav-section {
        margin-bottom: 1.5rem;
        padding-bottom: 1rem;
    }

    .category-link {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
    }
}

/* Small Mobile Phones (max-width: 480px) */
@media screen and (max-width: 480px) {
    .shop-custom-container {
        width: 100%;
        padding: 0 1rem; /* Switch from percentage width to padding for edge-to-edge control */
    }

    .category-nav-list {
        gap: 0.5rem;
    }

    /* Adjust padding inside the product card */
    .woocommerce ul.products li.product-card-item .product-info-content {
        padding: 0.875rem;
    }

    /* Ensure the 'Inquire' button is easy to tap */
    .woocommerce ul.products li.product-card-item .product-info-content > div:last-child a {
        padding: 0.5rem 1rem;
    }
}