/*
Theme Name: Astra Child
Theme URI: https://bookplay.mn/
Description: Child theme for Astra - BookPlay Store
Author: BookPlay Store
Template: astra
Version: 1.0.0
Text Domain: astra-child
*/


/* =========================================================
   BOOKPLAY STORE
   ========================================================= */


/* ---------------------------------------------------------
   HOMEPAGE - HIDE PAGE TITLE
   --------------------------------------------------------- */

.home .entry-header {
    display: none !important;
}


/* ---------------------------------------------------------
   FEATURED PRODUCTS
   --------------------------------------------------------- */

.bookplay-products {
    width: 100% !important;
}

.bookplay-products .wc-block-product-template {
    width: 100% !important;
}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 767px) {

    /* ---------- Main content ---------- */

    .home .site-content .ast-container {
        padding-left: 20px !important;
        padding-right: 20px !important;
    }


    /* ---------- Featured products heading ---------- */

    .bookplay-products-heading {
        font-size: 22px !important;
        line-height: 1.2 !important;
        margin-top: 14px !important;
        margin-bottom: 20px !important;
        text-align: center !important;
    }


    /* ---------- Products section ---------- */

    .bookplay-products {
        width: 100% !important;
        max-width: 100% !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        padding-bottom: 35px !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }


    /* ---------- Two-column product grid ---------- */

    .bookplay-products .wc-block-product-template {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;

        width: 100% !important;
        max-width: 100% !important;

        column-gap: 18px !important;
        row-gap: 30px !important;

        padding: 0 !important;
        margin: 0 !important;
    }


    /* ---------- Individual product ---------- */

    .bookplay-products .wc-block-product {
        width: 100% !important;
        min-width: 0 !important;
        max-width: none !important;

        margin: 0 !important;
        padding: 0 !important;

        text-align: center !important;
    }


    /* ---------- Product image ---------- */

    .bookplay-products .wc-block-components-product-image {
        width: 100% !important;
        max-width: 150px !important;

        margin-left: auto !important;
        margin-right: auto !important;
        margin-bottom: 10px !important;
    }

    .bookplay-products .wc-block-components-product-image img {
        display: block !important;

        width: 150px !important;
        max-width: 100% !important;
        height: auto !important;

        margin-left: auto !important;
        margin-right: auto !important;
    }


    /* ---------- Product name ---------- */

    .bookplay-products .wc-block-components-product-name {
        font-size: 16px !important;
        line-height: 1.25 !important;

        margin-top: 8px !important;
        margin-bottom: 10px !important;

        text-align: center !important;
    }


    /* ---------- Price ---------- */

    .bookplay-products .wc-block-components-product-price {
        font-size: 14px !important;
        line-height: 1.3 !important;

        margin-top: 6px !important;
        margin-bottom: 12px !important;

        text-align: center !important;
    }


    /* ---------- Add to cart button ---------- */

    .bookplay-products .wp-block-button {
        margin-top: 0 !important;
        margin-bottom: 0 !important;

        text-align: center !important;
    }

    .bookplay-products .wp-block-button__link {
        font-size: 14px !important;
        line-height: 1.2 !important;

        padding: 10px 16px !important;

        min-height: auto !important;
        width: auto !important;

        white-space: nowrap !important;
    }


    /* ---------- Bottom space before footer ---------- */

    .bookplay-products .wc-block-product-template {
        margin-bottom: 0 !important;
    }

}


/* =========================================================
   SMALL PHONES
   ========================================================= */

@media (max-width: 480px) {

    .home .site-content .ast-container {
        padding-left: 18px !important;
        padding-right: 18px !important;
    }

    .bookplay-products-heading {
        font-size: 21px !important;
        margin-top: 12px !important;
        margin-bottom: 18px !important;
    }

    .bookplay-products .wc-block-product-template {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        column-gap: 14px !important;
        row-gap: 28px !important;
    }

    .bookplay-products .wc-block-components-product-image {
        max-width: 145px !important;
    }

    .bookplay-products .wc-block-components-product-image img {
        width: 145px !important;
    }

    .bookplay-products .wc-block-components-product-name {
        font-size: 15px !important;
        line-height: 1.25 !important;
    }

    .bookplay-products .wc-block-components-product-price {
        font-size: 13px !important;
    }

    .bookplay-products .wp-block-button__link {
        font-size: 13px !important;
        padding: 10px 14px !important;
    }

}

/* Hide product category text on shop/product grids */
.woocommerce ul.products li.product .ast-woo-product-category,
.woocommerce-page ul.products li.product .ast-woo-product-category {
    display: none !important;
}

/* Hide WooCommerce result count */
.woocommerce .woocommerce-result-count {
    display: none !important;
}

/* =====================================================
   BookPlay Store - Hide WooCommerce breadcrumbs
   ===================================================== */

.woocommerce .woocommerce-breadcrumb {
    display: none !important;
}

/* =====================================================
   BookPlay Store - Compact Shop page
   ===================================================== */

.woocommerce-shop .ast-container {
    padding-top: 0 !important;
}

.woocommerce-shop #primary {
    margin-top: 25px !important;
    padding-top: 0 !important;
}

.woocommerce-shop .woocommerce-products-header {
    margin-bottom: 5px !important;
}

.woocommerce-shop .woocommerce-ordering {
    margin-bottom: 10px !important;
}

.woocommerce-shop ul.products {
    margin-top: 0 !important;
}
/* =====================================================
   BookPlay Store - Single Product Mobile Polish
   ===================================================== */

@media (max-width: 767px) {

    .single-product .site-content .ast-container {
        padding-left: 20px !important;
        padding-right: 20px !important;
    }

    .single-product div.product .woocommerce-product-gallery {
       width: 72% !important;
max-width: 300px !important;
        float: none !important;
        margin-left: auto !important;
        margin-right: auto !important;
        margin-bottom: 28px !important;
    }

    .single-product div.product .woocommerce-product-gallery img {
        width: 100% !important;
        height: auto !important;
    }

    .single-product div.product .summary {
        width: 100% !important;
        max-width: 100% !important;
        float: none !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        margin-top: 0 !important;
    }
}
/* =========================================================
   BOOKPLAY STORE - MOBILE PRODUCT CARDS
   Keep Add to Cart buttons aligned
   ========================================================= */

@media (max-width: 767px) {

    .woocommerce ul.products li.product {
        display: flex !important;
        flex-direction: column !important;
    }

    .woocommerce ul.products li.product .woocommerce-loop-product__title {
        min-height: 3em !important;
    }

    .woocommerce ul.products li.product .button {
        margin-top: auto !important;
    }

}

/* =========================================================
   BOOKPLAY STORE - BOOK PREVIEW POPUP
   ========================================================= */


/* ---------- Preview button ---------- */

.bookplay-preview-button {
    display: inline-block !important;

    margin-left: 8px !important;
    padding: 10px 18px !important;

    background: #ffffff !important;
    color: #0879d1 !important;

    border: 1px solid #0879d1 !important;
    border-radius: 3px !important;

    font-weight: 600 !important;
    line-height: 1.2 !important;

    cursor: pointer !important;
}


/* ---------- Dark background ---------- */

#bookplay-preview-overlay {
    display: none;

    position: fixed;
    z-index: 999999;

    top: 0;
    right: 0;
    bottom: 0;
    left: 0;

    background: rgba(0, 0, 0, 0.78);

    padding: 25px;
}


/* ---------- Open ---------- */

#bookplay-preview-overlay.is-open {
    display: flex;

    align-items: center;
    justify-content: center;
}


/* ---------- Popup ---------- */

#bookplay-preview-box {
    width: min(900px, 95vw);
    height: 92vh;

    background: #ffffff;

    border-radius: 8px;

    overflow: hidden;

    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);

    display: flex;
    flex-direction: column;
}


/* ---------- Header ---------- */

.bookplay-preview-header {
    height: 56px;
    min-height: 56px;

    padding: 0 15px 0 20px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    background: #ffffff;

    border-bottom: 1px solid #dddddd;
}


/* ---------- Title ---------- */

.bookplay-preview-title {
    font-size: 17px;
    font-weight: 600;
}


/* ---------- Close button ---------- */

#bookplay-preview-close {
    width: 40px;
    height: 40px;

    padding: 0 !important;

    background: transparent !important;
    color: #333333 !important;

    border: 0 !important;

    font-size: 32px !important;
    font-weight: 400 !important;
    line-height: 40px !important;

    cursor: pointer;
}


/* ---------- PDF ---------- */

#bookplay-preview-frame {
    display: block;

    width: 100%;
    height: 100%;

    flex: 1;

    border: 0;
}


/* ---------- Stop background scrolling ---------- */

body.bookplay-preview-open {
    overflow: hidden !important;
}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 767px) {

    .bookplay-preview-button {
        margin-left: 8px !important;
        padding: 12px 14px !important;
    }


    #bookplay-preview-overlay {
        padding: 0;
    }


    #bookplay-preview-box {
        width: 100vw;
        height: 100vh;

        border-radius: 0;
    }


    .bookplay-preview-header {
        height: 54px;
        min-height: 54px;

        padding-left: 15px;
        padding-right: 10px;
    }


    .bookplay-preview-title {
        font-size: 16px;
    }

}
/* =========================================================
   BookPlay Store - PDF Preview Popup
   ========================================================= */


/* Preview button */

.bookplay-preview-button {
    display: inline-block !important;
    margin-left: 8px !important;
    padding: 10px 16px !important;

    background: #ffffff !important;
    color: #087ac1 !important;

    border: 1px solid #087ac1 !important;
    border-radius: 2px !important;

    font-weight: 600 !important;
    cursor: pointer !important;

    vertical-align: middle !important;
}


/* Dark background */

#bookplay-preview-overlay {
    display: none;

    position: fixed;
    inset: 0;

    z-index: 999999;

    background: rgba(0, 0, 0, 0.72);

    padding: 30px;
}


/* Show popup */

#bookplay-preview-overlay.is-open {
    display: flex;

    align-items: center;
    justify-content: center;
}


/* Popup */

#bookplay-preview-box {
    width: 900px;
    max-width: 95vw;

    height: 90vh;

    background: #ffffff;

    border-radius: 6px;

    overflow: hidden;

    display: flex;
    flex-direction: column;
}


/* Header */

#bookplay-preview-header {
    flex: 0 0 auto;

    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 10px 14px;

    background: #ffffff;

    border-bottom: 1px solid #dddddd;

    font-weight: 600;
}


/* Close button */

#bookplay-preview-close {
    width: 36px;
    height: 36px;

    padding: 0 !important;

    background: transparent !important;
    color: #222222 !important;

    border: 0 !important;

    font-size: 28px !important;
    line-height: 36px !important;

    cursor: pointer;
}


/* Viewer area */

#bookplay-preview-content {
    flex: 1 1 auto;

    min-height: 0;

    overflow: hidden;
}

#bookplay-preview-content iframe {
    display: block;

    width: 100% !important;
    height: 100% !important;

    border: 0 !important;
}


/* Prevent page scrolling behind popup */

body.bookplay-preview-open {
    overflow: hidden;
}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 767px) {

    .bookplay-preview-button {
        margin-left: 8px !important;
        padding: 10px 14px !important;
    }

    #bookplay-preview-overlay {
        padding: 10px;
    }

    #bookplay-preview-box {
        width: 100%;
        max-width: 100%;

        height: 88vh;
    }

    #bookplay-preview-header {
        padding: 8px 12px;
    }

}
/* =========================================================
   BOOKPLAY STORE - PRODUCT COVER ALIGNMENT
   Keep full book covers visible and cards aligned
   ========================================================= */


/* ---------- Homepage featured products ---------- */

.bookplay-products .wc-block-components-product-image {
    height: 300px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.bookplay-products .wc-block-components-product-image img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
}


/* ---------- Mobile ---------- */

@media (max-width: 767px) {

    .bookplay-products .wc-block-components-product-image {
        height: 210px !important;
    }
}
/* =========================================================
   BOOKPLAY STORE - SHOP COVER ALIGNMENT TEST
   Keep full covers, equal image area
   ========================================================= */

.woocommerce-shop ul.products li.product .astra-shop-thumbnail-wrap {
    height: 300px !important;
    display: flex !important;
    align-items: flex-start !important;
    justify-content: center !important;
}

.woocommerce-shop ul.products li.product .astra-shop-thumbnail-wrap > a {
    width: 100% !important;
    height: 100% !important;
    display: flex !important;
    align-items: flex-start !important;
    justify-content: center !important;
}

.woocommerce-shop ul.products li.product .astra-shop-thumbnail-wrap img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    object-position: top center !important;
    margin: 0 !important;
}
/* =========================================================
   BOOKPLAY STORE - SHOP PRODUCT COLUMN CENTERING
   ========================================================= */

.woocommerce-shop ul.products li.product {
    text-align: center !important;
}

/* Cover area centered inside each product column */
.woocommerce-shop ul.products li.product .astra-shop-thumbnail-wrap {
    width: 100% !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

/* Keep the whole cover centered */
.woocommerce-shop ul.products li.product .astra-shop-thumbnail-wrap > a {
    margin-left: auto !important;
    margin-right: auto !important;
}

/* Title / price area centered */
.woocommerce-shop ul.products li.product .astra-shop-summary-wrap {
    width: 100% !important;
    text-align: center !important;
}

/* Add to cart button centered */
.woocommerce-shop ul.products li.product .button {
    align-self: center !important;
    margin-left: auto !important;
    margin-right: auto !important;
}
/* =========================================================
 * BookPlay Store - Shop thumbnail actions FINAL
 * Cover = product page
 * Blue button = add to cart
 * Remove Astra image overlay + View Cart link
 * ========================================================= */

.woocommerce ul.products li.product .astra-shop-thumbnail-wrap > .ast-on-card-button,
.woocommerce ul.products li.product .astra-shop-thumbnail-wrap > .added_to_cart.wc-forward {
    display: none !important;
}
/* BookPlay Store — remove Astra image hover Add to Cart */
.woocommerce ul.products li.product .ast-on-card-button {
    display: none !important;
}
/* =========================================================
   BookPlay – Featured Products Heading
   Mobile final polish
   ========================================================= */

@media (max-width: 767px) {

    .bookplay-products-heading {
        font-size: 21px !important;
        line-height: 1.25 !important;
        margin-top: 16px !important;
        margin-bottom: 22px !important;
        padding-left: 10px;
        padding-right: 10px;
        text-align: center !important;
    }

}

@media (max-width: 390px) {

    .bookplay-products-heading {
        font-size: 20px !important;
    }

}
