/*
 *  Theme Name: Wine House Child
 *  Template: wine-house
 *  Version: 1.0.0
 */

/* ------- Insert custom styles below this line ------- */

.whc-top-bar {
	background-color: #5b1a20;
	color: #fff;
	font-size: 16px;
	letter-spacing: 0.04em;
	padding: 10px 16px;
	overflow: hidden;
	text-align: center;
}

/* Default/static state: the group just wraps and centers like normal text. */
.whc-top-bar__group {
	display: inline-block;
}

.whc-top-bar__group[aria-hidden='true'] {
	display: none;
}

.whc-top-bar a {
	color: inherit;
	text-decoration: none;
}

.whc-top-bar a:hover {
	text-decoration: underline;
}

.whc-top-bar-sep {
	margin: 0 12px;
	opacity: 0.6;
}

/* Briefly toggled by JS to measure the content's natural (unwrapped) width. */
.whc-top-bar--measuring .whc-top-bar__group {
	white-space: nowrap;
}

/* Marquee state — JS adds this only when the content doesn't fit on one line. */
.whc-top-bar--scrolling {
	white-space: nowrap;
}

.whc-top-bar--scrolling .whc-top-bar__track {
	display: inline-flex;
	animation: whc-top-bar-scroll 24s linear infinite;
}

.whc-top-bar--scrolling:hover .whc-top-bar__track {
	animation-play-state: paused;
}

.whc-top-bar--scrolling .whc-top-bar__group {
	display: inline-flex;
	align-items: center;
	flex-shrink: 0;
	white-space: nowrap;
	padding-right: 64px;
}

.whc-top-bar--scrolling .whc-top-bar__group[aria-hidden='true'] {
	display: inline-flex;
}

@keyframes whc-top-bar-scroll {
	from {
		transform: translateX(0);
	}
	to {
		transform: translateX(-50%);
	}
}

@media (prefers-reduced-motion: reduce) {
	.whc-top-bar--scrolling .whc-top-bar__track {
		animation: none;
	}
	.whc-top-bar--scrolling {
		white-space: normal;
	}
	.whc-top-bar--scrolling .whc-top-bar__group {
		display: inline-block;
	}
	.whc-top-bar--scrolling .whc-top-bar__group[aria-hidden='true'] {
		display: none;
	}
}

.whc-footer-contact {
	display: flex;
	flex-wrap: wrap;
	gap: 24px;
	margin-top: 24px;
	padding-top: 24px;
	border-top: 1px solid rgba(255, 255, 255, 0.15);
	color: #fff;
}

.whc-footer-contact__info {
	flex: 1 1 240px;
}

.whc-footer-contact__title {
	margin: 0 0 10px;
	color: #fff;
}

.whc-footer-contact__address,
.whc-footer-contact__phone,
.whc-footer-contact__hours {
	margin: 0 0 8px;
	color: #fff;
}

.whc-footer-contact__phone a {
	color: inherit;
	text-decoration: none;
}

.whc-footer-contact__phone a:hover {
	text-decoration: underline;
}

.whc-footer-contact__map {
	flex: 2 1 320px;
}

.whc-footer-contact__map iframe {
	display: block;
	width: 100%;
}

.products .product .product-thumbnail img,
.woocommerce-product-gallery img {
	filter: saturate(1.5);
}

.products .product .thb-product-inner-wrapper .button {
	background-color: #5b1a20 !important;
	color: white !important;
	margin-top: 12px !important;
}

.whc-star-rating {
	font-size: 18px;
	color: #5b1a20;
}

.price-bgn {
	vertical-align: baseline;
	margin-top: 2px;
}

.woocommerce-loop-product__title {
	text-align: center;
}

.product-category {
	text-align: center;
}

.products .product .thb-product-inner-wrapper .thb-product-inner-content .whc-price-row {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-top: auto;
	margin-bottom: 0;
}

/* =============================================
 * Single Product (Snippet 318)
 * ============================================= */

.product_title.entry-title {
	margin-bottom: 10px !important;
}

.product-origin {
	margin-bottom: 10px !important;
}

/* =============================================
 * Shop Page Title (Snippet 327)
 * ============================================= */

.post-type-archive-product .thb-woocommerce-header {
	height: auto !important;
	min-height: 0 !important;
	padding-top: 0 !important;
	padding-bottom: 0 !important;
}

.post-type-archive-product .thb-woocommerce-header > .row:nth-child(2) {
	display: none;
}

/* =============================================
 * Align Prices to Bottom (Snippet 335)
 * ============================================= */

.thb-product-inner-wrapper {
	height: 100%;
}

.thb-product-inner-content .price {
	/* margin-top: auto; */
}

.thb-product-inner-content .price .amount {
	font-size: 18px;
}

/* =============================================
 * Live Search (Snippet 340)
 * ============================================= */

.thb-header-inline-search {
	position: relative;
}

#live-search-results {
	position: absolute;
	top: calc(100% + 4px);
	left: 0;
	width: 100%;
	background: #fff;
	border: 1px solid #e5e5e5;
	border-radius: 6px;
	z-index: 99999;
	max-height: 420px;
	overflow-y: auto;
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}

#live-search-results .live-search-item {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px 14px;
	border-bottom: 1px solid #f1f1f1;
	text-decoration: none;
	color: #333;
}

#live-search-results .live-search-item:hover {
	background: #f7f7f7;
}

.live-search-thumb img {
	width: 44px;
	height: 44px;
	object-fit: cover;
	border-radius: 4px;
}

.live-search-content {
	display: flex;
	flex-direction: column;
}

.live-search-title {
	font-size: 14px;
	font-weight: 500;
}

.live-search-price {
	font-size: 13px;
	color: #777;
}

#live-search-results:empty {
	display: none;
}

#live-search-results .live-search-all {
	display: block;
	padding: 12px 16px;
	text-align: center;
	font-weight: 500;
	border-top: 1px solid #f1f1f1;
	background: #fafafa;
	text-decoration: none;
	color: #333;
}

#live-search-results .live-search-all:hover {
	background: #f2f2f2;
}

/* =============================================
 * Sticky Cart Footer (Snippet 342)
 * ============================================= */

.widget_shopping_cart_content {
	position: relative;
	display: flex;
	flex-direction: column;
	height: 100%;
	max-height: 80vh;
}

.woocommerce-mini-cart {
	flex: 1;
	overflow-y: auto;
	margin-bottom: 0;
	padding-bottom: 8px;
}

.woocommerce-mini-cart__total {
	position: sticky;
	bottom: 0;
	background: #fff;
	padding: 12px 0;
	border-top: 1px solid #eee;
	margin: 0;
}

.woocommerce-mini-cart__buttons {
	padding: 10px 0 0;
	margin: 0;
}

/* =============================================
 * Checkout Button (Snippet 367)
 * ============================================= */

.wc-block-cart__submit-container {
	background-color: #5b1a20 !important;
}

.wc-block-cart__submit-container a div {
	color: white;
}

.wc-block-components-checkout-place-order-button {
	background-color: #5b1a20 !important;
}

.wc-block-components-checkout-place-order-button__text {
	color: white;
}

/* =============================================
 * Product Grid – Remove Black Borders
 * ============================================= */

.products .product,
.wc-block-grid__products .product {
	border-color: transparent !important;
}

.products .product .product-thumbnail,
.wc-block-grid__products .product .product-thumbnail {
	border-bottom-color: transparent !important;
}

.wc-block-grid__product-onsale,
.onsale {
	border-right-color: transparent !important;
	border-bottom-color: transparent !important;
}

.woocommerce.archive .thb-woocommerce-header > .row:not(.breadcrumbs) {
	display: none;
}

.woocommerce.archive .thb-woocommerce-header {
	min-height: 0;
	background-image: none !important;
}

/* =============================================
 * Outlet page – re-show the archive title row
 * that the shop/category archives hide above.
 * ============================================= */

.whc-outlet.woocommerce.archive .thb-woocommerce-header > .row:not(.breadcrumbs) {
	display: block;
}

.whc-outlet.post-type-archive-product .thb-woocommerce-header {
	height: auto !important;
	min-height: 0;
	padding: 24px 0 !important;
}

/* Outlet menu item – red font. */
.whc-outlet-link > a {
	color: #c0153b !important;
}

/* =============================================
 * Shop loop – brand grouping headers
 * ============================================= */

.products li.whc-brand-header {
	list-style: none;
	flex: 0 0 100%;
	max-width: 100%;
	width: 100%;
	grid-column: 1 / -1;
	margin: 32px 0 12px;
	padding: 0 0 8px;
	border: 0;
	border-bottom: 1px solid #1d1d1d;
	background: transparent;
}

.products li.whc-brand-header:first-child {
	margin-top: 0;
}

.products li.whc-brand-header .whc-brand-header__title {
	margin: 0;
	font-size: 22px;
	line-height: 1.3;
	font-weight: 600;
}

.products li.whc-brand-header .whc-brand-header__title a {
	color: inherit;
	text-decoration: none;
}

.products li.whc-brand-header .whc-brand-header__title a:hover {
	text-decoration: underline;
}

/* Trailing item(s) of a brand's incomplete last row (see
   whc_precompute_brand_row_fill()) get centered as a group in the row
   instead of sitting stuck to the left with blank space next to them.
   Cards keep their normal size — only their position in the row changes.
   Only matters once the Foundation grid switches from stacked (small-12)
   to 3-across (large-4), so it's scoped to that same breakpoint. */
@media print, screen and (min-width: 66.75em) {
	.products li.product.whc-row-fill-start {
		margin-left: auto !important;
	}

	.products li.product.whc-row-fill-end {
		margin-right: auto !important;
	}
}

/* =============================================
 * Shop loop – hover overlay (attributes)
 * ============================================= */

.products .product .product-thumbnail {
	position: relative;
	overflow: hidden;
}

.whc-attr-overlay {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 18px 20px;
	background: rgba(91, 26, 32, 0.94);
	color: #fff;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.25s ease, visibility 0.25s ease;
	pointer-events: none;
	z-index: 2;
}

.products .product:hover .whc-attr-overlay {
	opacity: 1;
	visibility: visible;
}

.whc-attr-overlay__list {
	list-style: none;
	margin: 0;
	padding: 0;
	width: 100%;
}

.whc-attr-overlay__list li {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 12px;
	padding: 7px 0;
	border-bottom: 1px solid rgba(255, 255, 255, 0.18);
	line-height: 1.35;
}

.whc-attr-overlay__list li:first-child {
	padding-top: 0;
}

.whc-attr-overlay__list li:last-child {
	padding-bottom: 0;
	border-bottom: 0;
}

.whc-attr-overlay__label {
	flex: 0 0 auto;
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	opacity: 0.85;
}

.whc-attr-overlay__value {
	flex: 1 1 auto;
	font-size: 13px;
	text-align: right;
}

/* Disable hover overlay on touch devices — there's no reliable hover. */
@media (hover: none) {
	.whc-attr-overlay {
		display: none;
	}
}

/* ------- Age verification (18+) gate ------- */

.whc-age-locked {
	overflow: hidden !important;
}

.whc-age-gate {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	opacity: 1;
	transition: opacity 0.3s ease;
}

.whc-age-gate--hidden {
	opacity: 0;
	pointer-events: none;
}

/* Default state as rendered by PHP: hidden until JS confirms (client-side,
   from the cookie) that the visitor hasn't verified yet. This keeps the gate
   correct under full-page caching, where the server-rendered HTML is shared
   across visitors and can't be trusted to reflect any single visitor's cookie. */
.whc-age-gate--pending {
	display: none;
}

.whc-age-gate__overlay {
	position: absolute;
	inset: 0;
	background-color: rgba(20, 6, 8, 0.92);
	backdrop-filter: blur(4px);
}

.whc-age-gate__box {
	position: relative;
	width: 100%;
	max-width: 460px;
	margin: auto;
	background-color: #fff;
	border-top: 6px solid #5b1a20;
	border-radius: 6px;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
	padding: 40px 32px;
	text-align: center;
}

.whc-age-gate__title {
	color: #5b1a20;
	font-size: 26px;
	line-height: 1.25;
	margin: 0 0 14px;
}

.whc-age-gate__text {
	color: #444;
	font-size: 16px;
	line-height: 1.5;
	margin: 0 0 28px;
}

.whc-age-gate__actions {
	display: flex;
	gap: 12px;
	justify-content: center;
	flex-wrap: wrap;
}

.whc-age-gate__btn {
	flex: 1 1 0;
	min-width: 140px;
	padding: 14px 20px;
	font-size: 16px;
	font-weight: 600;
	border: 2px solid #5b1a20;
	border-radius: 4px;
	cursor: pointer;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.whc-age-gate__btn--yes {
	background-color: #5b1a20;
	color: #fff;
}

.whc-age-gate__btn--yes:hover {
	background-color: #421217;
	border-color: #421217;
}

.whc-age-gate__btn--no {
	background-color: transparent;
	color: #5b1a20;
}

.whc-age-gate__btn--no:hover {
	background-color: #f3e9ea;
}

@media (max-width: 480px) {
	.whc-age-gate__box {
		padding: 32px 22px;
	}

	.whc-age-gate__title {
		font-size: 22px;
	}
}

/* ------- Shop filters as side-by-side sidebar ------- */

/* Hide the parent theme's off-canvas "Filters" trigger button. */
.thb-filter-bar #thb-shop-filters {
	display: none;
}

/* Drop the parent's top padding on the filter bar. */
.thb-filter-bar {
	padding-top: 0;
}

.whc-shop-layout {
	display: flex;
	align-items: flex-start;
	gap: 40px;
}

.whc-shop-sidebar {
	flex: 0 0 260px;
	max-width: 260px;
	position: sticky;
	top: 100px;
	/* Scroll the filters independently of the page when they're taller than
	   the viewport, instead of running off the bottom. */
	max-height: calc(100vh - 120px);
	overflow-y: auto;
	overscroll-behavior: contain;
	padding-right: 8px;
}

.whc-shop-products {
	flex: 1 1 auto;
	min-width: 0;
}

/* Keep the product grid edge-aligned with the sidebar (theme uses negative
   gutters on ul.products). */
.whc-shop-products ul.products {
	margin-left: 0;
	margin-right: 0;
}

.whc-shop-sidebar__title {
	font-size: 28px;
	font-weight: 500;
	letter-spacing: 0.04em;
	color: #5b1a20;
	margin: 0 0 20px;
	padding-bottom: 14px;
	border-bottom: 2px solid #5b1a20;
}

/* Filter widgets inside the sidebar. */
.whc-shop-sidebar .widget {
	/* margin-bottom = gap under the separator line, before the next filter. */
	margin-bottom: 28px;
	padding-bottom: 20px;
	/* Separator between one filter and the next. */
	border-bottom: 1px solid rgba(91, 26, 32, 0.15);
}

/* No trailing separator after the last filter. */
.whc-shop-sidebar .widget:last-child {
	margin-bottom: 0;
	padding-bottom: 0;
	border-bottom: 0;
}

/* When a filter is collapsed (closed), drop its separator + padding so closed
   filters stack tightly by their titles. */
.whc-shop-sidebar .widget.whc-collapsed {
	margin-bottom: 16px;
	padding-bottom: 0;
	border-bottom: 0;
}

.whc-shop-sidebar .widgettitle,
.whc-shop-sidebar .widget > .thb-widget-title,
.whc-shop-sidebar .widget h3 {
	font-size: 16px;
	font-weight: 600;
	letter-spacing: 0.02em;
	margin-bottom: 16px;
	color: #5b1a20;
}

/* Stack below the products on smaller screens. */
@media (max-width: 991px) {
	.whc-shop-layout {
		flex-direction: column;
		gap: 24px;
	}

	.whc-shop-sidebar {
		flex-basis: auto;
		max-width: none;
		width: 100%;
		position: static;
		/* Stacked full-width: no independent scroll, let it flow with the page. */
		max-height: none;
		overflow-y: visible;
		padding-right: 0;
	}
}

/* ------- Collapsible filter widgets ------- */

.whc-shop-sidebar .widget.whc-collapsible > .thb-widget-title {
	cursor: pointer;
	position: relative;
	padding-right: 22px;
	user-select: none;
}

.whc-shop-sidebar .widget.whc-collapsible > .thb-widget-title::after {
	content: '';
	position: absolute;
	right: 3px;
	top: 50%;
	width: 8px;
	height: 8px;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: translateY(-30%) rotate(-135deg);
	transition: transform 0.2s ease;
}

.whc-shop-sidebar .widget.whc-collapsed > .thb-widget-title::after {
	transform: translateY(-70%) rotate(45deg);
}

.whc-shop-sidebar .widget.whc-collapsed > *:not(.thb-widget-title) {
	display: none;
}

/* Square the layered-nav markers (parent theme draws them as circles via
   border-radius: 50%). Hover/chosen fills reuse the same element, so squaring
   the base shape covers all states. */
.whc-shop-sidebar .widget.widget_layered_nav li > a::before,
.whc-shop-sidebar .widget.widget_layered_nav_filters li > a::before {
	border-radius: 0;
}

/* The parent lays each filter row out as a wrapping flexbox, which mangles our
   long, two-line wine names: the marker centers between the wrapped lines and
   the (count) drops onto its own line. Use a block row with a hanging indent
   instead — marker in the left gutter aligned to the first line, the label
   indented under itself, and the count inline right after the name. */
.whc-shop-sidebar .widget.widget_layered_nav li {
	display: block;
	position: relative;
	padding-left: 25px;
}

.whc-shop-sidebar .widget.widget_layered_nav li > a {
	display: inline;
	position: static;
	padding-left: 0;
}

.whc-shop-sidebar .widget.widget_layered_nav li > a::before {
	left: 0;
	top: 5px;
	margin-top: 0;
}

.whc-shop-sidebar .widget.widget_layered_nav li .count {
	margin-left: 6px;
}

/* ------- Active filters bar (chips + clear all) ------- */

/* The sidebar's "Active filters" widget is replaced by the bar above the grid. */
.whc-shop-sidebar .widget_layered_nav_filters {
	display: none;
}

.whc-active-filters {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px;
	margin-bottom: 24px;
}

.whc-active-filters__label {
	font-weight: 600;
	color: #5b1a20;
}

.whc-active-filters__list {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.whc-active-filters__list li {
	margin: 0;
}

.whc-chip {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	background: #f3e9ea;
	color: #5b1a20;
	border: 1px solid #e0cdcf;
	border-radius: 999px;
	padding: 5px 13px;
	font-size: 14px;
	line-height: 1.4;
	text-decoration: none;
	transition: background 0.2s ease, border-color 0.2s ease;
}

.whc-chip:hover {
	background: #e6d3d5;
	border-color: #cbb0b3;
	color: #5b1a20;
}

.whc-chip__x {
	font-size: 17px;
	line-height: 1;
}

.whc-active-filters__clear {
	margin-left: auto;
	color: #5b1a20;
	font-weight: 600;
	font-size: 14px;
	text-decoration: underline;
}

.whc-active-filters__clear:hover {
	color: #421217;
}

@media (max-width: 991px) {
	.whc-active-filters__clear {
		margin-left: 0;
	}
}

/* =============================================
 * Single product – align & space "Add to cart"
 * with the plugin's "Бърза поръчка" (quick order)
 * toggle. The parent theme gives "Add to cart" a
 * 280px min-width + 5px left margin, so it sits
 * narrower and shifted vs the full-width toggle;
 * the toggle also has no top gap. Make the cart
 * button a full-width block and add a top gap.
 * ============================================= */

.thb-product-detail .product-information .single_add_to_cart_button,
.thb-product-detail .product-information .quantity + .single_add_to_cart_button {
	display: block;
	width: 100%;
	min-width: 0;
	margin-left: 0;
}

.thb-product-detail .product-information .quantity {
	margin-bottom: 15px;
}

.form-toggle-container {
	margin-top: 15px;
}
