/* =========================================
   WooCommerce Product Archive Styles
   Matching Homepage Category Grid Design
   ========================================= */

/* Archive Header */
.woocommerce-products-header {
    padding: 80px 20px 40px;
    background-color: #F9F9F9;
    text-align: center;
}

.woocommerce-products-header__title {
    font-size: 42px;
    font-weight: 700;
    color: #A62A44;
    margin-bottom: 20px;
    position: relative;
}

.woocommerce-products-header__title::after {
    content: '';
    display: block;
    width: 80px;
    height: 4px;
    background-color: #A62A44;
    margin: 20px auto 0;
    border-radius: 2px;
}

.term-description {
    max-width: 800px;
    margin: 20px auto 0;
    color: #534045;
    font-size: 18px;
    line-height: 1.6;
}

/* Products Wrapper */
.woocommerce-products-wrapper {
    padding-bottom: 80px;
}

.woocommerce-products-wrapper .container {
    padding-top: 40px;
}

/* Products Grid - Matching Homepage Style */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

/* Product Card - Matching Category Card Style */
.product-card {
    background: #FFFFFF;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 25px rgba(166, 42, 68, 0.2);
}

.product-card-link {
    text-decoration: none;
    display: block;
    flex: 1;
}

/* Product Image */
.product-image-wrapper {
    position: relative;
    height: 280px;
    overflow: hidden;
    background-color: #f5f5f5;
}

.product-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.product-card:hover .product-image-wrapper img {
    transform: scale(1.1);
}

/* Product Overlay */
.product-overlay {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 2;
}

.product-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sale-badge {
    background-color: #A62A44;
    color: #FFFFFF;
}

.out-of-stock-badge {
    background-color: #534045;
    color: #FFFFFF;
}

/* Product Details */
.product-details {
    padding: 20px 15px;
}

.product-title {
    color: #534045;
    margin: 0 0 10px;
    font-size: 20px;
    font-weight: 600;
    transition: color 0.3s ease;
    line-height: 1.3;
}

.product-card:hover .product-title {
    color: #A62A44;
}

.product-price {
    font-size: 22px;
    font-weight: 700;
    color: #A62A44;
    margin-bottom: 10px;
}

.product-price del {
    color: #999;
    font-size: 18px;
    font-weight: 400;
    margin-right: 8px;
}

.product-price ins {
    text-decoration: none;
}

.product-excerpt {
    font-size: 14px;
    color: #666;
    line-height: 1.5;
    margin-top: 10px;
}

/* Product Actions */
.product-actions {
    padding: 0 15px 20px;
}

/* Add to Cart Button - Higher specificity for white text */
.woocommerce .products-grid .product-card .product-actions .button,
.woocommerce .products-grid .product-card .product-actions .added_to_cart,
.product-actions .button,
.product-actions .added_to_cart {
    display: block;
    width: 100%;
    background-color: #A62A44;
    color: #FFFFFF;
    padding: 12px 20px;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
    text-align: center;
    border: none;
    cursor: pointer;
}

.woocommerce .products-grid .product-card .product-actions .button:hover,
.woocommerce .products-grid .product-card .product-actions .added_to_cart:hover,
.product-actions .button:hover,
.product-actions .added_to_cart:hover {
    background-color: #6F1426;
    color: #FFFFFF;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(166, 42, 68, 0.3);
}

.woocommerce .products-grid .product-card .product-actions .added_to_cart,
.product-actions .added_to_cart {
    background-color: #5D701D;
    color: #FFFFFF;
    margin-top: 10px;
}

.woocommerce .products-grid .product-card .product-actions .added_to_cart:hover,
.product-actions .added_to_cart:hover {
    background-color: #485712;
    color: #FFFFFF;
}

/* Toolbar (Sorting, Results Count) */
.woocommerce-result-count,
.woocommerce-ordering {
    font-size: 14px;
    color: #534045;
}

/* Remove float from ordering form */
.woocommerce form.woocommerce-ordering {
    float: none;
    clear: both;
}

.woocommerce-ordering select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background-color: #FFFFFF;
    color: #534045;
    font-size: 14px;
}

.woocommerce-ordering select:focus {
    outline: none;
    border-color: #A62A44;
}

/* Pagination */
.woocommerce-pagination {
    margin-top: 60px;
    text-align: center;
}

.woocommerce-pagination ul {
    display: inline-flex;
    gap: 10px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.woocommerce-pagination ul li {
    margin: 0;
}

.woocommerce-pagination ul li a,
.woocommerce-pagination ul li span {
    display: block;
    padding: 10px 16px;
    background-color: #FFFFFF;
    color: #534045;
    border: 1px solid #ddd;
    border-radius: 5px;
    text-decoration: none;
    transition: all 0.3s ease;
    font-weight: 500;
}

.woocommerce-pagination ul li a:hover,
.woocommerce-pagination ul li span.current {
    background-color: #A62A44;
    color: #FFFFFF;
    border-color: #A62A44;
}

/* Child Categories Section */
.child-categories-section {
    margin-bottom: 60px;
    padding-bottom: 40px;
    border-bottom: 2px solid #efecec;
}

.child-categories-title {
    text-align: center;
    font-size: 32px;
    font-weight: 700;
    color: #534045;
    margin-bottom: 40px;
}

/* No Products Found */
.woocommerce-info,
.woocommerce-no-products-found {
    text-align: center;
    padding: 60px 20px;
    color: #534045;
    font-size: 18px;
}

/* Responsive Design */
@media screen and (max-width: 1024px) {
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 25px;
    }
}

@media screen and (max-width: 768px) {
    .woocommerce-products-header {
        padding: 60px 20px 30px;
    }

    .woocommerce-products-header__title {
        font-size: 36px;
    }

    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 20px;
    }

    .product-image-wrapper {
        height: 220px;
    }
}

@media screen and (max-width: 480px) {
    .woocommerce-products-header {
        padding: 40px 15px 20px;
    }

    .woocommerce-products-header__title {
        font-size: 28px;
    }

    .products-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .product-image-wrapper {
        height: 250px;
    }

    .product-title {
        font-size: 18px;
    }

    .product-price {
        font-size: 20px;
    }
}

/* RTL Support */
.woocommerce-products-wrapper:lang(he) .woocommerce-products-header,
.woocommerce-products-wrapper:lang(he) .product-details {
    direction: rtl;
}

/* Hide Default WooCommerce Elements */
.woocommerce-products-wrapper .woocommerce-breadcrumb {
    display: none;
}

/* Ensure proper spacing */
.woocommerce-products-wrapper .woocommerce-notices-wrapper {
    max-width: 1220px;
    margin: 0 auto;
    padding: 20px;
}