/*!
Theme Name: Living Book Press Kadence
Theme URI: https://www.kadencewp.com/kadence-theme/
Template: kadence
Author: ClickWP
Author URI: https://clickwp.com
Description: A child theme for the Kadence Theme.
Version: 1.2.1
License: GNU General Public License v3.0 (or later)
License URI: https://www.gnu.org/licenses/gpl-3.0.html
Text Domain: kadence-child
*/

/* Theme customizations
-------------------------------------------------------------- */

select {
	border-radius: 3px;
	padding: 0.4em 0.5em;
}

div.kadence-sticky-add-to-cart.vs-sm-false {
	display: block !important;
}

@media screen and (max-width: 719px) {

	.kadence-sticky-add-to-cart-title-wrap {
		display: none !important;
	}

}

/* Single Product Page
-------------------------------------------------------------- */

.single-product.woocommerce .content-container.site-container {
	max-width: 1000px;
}

.woocommerce div.product div.images .product_image {
	margin-left: auto;
	margin-right: auto;
}

div.product .book-author,
.woocommerce div.product div.woocommerce-product-rating {
	float: left;
	font-size: 14px;
	line-height: 2;
	margin-bottom: 1em;
}

div.product .book-author {
	margin-right: 1.5rem;
}

.woocommerce div.product p.price {
	clear: both;
}

.product_meta span.posted_in,
.product_meta span.tagged_as {
    display: none !important;
}

.single-product .product .cart_ship {
	color: var(--global-palette6);
	margin-top: 1rem;
	font-size: 14px;
	text-align: center;
}

/** Product labels */

.product_labels ul {
	margin-left: 0;
}

.product_labels li {
	list-style: none;
	margin-bottom: 1rem;
	position: relative;
	display: flex;
	align-items: flex-start;
	column-gap: 16px;
	cursor: pointer;
	overflow: hidden;
}

.woocommerce .product_labels img {
	max-width: 32px;
	margin-top: 4px;
}

.product_labels li strong {
	display: block;
}

.product_labels li:hover,
.product_labels li:focus {
	overflow: visible;
}

.product_labels li:hover .tooltip,
.product_labels li:focus .tooltip {
	opacity: 1;
}

.product_labels .tooltip {
	color: #fff;
	font-size: 14px;
	max-width: 32ch;
	text-align: center;
	opacity:0;
	transition:.3s opacity; 
	position: absolute;
	/* over the label and centered */
	bottom: 125%;
    left: 5%;
    width: 90%;
}
.product_labels .tooltip {
	/* triangle dimension */
	--b: 2em; /* base */
	--h: 1em; /* height */
  
	--p: 25%; /* triangle position (0%:left 100%:right) */
	--r: 1em; /* the radius */
	--c: var(--global-palette2);
  
	padding: 1em;
	border-radius: var(--r) var(--r) min(var(--r),100% - var(--p) - var(--b)/2) min(var(--r),var(--p) - var(--b)/2)/var(--r);
	clip-path: polygon(0 100%,0 0,100% 0,100% 100%,
		min(100%,var(--p) + var(--b)/2) 100%,
		var(--p) calc(100% + var(--h)),
		max(0%  ,var(--p) - var(--b)/2) 100%);
	background: var(--c);
	border-image: conic-gradient(var(--c) 0 0) fill 0/
		var(--r) calc(100% - var(--p) - var(--b)/2) 0 calc(var(--p) - var(--b)/2)/
		0 0 var(--h) 0;
}

@media (min-width:640px) and (max-width:719px), (min-width:1100px) {

	.woocommerce .product_labels img {
		max-width: 40px;
		margin-top: 4px;
	}

	.product_labels ul {
		margin-left: 2em;
	}

	.product_labels .tooltip {
		color: #fff;
		font-size: 14px;
		max-width: 32ch;
		text-align: center;

		left: 50%;
        bottom: 50%;
        transform: translateY(50%);
	}
	.product_labels .tooltip {
		/* triangle dimension */
		--b: 2em; /* base */
		--h: 2em; /* height */
	
		--p: 50%; /* triangle position (0%:top 100%:bottom) */
		--r: 1em; /* the radius */
		--c: var(--global-palette2);
	
		padding: 1em;
		border-radius: var(--r)/min(var(--r),var(--p) - var(--b)/2) var(--r) var(--r) min(var(--r),100% - var(--p) - var(--b)/2);
		clip-path: polygon(0 100%,100% 100%,100% 0,0 0,
			0 max(0%  ,var(--p) - var(--b)/2),
			calc(-1*var(--h)) var(--p),
			0 min(100%,var(--p) + var(--b)/2));
		background: var(--c);
		border-image: conic-gradient(var(--c) 0 0) fill 0/
			calc(var(--p) - var(--b)/2) var(--r) calc(100% - var(--p) - var(--b)/2) 0/
			0 0 0 var(--h);
	}

}

@media (min-width:1100px) {

	.product_labels .tooltip {
		left: 70%;
	}

}

.product_labels .tooltip a {
	color: #fff;
}


/** Exploded tabs */

#recently-viewed-products ul.products {
	row-gap: 0;
	gap: 0;
}

.woocommerce div.product .woocommerce-tabs {
	border-width: 0 !important;
	padding-top: 1px; /* needed for tab top margins */
}

.wc-tabs-wrapper div[id^="tab-"],
.upsells.products,
.related.products,
#recently-viewed-products,
#reviews  {
	border-top: 1px solid #dadada;
	margin: 3em 0;
	padding: 3em 0 0;
}

.wc-tabs-wrapper div[id^="tab-"] > h2:first-of-type,
.upsells.products > h2:first-of-type,
.related.products > h2:first-of-type,
#recently-viewed-products > h2:first-of-type,
.woocommerce #reviews #comments .woocommerce-Reviews-title,
.woocommerce #reviews #reply-title {
	font-size: 18px;
	font-weight: bold;
	margin-bottom: 16px;
}

#tab-description .lbp-preview-book {
	text-align: center;
}

.button.book-preview {
	background-color: var(--global-palette-highlight);
	font-weight: bold;
	max-width: 240px;
	display: inline-flex;
	gap: 10px;
	align-items: center;
}

/** Format product attributes as list */

@media screen and (min-width: 720px) {

	table.woocommerce-product-attributes,
	table.woocommerce-product-attributes th,
	table.woocommerce-product-attributes td {
		border: none !important;
	}

	table.woocommerce-product-attributes th,
	table.woocommerce-product-attributes td {
		display: inline-block;
		font-style: normal !important;
		padding: 0 5px 0 0 !important;
		width: auto !important;
	}

	table.woocommerce-product-attributes th::after {
		content: ":";
	}

	table.woocommerce-product-attributes tbody {
		display: flex;
		flex-wrap: wrap;
	}

	table.woocommerce-product-attributes tr.woocommerce-product-attributes-item {
		flex: 1 1 50%; /* Take up half the container's width */
		min-height: 2.5em;
		align-content: center;
	}

}

/** Below product image */

.entry-summary #lbp-below-product-image { display: none; }

.woocommerce-product-gallery #lbp-below-product-image { 
	margin-top: 1rem;
	display: flex;
    flex-direction: column;
    align-items: center;
}

#lbp-below-product-image .yith-add-to-wishlist-button-block,
#lbp-below-product-image .lbp-preview-book {
	text-align: center;
}

#lbp-below-product-image a {
	font-weight: bold;
	text-decoration: none;
}

#lbp-below-product-image .lbp-preview-book a {
	display: flex;
	align-items: center;
	gap: 8px;
}

.lbp-preview-book svg {
	width: 31px;
	padding: 3px;
}

#lbp-below-product-image svg {
	color: var(--global-palette3) !important;
}

/* Plugin customizations
-------------------------------------------------------------- */

/** FacetWP */

.site .facetwp-checkbox {
	background-position: 0px 5px;
}

.facetwp-type-fselect .fs-label-wrap {
	border: 1px solid var(--global-gray-400);
	border-radius: 3px;
}

.facetwp-type-fselect .fs-open .fs-label-wrap {
	border-color: var(--global-palette6);
}

/** YITH Wishlist */

.entry-summary > .yith-wcwl-add-to-wishlist + .product_meta {
	margin-top: var(--global-sm-spacing);
}

.woocommerce .entry-summary .yith-wcwl-add-button a {
	font-weight: bold;
	text-decoration: none;
}

.woocommerce .entry-summary .yith-wcwl-add-button a.button.alt {
	background: var(--global-gray-400);
/* 	background: #ddd; */
	color: var(--global-palette4);
}

/** WPC Frequently Bought Together */

.woobt-before-text {
	font-weight: bold;
}


/** Search & Filter */

.widget .searchandfilter > ul {
	margin: 0 0 1em;
	padding: 0;
}

.widget .searchandfilter .sf-field-search label,
.widget .searchandfilter .chosen-container,
.widget .searchandfilter input[type="text"] {
	width: 100% !important;
}

.widget .sf-label-checkbox {
	display: inline;
	font-size: 0.9em;
}

/* Archive customizations
-------------------------------------------------------------- */

/** Archive bottom content */

.lbp-loop-wrap {
	display: flex;
	flex-direction: column;
}

.lbp-archive-bottom-content {
	margin: 2rem 0;
	order: 999;
}

.lbp-archive-bottom-content::before {
	content: "";
	display: block;
	width: 50%;
	height: 1px;
	background-color: var(--global-palette7);
	margin-bottom: 5rem;
	margin-left: 25%;
}

.lbp-archive-top-content h2,
.lbp-archive-top-content h3,
.lbp-archive-bottom-content h2,
.lbp-archive-bottom-content h3 {
	font-size: var(--global-kb-font-size-md);
	font-weight: bold;
	margin-top: 0;
}

.lbp-archive-bottom-content p:last-child {
	margin-bottom: 0;
}