/* Tractor Add-Ons Product Page — styles only apply on product pages (body.tapp). */
body.tapp {
	--tapp-ink: #111111;
	--tapp-text: #444444;
	--tapp-muted: #5b5b5b;
	--tapp-red: #cc0000;
	--tapp-red-bright: #ff0000;
	--tapp-dark: #2c2d33;
	--tapp-border: #e2e2e2;
	--tapp-soft: #f7f7f7;
	--tapp-ok: #1f7a3a;
	--tapp-bad: #8a1c1c;
	--tapp-font: Inter, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

/* Fonts: theme's Inter may fail to load, so give it a sans-serif backup. */
body.tapp div.product,
body.tapp div.product * { font-family: var(--tapp-font); }

/* Gallery */
body.tapp div.product .woocommerce-product-gallery__image,
body.tapp div.product .woocommerce-product-gallery .flex-viewport {
	background: var(--tapp-soft);
	border-radius: 12px;
}
body.tapp div.product .flex-control-thumbs img {
	border: 1px solid var(--tapp-border);
	border-radius: 8px;
	background: var(--tapp-soft);
}
body.tapp div.product .flex-control-thumbs img.flex-active { border: 2px solid var(--tapp-red); }

/* Summary */
body.tapp .summary { display: flex; flex-direction: column; gap: 16px; }
body.tapp .summary > * { margin-top: 0 !important; margin-bottom: 0 !important; }

.tapp-badges { display: flex; flex-wrap: wrap; gap: 8px; }
.tapp-badge {
	font-size: 12px; font-weight: 600; line-height: 1.2;
	color: var(--tapp-dark); background: #f1f1f1;
	padding: 5px 10px; border-radius: 999px;
}
.tapp-badge--accent { color: #fff; background: var(--tapp-red); font-weight: 700; }

body.tapp .summary .product_title {
	font-size: clamp(24px, 3vw, 32px); line-height: 1.15; font-weight: 800; color: var(--tapp-ink);
}
.tapp-subtitle { font-size: 15px; color: var(--tapp-muted); }
.tapp-subtitle strong { color: var(--tapp-ink); }

body.tapp .summary .price,
body.tapp .summary .price .amount { font-size: 34px; font-weight: 800; color: var(--tapp-red); }
body.tapp .summary .woocommerce-variation-price .price { font-size: 24px; }

/* Key spec boxes */
.tapp-boxes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tapp-box { border: 1px solid var(--tapp-border); border-radius: 10px; padding: 12px 14px; }
.tapp-box__label {
	font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--tapp-muted);
}
.tapp-box__value { font-size: 20px; font-weight: 700; color: var(--tapp-ink); margin-top: 2px; line-height: 1.25; }
.tapp-box__note { font-size: 13px; color: var(--tapp-muted); }

/* Warehouse buttons (built by tapp.js from the Location dropdown) */
body.tapp form.variations_form table.variations.tapp-has-buttons select { display: none !important; }
body.tapp form.variations_form table.variations th.label { padding: 0 0 10px; }
body.tapp form.variations_form table.variations th.label label {
	font-size: 14px; font-weight: 700; color: var(--tapp-ink);
}
.tapp-choices { display: flex; flex-wrap: wrap; gap: 8px; }
.tapp-choice {
	display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
	min-width: 130px; min-height: 56px; padding: 8px 14px;
	border: 1px solid #c9c9c9; border-radius: 8px; background: #fff;
	color: var(--tapp-ink); text-align: left; cursor: pointer;
	font-size: 15px; line-height: 1.25; text-transform: none; letter-spacing: normal;
}
.tapp-choice:hover { border-color: var(--tapp-dark); }
.tapp-choice[aria-pressed="true"] { border: 2px solid var(--tapp-red); background: #fff5f5; }
.tapp-choice__name { font-weight: 700; }
.tapp-choice__stock { font-size: 12px; font-weight: 600; color: var(--tapp-ok); }
.tapp-choice--out .tapp-choice__stock { color: var(--tapp-bad); }
body.tapp .reset_variations { font-size: 13px; margin-left: 8px; }

/* Quantity + Add to cart */
/* Quantity: one bordered box holding the number and the theme's up/down arrows
   (the theme positions the arrows outside the input, which made them overlap). */
body.tapp div.product form.cart .quantity {
	display: inline-flex; flex: 0 0 auto; width: auto; align-items: stretch;
	height: 52px; float: none; margin: 0;
	border: 1px solid #767676; border-radius: 8px; overflow: hidden; background: #fff;
}
body.tapp div.product form.cart .quantity .qty {
	height: 100%; width: 56px; min-width: 0; padding: 0;
	border: 0 !important; border-radius: 0; box-shadow: none; background: transparent;
	text-align: center; font-size: 17px; font-weight: 700; color: var(--tapp-ink);
}
body.tapp div.product form.cart .quantity .quantity-nav {
	position: static !important; display: flex; flex-direction: column;
	width: 36px; height: 100%; border: 0; border-left: 1px solid var(--tapp-border); border-radius: 0;
}
body.tapp div.product form.cart .quantity .quantity-button {
	position: relative !important; top: auto !important; bottom: auto !important;
	flex: 1 1 50%; width: 100%; height: auto !important;
}
body.tapp div.product form.cart .quantity .quantity-up { border-bottom: 1px solid var(--tapp-border); }
body.tapp div.product form.cart .single_add_to_cart_button {
	min-height: 52px; padding: 0 28px; border: 0; border-radius: 8px;
	background: var(--tapp-red) !important; color: #fff !important;
	font-size: 17px; font-weight: 700; text-transform: none; letter-spacing: normal;
}
body.tapp div.product form.cart .woocommerce-variation-add-to-cart,
body.tapp div.product form.cart:not(.variations_form) { display: flex; flex-wrap: wrap; gap: 12px; align-items: stretch; }
body.tapp div.product form.cart .single_add_to_cart_button { flex: 1 1 200px; white-space: nowrap; float: none; margin: 0; }
body.tapp div.product form.cart .single_add_to_cart_button:hover { background: var(--tapp-dark) !important; }
body.tapp div.product form.cart .single_add_to_cart_button.disabled { opacity: .55; }
body.tapp div.product .stock.in-stock { color: var(--tapp-ok); font-weight: 600; }
body.tapp div.product .stock.out-of-stock { color: var(--tapp-bad); font-weight: 600; }

/* Below the summary */
/* The theme puts this area in a full-width wrapper with no side padding,
   so add our own, lined up with the photo and summary above. */
.tapp-details {
	clear: both; box-sizing: border-box; width: 100%; max-width: 1300px; margin: 0 auto;
	padding: 40px clamp(16px, 4.2vw, 42px) 0;
	overflow-wrap: anywhere;
}
.tapp-details img { max-width: 100%; height: auto; }
.tapp-row { display: flex; flex-wrap: wrap; gap: 32px; align-items: flex-start; }
.tapp-details h2 { margin: 0 0 14px; font-size: 22px; font-weight: 800; color: var(--tapp-ink); }

.tapp-specs { flex: 1 1 520px; min-width: 0; }
.tapp-specs__wrap { border: 1px solid var(--tapp-border); border-radius: 10px; overflow-x: auto; }
.tapp-specs table { width: 100%; margin: 0; border: 0; border-collapse: collapse; font-size: 15px; }
.tapp-specs th, .tapp-specs td { padding: 12px 16px; border: 0; border-bottom: 1px solid #eeeeee; text-align: left; vertical-align: top; }
.tapp-specs tr:last-child th, .tapp-specs tr:last-child td { border-bottom: 0; }
.tapp-specs th { width: 42%; color: var(--tapp-muted); font-weight: 600; background: #fafafa; }
.tapp-specs td { color: var(--tapp-ink); }

.tapp-fit {
	flex: 1 1 380px; min-width: 0; box-sizing: border-box;
	background: var(--tapp-dark); color: #e9e9ec; border-radius: 12px; padding: 24px;
	display: flex; flex-direction: column; gap: 14px;
}
.tapp-details .tapp-fit h2 { color: #fff; margin: 0; }
.tapp-fit ol { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 10px; font-size: 15px; line-height: 1.5; }
.tapp-fit strong { color: #fff; }
.tapp-fit__btn {
	align-self: flex-start; display: inline-flex; align-items: center; min-height: 44px; box-sizing: border-box;
	padding: 12px 18px; border-radius: 8px; background: var(--tapp-red); color: #fff !important;
	font-weight: 700; text-decoration: none !important;
}
.tapp-fit__btn:hover { background: var(--tapp-red-bright); }

.tapp-about { margin-top: 48px; font-size: 16px; line-height: 1.65; }
.tapp-about > * { max-width: 760px; }

body.tapp a:focus-visible,
body.tapp button:focus-visible,
body.tapp select:focus-visible,
body.tapp input:focus-visible { outline: 3px solid #1e68c4; outline-offset: 2px; }

/* Pop-up mode (opened from a PTO selector page) */
body.tapp-popup .woocommerce-breadcrumb,
body.tapp-popup .shoptimizer-product-prevnext { display: none !important; }

@media (max-width: 600px) {
	.tapp-boxes { gap: 8px; }
	.tapp-box__value { font-size: 18px; }
	.tapp-choice { flex: 1 1 140px; }
	.tapp-fit { padding: 20px; }
}
