/**
 * DedeBuy WooCommerce shop & archive styles
 */

/* ---- Shop inside unified page shell ---- */
.dedebuy-page-shell .dedebuy-woo {
	padding: 0;
	width: 100%;
	max-width: none;
}

/* Neutralize WooCommerce float column layout */
.dedebuy-woo .woocommerce::before,
.dedebuy-woo .woocommerce::after {
	display: none !important;
}

.dedebuy-woo ul.products {
	clear: both !important;
}

.dedebuy-woo ul.products li.product,
.dedebuy-woo ul.products li.dedebuy-product-card,
.dedebuy-woo ul.products li.product-category {
	float: none !important;
	clear: none !important;
}

/* ---- Category pill navigation ---- */
.dedebuy-shop-cats {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin-bottom: 1.5rem;
	padding: 0.25rem 0;
}

.dedebuy-shop-cats__link {
	display: inline-flex;
	align-items: center;
	padding: 0.5rem 1.1rem;
	border-radius: var(--dedebuy-radius-pill);
	font-size: 0.875rem;
	font-weight: 600;
	text-decoration: none;
	color: var(--dedebuy-text-muted);
	background: var(--dedebuy-surface);
	border: 1px solid rgba(23, 23, 23, 0.1);
	transition: color var(--dedebuy-transition), background var(--dedebuy-transition), border-color var(--dedebuy-transition), transform var(--dedebuy-transition);
	cursor: pointer;
}

.dedebuy-shop-cats__link:hover {
	color: var(--wf-main-color);
	border-color: rgba(var(--wf-main-rgb), 0.35);
	transform: translateY(-1px);
}

.dedebuy-shop-cats__link.is-active {
	color: #fff;
	background: var(--wf-secondary-color);
	border-color: transparent;
	box-shadow: 0 4px 12px rgba(23, 23, 23, 0.15);
}

/* ---- Toolbar: count + sort ---- */
.dedebuy-shop-toolbar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	margin-bottom: 1.75rem;
	padding: 0.85rem 1.15rem;
	background: var(--dedebuy-surface);
	border: 1px solid rgba(23, 23, 23, 0.08);
	border-radius: var(--dedebuy-radius);
	box-shadow: var(--dedebuy-shadow);
}

.dedebuy-shop-toolbar .woocommerce-result-count {
	margin: 0;
	font-size: 0.875rem;
	color: var(--dedebuy-text-muted);
}

.dedebuy-shop-toolbar .woocommerce-ordering {
	margin: 0;
}

.dedebuy-shop-toolbar .woocommerce-ordering select {
	padding: 0.5rem 2rem 0.5rem 0.85rem;
	border-radius: var(--dedebuy-radius-pill);
	border: 1px solid rgba(23, 23, 23, 0.12);
	background: #fff;
	font-family: var(--dedebuy-font-body);
	font-size: 0.875rem;
	font-weight: 600;
	color: var(--wf-secondary-color);
	cursor: pointer;
	appearance: none;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%234a4039' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 0.65rem center;
	min-width: 180px;
}

.dedebuy-shop-toolbar .woocommerce-ordering select:focus {
	outline: 2px solid var(--dedebuy-lavender);
	outline-offset: 2px;
}

/* ---- Product grid ---- */
.dedebuy-woo ul.products {
	display: grid !important;
	grid-template-columns: repeat(5, 1fr);
	gap: 1.5rem;
	list-style: none;
	margin: 0;
	padding: 0;
	clear: none;
}

.dedebuy-woo ul.products::before,
.dedebuy-woo ul.products::after {
	display: none !important;
	content: none !important;
}

.dedebuy-woo ul.products li.product,
.dedebuy-woo ul.products li.dedebuy-product-card {
	float: none !important;
	width: 100% !important;
	margin: 0 !important;
	padding: 0 !important;
}

/* ---- Product card ---- */
.dedebuy-product-card__inner {
	display: flex;
	flex-direction: column;
	height: 100%;
	background: var(--dedebuy-surface);
	border: 1px solid rgba(23, 23, 23, 0.08);
	border-radius: var(--dedebuy-radius);
	box-shadow: var(--dedebuy-shadow);
	overflow: hidden;
	transition: box-shadow var(--dedebuy-transition), transform var(--dedebuy-transition);
}

.dedebuy-product-card:hover .dedebuy-product-card__inner {
	box-shadow: var(--dedebuy-shadow-soft);
	transform: translateY(-4px);
}

.dedebuy-product-card__media {
	position: relative;
	display: block;
	aspect-ratio: 1;
	overflow: hidden;
	background: linear-gradient(145deg, var(--dedebuy-peach), var(--dedebuy-lavender));
	text-decoration: none;
}

.dedebuy-product-card__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.4s ease;
}

.dedebuy-product-card:hover .dedebuy-product-card__media img {
	transform: scale(1.05);
}

.dedebuy-product-card__media .onsale {
	display: none !important;
}

.dedebuy-product-card__media .dedebuy-difficulty-badge {
	position: absolute;
	top: 0.75rem;
	right: 0.75rem;
	z-index: 2;
	margin: 0;
	backdrop-filter: blur(4px);
}

.dedebuy-sale-emoji {
	display: inline-block;
	margin-right: 0.2rem;
	font-size: 0.85em;
	line-height: 1;
	vertical-align: middle;
	opacity: 0.9;
}

.dedebuy-product-card__body {
	padding: 1rem 1.15rem 0.5rem;
	flex: 1;
}

.dedebuy-product-card__title-link {
	text-decoration: none;
	display: block;
}

.dedebuy-product-card .woocommerce-loop-product__title {
	font-family: var(--dedebuy-font-heading);
	font-size: 1rem;
	font-weight: 700;
	line-height: 1.35;
	margin: 0 0 0.5rem;
	color: var(--wf-secondary-color);
	padding: 0;
	transition: color var(--dedebuy-transition);
}

.dedebuy-product-card__title-link:hover .woocommerce-loop-product__title {
	color: var(--wf-main-color);
}

.dedebuy-product-card .price {
	color: var(--wf-main-color) !important;
	font-weight: 700 !important;
	font-size: 1.05rem !important;
	margin: 0;
}

.dedebuy-product-card .price del {
	color: var(--dedebuy-text-muted);
	font-weight: 500;
	font-size: 0.85rem;
	opacity: 0.8;
}

.dedebuy-product-card .price ins {
	text-decoration: none;
}

.dedebuy-product-card__footer {
	padding: 0.75rem 1.15rem 1.15rem;
}

.dedebuy-product-card__footer .button,
.dedebuy-product-card__footer .added_to_cart {
	display: block;
	width: 100%;
	text-align: center;
	padding: 0.7rem 1rem !important;
	font-size: 0.875rem !important;
	line-height: 1.3 !important;
}

.dedebuy-product-card__footer .added_to_cart {
	margin-top: 0.5rem;
	font-weight: 600;
	text-decoration: none;
}

/* ---- Breadcrumbs ---- */
.dedebuy-woo .woocommerce-breadcrumb {
	margin: 0 0 1.25rem;
	padding: 0;
	font-size: 0.85rem;
	color: var(--dedebuy-text-muted);
}

.dedebuy-woo .woocommerce-breadcrumb a {
	color: var(--dedebuy-text-muted);
	text-decoration: none;
	font-weight: 600;
}

.dedebuy-woo .woocommerce-breadcrumb a:hover {
	color: var(--wf-main-color);
}

/* ---- Archive description ---- */
.dedebuy-woo .term-description,
.dedebuy-woo .woocommerce-archive-description {
	margin-bottom: 1.5rem;
	padding: 1.15rem 1.25rem;
	background: rgba(var(--dedebuy-secondary-rgb), 0.1);
	border-radius: var(--dedebuy-radius);
	font-size: 0.95rem;
	line-height: 1.65;
	color: var(--dedebuy-text-muted);
}

.dedebuy-woo .term-description p:last-child,
.dedebuy-woo .woocommerce-archive-description p:last-child {
	margin-bottom: 0;
}

/* ---- Notices ---- */
.dedebuy-woo .woocommerce-info,
.dedebuy-woo .woocommerce-message,
.dedebuy-woo .woocommerce-error {
	border-radius: var(--dedebuy-radius);
	border: none;
	padding: 1rem 1.25rem;
	margin-bottom: 1.5rem;
	font-size: 0.9rem;
	box-shadow: var(--dedebuy-shadow);
}

.dedebuy-woo .woocommerce-message {
	background: rgba(var(--dedebuy-secondary-rgb), 0.15);
	color: var(--wf-secondary-color);
}

.dedebuy-woo .woocommerce-info {
	background: rgba(201, 184, 232, 0.2);
	color: var(--wf-secondary-color);
}

.dedebuy-woo .woocommerce-error {
	background: rgba(var(--wf-main-rgb), 0.1);
	color: var(--wf-secondary-color);
}

.dedebuy-woo .woocommerce-info::before,
.dedebuy-woo .woocommerce-message::before,
.dedebuy-woo .woocommerce-error::before {
	color: var(--wf-main-color);
}

/* ---- Pagination ---- */
.dedebuy-woo .woocommerce-pagination {
	margin-top: 2.5rem;
}

.dedebuy-woo .woocommerce-pagination ul {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0.4rem;
	list-style: none;
	margin: 0;
	padding: 0;
	border: none;
}

.dedebuy-woo .woocommerce-pagination ul li {
	border: none;
	margin: 0;
	padding: 0;
}

.dedebuy-woo .woocommerce-pagination ul li a,
.dedebuy-woo .woocommerce-pagination ul li span {
	display: flex;
	align-items: center;
	justify-content: center;
	min-width: 2.5rem;
	height: 2.5rem;
	padding: 0 0.5rem;
	border-radius: 50%;
	text-decoration: none;
	font-weight: 700;
	font-size: 0.875rem;
	color: var(--wf-secondary-color);
	background: var(--dedebuy-surface);
	border: 1px solid rgba(23, 23, 23, 0.1);
	transition: background var(--dedebuy-transition), color var(--dedebuy-transition), border-color var(--dedebuy-transition);
}

.dedebuy-woo .woocommerce-pagination ul li a:hover {
	color: var(--wf-main-color);
	border-color: rgba(var(--wf-main-rgb), 0.35);
}

.dedebuy-woo .woocommerce-pagination ul li span.current {
	background: var(--wf-secondary-color);
	color: #fff;
	border-color: transparent;
}

/* ---- Empty state ---- */
.dedebuy-woo .woocommerce-no-products-found {
	text-align: center;
	padding: 3rem 1.5rem;
	background: var(--dedebuy-surface);
	border-radius: var(--dedebuy-radius-lg);
	border: 1px dashed rgba(23, 23, 23, 0.15);
}

.dedebuy-woo .woocommerce-no-products-found .woocommerce-info {
	background: transparent;
	box-shadow: none;
	margin: 0;
}

/* ---- Global Woo buttons (shop + elsewhere) ---- */
.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button,
.woocommerce #respond input#submit {
	background: var(--wf-secondary-color) !important;
	color: #fff !important;
	border: none !important;
	border-radius: var(--dedebuy-radius-pill) !important;
	font-family: var(--dedebuy-font-body) !important;
	font-weight: 700 !important;
	cursor: pointer;
	transition: transform var(--dedebuy-transition), box-shadow var(--dedebuy-transition) !important;
}

.woocommerce a.button:hover,
.woocommerce button.button:hover,
.woocommerce input.button:hover {
	transform: translateY(-1px);
	box-shadow: var(--dedebuy-shadow-soft) !important;
	color: #fff !important;
	background: #000 !important;
}

.woocommerce a.button.alt,
.woocommerce button.button.alt {
	background: var(--wf-main-color) !important;
}

/* ---- Difficulty badges ---- */
.dedebuy-difficulty-badge {
	display: inline-block;
	padding: 0.3rem 0.65rem;
	border-radius: var(--dedebuy-radius-pill);
	font-size: 0.68rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	line-height: 1.2;
}

.dedebuy-difficulty-badge--beginner {
	background: rgba(23, 23, 23, 0.08);
	color: var(--dedebuy-secondary);
}

.dedebuy-difficulty-badge--easy {
	background: rgba(166, 124, 82, 0.15);
	color: var(--dedebuy-primary-dark);
}

.dedebuy-difficulty-badge--intermediate {
	background: rgba(23, 23, 23, 0.12);
	color: var(--wf-secondary-color);
}

/* ---- Page header on shop ---- */
body.woocommerce .dedebuy-shop-head {
	margin-bottom: 0;
	padding-bottom: 0;
}

/* ---- Responsive ---- */
@media (max-width: 991px) {
	.dedebuy-woo ul.products {
		grid-template-columns: repeat(2, 1fr);
		gap: 1rem;
	}
}

@media (max-width: 575px) {
	.dedebuy-shop-toolbar {
		flex-direction: column;
		align-items: stretch;
	}

	.dedebuy-shop-toolbar .woocommerce-ordering select {
		width: 100%;
	}

	.dedebuy-shop-cats {
		overflow-x: auto;
		flex-wrap: nowrap;
		padding-bottom: 0.5rem;
		-webkit-overflow-scrolling: touch;
		scrollbar-width: none;
	}

	.dedebuy-shop-cats::-webkit-scrollbar {
		display: none;
	}

	.dedebuy-shop-cats__link {
		flex-shrink: 0;
	}

	.dedebuy-woo ul.products {
		gap: 0.75rem;
	}
}

@media (prefers-reduced-motion: reduce) {
	.dedebuy-product-card__inner,
	.dedebuy-product-card__media img,
	.dedebuy-shop-cats__link {
		transition: none;
	}
}
