/**
* Theme Name: Sanat Child
* Description: This is a child theme of Sanat, generated by Merlin WP.
* Author: <a href="https://themeforest.net/user/expert-themes">Expert Themes</a>
* Template: sanat
* Version: 1.0
*/

a, a:visited, {
  color: inherit;
}

.main-header .header-top {
    position: relative;
    top: 40px;
    margin-top: -40px;
    background-color: #222222;
    z-index: 999999999;
}

/* Hide Sanat sidebar on the WooCommerce Cart page only */
body.woocommerce-cart .sidebar-side,
body.woocommerce-cart #primary-sidebar,
body.woocommerce-cart .shop-sidebar {
    display: none !important;
}

/* Make the Cart page content full width */
body.woocommerce-cart .content-side,
body.woocommerce-cart .content-area,
body.woocommerce-cart #primary {
    width: 100% !important;
    max-width: 100% !important;
    flex: 0 0 100% !important;
}

/*
 * WooCommerce Cart layout
 * Cart table on the left, Cart Totals on the right.
 */
@media only screen and (min-width: 992px) {

    body.woocommerce-cart .sidebar-page-container .content-side,
    body.woocommerce-cart .sidebar-page-container .blog-details-content,
    body.woocommerce-cart .sidebar-page-container .content-area,
    body.woocommerce-cart .sidebar-page-container #primary {
        width: 100% !important;
        max-width: 100% !important;
        flex: 0 0 100% !important;
    }

    body.woocommerce-cart div.woocommerce {
        display: grid !important;
        grid-template-columns: minmax(0, 2fr) minmax(320px, 0.9fr) !important;
        grid-template-areas:
            "notices notices"
            "cart totals" !important;
        column-gap: 40px !important;
        row-gap: 0 !important;
        align-items: start !important;
        width: 100% !important;
    }

    body.woocommerce-cart div.woocommerce > .woocommerce-notices-wrapper,
    body.woocommerce-cart div.woocommerce > .woocommerce-message,
    body.woocommerce-cart div.woocommerce > .woocommerce-error,
    body.woocommerce-cart div.woocommerce > .woocommerce-info {
        grid-area: notices !important;
    }

    body.woocommerce-cart div.woocommerce > form.woocommerce-cart-form {
        grid-area: cart !important;
        float: none !important;
        clear: none !important;
        width: 100% !important;
        max-width: none !important;
        margin: 0 !important;
    }

    body.woocommerce-cart div.woocommerce > .cart-collaterals {
        grid-area: totals !important;
        float: none !important;
        clear: none !important;
        width: 100% !important;
        max-width: none !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    body.woocommerce-cart div.woocommerce > .cart-collaterals .cart_totals {
        float: none !important;
        clear: none !important;
        width: 100% !important;
        max-width: none !important;
        margin: 0 !important;
    }

    body.woocommerce-cart .cart-collaterals::before,
    body.woocommerce-cart .cart-collaterals::after {
        display: none !important;
        content: none !important;
    }
}

/* Stack the two sections on tablets and phones. */
@media only screen and (max-width: 991px) {

    body.woocommerce-cart div.woocommerce {
        display: block !important;
    }

    body.woocommerce-cart .woocommerce-cart-form,
    body.woocommerce-cart .cart-collaterals,
    body.woocommerce-cart .cart-collaterals .cart_totals {
        float: none !important;
        clear: both !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    body.woocommerce-cart .cart-collaterals {
        margin-top: 30px !important;
    }
}

/**
 * Disable Sanat's default sidebar on the WooCommerce Checkout page only.
 */
add_filter(
    'is_active_sidebar',
    function ( $is_active, $sidebar_id ) {

        if (
            function_exists( 'is_checkout' )
            && is_checkout()
            && ! is_order_received_page()
            && 'default-sidebar' === $sidebar_id
        ) {
            return false;
        }

        return $is_active;
    },
    100,
    2
);
