/**
 * Custom Product Card Redesign
 * Inspired by krishcollections.in
 */

/* 1. Product Image and Overlay Buttons */
.product-wrapper .product-image {
    position: relative;
    overflow: hidden;
    border-radius: 4px;
}

/* Action buttons stack — always visible on top-right (krishcollections style) */
.product-wrapper .product-buttons {
    position: absolute !important;
    top: 12px !important;
    right: 12px !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
    z-index: 10 !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
    transition: none !important;
}

/* Override theme.css rules that hide wishlist/compare until hover */
.products.grid-view .product-wrapper .product-buttons .whishlist-button,
.products.grid-view .product-wrapper .product-buttons .quickview-button,
.products.grid-view .product-wrapper .product-buttons .cart-button,
.products.grid-view .product:hover .product-wrapper .product-buttons .whishlist-button,
.products.grid-view .product:hover .product-wrapper .product-buttons .quickview-button,
.products.grid-view .product:hover .product-wrapper .product-buttons .cart-button {
    opacity: 1 !important;
    visibility: visible !important;
    transform: scale(1) !important;
    display: block !important;
}

/* Hide the compare button in the loop — not in the reference */
.product-wrapper .product-buttons .compare-button {
    display: none !important;
}

/* Override theme.css .products .product-image .quickview-button absolute-bottom rule */
.products .product-image .product-buttons .quickview-button,
.product-wrapper .product-buttons .quickview-button {
    position: static !important;
    bottom: auto !important;
    left: auto !important;
    right: auto !important;
    transform: none !important;
    opacity: 1 !important;
    visibility: visible !important;
    z-index: auto !important;
    text-align: center !important;
}

/* Visual order: wishlist (heart) → quick view (eye) → cart */
.product-wrapper .product-buttons .whishlist-button { order: 1; }
.product-wrapper .product-buttons .quickview-button { order: 2; }
.product-wrapper .product-buttons .cart-button      { order: 3; }

.product-wrapper .product-buttons > div {
    margin: 0 !important;
    padding: 0 !important;
}

/* Circular pill buttons — cover all anchor/button/YITH markup variants */
.product-wrapper .product-buttons a,
.product-wrapper .product-buttons button,
.product-wrapper .product-buttons .whishlist-button .yith-wcwl-add-to-wishlist a,
.product-wrapper .product-buttons .whishlist-button .yith-add-to-wishlist-button-block a,
.product-wrapper .product-buttons .whishlist-button .yith-wcwl-add-button a,
.product-wrapper .product-buttons .whishlist-button a.yith-wcwl-add-to-wishlist-button,
.product-wrapper .product-buttons .whishlist-button button,
.product-wrapper .product-buttons .quickview-button a,
.product-wrapper .product-buttons .quickview-button a.quickview-btn,
.product-wrapper .product-buttons .quickview-button a.theme-button-style,
.product-wrapper .product-buttons .whishlist-button a.theme-button-style {
    width: 40px !important;
    height: 40px !important;
    line-height: 40px !important;
    min-width: 40px !important;
    max-width: 40px !important;
    background: #fff !important;
    color: #212121 !important;
    border-radius: 50% !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12) !important;
    font-size: 0 !important;
    transition: all 0.25s ease !important;
    padding: 0 !important;
    text-decoration: none !important;
    border: 0 !important;
    outline: 0 !important;
    text-align: center !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
}

/* Kill the focus ring / green outline that appears after click/tap on Quick View (and siblings) */
.product-wrapper .product-buttons a:focus,
.product-wrapper .product-buttons a:focus-visible,
.product-wrapper .product-buttons a:active,
.product-wrapper .product-buttons button:focus,
.product-wrapper .product-buttons button:focus-visible,
.product-wrapper .product-buttons button:active {
    outline: 0 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12) !important;
    border: 0 !important;
}

/* Hide YITH's own SVG / text / loader so only our ::before glyph is visible */
.product-wrapper .product-buttons .whishlist-button .yith-wcwl-icon,
.product-wrapper .product-buttons .whishlist-button .yith-wcwl-icon-svg,
.product-wrapper .product-buttons .whishlist-button svg,
.product-wrapper .product-buttons .whishlist-button i,
.product-wrapper .product-buttons .whishlist-button .yith-wcwl-add-to-wishlist-button-text,
.product-wrapper .product-buttons .whishlist-button .feedback,
.product-wrapper .product-buttons .whishlist-button .ajax-loading,
.product-wrapper .product-buttons .whishlist-button .clear,
.product-wrapper .product-buttons .whishlist-button br {
    display: none !important;
}

/* Collapse extra YITH wrappers so they don't become a second square */
.product-wrapper .product-buttons .whishlist-button .yith-wcwl-add-to-wishlist,
.product-wrapper .product-buttons .whishlist-button .yith-wcwl-add-button,
.product-wrapper .product-buttons .whishlist-button .yith-add-to-wishlist-button-block {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
    width: auto !important;
    height: auto !important;
    min-width: 0 !important;
    display: inline-block !important;
    line-height: 1 !important;
}

/* Icon glyphs (presslayouts icon font) */
.product-wrapper .product-buttons .whishlist-button a:before,
.product-wrapper .product-buttons .whishlist-button .yith-wcwl-add-to-wishlist a:before,
.product-wrapper .product-buttons .quickview-button a:before,
.product-wrapper .product-buttons .quickview-button a.quickview-btn:before,
.product-wrapper .product-buttons .cart-button a:before {
    display: inline-block !important;
    font-family: 'presslayouts-font' !important;
    font-size: 17px !important;
    line-height: 1 !important;
    font-weight: normal !important;
    margin: 0 !important;
}
.product-wrapper .product-buttons .whishlist-button a:before,
.product-wrapper .product-buttons .whishlist-button .yith-wcwl-add-to-wishlist a:before {
    content: "\e909" !important;
}
.product-wrapper .product-buttons .quickview-button a:before,
.product-wrapper .product-buttons .quickview-button a.quickview-btn:before {
    content: "\e98c" !important;
}
.product-wrapper .product-buttons .cart-button a:before {
    content: "\e90a" !important;
}
.product-type-variable .product-wrapper .product-buttons .cart-button a:before,
.product-type-grouped .product-wrapper .product-buttons .cart-button a:before,
.product-type-external .product-wrapper .product-buttons .cart-button a:before {
    content: "\e90a" !important;
}

/* Hide label text inside the buttons — icon-only */
.product-wrapper .product-buttons a *,
.product-wrapper .product-buttons button *,
.product-wrapper .product-buttons .added_to_cart,
.product-wrapper .product-buttons .yith-wcwl-add-to-wishlist .feedback {
    font-size: 0 !important;
}

.product-wrapper .product-buttons a:hover,
.product-wrapper .product-buttons button:hover {
    background: #059473 !important;
    color: #fff !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18) !important;
    border: 0 !important;
    outline: 0 !important;
    transform: translateY(-1px);
}
.product-wrapper .product-buttons a:hover:before,
.product-wrapper .product-buttons button:hover:before {
    color: #fff !important;
}

/* Wishlist active/added state */
.product-wrapper .product-buttons .whishlist-button .yith-wcwl-wishlistaddedbrowse a,
.product-wrapper .product-buttons .whishlist-button .yith-wcwl-wishlistexistsbrowse a {
    background: #059473 !important;
    color: #fff !important;
}
.product-wrapper .product-buttons .whishlist-button .yith-wcwl-wishlistaddedbrowse a:before,
.product-wrapper .product-buttons .whishlist-button .yith-wcwl-wishlistexistsbrowse a:before {
    color: #fff !important;
}

/* Mobile — slightly smaller circles so they don't overpower the image */
@media (max-width: 767px) {
    .product-wrapper .product-buttons {
        top: 8px !important;
        right: 8px !important;
        gap: 6px !important;
    }
    .product-wrapper .product-buttons a,
    .product-wrapper .product-buttons button,
    .product-wrapper .product-buttons .whishlist-button .yith-wcwl-add-to-wishlist a,
    .product-wrapper .product-buttons .whishlist-button button {
        width: 32px !important;
        height: 32px !important;
        line-height: 32px !important;
        min-width: 32px !important;
    }
    .product-wrapper .product-buttons .whishlist-button a:before,
    .product-wrapper .product-buttons .whishlist-button .yith-wcwl-add-to-wishlist a:before,
    .product-wrapper .product-buttons .quickview-button a:before,
    .product-wrapper .product-buttons .cart-button a:before {
        font-size: 14px !important;
    }
}

/* 2. Labels Redesign */
.product-wrapper .product-labels {
    position: absolute;
    top: 15px;
    left: 15px;
    z-index: 10;
}

.product-wrapper .product-labels .new {
    background: #84b74e;
    color: #fff;
    padding: 2px 8px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    border-radius: 2px;
}

/* 3. Product Info Area */
.product-wrapper .product-info {
    padding: 15px 0;
}

.product-wrapper .product-cats {
    font-size: 11px;
    color: #888;
    text-transform: uppercase;
    margin-bottom: 5px;
    letter-spacing: 0.5px;
}

.product-wrapper .product-cats a {
    color: #888;
}

.product-wrapper .product-title {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 8px;
    color: #333;
}

.product-wrapper .product-title a {
    color: #333;
}

/* 4. Price and Discount */
.product-wrapper .product-price {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.product-wrapper .product-price .price {
    font-size: 18px;
    font-weight: 700;
    color: #212121;
    display: flex;
    align-items: center;
    gap: 8px;
}

.product-wrapper .product-price del {
    font-size: 14px;
    color: #999;
    font-weight: 400;
}

.product-wrapper .product-price ins {
    text-decoration: none;
    background: transparent;
    padding: 0;
    color: #212121;
}

.product-wrapper .on-sale {
    background: transparent !important;
    color: #059473 !important;
    font-weight: 600;
    font-size: 14px;
    padding: 0 !important;
    border: none !important;
}

/* 5. Variations (Size Swatches) — archive/loop product card */
.product-wrapper .product-variations {
    margin-top: 10px;
    border-top: 1px solid #eee;
    padding-top: 15px;
}

/* Keep all swatches on one line — no wrapping */
.products .product-wrapper .pressmart-swatches,
.products .product-wrapper .product-variations .pressmart-swatches-wrap {
    flex-wrap: nowrap !important;
    overflow: visible !important;
    white-space: nowrap;
}

.product-wrapper .pressmart-swatches {
    display: flex !important;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap !important;
}

.product-wrapper .swatch-label-text {
    font-size: 13px;
    color: #666;
    font-weight: 500;
    margin-right: 4px;
}

/* Outer swatch (.swatch-term) — strip border so the inner span renders the button */
.products .product-wrapper .pressmart-swatches .swatch-term.swatch,
.products .product-wrapper .pressmart-swatches .swatch-term.swatch.swatch-circle {
    border: 0 !important;
    background: transparent !important;
    padding: 0 !important;
    margin: 0 !important;
    min-width: 0 !important;
    width: auto !important;
    height: auto !important;
    border-radius: 0 !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    box-sizing: border-box !important;
}

/* Inner span IS the button — square box like the screenshot */
.products .product-wrapper .pressmart-swatches .swatch.swatch-label > span,
.product-wrapper .pressmart-swatches .swatch.swatch-label > span {
    border: 1px solid #e0e0e0 !important;
    background: #fff !important;
    color: #222 !important;
    min-width: 36px !important;
    min-height: 36px !important;
    width: auto !important;
    height: auto !important;
    padding: 4px 10px !important;
    border-radius: 4px !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    line-height: 1 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08) !important;
    transition: border-color .2s ease, background-color .2s ease, color .2s ease, box-shadow .2s ease, transform .2s ease;
}

/* Hover — black background, white text, shadow highlight */
.products .product-wrapper .pressmart-swatches .swatch.swatch-label:hover > span {
    border-color: #000 !important;
    background: #000 !important;
    color: #fff !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25) !important;
    transform: translateY(-1px);
}
.products .product-wrapper .pressmart-swatches .swatch.swatch-label.swatch-selected > span {
    border-color: #000 !important;
    background: #000 !important;
    color: #fff !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25) !important;
}

/* "+N more" pill — same look as a size button, links to product page */
.products .product-wrapper .pressmart-swatches .swatch.swatch-more,
.product-wrapper .pressmart-swatches .swatch.swatch-more {
    border: 0 !important;
    background: transparent !important;
    padding: 0 !important;
    margin: 0 !important;
    text-decoration: none !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    box-sizing: border-box !important;
}
.products .product-wrapper .pressmart-swatches .swatch.swatch-more > span,
.product-wrapper .pressmart-swatches .swatch.swatch-more > span {
    border: 1px dashed #c5c5c5 !important;
    background: #f6f6f6 !important;
    color: #555 !important;
    min-width: 36px !important;
    min-height: 36px !important;
    padding: 4px 10px !important;
    border-radius: 4px !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    line-height: 1 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08) !important;
    transition: border-color .2s ease, background-color .2s ease, color .2s ease, box-shadow .2s ease, transform .2s ease;
}
.products .product-wrapper .pressmart-swatches .swatch.swatch-more:hover > span {
    border-color: #000 !important;
    background: #000 !important;
    color: #fff !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25) !important;
    transform: translateY(-1px);
}

/* Color / image swatches inside loop — keep them tidy alongside label swatches */
.products .product-wrapper .pressmart-swatches .swatch.swatch-color > span,
.products .product-wrapper .pressmart-swatches .swatch.swatch-image > img {
    width: 24px !important;
    height: 24px !important;
    line-height: 24px !important;
    border: 1px solid #e0e0e0 !important;
    border-radius: 4px !important;
}
.products .product-wrapper .pressmart-swatches .swatch.swatch-circle.swatch-color > span,
.products .product-wrapper .pressmart-swatches .swatch.swatch-circle.swatch-image > img {
    border-radius: 50% !important;
}

/* ===== Responsive — keep swatches inside the product card ===== */
/* Base guardrails: never overflow the card, allow horizontal scroll as last resort */
.products .product-wrapper .product-variations,
.product-wrapper .product-variations {
    max-width: 100%;
    overflow: hidden;
}
.products .product-wrapper .pressmart-swatches,
.product-wrapper .pressmart-swatches {
    max-width: 100%;
    min-width: 0;
}
.products .product-wrapper .pressmart-swatches .swatch,
.product-wrapper .pressmart-swatches .swatch {
    flex: 0 0 auto;
    min-width: 0 !important;
}

/* Tablet / small laptop */
@media (max-width: 1199px) {
    .products .product-wrapper .pressmart-swatches,
    .product-wrapper .pressmart-swatches {
        gap: 5px;
    }
    .products .product-wrapper .pressmart-swatches .swatch.swatch-label > span,
    .product-wrapper .pressmart-swatches .swatch.swatch-label > span,
    .products .product-wrapper .pressmart-swatches .swatch.swatch-more > span,
    .product-wrapper .pressmart-swatches .swatch.swatch-more > span {
        min-width: 32px !important;
        min-height: 32px !important;
        padding: 3px 8px !important;
        font-size: 12px !important;
    }
}

/* Tablet portrait */
@media (max-width: 991px) {
    .product-wrapper .swatch-label-text {
        font-size: 12px;
        margin-right: 3px;
    }
    .products .product-wrapper .pressmart-swatches,
    .product-wrapper .pressmart-swatches {
        gap: 4px;
    }
    .products .product-wrapper .pressmart-swatches .swatch.swatch-label > span,
    .product-wrapper .pressmart-swatches .swatch.swatch-label > span,
    .products .product-wrapper .pressmart-swatches .swatch.swatch-more > span,
    .product-wrapper .pressmart-swatches .swatch.swatch-more > span {
        min-width: 30px !important;
        min-height: 30px !important;
        padding: 3px 6px !important;
        font-size: 11px !important;
    }
    .products .product-wrapper .pressmart-swatches .swatch.swatch-color > span,
    .products .product-wrapper .pressmart-swatches .swatch.swatch-image > img {
        width: 22px !important;
        height: 22px !important;
        line-height: 22px !important;
    }
}

/* Mobile landscape / small tablet */
@media (max-width: 767px) {
    .product-wrapper .product-variations {
        padding-top: 8px;
        margin-top: 6px;
    }
    .product-wrapper .swatch-label-text {
        font-size: 9px;
        margin-right: 2px;
    }
    .products .product-wrapper .pressmart-swatches,
    .product-wrapper .pressmart-swatches {
        gap: 2px;
    }
    .products .product-wrapper .pressmart-swatches .swatch.swatch-label > span,
    .product-wrapper .pressmart-swatches .swatch.swatch-label > span,
    .products .product-wrapper .pressmart-swatches .swatch.swatch-more > span,
    .product-wrapper .pressmart-swatches .swatch.swatch-more > span {
        min-width: 20px !important;
        min-height: 20px !important;
        padding: 1px 4px !important;
        font-size: 8px !important;
        border-radius: 3px !important;
    }
    .products .product-wrapper .pressmart-swatches .swatch.swatch-color > span,
    .products .product-wrapper .pressmart-swatches .swatch.swatch-image > img {
        width: 16px !important;
        height: 16px !important;
        line-height: 16px !important;
    }
}

/* Small phones */
@media (max-width: 480px) {
    .product-wrapper .swatch-label-text {
        font-size: 8px;
    }
    .products .product-wrapper .pressmart-swatches,
    .product-wrapper .pressmart-swatches {
        gap: 2px;
    }
    .products .product-wrapper .pressmart-swatches .swatch.swatch-label > span,
    .product-wrapper .pressmart-swatches .swatch.swatch-label > span,
    .products .product-wrapper .pressmart-swatches .swatch.swatch-more > span,
    .product-wrapper .pressmart-swatches .swatch.swatch-more > span {
        min-width: 18px !important;
        min-height: 18px !important;
        padding: 1px 3px !important;
        font-size: 7px !important;
    }
    .products .product-wrapper .pressmart-swatches .swatch.swatch-color > span,
    .products .product-wrapper .pressmart-swatches .swatch.swatch-image > img {
        width: 14px !important;
        height: 14px !important;
        line-height: 14px !important;
    }
}

/* Hide duplicate Quick View from title area since we moved it to image buttons */
.product-wrapper .product-info .quickview-button {
    display: none;
}

/* Adjust shadow on hover for the whole card */
.product-wrapper {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background: #fff;
    padding: 10px;
}

.product-wrapper:hover {
    box-shadow: 0 10px 25px rgba(0,0,0,0.08);
    transform: translateY(-5px);
}

/* Disable hover-lift on touch devices to avoid sticky :hover after tap */
@media (hover: none) {
    .product-wrapper:hover {
        transform: none;
    }
}
