/* ================================================================
   MyGiftsCorner - Shop & Category Page Styles
   ================================================================ */

/* --- Hide default page banner if needed --- */
body.post-type-archive-product .entry-hero-container-inner .page-title,
body.tax-product_cat .entry-hero-container-inner .page-title {
    font-size: 28px !important;
    font-weight: 700 !important;
    color: #1a1a1a !important;
}

/* --- Breadcrumbs --- */
body.woocommerce .woocommerce-breadcrumb {
    font-size: 13px !important;
    color: #888 !important;
    padding: 10px 0 !important;
    margin-bottom: 10px !important;
}

body.woocommerce .woocommerce-breadcrumb a {
    color: #8B6F47 !important;
    text-decoration: none !important;
}

body.woocommerce .woocommerce-breadcrumb a:hover {
    text-decoration: underline !important;
}

/* --- Result Count & Ordering --- */
body.woocommerce .woocommerce-result-count {
    font-size: 13px !important;
    color: #888 !important;
}

body.woocommerce .woocommerce-ordering select {
    padding: 8px 14px !important;
    border: 1.5px solid #d4d4d4 !important;
    border-radius: 8px !important;
    font-size: 13px !important;
    background: #fafafa !important;
    color: #333 !important;
    cursor: pointer !important;
    min-height: 40px !important;
}

body.woocommerce .woocommerce-ordering select:focus {
    border-color: #8B6F47 !important;
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(139,111,71,0.1) !important;
}

/* --- Product Grid --- */
body.woocommerce ul.products {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 20px !important;
    padding: 0 !important;
    margin: 0 !important;
    list-style: none !important;
}

body.woocommerce ul.products li.product {
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    float: none !important;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    flex-direction: column;
}

body.woocommerce ul.products li.product:hover {
    border-color: #d4d4d4;
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
    transform: translateY(-4px);
}

/* --- Product Image --- */
body.woocommerce ul.products li.product .woocommerce-loop-product__link {
    display: block;
    text-decoration: none !important;
}

body.woocommerce ul.products li.product img {
    width: 100% !important;
    height: auto !important;
    border-radius: 12px 12px 0 0 !important;
    margin: 0 !important;
    transition: transform 0.3s ease !important;
}

body.woocommerce ul.products li.product:hover img {
    transform: scale(1.03);
}

/* Image container overflow hidden for zoom effect */
body.woocommerce ul.products li.product .woocommerce-loop-product__link {
    overflow: hidden;
    border-radius: 12px 12px 0 0;
}

/* --- Product Info Section --- */
body.woocommerce ul.products li.product .woocommerce-loop-product__title,
body.woocommerce ul.products li.product h2 {
    font-size: 14px !important;
    font-weight: 600 !important;
    color: #1a1a1a !important;
    padding: 12px 14px 4px !important;
    margin: 0 !important;
    line-height: 1.4 !important;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* --- Price --- */
body.woocommerce ul.products li.product .price {
    padding: 4px 14px 8px !important;
    margin: 0 !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    color: #1a1a1a !important;
}

body.woocommerce ul.products li.product .price del {
    color: #999 !important;
    font-size: 13px !important;
    font-weight: 400 !important;
    text-decoration: line-through !important;
}

body.woocommerce ul.products li.product .price ins {
    text-decoration: none !important;
    font-weight: 700 !important;
    color: #1a1a1a !important;
}

/* --- Save Badge on Cards --- */
body.woocommerce ul.products li.product .save-badge {
    position: absolute !important;
    top: 10px !important;
    left: 10px !important;
    bottom: auto !important;
    right: auto !important;
    background: #2D7D46 !important;
    color: #fff !important;
    padding: 4px 10px !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    border-radius: 6px !important;
    z-index: 5 !important;
    line-height: 1.3 !important;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15) !important;
}

/* --- Star Ratings --- */
body.woocommerce ul.products li.product .star-rating {
    margin: 0 14px 4px !important;
    font-size: 12px !important;
    color: #F4A623 !important;
}

/* --- Add to Cart Button --- */
body.woocommerce ul.products li.product .button,
body.woocommerce ul.products li.product a.add_to_cart_button,
body.woocommerce ul.products li.product a.product_type_simple {
    display: block !important;
    width: calc(100% - 28px) !important;
    margin: auto 14px 14px !important;
    padding: 10px 16px !important;
    background: #8B6F47 !important;
    color: #fff !important;
    border: none !important;
    border-radius: 8px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    text-align: center !important;
    text-decoration: none !important;
    cursor: pointer !important;
    transition: background 0.2s, transform 0.1s !important;
    line-height: 1.4 !important;
    margin-top: auto !important;
}

body.woocommerce ul.products li.product .button:hover,
body.woocommerce ul.products li.product a.add_to_cart_button:hover {
    background: #74593a !important;
    transform: translateY(-1px) !important;
}

/* Added to cart state */
body.woocommerce ul.products li.product a.added_to_cart {
    display: block !important;
    text-align: center !important;
    margin: 0 14px 14px !important;
    padding: 6px !important;
    font-size: 12px !important;
    color: #2D7D46 !important;
    font-weight: 600 !important;
    text-decoration: none !important;
}

/* Loading state */
body.woocommerce ul.products li.product a.add_to_cart_button.loading::after {
    content: "" !important;
    display: inline-block !important;
    width: 14px !important;
    height: 14px !important;
    border: 2px solid #fff !important;
    border-top-color: transparent !important;
    border-radius: 50% !important;
    animation: mgcSpin 0.6s linear infinite !important;
    margin-left: 8px !important;
    vertical-align: middle !important;
}

@keyframes mgcSpin {
    to { transform: rotate(360deg); }
}

/* Select Options / Variable products */
body.woocommerce ul.products li.product a.product_type_variable {
    background: transparent !important;
    color: #8B6F47 !important;
    border: 1.5px solid #8B6F47 !important;
}

body.woocommerce ul.products li.product a.product_type_variable:hover {
    background: #8B6F47 !important;
    color: #fff !important;
}

/* --- Category Header & Description --- */
body.woocommerce .term-description,
body.woocommerce .woocommerce-products-header__description {
    font-size: 14px !important;
    color: #555 !important;
    line-height: 1.7 !important;
    max-width: 800px !important;
    margin-bottom: 24px !important;
}

/* Category footer description (from your custom hook) */
.custom-category-footer-content {
    margin-top: 40px !important;
    background: #fafafa !important;
    border-top: 1px solid #eee !important;
    border-radius: 0 !important;
}

.custom-category-footer-content .container {
    max-width: 900px !important;
    font-size: 14px !important;
    color: #555 !important;
    line-height: 1.8 !important;
}

.custom-category-footer-content .container h2,
.custom-category-footer-content .container h3 {
    color: #1a1a1a !important;
    margin-top: 24px !important;
    margin-bottom: 10px !important;
}

/* --- Pagination --- */
body.woocommerce nav.woocommerce-pagination {
    margin: 40px 0 20px !important;
    text-align: center !important;
}

body.woocommerce nav.woocommerce-pagination ul {
    display: inline-flex !important;
    gap: 6px !important;
    border: none !important;
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

body.woocommerce nav.woocommerce-pagination ul li {
    border: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

body.woocommerce nav.woocommerce-pagination ul li a,
body.woocommerce nav.woocommerce-pagination ul li span {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 40px !important;
    height: 40px !important;
    padding: 0 12px !important;
    border: 1.5px solid #d4d4d4 !important;
    border-radius: 8px !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    color: #444 !important;
    background: #fff !important;
    text-decoration: none !important;
    transition: all 0.2s !important;
}

body.woocommerce nav.woocommerce-pagination ul li a:hover {
    border-color: #8B6F47 !important;
    color: #8B6F47 !important;
    background: #faf8f4 !important;
}

body.woocommerce nav.woocommerce-pagination ul li span.current {
    background: #8B6F47 !important;
    color: #fff !important;
    border-color: #8B6F47 !important;
    font-weight: 700 !important;
}

/* Prev/Next arrows */
body.woocommerce nav.woocommerce-pagination ul li a.prev,
body.woocommerce nav.woocommerce-pagination ul li a.next {
    font-size: 16px !important;
}

/* --- No Products Found --- */
body.woocommerce .woocommerce-info {
    background: #faf8f4 !important;
    border: 1px solid #e8e2d8 !important;
    border-left: 3px solid #8B6F47 !important;
    border-radius: 8px !important;
    padding: 16px 20px !important;
    font-size: 14px !important;
}

/* --- Subcategory Grid --- */
body.woocommerce ul.products li.product-category {
    border: 1px solid #eee !important;
    border-radius: 12px !important;
    overflow: hidden !important;
    text-align: center !important;
}

body.woocommerce ul.products li.product-category a {
    text-decoration: none !important;
}

body.woocommerce ul.products li.product-category h2,
body.woocommerce ul.products li.product-category .woocommerce-loop-category__title {
    font-size: 15px !important;
    font-weight: 600 !important;
    color: #1a1a1a !important;
    padding: 12px 10px !important;
    margin: 0 !important;
}

body.woocommerce ul.products li.product-category .count {
    font-size: 12px !important;
    color: #888 !important;
    font-weight: 400 !important;
}

/* --- Sidebar / Widget Area --- */
body.woocommerce .widget-area .widget {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 10px;
    padding: 18px;
    margin-bottom: 16px;
}

body.woocommerce .widget-area .widget-title {
    font-size: 15px !important;
    font-weight: 600 !important;
    color: #1a1a1a !important;
    margin: 0 0 12px 0 !important;
    padding: 0 0 10px 0 !important;
    border-bottom: 1px solid #f0f0f0 !important;
}

body.woocommerce .widget-area .widget ul {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

body.woocommerce .widget-area .widget ul li {
    padding: 6px 0 !important;
    font-size: 13px !important;
}

body.woocommerce .widget-area .widget ul li a {
    color: #444 !important;
    text-decoration: none !important;
    transition: color 0.2s !important;
}

body.woocommerce .widget-area .widget ul li a:hover {
    color: #8B6F47 !important;
}

/* --- Price Filter Widget --- */
body.woocommerce .widget_price_filter .price_slider_wrapper .ui-slider {
    background: #eee !important;
    border-radius: 4px !important;
}

body.woocommerce .widget_price_filter .price_slider_wrapper .ui-slider .ui-slider-range {
    background: #8B6F47 !important;
}

body.woocommerce .widget_price_filter .price_slider_wrapper .ui-slider .ui-slider-handle {
    background: #8B6F47 !important;
    border-color: #8B6F47 !important;
    border-radius: 50% !important;
}

body.woocommerce .widget_price_filter .price_slider_amount .button {
    background: #8B6F47 !important;
    color: #fff !important;
    border: none !important;
    border-radius: 6px !important;
    padding: 8px 16px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
}

/* ===================== RESPONSIVE ===================== */
@media (max-width: 1024px) {
    body.woocommerce ul.products {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 16px !important;
    }
}

@media (max-width: 768px) {
    body.woocommerce ul.products {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px !important;
    }

    body.woocommerce ul.products li.product .woocommerce-loop-product__title,
    body.woocommerce ul.products li.product h2 {
        font-size: 13px !important;
        padding: 10px 10px 4px !important;
    }

    body.woocommerce ul.products li.product .price {
        padding: 4px 10px 6px !important;
        font-size: 14px !important;
    }

    body.woocommerce ul.products li.product .button,
    body.woocommerce ul.products li.product a.add_to_cart_button {
        margin: auto 10px 10px !important;
        width: calc(100% - 20px) !important;
        padding: 9px 12px !important;
        font-size: 12px !important;
    }

    body.woocommerce ul.products li.product .save-badge {
        font-size: 10px !important;
        padding: 3px 8px !important;
    }

    body.woocommerce ul.products li.product:hover {
        transform: none;
    }
}

@media (max-width: 480px) {
    body.woocommerce ul.products {
        gap: 10px !important;
    }

    body.woocommerce nav.woocommerce-pagination ul li a,
    body.woocommerce nav.woocommerce-pagination ul li span {
        min-width: 36px !important;
        height: 36px !important;
        font-size: 13px !important;
    }
}