/**
 * WooCommerce overrides for WP Store theme
 */

.woocommerce-page .woocommerce-result-count,
.woocommerce-page .woocommerce-ordering {
	margin-bottom: 24px;
}

.woocommerce ul.products {
	display: grid !important;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 24px;
	margin: 0 !important;
	padding: 0 !important;
	width: 100%;
}

/* Homepage keeps theme setting columns (--home-cols) */
.woocommerce ul.products.products-grid--home {
	grid-template-columns: repeat(var(--home-cols, 4), minmax(0, 1fr));
	gap: 24px;
}

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

	.woocommerce ul.products.products-grid--home {
		grid-template-columns: repeat(min(3, var(--home-cols, 4)), minmax(0, 1fr));
		gap: 20px;
	}
}

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

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

.woocommerce ul.products li.product {
	width: 100% !important;
	margin: 0 !important;
	float: none !important;
	list-style: none;
	background: transparent;
	border: none;
	border-radius: 0;
	overflow: visible;
}

.woocommerce ul.products li.product:hover {
	transform: none;
	box-shadow: none;
	border-color: transparent;
}

.woocommerce ul.products li.product .product-card {
	height: 100%;
}

.woocommerce ul.products li.product .product-card .price,
.woocommerce ul.products li.product .product-card-footer .price,
.product-card-footer .product-price,
.product-card-footer .product-price .price {
	padding: 0 !important;
	margin: 0 !important;
}

.woocommerce ul.products li.product .product-card .button,
.woocommerce ul.products li.product .product-card-actions .button {
	margin: 0 !important;
}

.woocommerce ul.products li.product .woocommerce-loop-product__title {
	font-size: 16px;
	padding: 0 20px;
}

.woocommerce ul.products li.product .price {
	padding: 0;
	font-size: 18px;
	font-weight: 800;
	color: var(--wp-store-text);
}

.woocommerce ul.products li.product .button {
	margin: 0;
	border-radius: var(--wp-store-radius-sm);
	background: linear-gradient(135deg, var(--wp-store-primary), var(--wp-store-accent));
	color: white;
	font-weight: 600;
	padding: 10px 20px;
	transition: all var(--wp-store-transition);
}

.woocommerce ul.products li.product .button:hover {
	background: linear-gradient(135deg, var(--wp-store-primary-dark), var(--wp-store-primary));
	color: white;
}

.woocommerce div.product {
	display: block;
	margin-bottom: 0;
}

.single-product-pro.product {
	display: block !important;
	grid-template-columns: none;
}

.woocommerce div.product .woocommerce-product-gallery {
	border-radius: var(--wp-store-radius);
	overflow: hidden;
}

.woocommerce div.product .summary .price {
	font-size: inherit;
	font-weight: inherit;
	color: inherit;
	margin-bottom: 0;
}

.woocommerce ul.products li.product .product-card-actions .button,
.woocommerce ul.products li.product .product-cta-buttons--card .button {
	margin: 0 !important;
	padding: 10px 12px !important;
	font-size: 13px !important;
	min-height: 40px;
	width: 100%;
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
}

.woocommerce div.product .product-cta-buttons .single_add_to_cart_button:not(.btn-add-to-cart),
.woocommerce div.product .summary .single_add_to_cart_button:not(.btn-add-to-cart) {
	background: linear-gradient(135deg, var(--wp-store-primary), var(--wp-store-accent));
	color: white;
	font-weight: 600;
	border-radius: var(--wp-store-radius-sm);
	border: none;
	transition: all var(--wp-store-transition);
}

.woocommerce div.product .summary .single_add_to_cart_button:not(.btn-add-to-cart):hover {
	background: linear-gradient(135deg, var(--wp-store-primary-dark), var(--wp-store-primary));
	color: white;
}

.woocommerce .woocommerce-message,
.woocommerce .woocommerce-info,
.woocommerce .woocommerce-error {
	border-radius: var(--wp-store-radius-sm);
	border-top: none;
	padding: 16px 20px;
	margin-bottom: 24px;
}

.woocommerce .woocommerce-message {
	background: #ecfdf5;
	color: #065f46;
}

.woocommerce table.shop_table {
	border-radius: var(--wp-store-radius);
	overflow: hidden;
	border: 1px solid var(--wp-store-border);
}

.woocommerce table.shop_table th {
	background: #f8fafc;
	font-weight: 600;
}

.woocommerce .cart-collaterals .cart_totals {
	background: var(--wp-store-white);
	border: 1px solid var(--wp-store-border);
	border-radius: var(--wp-store-radius);
	padding: 24px;
}

.woocommerce .checkout .col2-set:not(.checkout-customer-details) {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 32px;
}

.checkout-form--pro .checkout-customer-details.col2-set,
.checkout-form--pro #customer_details.col2-set {
	display: block;
	width: 100%;
}

.checkout-form--pro .checkout-customer-details.col2-set::before,
.checkout-form--pro .checkout-customer-details.col2-set::after,
.checkout-form--pro #customer_details.col2-set::before,
.checkout-form--pro #customer_details.col2-set::after {
	display: none !important;
	content: none !important;
}

.checkout-form--pro #payment,
.checkout-page .checkout-form--pro #payment {
	background: transparent !important;
	border: none !important;
	padding: 0 !important;
	box-shadow: none !important;
}

/* Payment methods: keep radio + title on one row (WC default + theme img{display:block} break this) */
.woocommerce-checkout .checkout-form--pro #payment ul.payment_methods li {
	display: flex !important;
	flex-wrap: wrap;
	align-items: center;
}

.woocommerce-checkout .checkout-form--pro #payment ul.payment_methods li > input.input-radio {
	float: none !important;
	margin: 0 0 0 14px !important;
}

.woocommerce-checkout .checkout-form--pro #payment ul.payment_methods li > label img {
	display: inline-block !important;
	float: none !important;
	max-height: 28px;
	width: auto;
}

.woocommerce-checkout .checkout-form--pro #payment div.payment_box {
	flex: 0 0 100%;
	background: #f8fafc !important;
	color: var(--wp-store-text-light, #64748b) !important;
}

.woocommerce-checkout .checkout-form--pro #payment div.payment_box::before {
	display: none !important;
	content: none !important;
}

@media (max-width: 768px) {
	.woocommerce div.product {
		grid-template-columns: 1fr;
	}

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

/* ==========================================================================
   My Account
   ========================================================================== */

.woocommerce-account .shop-hero {
	margin-bottom: 0;
}

.woocommerce-account .wc-account-article {
	margin-top: 28px;
}

.woocommerce-account .woocommerce {
	max-width: none;
}

.wc-account-layout {
	margin-bottom: 48px;
}

.woocommerce-MyAccount-navigation-wrap {
	position: sticky;
	top: 24px;
}

.woocommerce-MyAccount-navigation.dashboard-nav ul,
.woocommerce-MyAccount-navigation.dashboard-nav li {
	list-style: none !important;
	margin: 0;
	padding: 0;
}

.woocommerce-MyAccount-navigation.dashboard-nav .dashboard-nav-link {
	display: flex;
	align-items: center;
	gap: 10px;
	width: 100%;
	text-decoration: none;
}

.woocommerce-MyAccount-navigation.dashboard-nav .dashboard-nav-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	border-radius: 8px;
	background: #f1f5f9;
	flex-shrink: 0;
}

.woocommerce-MyAccount-navigation.dashboard-nav .dashboard-nav-link.is-active .dashboard-nav-icon,
.woocommerce-MyAccount-navigation.dashboard-nav .dashboard-nav-link:hover .dashboard-nav-icon {
	background: rgb(13 148 136 / 0.15);
	color: var(--wp-store-primary);
}

.woocommerce-MyAccount-content {
	background: var(--wp-store-white);
	border: 1px solid var(--wp-store-border);
	border-radius: var(--wp-store-radius);
	padding: 28px;
	box-shadow: var(--wp-store-shadow);
	min-width: 0;
}

.wc-account-dashboard .dashboard-panel-head {
	margin-bottom: 24px;
}

.woocommerce-MyAccount-content > .woocommerce-notices-wrapper:first-child + *,
.woocommerce-MyAccount-content > h2:first-child,
.woocommerce-MyAccount-content > h3:first-child {
	margin-top: 0;
}

.woocommerce-MyAccount-content .woocommerce-orders-table,
.woocommerce-MyAccount-content .shop_table {
	margin-top: 0;
}

.woocommerce-MyAccount-content .woocommerce-orders-table {
	border-collapse: collapse;
	width: 100%;
}

.woocommerce-MyAccount-content .woocommerce-orders-table th,
.woocommerce-MyAccount-content .woocommerce-orders-table td {
	padding: 14px 16px;
	border-bottom: 1px solid var(--wp-store-border);
	font-size: 14px;
}

.woocommerce-MyAccount-content .woocommerce-orders-table th {
	background: #f8fafc;
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--wp-store-text-light);
}

.woocommerce-MyAccount-content .woocommerce-orders-table .order-status,
.woocommerce-MyAccount-content .woocommerce-orders-table mark {
	background: transparent;
	padding: 0;
	font-weight: 700;
}

.woocommerce-MyAccount-content .woocommerce-button,
.woocommerce-MyAccount-content .button {
	border-radius: var(--wp-store-radius-sm);
	font-weight: 600;
}

.woocommerce-MyAccount-content .woocommerce-EditAccountForm input.input-text,
.woocommerce-MyAccount-content .woocommerce-address-fields input.input-text,
.woocommerce-MyAccount-content .woocommerce-address-fields select,
.wc-account-form .input-text {
	width: 100%;
	padding: 12px 16px;
	border: 2px solid var(--wp-store-border);
	border-radius: 8px;
	font-family: inherit;
	font-size: 15px;
	transition: border-color 0.15s ease;
}

.woocommerce-MyAccount-content .woocommerce-EditAccountForm input.input-text:focus,
.woocommerce-MyAccount-content .woocommerce-address-fields input.input-text:focus,
.wc-account-form .input-text:focus {
	border-color: var(--wp-store-primary);
	outline: none;
}

.woocommerce-MyAccount-content .woocommerce-EditAccountForm label,
.woocommerce-MyAccount-content .woocommerce-address-fields label,
.wc-account-form label {
	display: block;
	font-weight: 600;
	font-size: 14px;
	margin-bottom: 6px;
}

.woocommerce-MyAccount-content .woocommerce-EditAccountForm fieldset,
.woocommerce-MyAccount-content .woocommerce-address-fields {
	margin-bottom: 20px;
}

.woocommerce-MyAccount-content .woocommerce-EditAccountForm .woocommerce-Button,
.woocommerce-MyAccount-content .woocommerce-address-fields button.button {
	background: var(--wp-store-primary, #0d9488);
	color: #fff;
	border: 1.5px solid var(--wp-store-primary, #0d9488);
	border-radius: 10px;
	font-weight: 700;
	box-shadow: 0 8px 18px rgba(13, 148, 136, 0.2);
}
	color: #fff;
	border: none;
	padding: 12px 24px;
}

/* Guest login / register */
.wc-account-guest .woocommerce-MyAccount-content,
.wc-account-auth {
	border: none;
	background: transparent;
	box-shadow: none;
	padding: 0;
}

.wc-account-auth-sms {
	margin-bottom: 20px;
}

.wc-account-auth-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 20px;
}

.wc-account-auth-grid--split {
	grid-template-columns: repeat(2, 1fr);
}

.wc-account-auth-card {
	background: var(--wp-store-white);
	border: 1px solid var(--wp-store-border);
	border-radius: var(--wp-store-radius);
	padding: 28px;
	box-shadow: var(--wp-store-shadow);
}

.wc-account-auth-card--featured {
	background: linear-gradient(135deg, rgb(13 148 136 / 0.08), rgb(15 23 42 / 0.04));
	border-color: rgb(13 148 136 / 0.25);
}

.wc-account-auth-card h2 {
	margin: 0 0 8px;
	font-size: 1.35rem;
}

.wc-account-auth-desc {
	color: var(--wp-store-text-light);
	margin: 0 0 20px;
	font-size: 15px;
}

.wc-account-auth-badge {
	display: inline-block;
	margin-bottom: 10px;
	padding: 4px 10px;
	border-radius: 999px;
	background: var(--wp-store-primary);
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

.wc-account-form .form-row {
	margin-bottom: 16px;
}

.wc-account-form-actions {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	flex-wrap: wrap;
	margin-top: 8px;
}

.wc-account-form .lost_password {
	margin: 16px 0 0;
	font-size: 14px;
}

.wc-account-form .lost_password a {
	color: var(--wp-store-primary);
	font-weight: 600;
}

@media (max-width: 1024px) {
	.wc-account-layout {
		grid-template-columns: 1fr;
	}

	.woocommerce-MyAccount-navigation-wrap {
		position: static;
	}
}

@media (max-width: 768px) {
	.wc-account-auth-grid--split {
		grid-template-columns: 1fr;
	}

	.woocommerce-MyAccount-content {
		padding: 20px;
	}
}

/* Cart & Checkout pages */
.cart-page,
.checkout-page {
	padding-bottom: 64px;
	background: var(--wp-store-bg, #f1f5f9);
}

.cart-page .entry-content,
.checkout-page .entry-content {
	margin-top: 28px;
}

.cart-page .cart-layout .woocommerce-cart-form,
.checkout-page .checkout-form--pro {
	background: transparent;
	border: none;
	border-radius: 0;
	padding: 0;
	box-shadow: none;
}

/* Legacy fallback when cart-layout is not present */
.cart-page .woocommerce-cart-form:not(.cart-card),
.checkout-page .woocommerce-checkout:not(.checkout-form--pro) {
	background: var(--wp-store-white);
	border: 1px solid var(--wp-store-border);
	border-radius: var(--wp-store-radius);
	padding: 24px;
	box-shadow: var(--wp-store-shadow);
}

.cart-page .cart-layout .cart-collaterals {
	margin-top: 0;
	float: none !important;
	width: 100% !important;
	clear: both !important;
}

.cart-page .cart-collaterals:not(.cart-summary-card) {
	margin-top: 28px;
}

.cart-page .cart_totals,
.checkout-page #order_review {
	background: var(--wp-store-white);
	border: 1px solid var(--wp-store-border);
	border-radius: var(--wp-store-radius);
	padding: 24px;
}

.cart-page .cart-layout .cart_totals,
.cart-page .cart-collaterals .cart_totals {
	float: none !important;
	width: 100% !important;
	max-width: 100% !important;
	clear: both !important;
}

.cart-page .cart-summary-card .cart-totals-pro {
	background: #fff;
	border: 1px solid var(--wp-store-border);
	border-radius: var(--wp-store-radius);
	padding: 28px;
	box-shadow: 0 12px 40px rgba(15, 23, 42, 0.08);
}

.cart-page .wc-proceed-to-checkout .checkout-button,
.checkout-page #place_order {
	background: var(--wp-store-primary) !important;
	background-image: none !important;
	color: #fff !important;
	border: none !important;
	border-radius: 12px;
	font-weight: 700;
	padding: 14px 24px;
	box-shadow: 0 4px 14px rgba(13, 148, 136, 0.25);
}

.cart-page .wc-proceed-to-checkout .checkout-button:hover,
.checkout-page #place_order:hover {
	background: var(--wp-store-primary-dark, #0f766e) !important;
	transform: translateY(-1px);
}

/* Wishlist button on product cards */
.product-card-image {
	position: relative;
}

.btn-wishlist-toggle {
	position: absolute;
	top: 12px;
	right: 12px;
	z-index: 3;
	width: 36px;
	height: 36px;
	border: none;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.95);
	color: var(--wp-store-text-light);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	box-shadow: var(--wp-store-shadow);
	transition: all var(--wp-store-transition);
}

.btn-wishlist-toggle:hover,
.btn-wishlist-toggle.is-active {
	color: #ef4444;
	background: #fff;
}

.btn-wishlist-toggle.is-active svg {
	fill: #ef4444;
}

.btn-wishlist-toggle.is-loading {
	opacity: 0.6;
	pointer-events: none;
}

.wc-account-wishlist .products-grid--wishlist {
	margin-top: 8px;
}

.woocommerce-MyAccount-navigation.dashboard-nav a {
	text-decoration: none;
}
