/*
Theme Name: WooCheck
Theme URI: https://example.com/woocheck
Author: Woocheck
Author URI: https://example.com
Description: A modern, clean WooCommerce block theme for cosmetic and beauty stores. Built on theme.json with full-site editing, WooCommerce block templates, and a soft, elegant design system.
Requires at least: 6.7
Tested up to: 7.0
Requires PHP: 7.4
Version: 1.8.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: woocheck
Tags: full-site-editing, block-themes, block-patterns, wide-blocks, e-commerce, custom-colors, custom-logo, custom-menu, editor-style, featured-images, threaded-comments, translation-ready
*/

/* Design is driven by theme.json; below are only refinements core styles can't express. */

/* Kill root block-gap margins between header / main / footer — sections
   own their spacing via padding, so these template-level gaps are pure air. */
.wp-site-blocks > * {
	margin-block-start: 0;
}

/* Product card polish */
.wc-block-grid__product,
.wp-block-woocommerce-product-template .wc-block-product {
	text-align: left;
}

/* Product images render as supplied. The soft tint is only a FALLBACK:
   with no padding or blending, an image that fills the square covers it
   completely — it shows only behind letterboxed (non-square) images
   and missing-image placeholders. */
.wp-block-woocommerce-product-image,
.wc-block-components-product-image {
	background: #F2F5F9;
	border-radius: 12px;
	overflow: hidden;
}

.wp-block-woocommerce-product-image img,
.wc-block-components-product-image img {
	border-radius: 12px;
	transition: transform 0.35s ease;
	aspect-ratio: 1 / 1;
	width: 100%;
	height: auto;
	object-fit: contain;
}

.wc-block-product:hover .wp-block-woocommerce-product-image img {
	transform: scale(1.03);
}

/* Single product gallery: stock image geometry so the WooCommerce
   hover zoom (magnify + pan with the cursor) positions correctly.
   Rounded frame with overflow hidden keeps the pan inside the image. */
.woocommerce-product-gallery .woocommerce-product-gallery__wrapper {
	background: #F2F5F9;
	border-radius: 16px;
	overflow: hidden;
}

.woocommerce-product-gallery .woocommerce-product-gallery__image {
	cursor: crosshair;
}

.woocommerce-product-gallery ol.flex-control-thumbs {
	margin-top: 0.75rem;
	gap: 0.6rem;
	display: flex;
	flex-wrap: wrap;
}

.woocommerce-product-gallery ol.flex-control-thumbs li {
	border-radius: 10px;
	overflow: hidden;
	list-style: none;
	border: 1px solid var(--wp--preset--color--border);
}

.woocommerce-product-gallery ol.flex-control-thumbs li img {
	cursor: pointer;
	display: block;
}

/* Soft cards for cart/checkout panels */
.wc-block-components-sidebar .wc-block-components-panel,
.wc-block-cart__sidebar .wp-block-woocommerce-cart-order-summary-block {
	border-radius: 12px;
}

/* Sale badge in brand tone */
.wc-block-components-product-sale-badge {
	background: var(--wp--preset--color--primary);
	color: var(--wp--preset--color--base);
	border: none;
	border-radius: 999px;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	font-size: 0.72rem;
}

/* Header mini cart + account icons align optically */
.wp-block-woocommerce-mini-cart {
	display: flex;
	align-items: center;
}

/* Details/FAQ block: soft divider look */
details.wp-block-details {
	border-bottom: 1px solid var(--wp--preset--color--border);
	padding: 1rem 0;
}

details.wp-block-details summary {
	cursor: pointer;
	font-weight: 600;
	list-style: none;
	position: relative;
	padding-right: 2rem;
}

details.wp-block-details summary::-webkit-details-marker {
	display: none;
}

details.wp-block-details summary::after {
	content: "+";
	position: absolute;
	right: 0;
	top: 50%;
	transform: translateY(-50%);
	font-size: 1.3em;
	font-weight: 400;
	color: var(--wp--preset--color--primary);
	transition: transform 0.2s ease;
}

details.wp-block-details[open] summary::after {
	transform: translateY(-50%) rotate(45deg);
}

/* Soft cards used by USP and testimonial patterns */
.woocheck-card {
	background: var(--wp--preset--color--base);
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 16px;
	padding: 1.6rem 1.4rem;
	transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.woocheck-card:hover {
	box-shadow: 0 10px 30px rgba(27, 37, 89, 0.08);
	transform: translateY(-2px);
}

/* Small pill chip (hero offer) */
.woocheck-chip {
	display: inline-block;
	background: var(--wp--preset--color--base);
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 999px;
	padding: 0.35rem 1rem;
	width: fit-content;
}

/* Hero image subtle lift */
.woocheck-hero-img img {
	box-shadow: 0 24px 60px rgba(27, 37, 89, 0.16);
	aspect-ratio: 1 / 1;
	object-fit: cover;
	width: 100%;
	height: auto;
}

/* Product cards: white card look with hover lift */
.wp-block-woocommerce-product-template .wc-block-product,
.wp-block-woocommerce-product-template > li {
	background: var(--wp--preset--color--base);
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 16px;
	padding: 1rem 1rem 0.5rem;
	transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.wp-block-woocommerce-product-template .wc-block-product:hover,
.wp-block-woocommerce-product-template > li:hover {
	box-shadow: 0 12px 34px rgba(27, 37, 89, 0.10);
	transform: translateY(-3px);
}

/* Compact add-to-cart in product cards; price + button sit on one row */
.wp-block-woocommerce-product-template .wc-block-components-product-button .wp-element-button,
.wp-block-woocommerce-product-template .wp-block-woocommerce-product-button .wp-element-button {
	padding: 0.45rem 1.1rem;
	font-size: 0.82rem;
	white-space: nowrap;
	margin: 0;
}

.wp-block-woocommerce-product-template .wc-block-components-product-price,
.wp-block-woocommerce-product-template .wp-block-woocommerce-product-price {
	font-weight: 700;
	margin: 0;
}

/* Category/promo cover cards hover zoom */
.wp-block-cover.has-custom-border {
	overflow: hidden;
}

/* ---- Shop page: breadcrumb band, top bar, filter sidebar ---- */

/* Breadcrumb band under the header */
.woocheck-breadcrumb-band {
	border-bottom: 1px solid var(--wp--preset--color--border);
}

.woocheck-breadcrumb-band .wc-block-breadcrumbs,
.woocheck-breadcrumb-band .woocommerce-breadcrumb {
	margin: 0;
	color: var(--wp--preset--color--muted);
}

.woocheck-breadcrumb-band a {
	color: var(--wp--preset--color--primary);
	text-decoration: none;
}

.woocheck-breadcrumb-band a:hover {
	text-decoration: underline;
}

/* Results / sorting top bar */
.woocheck-shop-topbar {
	border: 1px solid var(--wp--preset--color--border);
}

.woocheck-shop-topbar .woocommerce-result-count {
	margin: 0;
	color: var(--wp--preset--color--muted);
}

.woocheck-shop-topbar select,
.wc-block-catalog-sorting select {
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 8px;
	background: var(--wp--preset--color--base);
	padding: 0.45rem 2rem 0.45rem 0.75rem;
	font-size: 0.875rem;
	color: inherit;
}

/* Filter sidebar: flat panels per filter group (no outer card) */
.woocheck-shop-sidebar {
	align-self: flex-start;
	position: sticky;
	top: 1.5rem;
}

.woocheck-shop-sidebar .wc-block-product-filters > *:not([hidden]) {
	background: var(--wp--preset--color--surface);
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 12px;
	padding: 1.15rem 1.15rem 1.25rem;
}

.woocheck-shop-sidebar h3 {
	font-size: 0.82rem !important;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.09em;
	color: var(--wp--preset--color--contrast);
	margin: 0 0 0.85rem;
	padding-bottom: 0.65rem;
	border-bottom: 1px solid var(--wp--preset--color--border);
}

/* Kill browser-default fieldset chrome inside filters */
.woocheck-shop-sidebar fieldset {
	border: 0;
	padding: 0;
	margin: 0;
	min-width: 0;
}

.woocheck-shop-sidebar legend {
	padding: 0;
}

/* Checkbox list */
.woocheck-shop-sidebar .wc-block-product-filter-checkbox-list__item {
	margin-bottom: 0.5rem;
}

.woocheck-shop-sidebar .wc-block-product-filter-checkbox-list__label {
	font-size: 0.92rem;
	display: flex;
	align-items: center;
	gap: 0.55rem;
	cursor: pointer;
}

.woocheck-shop-sidebar input[type="checkbox"] {
	accent-color: var(--wp--preset--color--primary);
	width: 1.05rem;
	height: 1.05rem;
	margin: 0;
	flex-shrink: 0;
}

/* Price slider: brand colors via Woo's own CSS hooks; narrow the min/max
   inputs so the block's grid (input | slider | input) fits the sidebar. */
.woocheck-shop-sidebar .wc-block-product-filter-price-slider {
	--wc-product-filter-price-slider: var(--wp--preset--color--primary);
	--wc-product-filter-price-slider-handle: var(--wp--preset--color--base);
	--wc-product-filter-price-slider-handle-border: var(--wp--preset--color--primary);
}

.woocheck-shop-sidebar .wc-block-product-filter-price-slider__left input,
.woocheck-shop-sidebar .wc-block-product-filter-price-slider__right input {
	width: 5.2em;
	min-width: 0;
	box-sizing: border-box;
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 8px;
	background: var(--wp--preset--color--base);
	padding: 0.35rem 0.5rem;
	font-size: 0.82rem;
	color: inherit;
	text-align: center;
}

/* Active filter chips */
.woocheck-shop-sidebar .wc-block-product-filter-removable-chips__item {
	background: var(--wp--preset--color--sand);
	border-radius: 999px;
	font-size: 0.82rem;
}

@media (max-width: 781px) {
	.woocheck-shop-sidebar {
		position: static;
	}
}

/* ---- Sticky header ---- */
header.wp-block-template-part {
	position: sticky;
	top: 0;
	z-index: 100;
	background: var(--wp--preset--color--base);
	box-shadow: 0 1px 12px rgba(27, 37, 89, 0.06);
}

body.admin-bar header.wp-block-template-part {
	top: var(--wp-admin--admin-bar--height, 32px);
}

/* Checkout: keep the sticky order summary clear of the sticky header */
.wc-block-checkout__sidebar.is-sticky,
.wc-block-checkout__sidebar {
	top: 150px !important;
}

/* WP core's interactivity loading bar is 100vw, which includes the
   scrollbar and causes horizontal overflow. */
.wp-interactivity-router-loading-bar {
	width: 100%;
}

/* Mobile hamburger nav: hidden on desktop (the desktop header is
   deliberately minimal), shown in the header's left group on mobile. */
.wp-block-navigation.woocheck-mobile-nav {
	display: none;
}

/* ---- Mobile layout fixes ---- */
@media (max-width: 781px) {
	.wp-block-navigation.woocheck-mobile-nav {
		display: flex;
	}

	.woocheck-mobile-nav .wp-block-navigation__responsive-container-open {
		min-width: 44px;
		min-height: 44px;
		display: inline-flex;
		align-items: center;
		justify-content: center;
	}

	/* (1) Filter overlay must be fully gone when closed — Woo leaves the
	   fixed full-viewport container painted and only slides the dialog
	   offscreen. Open state toggles .is-overlay-opened on the parent. */
	.wc-block-product-filters:not(.is-overlay-opened) .wc-block-product-filters__overlay {
		display: none;
	}

	/* (2) Search must shrink: the input's intrinsic min-width (~170px)
	   plus select and button exceeds narrow containers, blowing the flex
	   item out of its parent. width:0 + grow makes it fully fluid. */
	header.wp-block-template-part .wp-block-group:has(> .woocheck-search-form) {
		min-width: 0;
	}

	/* Mobile search: same minimal bar, input stays fully fluid. */
	.woocheck-search-form__input {
		flex: 1 1 0;
		width: 0;
		min-width: 0;
	}

	/* (4) 40px+ tap targets */
	.wp-block-query-pagination .page-numbers {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		min-width: 40px;
		min-height: 40px;
	}

	.wc-block-product-filters input[type="checkbox"] {
		width: 22px;
		height: 22px;
	}

	.wc-block-product-filter-checkbox-list__label {
		min-height: 40px;
		align-items: center;
	}

	.wc-block-product-filter-price-slider__left input,
	.wc-block-product-filter-price-slider__right input {
		min-height: 42px;
	}

	.wc-block-product-filters__close-overlay {
		min-width: 44px;
		min-height: 44px;
	}

	.woocommerce-breadcrumb a {
		display: inline-block;
		padding: 10px 2px;
	}

	/* (5) 16px+ inputs so iOS doesn't zoom on focus */
	input,
	select,
	textarea {
		font-size: 16px !important;
	}

	/* Tablet + phone shared header: compact padding, smaller logo, icons
	   pushed right. Tablets (600–781px) keep everything on ONE line; only
	   the phone block below stacks the search onto its own row. */
	header.wp-block-template-part > .wp-block-group.alignfull {
		padding-top: 0.6rem;
		padding-bottom: 0.7rem;
	}

	header.wp-block-template-part .alignwide.wp-block-group-is-layout-flex {
		gap: 0.6rem 0.75rem;
	}

	header.wp-block-template-part .wp-block-group:has(.wp-block-woocommerce-mini-cart) {
		margin-left: auto;
	}

	header.wp-block-template-part .wp-block-site-logo img {
		width: 42px !important;
		height: auto;
	}

	/* Product cards: let price + add-to-cart wrap instead of overflowing
	   the card; the button goes full width on its own line. */
	.wp-block-woocommerce-product-template .wc-block-product .wp-block-group-is-layout-flex {
		flex-wrap: wrap;
	}

	.wp-block-woocommerce-product-template .wp-block-woocommerce-product-button,
	.wp-block-woocommerce-product-template .wp-block-woocommerce-product-button .wp-element-button {
		width: 100%;
		text-align: center;
	}
}


/* ---- Live search dropdown ---- */
.woocheck-live-search__panel {
	position: absolute;
	top: calc(100% + 6px);
	left: 0;
	right: 0;
	background: var(--wp--preset--color--base);
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 14px;
	box-shadow: 0 16px 40px rgba(27, 37, 89, 0.14);
	overflow: hidden;
	z-index: 110;
}

.woocheck-live-search__list {
	list-style: none;
	margin: 0;
	padding: 0.4rem;
	max-height: 420px;
	overflow-y: auto;
}

.woocheck-live-search__item {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	padding: 0.5rem 0.6rem;
	border-radius: 10px;
	text-decoration: none;
	color: inherit;
}

.woocheck-live-search__item:hover,
.woocheck-live-search__item:focus {
	background: var(--wp--preset--color--surface);
	color: inherit;
}

.woocheck-live-search__thumb {
	width: 42px;
	height: 42px;
	border-radius: 8px;
	object-fit: cover;
	flex-shrink: 0;
	background: var(--wp--preset--color--surface);
}

.woocheck-live-search__text {
	display: flex;
	flex-direction: column;
	gap: 0.1rem;
	min-width: 0;
}

.woocheck-live-search__name {
	font-size: 0.9rem;
	font-weight: 500;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.woocheck-live-search__price {
	font-size: 0.82rem;
	font-weight: 700;
	color: var(--wp--preset--color--primary);
}

.woocheck-live-search__empty {
	padding: 0.9rem 0.8rem;
	font-size: 0.9rem;
	color: var(--wp--preset--color--muted);
}

.woocheck-live-search__all {
	display: block;
	width: 100%;
	border: 0;
	border-top: 1px solid var(--wp--preset--color--border);
	background: var(--wp--preset--color--surface);
	color: var(--wp--preset--color--primary);
	font-size: 0.85rem;
	font-weight: 600;
	padding: 0.65rem;
	cursor: pointer;
	text-align: center;
}

/* Header search: category select | input | button as one unit */
/* Minimal search bar (Chaldal/Daraz style): one rounded field with a
   magnifier icon inside the right edge. The category select stays in the
   markup for the form's function but is not part of this design. */
.woocheck-search-form {
	position: relative;
	display: flex;
	align-items: stretch;
	width: 100%;
	min-height: 38px;
	background: var(--wp--preset--color--base);
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 10px;
	overflow: visible;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.woocheck-search-form__cat {
	display: none;
}

.woocheck-search-form__input {
	flex: 1 1 auto;
	min-width: 0;
	border: 0;
	background: transparent;
	padding: 0.4rem 0.25rem 0.4rem 1rem;
	font-size: 0.9rem;
	color: inherit;
	border-radius: 10px 0 0 10px;
}

.woocheck-search-form__input::placeholder {
	color: var(--wp--preset--color--muted);
}

.woocheck-search-form__input:focus {
	outline: none;
}

.woocheck-search-form:focus-within {
	border-color: var(--wp--preset--color--primary);
	box-shadow: 0 0 0 2px rgba(29, 127, 209, 0.15);
}

/* Icon-only submit inside the field */
.woocheck-search-form__submit {
	flex-shrink: 0;
	align-self: stretch;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 48px;
	border: 0;
	padding: 0 0.9rem;
	border-radius: 0 10px 10px 0;
	background: transparent;
	color: var(--wp--preset--color--muted);
	cursor: pointer;
	transition: color 0.2s ease;
}

.woocheck-search-form__submit:hover,
.woocheck-search-form__submit:focus-visible {
	color: var(--wp--preset--color--primary);
}

/* Account control as a solid rounded button (Chaldal-style Login) */
header.wp-block-template-part .wp-block-woocommerce-customer-account > a {
	display: inline-flex;
	align-items: center;
	gap: 0.45rem;
	background: var(--wp--preset--color--primary);
	color: var(--wp--preset--color--base);
	border-radius: 8px;
	padding: 0.5rem 1.1rem;
	font-weight: 600;
	text-decoration: none;
	transition: background 0.2s ease;
}

header.wp-block-template-part .wp-block-woocommerce-customer-account > a:hover {
	background: var(--wp--preset--color--primary-dark);
	color: var(--wp--preset--color--base);
}

header.wp-block-template-part .wp-block-woocommerce-customer-account svg {
	fill: currentColor;
}

@media (max-width: 781px) {
	.woocheck-search-form__submit {
		padding: 0 1.1rem;
	}
}

/* ---- Product specification table (Additional information) ---- */
.woocommerce-product-attributes {
	width: 100%;
	border-collapse: collapse;
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 12px;
	overflow: hidden;
}

.woocommerce-product-attributes tr:nth-child(odd) {
	background: var(--wp--preset--color--surface);
}

.woocommerce-product-attributes th,
.woocommerce-product-attributes td {
	border: 0;
	border-bottom: 1px solid var(--wp--preset--color--border);
	padding: 0.75rem 1.1rem;
	text-align: left;
	font-style: normal;
}

.woocommerce-product-attributes tr:last-child th,
.woocommerce-product-attributes tr:last-child td {
	border-bottom: 0;
}

.woocommerce-product-attributes th {
	width: 34%;
	font-size: 0.8rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--wp--preset--color--muted);
}

.woocommerce-product-attributes td p {
	margin: 0;
	font-size: 0.95rem;
}

/* Product details tabs: clean underline style */
.wp-block-woocommerce-product-details .wc-tabs {
	border-bottom: 1px solid var(--wp--preset--color--border) !important;
	margin: 0 0 1.5rem !important;
	padding: 0 !important;
}

.wp-block-woocommerce-product-details .wc-tabs li {
	background: none !important;
	border: 0 !important;
	margin: 0 1.75rem 0 0 !important;
	padding: 0 !important;
}

.wp-block-woocommerce-product-details .wc-tabs li a {
	display: inline-block;
	padding: 0.7rem 0 !important;
	font-weight: 600 !important;
	color: var(--wp--preset--color--muted) !important;
	border-bottom: 2px solid transparent;
	text-decoration: none;
}

.wp-block-woocommerce-product-details .wc-tabs li.active a {
	color: var(--wp--preset--color--contrast) !important;
	border-bottom-color: var(--wp--preset--color--primary);
}

/* Focus visibility */
:where(a, button, input, summary):focus-visible {
	outline: 2px solid var(--wp--preset--color--primary);
	outline-offset: 2px;
}

/* ---- Phone-only header (<600px): search stacks onto its own row,
   shorter bar, tighter top spacing ---- */
@media (max-width: 599px) {
	header.wp-block-template-part > .wp-block-group.alignfull {
		padding-top: 0.4rem;
		padding-bottom: 0.55rem;
	}

	header.wp-block-template-part .alignwide.wp-block-group-is-layout-flex {
		gap: 0.4rem 0.6rem;
	}

	header.wp-block-template-part .wp-block-group:has(> .woocheck-search-form) {
		order: 3;
		flex-basis: 100%;
	}

	header.wp-block-template-part .wp-block-group:has(.wp-block-woocommerce-mini-cart) {
		order: 2;
	}

	/* Logo image carries the brand on phones */
	header.wp-block-template-part .wp-block-site-title,
	header.wp-block-template-part .wc-block-customer-account__account-label,
	header.wp-block-template-part .label {
		display: none;
	}

	header.wp-block-template-part .wp-block-woocommerce-customer-account > a {
		padding: 0.45rem 0.6rem;
	}

	/* Shorter search bar */
	.woocheck-search-form {
		min-height: 38px;
	}

	.woocheck-search-form__input {
		padding: 0.4rem 0.25rem 0.4rem 0.9rem;
	}

	.woocheck-search-form__submit {
		min-width: 42px;
		padding: 0 0.7rem;
	}
}
