/**
 * TopVape WooCommerce presentation hooks.
 *
 * Product facts and commerce behavior remain native to WooCommerce.
 */

.woocommerce .woocommerce-products-header,
.woocommerce .woocommerce-result-count,
.woocommerce .woocommerce-ordering {
	margin-bottom: 1.5rem;
}

.woocommerce ul.products {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 1.5rem;
}

.woocommerce ul.products::before,
.woocommerce ul.products::after {
	display: none;
}

.woocommerce ul.products li.product,
.woocommerce-page ul.products li.product {
	float: none;
	width: auto;
	margin: 0;
	padding: 1rem;
	background: var(--wp--preset--color--surface, #17171b);
	border: 1px solid rgb(255 255 255 / 10%);
}

.woocommerce ul.products li.product a {
	text-decoration: none;
}

.woocommerce ul.products li.product .woocommerce-loop-product__title {
	color: var(--wp--preset--color--foreground, #f5f5f3);
	font-size: 1rem;
}

.woocommerce ul.products li.product .price,
.woocommerce div.product p.price,
.woocommerce div.product span.price {
	color: var(--wp--preset--color--accent, #c7a86b);
	font-weight: 700;
}

.woocommerce div.product .woocommerce-product-gallery,
.woocommerce div.product .summary {
	margin-bottom: 2rem;
}

.woocommerce div.product .woocommerce-product-gallery img {
	background: var(--wp--preset--color--surface, #17171b);
}

.woocommerce div.product form.cart {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.75rem;
}

.woocommerce div.product form.cart .variations {
	flex-basis: 100%;
}

.woocommerce div.product form.cart .variations th,
.woocommerce div.product form.cart .variations td {
	padding: 0.5rem;
	text-align: start;
}

.woocommerce div.product form.cart .button,
.woocommerce ul.products li.product .button {
	min-height: 44px;
}

.woocommerce .woocommerce-error,
.woocommerce .woocommerce-info,
.woocommerce .woocommerce-message {
	background: var(--wp--preset--color--surface, #17171b);
	color: var(--wp--preset--color--foreground, #f5f5f3);
	border-top-color: var(--wp--preset--color--accent, #c7a86b);
}

/* Customer flow shell: Cart, Checkout, Thank you and My Account. */
.site-main--customer-flow {
	width: min(100% - 2.5rem, 1200px);
	padding-block: clamp(2rem, 5vw, 4.5rem);
}

.topvape-customer-flow__page,
.topvape-customer-flow__content {
	max-width: none;
}

.topvape-customer-flow__header {
	margin-bottom: clamp(1.5rem, 4vw, 3rem);
	padding-bottom: 1rem;
	border-bottom: 1px solid rgb(255 255 255 / 10%);
}

.topvape-customer-flow__title {
	margin: 0;
	font-size: clamp(2rem, 5vw, 3.25rem);
	line-height: 1.1;
}

.woocommerce form,
.woocommerce table.shop_table,
.woocommerce .cart-collaterals .cart_totals,
.woocommerce .col2-set > div,
.woocommerce .woocommerce-MyAccount-navigation,
.woocommerce .woocommerce-MyAccount-content,
.woocommerce .woocommerce-order,
.woocommerce .woocommerce-customer-details address,
.wc-block-cart__main,
.wc-block-cart__sidebar,
.wc-block-checkout__main,
.wc-block-checkout__sidebar {
	border-color: rgb(255 255 255 / 10%);
}

.woocommerce form.login,
.woocommerce form.register,
.woocommerce form.lost_reset_password,
.woocommerce form.checkout_coupon,
.woocommerce .cart-collaterals .cart_totals,
.woocommerce .woocommerce-checkout-review-order,
.woocommerce .woocommerce-MyAccount-navigation,
.woocommerce .woocommerce-MyAccount-content,
.woocommerce .woocommerce-order-details,
.woocommerce .woocommerce-customer-details,
.woocommerce .woocommerce-address-fields,
.woocommerce .woocommerce-EditAccountForm {
	padding: clamp(1rem, 3vw, 2rem);
	background: var(--wp--preset--color--surface, #17171b);
	border: 1px solid rgb(255 255 255 / 10%);
	border-radius: 0.5rem;
}

/* Shared form controls. */
.woocommerce form .form-row {
	margin-bottom: 1rem;
}

.woocommerce form .form-row label {
	margin-bottom: 0.4rem;
	color: var(--wp--preset--color--foreground, #f5f5f3);
	font-weight: 600;
}

.woocommerce form .form-row .required {
	color: #e8c77f;
}

.woocommerce input.input-text,
.woocommerce textarea,
.woocommerce select,
.woocommerce .select2-container--default .select2-selection--single,
.woocommerce .select2-container--default .select2-selection--multiple,
.wc-block-components-text-input input,
.wc-block-components-combobox .wc-block-components-combobox-control input,
.wc-block-components-form .wc-block-components-text-input input {
	min-height: 48px;
	padding: 0.75rem;
	background: #0f0f12;
	color: var(--wp--preset--color--foreground, #f5f5f3);
	border: 1px solid rgb(255 255 255 / 16%);
	border-radius: 0.35rem;
}

.woocommerce textarea {
	min-height: 8rem;
}

.woocommerce input.input-text:focus,
.woocommerce textarea:focus,
.woocommerce select:focus,
.wc-block-components-text-input input:focus {
	border-color: var(--wp--preset--color--accent, #c7a86b);
	outline: 2px solid transparent;
	box-shadow: 0 0 0 2px rgb(199 168 107 / 25%);
}

.woocommerce button.button,
.woocommerce a.button,
.woocommerce input.button,
.wc-block-components-button:not(.is-link) {
	min-height: 46px;
	padding: 0.75rem 1.25rem;
	background: var(--wp--preset--color--accent, #c7a86b);
	color: #0b0b0d;
	border: 1px solid transparent;
	border-radius: 0.35rem;
	font-weight: 700;
	text-decoration: none;
}

.woocommerce button.button:hover,
.woocommerce a.button:hover,
.woocommerce input.button:hover,
.wc-block-components-button:not(.is-link):hover {
	background: #ddc187;
	color: #0b0b0d;
}

/* Cart: retain native table/actions while improving hierarchy. */
.woocommerce-cart-form table.shop_table,
.woocommerce .woocommerce-checkout-review-order-table,
.woocommerce .woocommerce-order-details table,
.woocommerce .woocommerce-orders-table {
	background: var(--wp--preset--color--surface, #17171b);
	border: 1px solid rgb(255 255 255 / 10%);
	border-collapse: separate;
	border-radius: 0.5rem;
}

.woocommerce table.shop_table th,
.woocommerce table.shop_table td {
	padding: 1rem;
	border-color: rgb(255 255 255 / 8%);
}

.woocommerce-cart-form .product-thumbnail img,
.wc-block-cart-item__image img {
	border-radius: 0.35rem;
}

.woocommerce-cart-form .coupon {
	display: flex;
	gap: 0.5rem;
}

.woocommerce-cart-form .coupon .input-text {
	width: auto;
	min-width: 10rem;
}

.woocommerce .cart-collaterals {
	margin-top: 2rem;
}

.woocommerce .cart-collaterals .cart_totals {
	float: right;
	width: min(100%, 30rem);
}

.woocommerce .wc-proceed-to-checkout {
	padding-bottom: 0;
}

.woocommerce .wc-proceed-to-checkout a.checkout-button {
	display: flex;
	align-items: center;
	justify-content: center;
}

/* Checkout: native billing, shipping, order review and gateway markup. */
.woocommerce-checkout form.checkout {
	display: grid;
	grid-template-columns: minmax(0, 1.35fr) minmax(20rem, 0.65fr);
	gap: clamp(1.5rem, 4vw, 3rem);
	padding: 0;
	background: transparent;
	border: 0;
}

.woocommerce-checkout #customer_details,
.woocommerce-checkout #order_review_heading,
.woocommerce-checkout #order_review {
	float: none;
	width: auto;
}

.woocommerce-checkout #customer_details {
	grid-row: 1 / span 2;
}

.woocommerce-checkout #order_review_heading,
.woocommerce-checkout #order_review {
	grid-column: 2;
}

.woocommerce-checkout #order_review_heading {
	align-self: end;
	margin: 0;
}

.woocommerce-checkout #order_review {
	align-self: start;
}

.woocommerce-checkout #payment {
	background: #101014;
	color: inherit;
}

.woocommerce-checkout #payment ul.payment_methods,
.woocommerce-checkout #payment div.form-row {
	padding: 1rem;
	border-color: rgb(255 255 255 / 10%);
}

.woocommerce-checkout #payment div.payment_box {
	background: #24242a;
	color: inherit;
}

.woocommerce-checkout #payment div.payment_box::before {
	border-bottom-color: #24242a;
}

/* Thank-you page and native order details. */
.woocommerce-order-received .woocommerce-thankyou-order-received {
	padding: 1rem 1.25rem;
	background: rgb(74 124 89 / 20%);
	border: 1px solid rgb(105 178 126 / 45%);
	border-radius: 0.5rem;
	font-size: 1.05rem;
}

.woocommerce ul.order_details {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 1px;
	margin: 1.5rem 0 2rem;
	padding: 1px;
	background: rgb(255 255 255 / 10%);
	border-radius: 0.5rem;
	overflow: hidden;
}

.woocommerce ul.order_details li {
	float: none;
	margin: 0;
	padding: 1rem;
	background: var(--wp--preset--color--surface, #17171b);
	border: 0;
}

/* My Account: navigation, dashboard, orders, addresses and details. */
.woocommerce-account.logged-in .woocommerce {
	display: grid;
	grid-template-columns: minmax(13rem, 0.28fr) minmax(0, 1fr);
	gap: 2rem;
}

.woocommerce-account.logged-in .woocommerce::before,
.woocommerce-account.logged-in .woocommerce::after {
	display: none;
}

.woocommerce-account .woocommerce-MyAccount-navigation,
.woocommerce-account .woocommerce-MyAccount-content {
	float: none;
	width: auto;
}

.woocommerce-account .woocommerce-MyAccount-navigation ul {
	margin: 0;
	padding: 0;
	list-style: none;
}

.woocommerce-account .woocommerce-MyAccount-navigation li + li {
	border-top: 1px solid rgb(255 255 255 / 8%);
}

.woocommerce-account .woocommerce-MyAccount-navigation a {
	display: block;
	padding: 0.8rem 0.25rem;
	color: var(--wp--preset--color--muted, #a7a7ad);
	text-decoration: none;
}

.woocommerce-account .woocommerce-MyAccount-navigation .is-active a,
.woocommerce-account .woocommerce-MyAccount-navigation a:hover {
	color: var(--wp--preset--color--accent, #c7a86b);
}

.woocommerce-account .addresses {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 1rem;
}

.woocommerce-account .addresses .col-1,
.woocommerce-account .addresses .col-2 {
	float: none;
	width: auto;
	padding: 1rem;
	background: #101014;
	border: 1px solid rgb(255 255 255 / 8%);
	border-radius: 0.35rem;
}

.woocommerce-account .woocommerce-form-login,
.woocommerce-account .woocommerce-form-register,
.woocommerce-account .lost_reset_password {
	max-width: 38rem;
}

/* WooCommerce Blocks equivalents. */
.wc-block-cart,
.wc-block-checkout {
	color: var(--wp--preset--color--foreground, #f5f5f3);
}

.wc-block-components-sidebar-layout .wc-block-components-main,
.wc-block-components-sidebar-layout .wc-block-components-sidebar {
	box-sizing: border-box;
}

.wc-block-components-order-summary,
.wc-block-components-totals-wrapper,
.wc-block-components-panel,
.wc-block-components-checkout-step {
	border-color: rgb(255 255 255 / 10%);
}

.wc-block-components-radio-control-accordion-option,
.wc-block-components-radio-control__option {
	background: var(--wp--preset--color--surface, #17171b);
	color: inherit;
}

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

	.woocommerce-checkout form.checkout {
		grid-template-columns: 1fr;
	}

	.woocommerce-checkout #order_review_heading,
	.woocommerce-checkout #order_review {
		grid-column: 1;
	}

	.woocommerce-checkout #customer_details {
		grid-row: auto;
	}
}

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

	.woocommerce div.product form.cart {
		align-items: stretch;
		flex-direction: column;
	}

	.site-main--customer-flow {
		width: min(100% - 1.5rem, 1200px);
	}

	.woocommerce-account.logged-in .woocommerce,
	.woocommerce-account .addresses,
	.woocommerce ul.order_details {
		grid-template-columns: 1fr;
	}

	.woocommerce form.login,
	.woocommerce form.register,
	.woocommerce form.lost_reset_password,
	.woocommerce .woocommerce-MyAccount-navigation,
	.woocommerce .woocommerce-MyAccount-content {
		padding: 1rem;
	}

	.woocommerce-cart-form {
		overflow-x: auto;
	}

	.woocommerce-cart-form table.shop_table {
		min-width: 42rem;
	}

	.woocommerce-cart-form .coupon {
		align-items: stretch;
		flex-direction: column;
	}

	.woocommerce-cart-form .coupon .input-text,
	.woocommerce-cart-form .coupon .button {
		width: 100%;
	}
}
