/*
Theme Name: Blocksy Child
Theme URI: https://creativethemes.com/blocksy/
Description: Child theme for Blocksy custom WooCommerce product card pricing badges.
Author: Copilot
Template: blocksy
Version: 1.0.0
Text Domain: blocksy-child
*/

/* Product card save amount under price */
.woocommerce ul.products li.product .ct-save-amount,
.woocommerce-page ul.products li.product .ct-save-amount {
    display: inline-block !important;
    margin-top: 8px !important;
    padding: 6px 14px !important;
    background: #b00000 !important;
    color: #ffffff !important;
    border-radius: 0 !important;
    border: 0 !important;
    font-size: 13px !important;
    line-height: 1.15 !important;
    font-weight: 700 !important;
}

/* Product card regular price must be gray and not bold */
.woocommerce ul.products li.product .price del,
.woocommerce-page ul.products li.product .price del,
.woocommerce ul.products li.product .price del .amount,
.woocommerce-page ul.products li.product .price del .amount,
.woocommerce ul.products li.product .price del bdi,
.woocommerce-page ul.products li.product .price del bdi {
    color: #9b9b9b !important;
    opacity: 1 !important;
    font-weight: 400 !important;
}

/* Sale badge text layout: 12% + OFF */
.woocommerce ul.products li.product .onsale .ct-sale-percent,
.woocommerce-page ul.products li.product .onsale .ct-sale-percent,
.woocommerce ul.products li.product .onsale .ct-sale-off,
.woocommerce-page ul.products li.product .onsale .ct-sale-off {
    display: block !important;
    line-height: 0.95 !important;
    text-align: center !important;
}

.woocommerce ul.products li.product .onsale .ct-sale-percent,
.woocommerce-page ul.products li.product .onsale .ct-sale-percent {
    font-size: 15px !important;
    font-weight: 700 !important;
}

.woocommerce ul.products li.product .onsale .ct-sale-off,
.woocommerce-page ul.products li.product .onsale .ct-sale-off {
    margin-top: 0 !important;
    font-size: 10px !important;
    font-weight: 700 !important;
    letter-spacing: 0.01em !important;
}

/* Match screenshot-like red circular discount badge */
.woocommerce ul.products li.product .onsale,
.woocommerce-page ul.products li.product .onsale {
    min-width: 58px !important;
    min-height: 58px !important;
    width: 58px !important;
    height: 58px !important;
    border-radius: 999px !important;
    background: #b00000 !important;
    color: #ffffff !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-direction: column !important;
    gap: 0 !important;
    top: 10px !important;
    right: 10px !important;
    left: auto !important;
    padding: 1px 0 0 !important;
}

/* Mobile: keep same visual proportion but smaller */
@media (max-width: 768px) {
    .woocommerce ul.products li.product .onsale,
    .woocommerce-page ul.products li.product .onsale {
        min-width: 46px !important;
        min-height: 46px !important;
        width: 46px !important;
        height: 46px !important;
        top: 6px !important;
        right: 6px !important;
    }

    .woocommerce ul.products li.product .onsale .ct-sale-percent,
    .woocommerce-page ul.products li.product .onsale .ct-sale-percent {
        font-size: 12px !important;
    }

    .woocommerce ul.products li.product .onsale .ct-sale-off,
    .woocommerce-page ul.products li.product .onsale .ct-sale-off {
        font-size: 8px !important;
    }
}

/* Product card quick view: bottom overlay bar inside image */
.woocommerce ul.products li.product figure,
.woocommerce-page ul.products li.product figure {
    position: relative;
}

.woocommerce ul.products li.product figure .ct-woo-card-extra,
.woocommerce-page ul.products li.product figure .ct-woo-card-extra {
    position: absolute !important;
    z-index: 5 !important;
    inset-inline: 0 !important;
    top: auto !important;
    bottom: 0 !important;
    inset-block-start: auto !important;
    inset-block-end: 0 !important;
    width: 100% !important;
    display: block !important;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.22s ease, transform 0.22s ease;
    pointer-events: none;
}

.woocommerce ul.products li.product figure .ct-woo-card-extra > :not(.ct-open-quick-view),
.woocommerce-page ul.products li.product figure .ct-woo-card-extra > :not(.ct-open-quick-view) {
    display: none !important;
}

.woocommerce ul.products li.product figure .ct-woo-card-extra .ct-open-quick-view,
.woocommerce-page ul.products li.product figure .ct-woo-card-extra .ct-open-quick-view {
    width: 100% !important;
    min-height: 44px !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: #1f1f1f !important;
    color: #ffffff !important;
    --theme-button-text-initial-color: #ffffff !important;
    --theme-button-text-hover-color: #ffffff !important;
    box-shadow: none !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.woocommerce ul.products li.product figure .ct-woo-card-extra .ct-open-quick-view::after,
.woocommerce-page ul.products li.product figure .ct-woo-card-extra .ct-open-quick-view::after {
    content: "QUICK VIEW";
    color: #ffffff;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.02em;
    line-height: 1;
}

.woocommerce ul.products li.product figure .ct-woo-card-extra .ct-open-quick-view svg,
.woocommerce-page ul.products li.product figure .ct-woo-card-extra .ct-open-quick-view svg,
.woocommerce ul.products li.product figure .ct-woo-card-extra .ct-open-quick-view .ct-tooltip,
.woocommerce-page ul.products li.product figure .ct-woo-card-extra .ct-open-quick-view .ct-tooltip {
    display: none !important;
}

.woocommerce ul.products li.product figure .ct-woo-card-extra[data-type] .ct-open-quick-view,
.woocommerce-page ul.products li.product figure .ct-woo-card-extra[data-type] .ct-open-quick-view {
    top: auto !important;
    bottom: 0 !important;
}

@media (any-hover: hover) {
    .woocommerce ul.products li.product:hover figure .ct-woo-card-extra,
    .woocommerce-page ul.products li.product:hover figure .ct-woo-card-extra {
        opacity: 1;
        transform: translateY(0);
        pointer-events: auto;
    }
}

@media (any-hover: none) {
    .woocommerce ul.products li.product figure .ct-woo-card-extra,
    .woocommerce-page ul.products li.product figure .ct-woo-card-extra {
        opacity: 1;
        transform: translateY(0);
        pointer-events: auto;
    }
}

/* Mobile: place Quick View below image, not over image */
@media (max-width: 768px) {
    .woocommerce ul.products li.product figure,
    .woocommerce-page ul.products li.product figure {
        padding-bottom: 44px;
    }

    .woocommerce ul.products li.product figure .ct-woo-card-extra,
    .woocommerce-page ul.products li.product figure .ct-woo-card-extra {
        top: auto !important;
        bottom: 0 !important;
        inset-inline: 0 !important;
        opacity: 1 !important;
        transform: translateY(0) !important;
        pointer-events: auto !important;
    }

    .woocommerce ul.products li.product figure .ct-woo-card-extra .ct-open-quick-view,
    .woocommerce-page ul.products li.product figure .ct-woo-card-extra .ct-open-quick-view {
        min-height: 44px !important;
    }
}

/* [all_comments] shortcode */
.ct-all-comments-wrap {
    margin: 20px 0;
}

.ct-all-comments-title {
    text-align: center;
    margin: 0 0 20px;
}

.ct-all-comments-summary {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    padding: 28px;
    margin: 0 0 24px;
    background: #f3f3f3;
}

.ct-all-comments-summary-left {
    min-width: 220px;
}

.ct-all-comments-summary-stars {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 42px;
    line-height: 1;
    color: #f2a65a;
}

.ct-all-comments-summary-stars .is-empty {
    color: #bcbcbc;
}

.ct-all-comments-summary-stars strong {
    margin-left: 10px;
    color: #202020;
    font-size: 26px;
    font-weight: 500;
}

.ct-all-comments-summary-right {
    flex: 1 1 auto;
    min-width: 280px;
    max-width: 430px;
    display: grid;
    gap: 10px;
}

.ct-all-comments-dist-row {
    display: grid;
    grid-template-columns: 130px 1fr auto;
    align-items: center;
    gap: 10px;
}

.ct-all-comments-dist-stars {
    color: #f2a65a;
    font-size: 16px;
    line-height: 1;
    letter-spacing: 1px;
}

.ct-all-comments-dist-stars .is-empty {
    color: #bcbcbc;
}

.ct-all-comments-dist-bar {
    height: 14px;
    background: #d7d7d7;
    overflow: hidden;
}

.ct-all-comments-dist-bar > span {
    display: block;
    height: 100%;
    background: #f2a65a;
}

.ct-all-comments-dist-count {
    color: #2c2c2c;
    font-size: 18px;
    line-height: 1;
}

.ct-all-comments-list {
    display: grid;
    gap: 16px;
}

.ct-all-comment-item {
    padding: 16px;
    border: 1px solid #e5e5e5;
    background: #f9f9f9;
}

.ct-all-comment-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.ct-all-comment-author {
    font-weight: 700;
    line-height: 1.2;
}

.ct-all-comment-date {
    color: #808080;
    font-size: 13px;
}

.ct-all-comment-rating {
    color: #f2a65a;
    margin: 6px 0;
}

.ct-all-comment-rating .is-empty {
    color: #bcbcbc;
}

.ct-all-comment-content p:last-child {
    margin-bottom: 0;
}

.ct-all-comments-empty {
    text-align: center;
    color: #8a8a8a;
    font-size: 28px;
    padding: 48px 20px;
}

@media (max-width: 900px) {
    .ct-all-comments-summary {
        flex-direction: column;
        padding: 20px;
    }

    .ct-all-comments-summary-stars {
        font-size: 30px;
    }

    .ct-all-comments-summary-stars strong {
        font-size: 22px;
    }

    .ct-all-comments-summary-right {
        max-width: 100%;
    }

    .ct-all-comments-dist-row {
        grid-template-columns: 110px 1fr auto;
        gap: 8px;
    }

    .ct-all-comments-dist-count {
        font-size: 16px;
    }
}

/* [footer_subscribe] shortcode */
.ct-footer-subscribe {
    width: 100%;
}

.ct-footer-subscribe-form {
    display: flex;
    gap: 16px;
    align-items: stretch;
    max-width: 900px;
}

.ct-footer-subscribe-form input[type="email"] {
    flex: 1 1 auto;
    min-height: 54px;
    padding: 0 24px;
    border: 2px solid rgba(255, 255, 255, 0.75);
    border-radius: 0;
    background: transparent;
    color: #ffffff;
    font-size: 18px;
}

.ct-footer-subscribe-form input[type="email"]::placeholder {
    color: rgba(255, 255, 255, 0.72);
}

.ct-footer-subscribe-form button {
    min-height: 54px;
    padding: 0 28px;
    border: 0;
    border-radius: 0;
    background: #f0f0f0;
    color: #252525;
    font-size: 22px;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.ct-footer-subscribe-message {
    margin-bottom: 10px;
    font-size: 14px;
}

.ct-footer-subscribe-message.is-success {
    color: #29bf5f;
}

.ct-footer-subscribe-message.is-info {
    color: #f5d66a;
}

.ct-footer-subscribe-message.is-error {
    color: #ff7f7f;
}

@media (max-width: 768px) {
    .ct-footer-subscribe-form {
        gap: 10px;
    }

    .ct-footer-subscribe-form input[type="email"] {
        min-height: 48px;
        font-size: 16px;
        padding: 0 16px;
    }

    .ct-footer-subscribe-form button {
        min-height: 48px;
        font-size: 18px;
        padding: 0 16px;
    }
}

/* Woo breadcrumbs: align left + light gray container */
.tax-product_cat .hero-section .entry-header .ct-breadcrumbs,
.single-product .hero-section .entry-header .ct-breadcrumbs {
    display: block;
    width: 100%;
    text-align: left !important;
    background: #f3f3f3;
    padding: 10px 14px;
    border-radius: 0;
}

.tax-product_cat .hero-section .entry-header .ct-breadcrumbs[data-source="default"] > span,
.single-product .hero-section .entry-header .ct-breadcrumbs[data-source="default"] > span {
    justify-content: flex-start;
}

/* Product description cleanup for imported inline-styled HTML */
.single-product .woocommerce-Tabs-panel--description .c6 {
    width: 100% !important;
    float: none !important;
    padding: 0 !important;
}

.single-product .woocommerce-Tabs-panel--description .row.center1 {
    display: grid;
    grid-template-columns: repeat(3, minmax(140px, 1fr));
    gap: 10px;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

.single-product .woocommerce-Tabs-panel--description .e4 {
    width: auto !important;
    float: none !important;
    padding: 8px !important;
    text-align: center !important;
}

/* Single product Buy it now button */
.single-product form.cart .single_buy_now_button {
    width: 100%;
    margin-top: 10px;
}

/* Hide variation price above Add to cart; keep title-area price only */
.single-product .summary .single_variation .woocommerce-variation-price,
.single-product .summary .single_variation .price {
    display: none !important;
}

@media (max-width: 900px) {
    .single-product .woocommerce-Tabs-panel--description .row.center1 {
        grid-template-columns: repeat(2, minmax(120px, 1fr));
    }
}

@media (max-width: 640px) {
    .single-product .woocommerce-Tabs-panel--description .row.center1 {
        grid-template-columns: 1fr;
    }
}

/* Hide Quick View button on hover for sold out products */
.woocommerce ul.products li.product.outofstock figure .ct-woo-card-extra .ct-open-quick-view,
.woocommerce-page ul.products li.product.outofstock figure .ct-woo-card-extra .ct-open-quick-view {
    display: none !important;
}

/* Sold Out banner at the bottom of product card image */
.ct-sold-out-banner {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    background-color: rgba(80, 80, 80, 0.85);
    color: #ffffff;
    text-align: center;
    font-size: 14px;
    font-weight: 700;
    padding: 8px 0;
    z-index: 10;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* Ensure currency symbol is always visible on all product prices */
.woocommerce-Price-currencySymbol {
    display: inline !important;
    visibility: visible !important;
    font-size: inherit !important;
}
