/*
 * Mashabear Design: storefront + brand utility classes.
 *
 * Theme responsibility:
 * - Theme must NOT define styles for `.mb-shop-btn`.
 * Plugin responsibility:
 * - Define `.mb-shop-btn` and reusable UI helpers (cards/badges).
 */

:root {
	--mb-bg: var(--wp--preset--color--background, #fffbf4);
	--mb-surface: var(--wp--preset--color--surface, #ffffff);
	--mb-text: var(--wp--preset--color--text, #111111);
	--mb-teal: var(--wp--preset--color--foreground, #068985);
	--mb-accent: var(--wp--preset--color--accent, #ff8000);
	--mb-accent-hover: var(--wp--preset--color--accent-hover, #e67300);
	--mb-radius-pill: 999px;
}

/* SHOP button in block navigation: class is attached to the navigation item. */
.mb-shop-btn > a,
.mb-shop-btn a {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 10px 18px;
	border-radius: var(--mb-radius-pill);
	background: var(--mb-accent);
	color: #ffffff;
	font-weight: 800;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	border: 2px solid var(--mb-accent);
	text-decoration: none;
	transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.mb-shop-btn > a:hover,
.mb-shop-btn a:hover {
	background: var(--mb-accent-hover);
	border-color: var(--mb-accent-hover);
	transform: translateY(-1px);
	text-decoration: none;
}

/* Toggle button (Collections <-> All products), placed next to SHOP in the header nav. */
.mb-shop-toggle-btn > a,
.mb-shop-toggle-btn a {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 10px 18px;
	border-radius: var(--mb-radius-pill);
	background: rgba(255, 255, 255, 0.86);
	color: rgba(17, 17, 17, 0.92);
	font-weight: 800;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	border: 2px solid rgba(17, 17, 17, 0.10);
	text-decoration: none;
	transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.15s ease, color 0.15s ease;
}

.mb-shop-toggle-btn > a:hover,
.mb-shop-toggle-btn a:hover {
	background: rgba(255, 255, 255, 0.98);
	border-color: rgba(255, 128, 0, 0.55);
	color: rgba(17, 17, 17, 0.98);
	transform: translateY(-1px);
	text-decoration: none;
}

/* Utility: card + badge (can be used by content blocks or future patterns). */
.mb-card {
	background: var(--mb-surface);
	border: 2px solid rgba(17, 17, 17, 0.10);
	border-radius: 22px;
	box-shadow: 0 16px 0 rgba(6, 137, 133, 0.10), 0 28px 60px rgba(0, 0, 0, 0.06);
	transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}

.mb-card:hover {
	transform: translateY(-2px);
	box-shadow: 0 18px 0 rgba(255, 128, 0, 0.12), 0 34px 72px rgba(0, 0, 0, 0.08);
	border-color: rgba(17, 17, 17, 0.14);
}

.mb-card:active {
	transform: translateY(0px);
}

.mb-badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 6px 10px;
	border-radius: var(--mb-radius-pill);
	background: rgba(6, 137, 133, 0.12);
	color: var(--mb-teal);
	font-weight: 800;
	font-size: 12px;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

/* Optional storefront accent helpers (does not override WooCommerce core). */
.mb-price {
	color: var(--mb-teal);
	font-weight: 800;
}

/* Collection banner (pulled from store.mashabear.com). */
.mb-collection-banner {
	position: relative;
	border-radius: 22px;
	overflow: hidden;
	min-height: 180px;
	background:
		linear-gradient(180deg, rgba(0, 0, 0, 0.20), rgba(0, 0, 0, 0.05)),
		var(--mb-collection-banner);
	background-size: cover;
	background-position: center;
	box-shadow: 0 18px 46px rgba(0, 0, 0, 0.10);
	margin: 16px 0 22px;
}

	.mb-collection-banner__caption {
		position: absolute;
		left: 18px;
		bottom: 14px;
		padding: 8px 12px;
		border-radius: 999px;
		background: rgba(255, 255, 255, 0.92);
		color: rgba(17, 17, 17, 0.95);
		font-weight: 900;
		letter-spacing: 0.02em;
		text-transform: uppercase;
		font-size: 12px;
		backdrop-filter: blur(6px);
	}

	/* Storefront home (Shop root): hero + collections grid (Shopify-like). */
	.mb-storefront {
		color: var(--mb-text);
	}

	.mb-hero {
		margin: 10px 0 18px;
	}

	.mb-hero__wrap {
		position: relative;
		border-radius: 26px;
		overflow: hidden;
		background: #6d2cff;
		box-shadow: 0 22px 60px rgba(0, 0, 0, 0.14);
	}

	.mb-hero__media {
		display: block;
	}

	.mb-hero__img {
		display: block;
		width: 100%;
		height: auto;
	}

	.mb-hero__actions {
		position: absolute;
		left: 18px;
		right: 18px;
		bottom: 14px;
		display: flex;
		gap: 10px;
		justify-content: flex-start;
		align-items: center;
	}

	.mb-hero__btn {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		padding: 12px 18px;
		border-radius: var(--mb-radius-pill);
		font-weight: 900;
		letter-spacing: 0.02em;
		text-transform: uppercase;
		font-size: 12px;
		border: 2px solid transparent;
		text-decoration: none;
		transition: transform 0.15s ease, background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
	}

	.mb-hero__btn--primary {
		background: rgba(255, 255, 255, 0.94);
		border-color: rgba(255, 255, 255, 0.94);
		color: rgba(17, 17, 17, 0.95);
	}

	.mb-hero__btn--ghost {
		background: rgba(6, 137, 133, 0.92);
		border-color: rgba(6, 137, 133, 0.92);
		color: #ffffff;
	}

	.mb-hero__btn:hover {
		transform: translateY(-1px);
		text-decoration: none;
	}

	.mb-collections {
		margin: 18px 0 10px;
	}

	.mb-collections__title {
		margin: 10px 0 14px;
		font-weight: 900;
		font-size: 18px;
		letter-spacing: 0.01em;
		color: rgba(6, 137, 133, 0.98);
		text-transform: none;
	}

	.mb-collections__grid {
		display: grid;
		grid-template-columns: repeat(4, minmax(0, 1fr));
		gap: 14px;
		grid-auto-rows: 160px;
	}

	@media (max-width: 1000px) {
		.mb-collections__grid {
			grid-template-columns: repeat(3, minmax(0, 1fr));
			grid-auto-rows: 150px;
		}
	}

	@media (max-width: 760px) {
		.mb-collections__grid {
			grid-template-columns: repeat(2, minmax(0, 1fr));
			gap: 12px;
			grid-auto-rows: 140px;
		}
	}

	.mb-collection-card {
		position: relative;
		display: block;
		min-height: 150px;
		border-radius: 24px;
		overflow: hidden;
		background: var(--mb-card-bg, #e6f6ff);
		border: 1px solid rgba(0, 0, 0, 0.06);
		box-shadow: 0 14px 34px rgba(0, 0, 0, 0.07);
		transform: translateY(0);
		transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
	}

	.mb-collection-card:hover {
		transform: translateY(-2px);
		box-shadow: 0 20px 46px rgba(0, 0, 0, 0.10);
		border-color: rgba(6, 137, 133, 0.25);
	}

	.mb-collection-card__img {
		position: absolute;
		inset: 0;
		width: 100%;
		height: 100%;
		object-fit: cover;
		filter: saturate(1.06) contrast(1.04);
		transform: scale(1.02);
	}

	/* Soft overlay so the label stays readable even on busy images. */
	.mb-collection-card::before {
		content: "";
		position: absolute;
		inset: 0;
		background:
			radial-gradient(120% 90% at 18% 92%, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0) 58%),
			linear-gradient(180deg, rgba(0, 0, 0, 0.10), rgba(0, 0, 0, 0.00) 40%);
		opacity: 0.55;
		pointer-events: none;
	}

	.mb-collection-card__label {
		position: absolute;
		left: 14px;
		bottom: 12px;
		padding: 8px 12px;
		border-radius: var(--mb-radius-pill);
		background: rgba(255, 255, 255, 0.92);
		color: rgba(17, 17, 17, 0.95);
		font-weight: 800;
		letter-spacing: 0.01em;
		text-transform: none;
		font-size: 13px;
		backdrop-filter: blur(6px);
	}

	/* Make WooCommerce storefront links closer to the reference (teal). */
	body.woocommerce a:not(.button):not(.wp-element-button):not(.wp-block-button__link) {
		color: rgba(6, 137, 133, 0.98);
	}

	/* Mosaic layout hint (reference store has an irregular grid). */
	@media (min-width: 761px) {
		.mb-collections__grid .mb-collection-card:nth-child(1) {
			grid-column: span 2;
		}
		.mb-collections__grid .mb-collection-card:nth-child(2) {
			grid-column: span 2;
		}
		.mb-collections__grid .mb-collection-card:nth-child(7) {
			grid-column: span 2;
		}
	}

	/* Shop header (store-like). */
	.mb-shop-header {
		background: rgba(255, 251, 244, 0.92);
		backdrop-filter: blur(10px);
		border-bottom: 2px solid rgba(0, 0, 0, 0.08);
		position: sticky;
		top: 0;
		z-index: 1000;
	}

	body.woocommerce-shop {
		background: #ffffff;
	}

	.mb-shop-header__left,
	.mb-shop-header__right {
		display: flex;
		align-items: center;
		flex: 0 0 auto;
	}

	.mb-shop-header__left {
		gap: 18px;
	}

	.mb-shop-header__nav.wp-block-navigation {
		display: flex;
		align-items: center;
		font-weight: 800;
		font-size: 13px;
	}

	.mb-shop-header__nav.wp-block-navigation a {
		color: rgba(17, 17, 17, 0.92);
		text-decoration: none;
	}

	.mb-shop-header__nav.wp-block-navigation a:hover {
		text-decoration: underline;
		text-underline-offset: 0.25rem;
	}

	.mb-shop-header .wp-block-site-logo a {
		display: inline-flex;
		align-items: center;
		text-decoration: none;
	}

	.mb-shop-header .wp-block-site-logo img,
	.mb-shop-header .wp-block-site-logo svg {
		display: block;
		height: auto;
		max-height: 46px;
		width: auto;
	}

	.mb-shop-header__right {
		gap: 10px;
	}

	.mb-shop-header__icon {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		width: 36px;
		height: 36px;
		border-radius: 999px;
		background: rgba(6, 137, 133, 0.10);
		color: rgba(6, 137, 133, 0.98);
		text-decoration: none;
	}

	.mb-shop-header__icon:hover {
		background: rgba(6, 137, 133, 0.16);
	}

	/* Mobile "desktop mode" commonly reports a ~980px layout viewport; keep header usable there too. */
	@media (max-width: 1000px) {
		.mb-shop-header__right {
			gap: 8px;
		}
	}

	/* Mobile: keep the store header clean (logo + quick actions). */
	@media (max-width: 760px) {
		.mb-shop-header__nav.wp-block-navigation {
			display: none;
		}

		.mb-shop-header .wp-block-site-logo img,
		.mb-shop-header .wp-block-site-logo svg {
			max-height: 40px;
		}
	}

	/* Shop switcher (Collections <-> All products). */
	.mb-shop-switch {
		display: flex;
		align-items: center;
		gap: 10px;
		padding: 6px;
		border-radius: 999px;
		background: rgba(255, 255, 255, 0.92);
		border: 2px solid rgba(0, 0, 0, 0.08);
		box-shadow: 0 18px 50px rgba(0, 0, 0, 0.08);
		backdrop-filter: blur(10px);
	}

	.mb-shop-switch__link {
		flex: 1 1 0;
		display: inline-flex;
		align-items: center;
		justify-content: center;
		padding: 10px 12px;
		border-radius: 999px;
		border: 2px solid rgba(0, 0, 0, 0.08);
		text-decoration: none;
		font-weight: 900;
		letter-spacing: 0.02em;
		text-transform: uppercase;
		font-size: 12px;
		color: rgba(17, 17, 17, 0.92);
		background: rgba(255, 255, 255, 0.80);
		transition: transform 0.15s ease, background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
	}

	.mb-shop-switch__link:hover {
		transform: translateY(-1px);
		text-decoration: none;
	}

	.mb-shop-switch__link[aria-current="page"] {
		background: var(--mb-accent);
		border-color: var(--mb-accent);
		color: #ffffff;
	}

	@media (max-width: 760px) {
		.mb-shop-switch {
			gap: 8px;
			padding: 6px;
		}

		.mb-shop-switch__link {
			padding: 11px 12px;
			font-size: 11px;
		}
	}
