/* ==========================================================================
   Apex Product Loop — dark card design matching the original layout
   ========================================================================== */

ul.products {
	display: grid !important;
	grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
	gap: 22px !important;
	list-style: none !important;
	padding-left: 0 !important;
	margin: 0 !important;
}

@media (max-width: 1200px) {
	ul.products {
		grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
	}
}

@media (max-width: 900px) {
	ul.products {
		grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
	}
}

@media (max-width: 560px) {
	ul.products {
		grid-template-columns: 1fr !important;
	}
}

ul.products li.product,
ul.products li.product * {
	box-sizing: border-box;
}

ul.products li.product {
	background-color: #0a0a0f !important;
	border: 1px solid rgba(255, 255, 255, 0.08);
	border-radius: 10px;
	padding: 18px;
	margin: 0 !important;
	width: 100% !important;
	max-width: 100% !important;
	float: none !important;
	color: #fff;
	display: flex;
	flex-direction: column;
}

ul.products li.product a.woocommerce-LoopProduct-link {
	color: inherit;
	text-decoration: none;
	display: block;
}

ul.products li.product img {
	background-color: #000;
	border-radius: 6px;
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 3 / 4;
	object-fit: cover;
	object-position: center top;
	margin-bottom: 10px;
}

ul.products li.product .woocommerce-loop-product__title,
ul.products li.product h2,
ul.products li.product h3 {
	color: #fff !important;
	font-size: 16px;
	font-weight: 700;
	margin: 0 0 4px !important;
	line-height: 1.3;
}

ul.products li.product .apex-loop-subtitle {
	color: rgba(255, 255, 255, 0.55);
	font-size: 12.5px;
	margin-bottom: 4px;
}

/* Hide default price/button wherever the theme renders them, since our
   custom block below replaces both. */
ul.products li.product > a > .price,
ul.products li.product .price:not(.apex-price):not(.apex-price *) {
	display: none !important;
}

ul.products li.product a.button.add_to_cart_button,
ul.products li.product a.added_to_cart {
	display: none !important;
}

/* ---- Our custom block ---- */

.apex-variations {
	margin-top: auto;
	padding-top: 10px;
}

.apex-attr-group {
	margin-bottom: 10px;
}

.apex-attr-label {
	display: block;
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: rgba(255, 255, 255, 0.5);
	margin-bottom: 6px;
}

.apex-swatches {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.apex-swatch {
	border: 1px solid rgba(255, 255, 255, 0.25) !important;
	background: transparent !important;
	color: #fff !important;
	padding: 5px 12px !important;
	font-size: 12px !important;
	font-weight: 600;
	border-radius: 5px !important;
	cursor: pointer;
	transition: background-color 0.15s ease, border-color 0.15s ease;
	line-height: 1.4;
}

.apex-swatch:hover {
	border-color: #2b6cff !important;
}

.apex-swatch.is-active {
	background-color: #2b6cff !important;
	border-color: #2b6cff !important;
	color: #fff !important;
}

.apex-price {
	font-size: 22px;
	font-weight: 700;
	color: #2b6cff !important;
	margin: 12px 0 !important;
}

.apex-price .woocommerce-Price-amount {
	color: #2b6cff !important;
}

.apex-purchase-row {
	display: flex;
	align-items: stretch;
	gap: 8px;
	flex-wrap: nowrap;
	width: 100%;
}

.apex-qty {
	display: flex;
	align-items: center;
	border: 1px solid rgba(255, 255, 255, 0.25);
	border-radius: 5px;
	overflow: hidden;
	background: transparent;
	flex: 0 0 auto !important;
	width: auto !important;
	max-width: 84px !important;
	height: 32px;
}

.apex-qty button {
	background: transparent !important;
	border: none !important;
	color: #fff !important;
	width: 26px !important;
	max-width: 26px !important;
	flex: 0 0 26px !important;
	height: 100% !important;
	cursor: pointer;
	font-size: 14px;
	line-height: 1;
	padding: 0 !important;
}

.apex-qty button:hover {
	background: rgba(255, 255, 255, 0.08) !important;
}

.apex-qty-input {
	width: 28px !important;
	max-width: 28px !important;
	flex: 0 0 28px !important;
	text-align: center;
	border: none !important;
	background: transparent !important;
	color: #fff !important;
	font-size: 13px;
	box-shadow: none !important;
	-moz-appearance: textfield;
	height: 100% !important;
	padding: 0 !important;
	min-width: 0 !important;
}

.apex-qty-input::-webkit-outer-spin-button,
.apex-qty-input::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

.apex-add-to-cart {
	flex: 1 1 auto !important;
	min-width: 80px !important;
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	gap: 6px;
	padding: 0 10px !important;
	height: 32px;
	border-radius: 5px !important;
	border: 1px solid rgba(255, 255, 255, 0.25) !important;
	background: transparent !important;
	color: #fff !important;
	cursor: pointer;
	font-size: 12.5px !important;
	font-weight: 600;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.apex-add-to-cart:hover:not(:disabled) {
	background-color: #2b6cff !important;
	border-color: #2b6cff !important;
	color: #fff !important;
}

.apex-add-to-cart:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.apex-message {
	margin-top: 6px;
	font-size: 12px;
	color: #ff6b6b;
	min-height: 14px;
}
