/* Shop Core front-end. Colours follow the theme through CSS custom properties. */
:root {
	--shop-core-brand: var(--wp--preset--color--brand, #00704a);
	--shop-core-brand-soft: var(--wp--preset--color--brand-soft, #e3f2eb);
	--shop-core-sale: var(--wp--preset--color--sale, #b4311f);
	--shop-core-sale-soft: #fde2dd;
	--shop-core-ink: var(--wp--preset--color--ink, #1c2329);
	--shop-core-muted: var(--wp--preset--color--muted, #5b6670);
	--shop-core-line: var(--wp--preset--color--line, #e3e7eb);
	--shop-core-surface: var(--wp--preset--color--surface, #ffffff);
	--shop-core-radius: 10px;
}

.shop-core-icon { flex: none; }

.shop-core-badge {
	display: inline-block;
	background: var(--shop-core-sale);
	color: #fff;
	font-size: 12px;
	font-weight: 700;
	line-height: 1.6;
	padding: 0 7px;
	border-radius: 4px;
}

.shop-core-notice {
	background: #fdf0ee;
	color: #7a2a1d;
	border-radius: 8px;
	padding: 10px 12px;
	font-size: 14px;
}

.shop-core-eta {
	display: block;
	color: var(--shop-core-muted);
	font-size: 12px;
}

/* Free delivery progress */
.shop-core-free-delivery {
	background: var(--shop-core-brand-soft);
	color: #00573a;
	border-radius: 8px;
	padding: 10px 12px;
	margin: 0 0 16px;
	font-size: 14px;
}
.shop-core-free-delivery__bar {
	display: block;
	height: 6px;
	border-radius: 3px;
	background: rgba(0, 112, 74, 0.18);
	margin-top: 8px;
	overflow: hidden;
}
.shop-core-free-delivery__bar span {
	display: block;
	height: 100%;
	background: var(--shop-core-brand);
}

/* Delivery info */
.shop-core-delivery {
	border: 1px solid var(--shop-core-line);
	border-radius: var(--shop-core-radius);
	padding: 4px 14px;
	margin: 16px 0;
	background: var(--shop-core-surface);
}
.shop-core-delivery__row {
	display: flex;
	gap: 12px;
	align-items: flex-start;
	padding: 10px 0;
	font-size: 14px;
	line-height: 1.45;
}
.shop-core-delivery__row + .shop-core-delivery__row { border-top: 1px solid var(--shop-core-line); }
.shop-core-delivery__row .shop-core-icon { color: var(--shop-core-brand); margin-top: 2px; }
.shop-core-delivery__body { flex: 1; display: flex; flex-direction: column; }
.shop-core-delivery__body span { color: var(--shop-core-muted); font-size: 13px; }
.shop-core-delivery__price { font-weight: 700; white-space: nowrap; }

/* Flash sale */
.shop-core-flash {
	background: var(--shop-core-surface);
	border-radius: 12px;
	padding: 14px 0 14px 14px;
}
.shop-core-flash__head { display: flex; align-items: center; gap: 10px; padding-right: 14px; flex-wrap: wrap; }
.shop-core-flash__title { margin: 0; font-size: 1.125rem; color: var(--shop-core-sale); }
.shop-core-flash__all { margin-left: auto; font-size: 14px; font-weight: 600; text-decoration: none; }
.shop-core-countdown { display: inline-flex; gap: 3px; align-items: center; font-size: 13px; font-weight: 700; }
.shop-core-countdown b { background: var(--shop-core-sale); color: #fff; border-radius: 4px; padding: 0 5px; min-width: 1.6em; text-align: center; }
.shop-core-flash__list {
	list-style: none;
	margin: 12px 0 0;
	padding: 0 14px 4px 0;
	display: grid;
	grid-auto-flow: column;
	grid-auto-columns: minmax(124px, 168px);
	gap: 10px;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
}
.shop-core-flash__item { scroll-snap-align: start; }
.shop-core-flash__item a { display: flex; flex-direction: column; gap: 4px; color: var(--shop-core-ink); text-decoration: none; }
.shop-core-flash__image { position: relative; display: block; border-radius: 8px; overflow: hidden; background: #f1f3f5; aspect-ratio: 1; }
.shop-core-flash__image img { width: 100%; height: 100%; object-fit: cover; display: block; }
.shop-core-flash__image .shop-core-badge { position: absolute; top: 0; left: 0; border-radius: 8px 0 8px 0; }
.shop-core-flash__name { font-size: 13px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.shop-core-flash__price { font-size: 15px; font-weight: 700; color: var(--shop-core-sale); }
.shop-core-flash__price del { color: var(--shop-core-muted); font-weight: 400; font-size: 12px; }
.shop-core-flash__price ins { text-decoration: none; }
.shop-core-flash__sold {
	position: relative;
	display: block;
	height: 16px;
	border-radius: 8px;
	background: var(--shop-core-sale-soft);
	overflow: hidden;
	font-size: 10.5px;
	font-weight: 700;
	text-align: center;
	line-height: 16px;
}
.shop-core-flash__sold::before {
	content: "";
	position: absolute;
	inset: 0 auto 0 0;
	width: var(--sold, 0%);
	background: #e8604c;
}
.shop-core-flash__sold span { position: relative; }

/* Coupons */
.shop-core-coupons { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.shop-core-coupon { display: flex; align-items: stretch; border: 1px dashed #f0a800; border-radius: var(--shop-core-radius); background: var(--shop-core-surface); overflow: hidden; }
.shop-core-coupon__value { width: 88px; background: #ffb400; color: var(--shop-core-ink); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 8px 4px; }
.shop-core-coupon__value strong { font-size: 19px; line-height: 1.1; }
.shop-core-coupon__value span { font-size: 11px; }
.shop-core-coupon__body { flex: 1; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; font-size: 12.5px; color: var(--shop-core-muted); }
.shop-core-coupon__body strong { color: var(--shop-core-ink); font-size: 14px; }
.shop-core-coupon__expiry { color: var(--shop-core-sale); }
.shop-core-coupon__copy { border: 0; border-left: 1px solid var(--shop-core-line); background: transparent; padding: 8px 12px; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font: inherit; font-size: 12px; color: var(--shop-core-brand); font-weight: 700; min-width: 72px; }
.shop-core-coupon__copy code { font-size: 12px; color: var(--shop-core-ink); }

/* Tracking */
.shop-core-track__form { display: grid; gap: 4px; max-width: 480px; }
.shop-core-track__form label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.shop-core-track__form input { width: 100%; box-sizing: border-box; min-height: 46px; padding: 0 12px; border: 1px solid #d3d9de; border-radius: 8px; font: inherit; }
.shop-core-track__error { color: var(--shop-core-sale); font-weight: 600; }
.shop-core-track__result { margin-top: 20px; background: var(--shop-core-surface); border: 1px solid var(--shop-core-line); border-radius: 12px; padding: 16px; }
.shop-core-track__result h2 { margin: 0 0 4px; font-size: 1.25rem; }
.shop-core-track__meta { color: var(--shop-core-muted); margin: 0 0 12px; font-size: 14px; }
.shop-core-track__items { margin: 12px 0 0; padding-left: 18px; font-size: 14px; }

.shop-core-timeline { margin: 0 0 20px; }
.shop-core-timeline__steps { list-style: none; margin: 0; padding: 0; }
.shop-core-timeline__step { position: relative; display: flex; gap: 12px; align-items: flex-start; padding: 0 0 18px; font-size: 14px; color: var(--shop-core-muted); }
.shop-core-timeline__step:not(:last-child)::after { content: ""; position: absolute; left: 10px; top: 22px; bottom: 0; width: 2px; background: var(--shop-core-line); }
.shop-core-timeline__step.is-done:not(:last-child)::after { background: var(--shop-core-brand); }
.shop-core-timeline__dot { flex: none; width: 22px; height: 22px; border-radius: 50%; border: 2px solid #c5cdd4; box-sizing: border-box; display: flex; align-items: center; justify-content: center; background: #fff; color: #fff; }
.shop-core-timeline__step.is-done .shop-core-timeline__dot { background: var(--shop-core-brand); border-color: var(--shop-core-brand); }
.shop-core-timeline__step.is-current .shop-core-timeline__dot { border-color: var(--shop-core-brand); }
.shop-core-timeline__step.is-done, .shop-core-timeline__step.is-current { color: var(--shop-core-ink); }
.shop-core-timeline__step.is-current .shop-core-timeline__label { font-weight: 700; }
.shop-core-timeline__courier { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; border-top: 1px solid var(--shop-core-line); padding-top: 12px; margin: 0; }
.shop-core-timeline__stopped { font-weight: 600; color: var(--shop-core-sale); }

/* Wallet payment */
.shop-core-wallet__steps { margin: 0 0 12px; padding-left: 20px; font-size: 14px; line-height: 1.6; }
.shop-core-wallet-label { display: inline-flex; align-items: center; gap: 10px; }
.shop-core-wallet-label__chip { color: #fff; font-size: 11px; font-weight: 700; padding: 4px 8px; border-radius: 6px; }

/* Live search */
.shop-core-live {
	position: absolute;
	z-index: 1000;
	left: 0;
	right: 0;
	top: calc(100% + 6px);
	background: #fff;
	color: var(--shop-core-ink);
	border-radius: 12px;
	box-shadow: 0 10px 30px rgba(16, 24, 32, 0.18);
	overflow: hidden;
	max-height: 70vh;
	overflow-y: auto;
	text-align: left;
}
.shop-core-live__item { display: flex; gap: 10px; align-items: center; padding: 8px 12px; color: inherit; text-decoration: none; }
.shop-core-live__item:hover, .shop-core-live__item.is-active { background: #f1f3f5; }
.shop-core-live__item img { width: 44px; height: 44px; object-fit: cover; border-radius: 6px; flex: none; }
.shop-core-live__item > span:nth-child(2) { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.shop-core-live__name { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shop-core-live__meta { font-size: 12px; color: var(--shop-core-muted); }
.shop-core-live__price { font-weight: 700; color: var(--shop-core-sale); font-size: 13px; white-space: nowrap; }
.shop-core-live__all { display: block; text-align: center; padding: 10px; font-weight: 700; font-size: 14px; border-top: 1px solid var(--shop-core-line); color: var(--shop-core-brand); text-decoration: none; }
.shop-core-live__empty { margin: 0; padding: 14px; color: var(--shop-core-muted); font-size: 14px; }

/* Wishlist heart */
.wc-block-components-product-image { position: relative; }
.shop-wish {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	border: 1px solid var(--shop-core-line);
	background: #fff;
	color: var(--shop-core-muted);
	cursor: pointer;
	font: inherit;
}
.shop-wish svg { flex: none; }
.shop-wish.is-active { color: var(--shop-core-sale); border-color: #f1c6be; }
.shop-wish.is-active svg { fill: currentColor; }
.shop-wish--card {
	position: absolute;
	top: 6px;
	right: 6px;
	z-index: 2;
	width: 34px;
	height: 34px;
	border-radius: 50%;
	padding: 0;
	box-shadow: 0 1px 4px rgba(16, 24, 32, 0.12);
}
.shop-wish--single { min-height: 44px; padding: 0 16px; border-radius: 999px; margin-top: 10px; font-weight: 600; }

/* Wishlist page */
.shop-wishlist__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.shop-wishlist__item { display: flex; gap: 12px; background: var(--shop-core-surface); border: 1px solid var(--shop-core-line); border-radius: var(--shop-core-radius); padding: 10px; }
.shop-wishlist__item.is-out { opacity: 0.7; }
.shop-wishlist__img { flex: none; width: 96px; height: 96px; border-radius: 8px; overflow: hidden; background: #f1f3f5; }
.shop-wishlist__img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.shop-wishlist__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.shop-wishlist__name { color: var(--shop-core-ink); text-decoration: none; font-size: 14px; line-height: 1.35; }
.shop-wishlist__price { font-weight: 700; color: var(--shop-core-sale); }
.shop-wishlist__price del { color: var(--shop-core-muted); font-weight: 400; font-size: 12px; }
.shop-wishlist__price ins { text-decoration: none; }
.shop-wishlist__drop { align-self: flex-start; font-size: 12px; font-weight: 700; color: #00573a; background: var(--shop-core-brand-soft); padding: 0 6px; border-radius: 4px; }
.shop-wishlist__actions { display: flex; gap: 8px; align-items: center; margin-top: auto; }
.shop-wishlist__cart { flex: 1; text-align: center; padding: 8px 12px !important; font-size: 13px !important; }
.shop-wishlist__actions .shop-wish { width: 38px; height: 38px; border-radius: 50%; padding: 0; }
.shop-wishlist__out { flex: 1; font-size: 13px; color: var(--shop-core-muted); }
.shop-wishlist__empty { text-align: center; padding: 40px 16px; color: var(--shop-core-muted); }

/* Filters */
.shop-filters { margin: 0 0 12px; }
.shop-filters__toggle {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-height: 44px;
	padding: 0 16px;
	border: 1px solid var(--shop-core-line);
	border-radius: 999px;
	background: #fff;
	font-weight: 700;
	cursor: pointer;
	list-style: none;
}
.shop-filters__toggle::-webkit-details-marker { display: none; }
.shop-filters__count { min-width: 20px; height: 20px; border-radius: 10px; background: var(--shop-core-brand); color: #fff; font-size: 12px; display: inline-flex; align-items: center; justify-content: center; }
.shop-filters__form { margin-top: 10px; background: #fff; border: 1px solid var(--shop-core-line); border-radius: 12px; padding: 14px; display: grid; gap: 14px; }
.shop-filters__group { border: 0; margin: 0; padding: 0; min-width: 0; }
.shop-filters__group legend { font-weight: 700; font-size: 14px; margin-bottom: 8px; padding: 0; }
.shop-filters__price { display: flex; align-items: center; gap: 8px; }
.shop-filters__price label { flex: 1; }
.shop-filters__price input { width: 100%; box-sizing: border-box; min-height: 44px; border: 1px solid #d3d9de; border-radius: 8px; padding: 0 10px; font: inherit; }
.shop-filters__chips { display: flex; flex-wrap: wrap; gap: 8px; }
.shop-filters__chip { position: relative; }
.shop-filters__chip input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.shop-filters__chip span { display: inline-flex; align-items: center; gap: 4px; min-height: 36px; padding: 0 14px; border: 1.5px solid #d3d9de; border-radius: 18px; font-size: 13px; font-weight: 600; background: #fff; }
.shop-filters__chip input:checked + span { border-color: var(--shop-core-brand); background: var(--shop-core-brand-soft); color: #00573a; }
.shop-filters__chip input:focus-visible + span { outline: 2px solid var(--shop-core-brand); outline-offset: 2px; }
.shop-filters__check { display: flex; align-items: center; gap: 8px; min-height: 36px; font-size: 14px; }
.shop-filters__check input { width: 18px; height: 18px; margin: 0; accent-color: var(--shop-core-brand); }
.shop-filters__actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.shop-filters__clear { font-weight: 600; }
.shop-filters__active { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.shop-filters__active a { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 12px; border-radius: 16px; background: var(--shop-core-brand-soft); color: #00573a; font-size: 13px; font-weight: 600; text-decoration: none; }
@media (min-width: 782px) {
	.shop-filters__form { grid-template-columns: minmax(200px, 1fr) minmax(260px, 2fr) minmax(160px, 1fr) auto; align-items: end; }
	.shop-filters__actions { flex-direction: column; align-items: stretch; }
}
.shop-payments-sandbox { color: #8a5a00; font-size: 13px; }
.shop-filters__actions .wp-element-button { white-space: nowrap; }
