/**
 * AutoPro Core — WooCommerce theme layer (cart / checkout / My Account,
 * incl. WooCommerce Subscriptions pages like /my-account/subscriptions/
 * and /my-account/view-subscription/{id}/).
 *
 * Scoped to WC's body classes so it can never leak onto marketplace or
 * Elementor pages. Follows the marketplace dark design: #0e0e0e canvas,
 * #171717 cards, #363636 borders, red #e10012 accents. Selectors are
 * scoped deep enough (body.class .woocommerce …) to beat the Elementor
 * kit's global element rules without !important.
 */

body.woocommerce-account,
body.woocommerce-cart,
body.woocommerce-checkout {
	--apc-wred: #e10012;
	--apc-wred-dark: #b8000e;
	--apc-wbg: #0e0e0e;
	--apc-wcard: #171717;
	--apc-wcard2: #121212;
	--apc-wborder: #363636;
	--apc-wtext: #f5f5f5;
	--apc-wmuted: #a3a3a3;
	--apc-winput: #0e0e0e;

	background: var(--apc-wbg);
	color: var(--apc-wtext);
	color-scheme: dark;
}

/* Layout: keep WC content comfortably centered on the dark canvas. */
body.woocommerce-account .woocommerce,
body.woocommerce-cart .woocommerce,
body.woocommerce-checkout .woocommerce {
	max-width: 1200px;
	margin: 0 auto;
}

body.woocommerce-account .woocommerce a,
body.woocommerce-cart .woocommerce a,
body.woocommerce-checkout .woocommerce a {
	color: var(--apc-wtext);
}

body.woocommerce-account .woocommerce a:hover,
body.woocommerce-cart .woocommerce a:hover,
body.woocommerce-checkout .woocommerce a:hover {
	color: var(--apc-wred);
}

/* ===== Headings ===== */
body.woocommerce-account .woocommerce h1,
body.woocommerce-account .woocommerce h2,
body.woocommerce-account .woocommerce h3,
body.woocommerce-cart .woocommerce h1,
body.woocommerce-cart .woocommerce h2,
body.woocommerce-checkout .woocommerce h1,
body.woocommerce-checkout .woocommerce h2,
body.woocommerce-checkout .woocommerce h3 {
	color: var(--apc-wtext);
}

/* ===== My Account navigation (sidebar-style list like the app shell) ===== */
body.woocommerce-account .woocommerce-MyAccount-navigation ul {
	margin: 0 0 24px;
	padding: 0;
	list-style: none;
	background: var(--apc-wcard);
	border: 1px solid var(--apc-wborder);
	border-radius: 12px;
	overflow: hidden;
}

body.woocommerce-account .woocommerce-MyAccount-navigation li {
	margin: 0;
	padding: 0;
	border-bottom: 1px solid var(--apc-wborder);
}

body.woocommerce-account .woocommerce-MyAccount-navigation li:last-child { border-bottom: 0; }

body.woocommerce-account .woocommerce-MyAccount-navigation a {
	display: flex;
	align-items: center;
	padding: 12px 16px;
	font-size: 13.5px;
	font-weight: 600;
	color: var(--apc-wtext);
	text-decoration: none;
	transition: background 0.15s ease, color 0.15s ease;
}

body.woocommerce-account .woocommerce-MyAccount-navigation a:hover {
	background: #1f1f1f;
	color: var(--apc-wtext);
}

body.woocommerce-account .woocommerce-MyAccount-navigation .is-active a {
	background: var(--apc-wred);
	color: #ffffff;
}

/* ===== Content cards ===== */
body.woocommerce-account .woocommerce-MyAccount-content,
body.woocommerce-cart form.woocommerce-cart-form,
body.woocommerce-cart .cart_totals,
body.woocommerce-checkout #order_review,
body.woocommerce-checkout #customer_details,
body.woocommerce-checkout .woocommerce-additional-fields,
body.woocommerce-checkout #payment {
	background: var(--apc-wcard);
	border: 1px solid var(--apc-wborder);
	border-radius: 14px;
	color: var(--apc-wtext);
}

body.woocommerce-account .woocommerce-MyAccount-content {
	padding: 24px 26px 28px;
}

body.woocommerce-account .woocommerce-MyAccount-content p,
body.woocommerce-cart .woocommerce-info p {
	color: var(--apc-wmuted);
}

/* ===== Tables (orders, subscriptions, view-subscription, order review) ===== */
body.woocommerce-account .woocommerce table,
body.woocommerce-cart .woocommerce table,
body.woocommerce-checkout .woocommerce table {
	width: 100%;
	border-collapse: collapse;
	background: var(--apc-wcard2);
	border: 1px solid var(--apc-wborder);
	border-radius: 12px;
	overflow: hidden;
	color: var(--apc-wtext);
}

body.woocommerce-account .woocommerce table th,
body.woocommerce-cart .woocommerce table th,
body.woocommerce-checkout .woocommerce table th {
	background: #1b1b1b;
	color: var(--apc-wtext);
	font-size: 11.5px;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	padding: 12px 14px;
	border-bottom: 1px solid var(--apc-wborder);
}

body.woocommerce-account .woocommerce table td,
body.woocommerce-cart .woocommerce table td,
body.woocommerce-checkout .woocommerce table td {
	padding: 13px 14px;
	border-bottom: 1px solid var(--apc-wborder);
	font-size: 13.5px;
	color: var(--apc-wtext);
}

body.woocommerce-account .woocommerce table tr:last-child td,
body.woocommerce-cart .woocommerce table tr:last-child td,
body.woocommerce-checkout .woocommerce table tr:last-child td {
	border-bottom: 0;
}

/* Product thumbnails inside cart tables stay crisp on dark. */
body.woocommerce-cart .woocommerce table img {
	border-radius: 8px;
	background: #0d0d0d;
}

/* ===== Status chips (orders + subscriptions) ===== */
body.woocommerce-account .woocommerce .order-status,
body.woocommerce-account .woocommerce .subscription-status {
	display: inline-block;
	padding: 4px 10px;
	border-radius: 999px;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	background: #2a2a2a;
	color: #d4d4d4;
}

body.woocommerce-account .woocommerce .status-active,
body.woocommerce-account .woocommerce .status-completed {
	background: rgba(46, 125, 79, 0.18);
	color: #6fce93;
}

body.woocommerce-account .woocommerce .status-processing {
	background: rgba(59, 130, 246, 0.16);
	color: #7fb0f5;
}

body.woocommerce-account .woocommerce .status-on-hold,
body.woocommerce-account .woocommerce .status-pending-cancel,
body.woocommerce-account .woocommerce .status-pending {
	background: rgba(217, 146, 22, 0.16);
	color: #eab065;
}

body.woocommerce-account .woocommerce .status-cancelled,
body.woocommerce-account .woocommerce .status-expired,
body.woocommerce-account .woocommerce .status-switched {
	background: #262626;
	color: #8f8f8f;
}

/* ===== Forms ===== */
body.woocommerce-account .woocommerce input[type="text"],
body.woocommerce-account .woocommerce input[type="email"],
body.woocommerce-account .woocommerce input[type="password"],
body.woocommerce-account .woocommerce input[type="tel"],
body.woocommerce-account .woocommerce input[type="search"],
body.woocommerce-account .woocommerce input[type="number"],
body.woocommerce-cart .woocommerce input[type="text"],
body.woocommerce-cart .woocommerce input[type="email"],
body.woocommerce-cart .woocommerce input[type="number"],
body.woocommerce-checkout .woocommerce input[type="text"],
body.woocommerce-checkout .woocommerce input[type="email"],
body.woocommerce-checkout .woocommerce input[type="tel"],
body.woocommerce-checkout .woocommerce input[type="password"],
body.woocommerce-account .woocommerce select,
body.woocommerce-cart .woocommerce select,
body.woocommerce-checkout .woocommerce select,
body.woocommerce-account .woocommerce textarea,
body.woocommerce-checkout .woocommerce textarea {
	background: var(--apc-winput);
	border: 1px solid var(--apc-wborder);
	border-radius: 10px;
	color: var(--apc-wtext);
	padding: 10px 12px;
	font-size: 13.5px;
	outline: none;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

body.woocommerce-account .woocommerce input:focus,
body.woocommerce-cart .woocommerce input:focus,
body.woocommerce-checkout .woocommerce input:focus,
body.woocommerce-account .woocommerce select:focus,
body.woocommerce-cart .woocommerce select:focus,
body.woocommerce-checkout .woocommerce select:focus,
body.woocommerce-account .woocommerce textarea:focus,
body.woocommerce-checkout .woocommerce textarea:focus {
	border-color: var(--apc-wred);
	box-shadow: 0 0 0 3px rgba(225, 0, 18, 0.15);
}

body.woocommerce-account .woocommerce ::placeholder,
body.woocommerce-cart .woocommerce ::placeholder,
body.woocommerce-checkout .woocommerce ::placeholder {
	color: #7d7d7d;
}

body.woocommerce-account .woocommerce label,
body.woocommerce-checkout .woocommerce label {
	color: var(--apc-wtext);
	font-size: 12.5px;
	font-weight: 600;
}

body.woocommerce-account .woocommerce fieldset,
body.woocommerce-checkout .woocommerce fieldset {
	border: 1px solid var(--apc-wborder);
	border-radius: 12px;
}

body.woocommerce-account .woocommerce legend,
body.woocommerce-checkout .woocommerce legend {
	color: var(--apc-wtext);
	padding: 0 8px;
	font-weight: 700;
}

/* ===== Buttons: dark secondary by default, red for primary actions ===== */
body.woocommerce-account .woocommerce .button,
body.woocommerce-account .woocommerce a.button,
body.woocommerce-account .woocommerce button.button,
body.woocommerce-cart .woocommerce .button,
body.woocommerce-cart .woocommerce a.button,
body.woocommerce-cart .woocommerce button.button,
body.woocommerce-checkout .woocommerce .button,
body.woocommerce-checkout .woocommerce a.button,
body.woocommerce-checkout .woocommerce button.button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: #1f1f1f;
	border: 1px solid var(--apc-wborder);
	border-radius: 10px;
	color: var(--apc-wtext);
	font-size: 13px;
	font-weight: 700;
	line-height: 1;
	padding: 12px 18px;
	text-decoration: none;
	cursor: pointer;
	transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

body.woocommerce-account .woocommerce .button:hover,
body.woocommerce-account .woocommerce a.button:hover,
body.woocommerce-account .woocommerce button.button:hover,
body.woocommerce-cart .woocommerce .button:hover,
body.woocommerce-cart .woocommerce a.button:hover,
body.woocommerce-cart .woocommerce button.button:hover,
body.woocommerce-checkout .woocommerce .button:hover,
body.woocommerce-checkout .woocommerce a.button:hover,
body.woocommerce-checkout .woocommerce button.button:hover {
	background: #292929;
	border-color: #4a4a4a;
	color: var(--apc-wtext);
}

/* Primary actions: subscribe, proceed to checkout, place order, save. */
body.woocommerce-account .woocommerce a.button.alt,
body.woocommerce-account .woocommerce button.button.alt,
body.woocommerce-cart .woocommerce .wc-proceed-to-checkout a.checkout-button,
body.woocommerce-checkout .woocommerce #place_order,
body.woocommerce-checkout .woocommerce button.button.alt {
	background: var(--apc-wred);
	border-color: var(--apc-wred);
	color: #ffffff;
}

body.woocommerce-account .woocommerce a.button.alt:hover,
body.woocommerce-account .woocommerce button.button.alt:hover,
body.woocommerce-cart .woocommerce .wc-proceed-to-checkout a.checkout-button:hover,
body.woocommerce-checkout .woocommerce #place_order:hover,
body.woocommerce-checkout .woocommerce button.button.alt:hover {
	background: var(--apc-wred-dark);
	border-color: var(--apc-wred-dark);
	color: #171717;
}

/* ===== Notices ===== */
body.woocommerce-account .woocommerce .woocommerce-message,
body.woocommerce-account .woocommerce .woocommerce-info,
body.woocommerce-account .woocommerce .woocommerce-error,
body.woocommerce-cart .woocommerce .woocommerce-message,
body.woocommerce-cart .woocommerce .woocommerce-info,
body.woocommerce-cart .woocommerce .woocommerce-error,
body.woocommerce-checkout .woocommerce .woocommerce-message,
body.woocommerce-checkout .woocommerce .woocommerce-info,
body.woocommerce-checkout .woocommerce .woocommerce-error {
	background: var(--apc-wcard);
	border: 1px solid var(--apc-wborder);
	border-left-width: 3px;
	border-radius: 12px;
	color: var(--apc-wtext);
}

body.woocommerce-account .woocommerce .woocommerce-message,
body.woocommerce-cart .woocommerce .woocommerce-message { border-left-color: #6fce93; }

body.woocommerce-account .woocommerce .woocommerce-info,
body.woocommerce-cart .woocommerce .woocommerce-info,
body.woocommerce-checkout .woocommerce .woocommerce-info { border-left-color: #7fb0f5; }

body.woocommerce-account .woocommerce .woocommerce-error,
body.woocommerce-cart .woocommerce .woocommerce-error,
body.woocommerce-checkout .woocommerce .woocommerce-error { border-left-color: #e10012; }

/* ===== Cart specifics ===== */
body.woocommerce-cart .woocommerce .coupon { display: flex; gap: 8px; }

body.woocommerce-cart .woocommerce .coupon .input-text { flex: 1 1 auto; width: auto; }

body.woocommerce-cart .cart_totals { padding: 22px 24px; }

body.woocommerce-cart .cart_totals h2 { margin: 0 0 14px; font-size: 18px; }

body.woocommerce-cart .wc-proceed-to-checkout { padding: 0; margin-top: 16px; }

body.woocommerce-cart .wc-proceed-to-checkout .checkout-button {
	width: 100%;
	justify-content: center;
}

/* ===== Checkout specifics ===== */
body.woocommerce-checkout .woocommerce-billing-fields h3,
body.woocommerce-checkout .woocommerce-additional-fields h3,
body.woocommerce-checkout #order_review_heading {
	color: var(--apc-wtext);
	font-size: 17px;
	margin: 0 0 14px;
}

body.woocommerce-checkout #customer_details { padding: 22px 24px; }

body.woocommerce-checkout #order_review { padding: 22px 24px; }

body.woocommerce-checkout #payment {
	padding: 0;
	background: var(--apc-wcard2);
}

body.woocommerce-checkout #payment ul.payment_methods {
	list-style: none;
	margin: 0;
	padding: 18px 20px;
	border-bottom: 1px solid var(--apc-wborder);
}

body.woocommerce-checkout #payment ul.payment_methods li {
	padding: 8px 0;
}

body.woocommerce-checkout #payment div.payment_box {
	background: #1b1b1b;
	border-radius: 10px;
	color: var(--apc-wmuted);
	padding: 12px 14px;
	font-size: 12.5px;
}

body.woocommerce-checkout #payment .place-order { padding: 18px 20px; }

body.woocommerce-checkout #place_order { width: 100%; }

/* ===== Subscription detail page (view-subscription) ===== */
body.woocommerce-account .woocommerce .subscription-details,
body.woocommerce-account .woocommerce .woocommerce-orders-table {
	margin-bottom: 22px;
}

/* ===== Small screens ===== */
@media (max-width: 640px) {
	body.woocommerce-account .woocommerce-MyAccount-content,
	body.woocommerce-checkout #customer_details,
	body.woocommerce-checkout #order_review,
	body.woocommerce-cart .cart_totals { padding: 18px 16px; }

	body.woocommerce-account .woocommerce table,
	body.woocommerce-cart .woocommerce table,
	body.woocommerce-checkout .woocommerce table { font-size: 12.5px; }
}
