/**
 * WooCommerce Base Styles
 *
 * Main WooCommerce stylesheet with base overrides and shared components.
 *
 * @package WPR\NPX
 */

/* ==========================================================================
   WooCommerce Base Reset
   ========================================================================== */

/**
 * Reset WooCommerce default styles
 */
.woocommerce,
.woocommerce-page {
	box-sizing: border-box;
}

/**
 * Override WooCommerce blocktheme max-width (1000px) — our theme handles
 * content width via theme.json layout / template contentSize.
 */
.woocommerce-cart main .woocommerce,
.woocommerce-checkout main .woocommerce,
.woocommerce-account main .woocommerce {
	max-width: 100%;
}

.woocommerce *,
.woocommerce *::before,
.woocommerce *::after,
.woocommerce-page *,
.woocommerce-page *::before,
.woocommerce-page *::after {
	box-sizing: inherit;
}

/* ==========================================================================
   Typography
   ========================================================================== */

.woocommerce h1,
.woocommerce h2,
.woocommerce h3,
.woocommerce h4,
.woocommerce h5,
.woocommerce h6 {
	font-family: var(--wp--preset--font-family--primary);
	font-weight: 600;
	line-height: 1.2;
	margin-bottom: var(--wp--preset--spacing--20);
	color: var(--wp--preset--color--black);
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.woocommerce .button,
.woocommerce button.button,
.woocommerce input.button,
.woocommerce a.button,
.woocommerce .wp-element-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: var(--wp--preset--spacing--10);
	padding: var(--wp--preset--spacing--20) var(--wp--preset--spacing--40);
	font-family: var(--wp--preset--font-family--primary);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 500;
	line-height: 1.5;
	text-decoration: none;
	border-radius: var(--wp--custom--button-radius);
	border: none;
	cursor: pointer;
	transition: background-color 0.2s ease, color 0.2s ease, transform 0.1s ease;
}

.woocommerce .button:focus,
.woocommerce button.button:focus,
.woocommerce input.button:focus,
.woocommerce a.button:focus {
	outline: 2px solid var(--wp--preset--color--primary);
	outline-offset: 2px;
}

.woocommerce .button:active,
.woocommerce button.button:active,
.woocommerce input.button:active,
.woocommerce a.button:active {
	transform: scale(0.98);
}

/* Primary Button */
.npx-button--primary,
.woocommerce .button.alt,
.woocommerce button.button.alt,
.woocommerce input.button.alt,
.woocommerce a.button.alt,
.woocommerce #respond input#submit.alt {
	background-color: var(--wp--preset--color--primary);
	color: var(--wp--preset--color--white);
}

.npx-button--primary:hover,
.woocommerce .button.alt:hover,
.woocommerce button.button.alt:hover,
.woocommerce input.button.alt:hover,
.woocommerce a.button.alt:hover,
.woocommerce #respond input#submit.alt:hover {
	background-color: #005bb5;
	color: var(--wp--preset--color--white);
}

/* Secondary Button */
.npx-button--secondary,
.woocommerce .button:not(.alt),
.woocommerce button.button:not(.alt),
.woocommerce input.button:not(.alt),
.woocommerce a.button:not(.alt) {
	background-color: var(--wp--preset--color--primary);
	color: var(--wp--preset--color--white);
	border-radius: 30px;
	padding: 16px 32px;
	font-size: var(--wp--preset--font-size--body-m);
	font-weight: 600;
}

.npx-button--secondary:hover,
.woocommerce .button:not(.alt):hover,
.woocommerce button.button:not(.alt):hover,
.woocommerce input.button:not(.alt):hover,
.woocommerce a.button:not(.alt):hover {
	background-color: #005bb5;
	color: var(--wp--preset--color--white);
}

/* Disabled Button */
.woocommerce .button:disabled,
.woocommerce .button.disabled,
.woocommerce button.button:disabled,
.woocommerce button.button.disabled {
	opacity: 0.5;
	cursor: not-allowed;
	pointer-events: none;
}

.woocommerce-form.woocommerce-form-login.login .woocommerce-form-row {
	margin-bottom: var(--wp--preset--spacing--40);
}

/* ==========================================================================
   Form Elements
   ========================================================================== */

.woocommerce form .form-row {
	margin-bottom: var(--wp--preset--spacing--20);
}

.woocommerce form .form-row label:not(.inline) {
	display: none !important;
	margin-bottom: var(--wp--preset--spacing--10);
	font-family: var(--wp--preset--font-family--primary);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 500;
	color: var(--wp--preset--color--black);
}

.woocommerce form .form-row label .required {
	color: #dc3545;
	margin-left: 2px;
}

.woocommerce form .form-row input.input-text,
.woocommerce form .form-row textarea,
.woocommerce form .form-row select,
.npx-input {
	width: 100%;
	padding: 14px 12px;
	font-family: var(--wp--preset--font-family--primary);
	font-size: 17px;
	line-height: 1.5;
	color: var(--wp--preset--color--black);
	background-color: var(--wp--preset--color--white);
	border: 1px solid var(--wp--preset--color--gray);
	border-radius: 10px;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.woocommerce form .form-row input.input-text:focus,
.woocommerce form .form-row textarea:focus,
.woocommerce form .form-row select:focus,
.npx-input:focus {
	outline: none;
	border-color: var(--wp--preset--color--primary);
	box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.1);
}

.woocommerce form .form-row input.input-text::placeholder,
.woocommerce form .form-row textarea::placeholder,
.npx-input::placeholder {
	color: #6e6e73;
}

/* Select Dropdown */
.woocommerce form .form-row select {
	appearance: none;
	background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%23000000' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 16px center;
	padding-right: 48px;
	cursor: pointer;
}

/* Form Row Layout */
.woocommerce form .form-row-first,
.woocommerce form .form-row-last {
	width: calc(50% - 8px);
	float: left;
}

.woocommerce form .form-row-first {
	margin-right: 8px;
}

.woocommerce form .form-row-last {
	margin-left: 8px;
}

.woocommerce form .form-row-wide {
	clear: both;
}

/* Error State */
.woocommerce form .form-row.woocommerce-invalid input.input-text,
.woocommerce form .form-row.woocommerce-invalid select {
	border-color: #dc3545;
}

.woocommerce form .form-row.woocommerce-invalid label {
	color: #dc3545;
}

/* ==========================================================================
   Notices
   ========================================================================== */

.woocommerce-message,
.woocommerce-info,
.woocommerce-error,
.woocommerce-notice {
	padding: var(--wp--preset--spacing--20) var(--wp--preset--spacing--30);
	margin-bottom: var(--wp--preset--spacing--30);
	font-family: var(--wp--preset--font-family--primary);
	font-size: var(--wp--preset--font-size--small);
	line-height: 1.5;
	border-radius: 10px;
	list-style: none;
}

.woocommerce-message {
	background-color: #d4edda;
	color: #155724;
	border: 1px solid #c3e6cb;
}

.woocommerce-info {
	background-color: #cce5ff;
	color: #004085;
	border: 1px solid #b8daff;
}

/* Hide global error notices by default on forms with inline validation to prevent flashing */
.woocommerce-checkout .woocommerce-error,
.woocommerce-checkout .wc-block-components-notice-banner.is-error,
.woocommerce-edit-address .woocommerce-error,
.woocommerce-edit-address .wc-block-components-notice-banner.is-error,
.woocommerce-account .woocommerce-address-fields .woocommerce-error,
.woocommerce-account .woocommerce-address-fields .wc-block-components-notice-banner.is-error {
	display: none !important;
}

/* Class to reveal global errors if JS determines they couldn't be mapped inline */
.woocommerce-notices-wrapper.npx-show-global-error .woocommerce-error,
.woocommerce-notices-wrapper.npx-show-global-error .wc-block-components-notice-banner.is-error {
	display: block !important;
}

.woocommerce-error {
	background-color: #f8d7da;
	color: #721c24;
	border: 1px solid #f5c6cb;
}

.woocommerce-error li {
	margin-bottom: var(--wp--preset--spacing--10);
}

.woocommerce-error li:last-child {
	margin-bottom: 0;
}

/* Notice with Button */
.woocommerce-message .button,
.woocommerce-info .button {
	float: right;
	margin-left: var(--wp--preset--spacing--20);
}

/* ==========================================================================
   Tables
   ========================================================================== */

.woocommerce table.shop_table {
	width: 100%;
	border-collapse: separate;
	margin-bottom: 30px;
	font-family: var(--wp--preset--font-family--primary);
}

.woocommerce table.shop_table th,
.woocommerce table.shop_table td {
	padding: 16px 24px;
	text-align: left;
	vertical-align: middle;
	border-bottom: 1px solid var(--wp--preset--color--gray);
}

.woocommerce table.shop_table thead th {
	font-size: 20px;
	font-weight: 500;
	padding: 16px 20px;
	color: var(--wp--preset--color--black);
	background-color: var(--wp--preset--color--background);
}

.woocommerce table.shop_table tbody td {
	color: var(--wp--preset--color--black);
}

/* ==========================================================================
   Price Styling
   ========================================================================== */

.woocommerce .price,
.woocommerce .amount {
	margin-top: 16px;
	font-family: var(--wp--preset--font-family--primary);
	color: var(--wp--preset--color--black);
}

.woocommerce .price del {
	color: #6e6e73;
	text-decoration: line-through;
	margin-right: var(--wp--preset--spacing--10);
}

.woocommerce .price ins {
	text-decoration: none;
	font-weight: 600;
}

/* Sale Badge */
.woocommerce span.onsale {
	position: absolute;
	top: var(--wp--preset--spacing--20);
	left: var(--wp--preset--spacing--20);
	padding: var(--wp--preset--spacing--10) var(--wp--preset--spacing--20);
	background-color: #dc3545;
	color: var(--wp--preset--color--white);
	font-size: var(--wp--preset--font-size--x-small);
	font-weight: 600;
	text-transform: uppercase;
	border-radius: var(--wp--custom--button-radius);
	z-index: 10;
}

/* ==========================================================================
   Pagination
   ========================================================================== */

.woocommerce nav.woocommerce-pagination {
	margin-top: var(--wp--preset--spacing--50);
	text-align: center;
}

.woocommerce nav.woocommerce-pagination ul {
	display: inline-flex;
	gap: var(--wp--preset--spacing--10);
	list-style: none;
	margin: 0;
	padding: 0;
}

.woocommerce nav.woocommerce-pagination ul li {
	margin: 0;
}

.woocommerce nav.woocommerce-pagination ul li a,
.woocommerce nav.woocommerce-pagination ul li span {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	font-family: var(--wp--preset--font-family--primary);
	font-size: var(--wp--preset--font-size--small);
	text-decoration: none;
	color: var(--wp--preset--color--black);
	background-color: var(--wp--preset--color--white);
	border: 1px solid var(--wp--preset--color--gray);
	border-radius: 50%;
	transition: all 0.2s ease;
}

.woocommerce nav.woocommerce-pagination ul li a:hover {
	background-color: var(--wp--preset--color--primary);
	border-color: var(--wp--preset--color--primary);
	color: var(--wp--preset--color--white);
}

.woocommerce nav.woocommerce-pagination ul li span.current {
	background-color: var(--wp--preset--color--primary);
	border-color: var(--wp--preset--color--primary);
	color: var(--wp--preset--color--white);
}

/* ==========================================================================
   Breadcrumbs
   ========================================================================== */

.woocommerce .woocommerce-breadcrumb,
.npx-breadcrumb {
	margin-bottom: var(--wp--preset--spacing--30);
	font-family: var(--wp--preset--font-family--primary);
	font-size: var(--wp--preset--font-size--small);
	color: #6e6e73;
}

.woocommerce .woocommerce-breadcrumb a,
.npx-breadcrumb a {
	color: #6e6e73;
	text-decoration: none;
	transition: color 0.2s ease;
}

.woocommerce .woocommerce-breadcrumb a:hover,
.npx-breadcrumb a:hover {
	color: var(--wp--preset--color--primary);
}

/* ==========================================================================
   Star Ratings
   ========================================================================== */

.woocommerce .star-rating {
	display: inline-flex;
	font-size: 14px;
	color: #ffc107;
	overflow: hidden;
}

.woocommerce .star-rating::before {
	content: "\2605\2605\2605\2605\2605";
	color: var(--wp--preset--color--gray);
}

.woocommerce .star-rating span {
	overflow: hidden;
	float: left;
	top: 0;
	left: 0;
	position: absolute;
}

.woocommerce .star-rating span::before {
	content: "\2605\2605\2605\2605\2605";
	color: #ffc107;
}

/* ==========================================================================
   Loading States
   ========================================================================== */

.woocommerce .blockUI.blockOverlay {
	background-color: rgba(255, 255, 255, 0.7) !important;
}

.woocommerce .blockUI.blockOverlay::before {
	content: "";
	display: block;
	width: 30px;
	height: 30px;
	position: absolute;
	top: 50%;
	left: 50%;
	margin: -15px 0 0 -15px;
	border: 3px solid var(--wp--preset--color--gray);
	border-top-color: var(--wp--preset--color--primary);
	border-radius: 50%;
	animation: npx-spin 0.8s linear infinite;
}

@keyframes npx-spin {
	to {
		transform: rotate(360deg);
	}
}

/* ==========================================================================
   Quantity Input
   ========================================================================== */

.woocommerce .quantity {
	display: inline-flex;
	align-items: center;
	border-radius: 10px;
	overflow: hidden;
}

.woocommerce .quantity .qty {
	width: 60px;
	padding: var(--wp--preset--spacing--20);
	text-align: center;
	font-family: var(--wp--preset--font-family--primary);
	font-size: var(--wp--preset--font-size--small);
	border: none;
	-moz-appearance: textfield;
}

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

/* Custom Quantity Buttons */
.npx-quantity {
	display: inline-flex;
	align-items: center;
	border: 1px solid var(--wp--preset--color--gray);
	border-radius: 4px;
	overflow: hidden;
}

.npx-quantity__button {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	background-color: var(--wp--preset--color--white);
	border: none;
	cursor: pointer;
	transition: background-color 0.2s ease;
}

.npx-quantity__button:hover {
	background-color: var(--wp--preset--color--background);
}

.npx-quantity__button:focus {
	outline: none;
	background-color: var(--wp--preset--color--background);
}

.npx-quantity__input {
	width: 60px;
	padding: var(--wp--preset--spacing--10);
	text-align: center;
	font-family: var(--wp--preset--font-family--primary);
	font-size: var(--wp--preset--font-size--small);
	border: none;
	border-left: 1px solid var(--wp--preset--color--gray);
	border-right: 1px solid var(--wp--preset--color--gray);
	-moz-appearance: textfield;
}

.npx-quantity__input::-webkit-outer-spin-button,
.npx-quantity__input::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

/* ==========================================================================
   Responsive Utilities
   ========================================================================== */

@media (max-width: 768px) {

	.woocommerce form .form-row-first,
	.woocommerce form .form-row-last {
		width: 100%;
		float: none;
		margin-left: 0;
		margin-right: 0;
	}

	.woocommerce table.shop_table_responsive thead {
		display: none;
	}

	.woocommerce table.shop_table_responsive tr {
		display: block;
		margin-bottom: var(--wp--preset--spacing--20);
		border: 1px solid var(--wp--preset--color--gray);
		border-radius: 10px;
	}

	.woocommerce table.shop_table_responsive td {
		display: block;
		text-align: right;
		border-bottom: 1px solid var(--wp--preset--color--gray);
	}

	.woocommerce table.shop_table_responsive td:last-child {
		border-bottom: none;
	}

	.woocommerce table.shop_table_responsive td::before {
		content: attr(data-title) ": ";
		float: left;
		font-weight: 600;
	}

	.woocommerce-message .button,
	.woocommerce-info .button {
		float: none;
		display: block;
		margin: var(--wp--preset--spacing--20) 0 0 0;
	}
}

/* ==========================================================================
   Archive / Product Cards (Figma Design)
   ========================================================================== */



/* Hide duplicate heading from product-collection block (our query-title handles this) */
.npx-archive-grid-container .wp-block-woocommerce-product-collection>h2,
.npx-archive-grid-container .wp-block-woocommerce-product-collection>.wc-block-product-collection-header {
	display: none !important;
}

/* Product Grid */
ul.products,
ul.wc-block-product-template,
.wp-block-woocommerce-product-collection ul,
.wc-block-grid__products {
	display: grid !important;
	grid-template-columns: repeat(3, 1fr) !important;
	gap: 40px !important;
	margin: 0 !important;
	padding: 0 !important;
}

.woocommerce ul.products::before,
.woocommerce ul.products::after,
ul.wc-block-product-template::before,
ul.wc-block-product-template::after {
	display: none !important;
}

/* Individual Product Card */
.woocommerce ul.products li.product,
.wc-block-grid__product,
li.wp-block-post {
	display: flex !important;
	flex-direction: column !important;
	align-items: center !important;
	text-align: center !important;
	width: 100% !important;
	margin: 0 !important;
	padding: 0 !important;
	background: transparent !important;
	border: none !important;
}

/* Remove default link outline that wraps the whole card in Woo */
.woocommerce ul.products li.product a.woocommerce-LoopProduct-link,
li.wp-block-post a {
	display: flex !important;
	flex-direction: column !important;
	align-items: center !important;
	text-decoration: none !important;
	width: 100% !important;
	flex-grow: 1 !important;
}

/* Product Image */
.woocommerce ul.products li.product img,
.wc-block-grid__product-image img,
.wp-block-woocommerce-product-image img {
	width: 100% !important;
	max-width: 250px !important;
	height: auto !important;
	margin: 0 auto 24px auto !important;
	display: block !important;
	object-fit: contain !important;
	box-shadow: none !important;
	transition: transform 0.3s ease !important;
}

.woocommerce ul.products li.product:hover img,
.wc-block-grid__product:hover .wc-block-grid__product-image img,
li.wp-block-post:hover .wp-block-woocommerce-product-image img {
	transform: scale(1.02) !important;
}

/* Product Title — layout only (typography set via block attributes) */
.woocommerce ul.products li.product .woocommerce-loop-product__title,
.wc-block-grid__product-title,
.wp-block-woocommerce-product-collection h2.wp-block-post-title {
	padding: 0 !important;
	margin: 0 0 8px 0 !important;
}

.wp-block-woocommerce-product-collection h2.wp-block-post-title a {
	color: inherit !important;
	text-decoration: none !important;
}

/* Custom Subtitle ("10 mg") */
.npx-product-subtitle,
.wc-block-grid__product-excerpt {
	font-family: var(--wp--preset--font-family--primary) !important;
	font-size: 14px !important;
	color: #6e6e73 !important;
	font-weight: 400 !important;
	margin: 0 0 12px 0 !important;
}

/* Product Price — layout only (typography set via block attributes) */
.npx-archive-grid-container .woocommerce ul.products li.product .price,
.npx-archive-grid-container .wc-block-grid__product-price,
.npx-archive-grid-container .wp-block-woocommerce-product-price {
	display: flex !important;
	justify-content: center !important;
	align-items: center !important;
	gap: 6px !important;
}

/* Hide rating if it appears */
.woocommerce .star-rating,
.wc-block-grid__product-rating {
	display: none !important;
}

/* Add to Cart / "Shop" Button */
.woocommerce ul.products li.product .button,
.woocommerce ul.products li.product .wp-block-button__link,
.wc-block-grid__product-add-to-cart .wp-block-button__link,
.wp-block-woocommerce-product-button .wp-block-button__link {
	margin-top: auto !important;
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	background-color: var(--wp--preset--color--primary, #0071E3);
	color: var(--wp--preset--color--white, #ffffff);
	border-radius: 50px;
	padding: 10px 32px;
	font-family: var(--wp--preset--font-family--primary);
	font-size: 14px;
	font-weight: 500;
	line-height: 1;
	text-transform: none;
	min-width: 120px;
	text-decoration: none !important;
	border: none !important;
}

.woocommerce ul.products li.product .button:hover,
.woocommerce ul.products li.product .wp-block-button__link:hover,
.wc-block-grid__product-add-to-cart .wp-block-button__link:hover,
.wp-block-woocommerce-product-button .wp-block-button__link:hover {
	background-color: #005bb5;
	color: var(--wp--preset--color--white, #ffffff);
}

/* Remove Gutenberg button wrappers */
.wp-block-woocommerce-product-button {
	margin: auto 0 0 0 !important;
	padding: 0 !important;
	border: none !important;
	background: none !important;
}

/* Responsive Grid */
@media (max-width: 1024px) {

	ul.products,
	ul.wc-block-product-template,
	.wp-block-woocommerce-product-collection ul,
	.wc-block-grid__products {
		grid-template-columns: repeat(2, 1fr) !important;
		gap: 32px !important;
	}
}

@media (max-width: 600px) {

	ul.products,
	ul.wc-block-product-template,
	.wp-block-woocommerce-product-collection ul,
	.wc-block-grid__products {
		grid-template-columns: 1fr !important;
		gap: 24px !important;
	}
}

/* ==========================================================================
   Inline Validation Errors
   ========================================================================== */

.npx-inline-error {
	color: #dc3545;
	font-size: 14px;
	margin-top: 6px;
	line-height: 1.3;
}