/**
* Theme Name:        avanam-majori
* Theme URI:         https://templatemela.com/
* Template:          avanam
* Author:            TemplateMela
* Author URI:        #
* Description:       This is a child theme of Avanam, generated by TemplateMela.
* Version:           1.0.0
* License:           GNU General Public License v3.0 (or later)
* License URI:       https://www.gnu.org/licenses/gpl-3.0.html
* Text Domain:       avanam-majori
* Requires at least: 6.2
* Tested up to:      6.6
* Requires PHP:      7.4
* Tags: translation-ready, two-columns, right-sidebar, left-sidebar, footer-widgets, blog, custom-logo, custom-background, custom-menu, rtl-language-support, editor-style, threaded-comments, custom-colors, featured-images, wide-blocks, full-width-template, theme-options, e-commerce

*/

/* Product Grid Customizations */

/* Position the product actions (Add to Cart) over the image */
ul.products li.product .product-actions {
    position: absolute;
    bottom: 15px;
    right: 15px;
    z-index: 10;
}

ul.products li.product .child-icon-btn {
    width: 40px !important;
    height: 40px !important;
    border-radius: 50% !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    background-color: rgba(255, 255, 255, 0.95) !important;
    color: #333 !important;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    border: none !important;
    transition: all 0.3s ease !important;
}

ul.products li.product .child-icon-btn:hover {
    background-color: #000 !important;
    color: #fff !important;
    transform: scale(1.1);
}

ul.products li.product .child-icon-btn .base-svg-iconset svg {
    margin: 0 !important;
    width: 20px;
    height: 20px;
}

/* Ensure the product thumbnail is relative for positioning */
ul.products li.product .product-thumbnail {
    position: relative;
}

.woocommerce ul.products li.product a.woocommerce-loop-image-link{
    height: 338px;
}
.woocommerce ul.products li.product a img{
    height: 100% !important;
    object-fit: cover;
}

/* Badge styling (On Sale, Waterproof, etc.) */
ul.products li.product .onsale,
ul.products li.product .badge,
ul.products li.product .tm-badge {
    top: 15px !important;
    left: 15px !important;
    right: auto !important;
    border-radius: 4px !important;
    padding: 4px 10px !important;
    font-size: 12px !important;
    background: #fff !important;
    color: #333 !important;
    border: 1px solid #e5e5e5 !important;
    text-transform: capitalize !important;
    font-weight: 500 !important;
    line-height: 1 !important;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

/* Simplify the details below the image */
ul.products li.product .entry-content-wrap {
    padding: 15px 0 0 !important;
    margin: 0 !important;
    background: transparent !important;
    text-align: left !important;
}

ul.products li.product .woocommerce-loop-product__title {
    font-size: 14px !important;
    font-weight: 400 !important;
    margin: 0 0 5px !important;
    color: #1a1a1a !important;
    line-height: 16px !important;
}

ul.products li.product .price {
    font-size: 14px !important;
    color: #333 !important;
    font-weight: 400 !important;
}

/* Hide the old action wrap since we moved the button */
ul.products li.product .product-action-wrap {
    display: none !important;
}

/* Hide ratings as requested */
ul.products li.product .star-rating {
    display: none !important;
}

/* Hide extra lines/borders from theme */
ul.products li.product .content-bg {
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
}


/* product hover */
.woocommerce ul.products.woo-archive-action-on-hover:not(.products-list-view) li.product:hover .entry-content-wrap,
.woocommerce ul.products.woo-archive-action-on-hover:not(.products-list-view) li.product:focus-within .entry-content-wrap {
    transform: translateY(0) !important;
}

.woocommerce ul.products .product-actions {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translate3d(0, 0, 0) !important;
    justify-content: end !important;
}

.woocommerce ul.products li.product .product-thumbnail .product-actions button {
    display: none !important;
}

.woocommerce ul.products li.product .product-thumbnail .product-actions a.button {
    border-radius: 50% !important;
}


/* navigation */
.splide .splide__arrow {
    top: 50% !important;
}

/* WooCommerce Auto Update Cart: Hide redundant Update Cart button */
.woocommerce-cart-form button[name="update_cart"],
.woocommerce-cart-form input[name="update_cart"] {
    display: none !important;
}

/* Variation Swatches Styles */
.child-variation-selector {
    margin-top: 12px;
    margin-bottom: 5px;
    width: 100%;
}

.swatches-row {
    margin-bottom: 8px;
    width: 100%;
}

.swatches-list {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* Swatch Button */
.swatch-btn {
    position: relative;
    padding: 6px 14px !important;
    border: 1px solid #d5d5d5 !important;
    background-color: #fff !important;
    color: #333 !important;
    border-radius: 4px !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    cursor: pointer;
    transition: all 0.2s ease !important;
    overflow: hidden;
    line-height: 1.2 !important;
    box-shadow: none !important;
    display: inline-block !important;
    height: auto !important;
    width: auto !important;
    text-transform: none !important;
}

.swatch-btn:hover {
    border-color: #333 !important;
    background-color: #f9f9f9 !important;
    color: #000 !important;
}

.swatch-btn.selected {
    background-color: #2b2b2b !important;
    color: #fff !important;
    border-color: #2b2b2b !important;
}

/* Out of Stock Variation Diagonal Crossed-Out Line */
.swatch-btn.out-of-stock {
    opacity: 0.55;
    cursor: not-allowed;
    color: #aaa !important;
    border-color: #e2e2e2 !important;
    background-color: #fafafa !important;
}

.swatch-btn.out-of-stock::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top right, transparent calc(50% - 1px), #ccc calc(50% - 1px), #ccc calc(50% + 1px), transparent calc(50% + 1px)) !important;
    pointer-events: none;
}

.swatch-btn.out-of-stock:hover {
    background-color: #fafafa !important;
    border-color: #e2e2e2 !important;
    color: #aaa !important;
}

/* Color & Image Swatches in Product Grid */
.swatch-btn.color-swatch,
.swatch-btn.image-swatch {
    width: 16px !important;
    height: 16px !important;
    min-width: 16px !important;
    padding: 0 !important;
    border-radius: 50% !important;
    border: none !important;
    box-shadow: none !important;
    overflow: hidden;
    vertical-align: middle;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    background-color: #fff !important; /* Acts as white frame */
}

.swatch-btn.color-swatch .bt_color_sw_span,
.swatch-btn.image-swatch .bt_color_sw_span {
    width: 18px !important;
    height: 18px !important;
    border-radius: 50% !important;
    display: block !important;
    margin: 0 auto !important;
    background-size: cover !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
}

.swatch-btn.color-swatch:hover,
.swatch-btn.image-swatch:hover {
    box-shadow: 0 0 0 1px #333 !important;
}

.swatch-btn.color-swatch.selected,
.swatch-btn.image-swatch.selected {
    border-color: transparent !important;
}

/* Ensure diagonal line displays correctly inside circular swatches when out of stock */
.swatch-btn.color-swatch.out-of-stock,
.swatch-btn.image-swatch.out-of-stock {
    box-shadow: 0 0 0 1px #e2e2e2 !important;
    border-color: transparent !important;
}

.swatch-btn.color-swatch.out-of-stock::after,
.swatch-btn.image-swatch.out-of-stock::after {
    border-radius: 50%;
}


/* Disabled state for add to cart button when selection is invalid/out-of-stock */
ul.products li.product .child-icon-btn.disabled {
    opacity: 0.4 !important;
    cursor: not-allowed !important;
    background-color: rgba(230, 230, 230, 0.95) !important;
    color: #888 !important;
    pointer-events: none !important;
    transform: none !important;
    box-shadow: none !important;
}