/*
Theme Name: Gangma OTR
Theme URI: https://gangmaotr.com/
Author: Gangma Specialty Tire
Description: Catalogue theme for OTR and specialty tires. Renders products, sizes and machine types owned by the OTR Catalogue plugin.
Version: 0.2.1
Requires at least: 6.4
Requires PHP: 8.0
License: GPL-2.0-or-later
Text Domain: gangma-otr
*/

:root {
	--ink: #12151a;
	--ink-2: #3f4753;
	--ink-3: #6b7482;
	--line: #e3e6ea;
	--line-2: #cdd3da;
	--bg: #ffffff;
	--bg-2: #f6f7f9;
	--accent: #c2410c;
	--accent-2: #9a3208;
	--radius: 6px;
	--wrap: 1180px;
	--header-h: 64px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
	margin: 0;
	background: var(--bg);
	color: var(--ink);
	font: 16px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	-webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--accent-2); }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }

.skip-link {
	position: absolute; left: -9999px; top: 0; background: #fff; padding: 10px 16px; z-index: 200;
}
.skip-link:focus { left: 8px; top: 8px; }

/* ---------- header ---------- */

.site-header {
	position: sticky; top: 0; z-index: 60;
	background: var(--ink);
	color: #fff; border-bottom: 1px solid #23282f;
}
.site-header__inner {
	display: flex; align-items: center; gap: 24px; min-height: var(--header-h);
}
.site-brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 700; white-space: nowrap; }
.site-brand:hover { color: #fff; }
.site-brand__mark {
	width: 26px; height: 26px; border-radius: 50%; border: 3px solid var(--accent); display: inline-block;
}
.site-nav { display: flex; gap: 20px; margin-left: auto; flex-wrap: wrap; }
.site-nav a { color: #cfd5dd; text-decoration: none; font-size: 15px; padding: 6px 0; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: #fff; }
.header-cta {
	background: var(--accent); color: #fff; border-radius: var(--radius);
	padding: 10px 16px; font-weight: 600; font-size: 14px; text-decoration: none; white-space: nowrap;
}
.header-cta:hover { background: var(--accent-2); color: #fff; }

@media (max-width: 860px) {
	.site-nav { display: none; }
	.header-cta { margin-left: auto; }
}

/* ---------- page furniture ---------- */

.pagehead { padding: 44px 0 28px; border-bottom: 1px solid var(--line); }
.pagehead .eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: 12px; color: var(--ink-3); margin: 0 0 10px; }
.pagehead h1 { margin: 0; font-size: clamp(26px, 3.6vw, 38px); line-height: 1.2; letter-spacing: -.01em; }
.pagehead p { margin: 12px 0 0; color: var(--ink-2); max-width: 68ch; }

.section { padding: 40px 0; }
.section--tight { padding: 26px 0; }
.section h2 { font-size: 22px; margin: 0 0 16px; letter-spacing: -.01em; }

/* ---------- product cards ---------- */

.grid {
	display: grid; gap: 18px;
	grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}
.card {
	border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
	background: #fff; display: flex; flex-direction: column;
}
.card__media { aspect-ratio: 4 / 3; background: var(--bg-2); }
.card__media img { width: 100%; height: 100%; object-fit: cover; }
.card__body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card__brand { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.card__model { font-size: 19px; font-weight: 700; margin: 0; }
.card__model a { color: var(--ink); text-decoration: none; }
.card__meta { font-size: 13.5px; color: var(--ink-2); margin: 0; }
.card__foot { margin-top: auto; padding-top: 10px; font-size: 13.5px; }

/* ---------- filter bar ---------- */

.filters {
	display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end;
	padding: 16px; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius);
	margin-bottom: 24px;
}
.filters label { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; color: var(--ink-2); }
.filters input, .filters select {
	min-width: 180px; padding: 9px 11px; border: 1px solid var(--line-2); border-radius: var(--radius);
	font: inherit; font-size: 14px; background: #fff; color: var(--ink);
}
.filters .btn { align-self: flex-end; }

.btn {
	display: inline-flex; align-items: center; justify-content: center;
	padding: 10px 18px; border-radius: var(--radius); border: 1px solid var(--line-2);
	background: #fff; color: var(--ink); font: inherit; font-size: 14px; font-weight: 600;
	text-decoration: none; cursor: pointer;
}
.btn--primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn--primary:hover { background: var(--accent-2); border-color: var(--accent-2); color: #fff; }
.btn--ghost { background: transparent; }

/* ---------- specification table ---------- */

.spec-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
.spec-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.spec-table th, .spec-table td { padding: 11px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.spec-table thead th {
	background: var(--bg-2); font-size: 11px; text-transform: uppercase; letter-spacing: .06em;
	color: var(--ink-3); font-weight: 700; white-space: nowrap;
}
.spec-table tbody tr:last-child td { border-bottom: 0; }
.spec-table td.is-right, .spec-table th.is-right { text-align: right; }
.spec-table td.is-nowrap { white-space: nowrap; }
.spec-table tbody tr:hover { background: #fafbfc; }
.spec-missing { color: var(--ink-3); font-size: 13px; }

.notice-inline { font-size: 13.5px; color: var(--ink-3); margin: 14px 0 0; }

/* ---------- product page ---------- */

.product { display: grid; gap: 32px; grid-template-columns: minmax(0, 380px) minmax(0, 1fr); padding: 32px 0; }
.product__media { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.product__eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: 12px; color: var(--ink-3); margin: 0 0 8px; }
.product__title { margin: 0; font-size: clamp(26px, 3.4vw, 36px); letter-spacing: -.01em; }
.product__sub { margin: 8px 0 0; color: var(--ink-2); font-size: 14.5px; }
.product__summary { margin: 16px 0 0; color: var(--ink-2); max-width: 62ch; }
@media (max-width: 780px) { .product { grid-template-columns: 1fr; gap: 20px; } }

/* ---------- enquiry form ---------- */

.form-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; background: #fff; }
.form-row { display: grid; gap: 14px; grid-template-columns: 1fr 1fr; margin-bottom: 14px; }
.form-row--single { grid-template-columns: 1fr; }
@media (max-width: 640px) { .form-row { grid-template-columns: 1fr; } }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13.5px; font-weight: 600; color: var(--ink-2); }
.field input, .field select, .field textarea {
	padding: 10px 12px; border: 1px solid var(--line-2); border-radius: var(--radius);
	font: inherit; font-size: 15px; background: #fff; color: var(--ink); width: 100%;
}
.field textarea { min-height: 130px; resize: vertical; }
.field--check { flex-direction: row; align-items: flex-start; gap: 10px; }
.field--check input { width: auto; margin-top: 3px; }
.field--check label { font-weight: 400; font-size: 13.5px; color: var(--ink-2); }
.form-hint { font-size: 13px; color: var(--ink-3); margin: 0; }
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.status {
	border: 1px solid var(--line-2); border-left: 4px solid var(--accent);
	background: var(--bg-2); padding: 14px 16px; border-radius: var(--radius); margin-bottom: 20px;
}
.status--ok { border-left-color: #15803d; }
.status p { margin: 0; }

/* ---------- footer ---------- */

.site-footer { margin-top: 56px; background: var(--ink); color: #b9c0c9; padding: 40px 0 28px; }
.site-footer a { color: #dfe4ea; text-decoration: none; }
.site-footer a:hover { color: #fff; }
.footer-grid { display: grid; gap: 28px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.footer-grid h3 { color: #fff; font-size: 13px; text-transform: uppercase; letter-spacing: .08em; margin: 0 0 12px; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 14px; }
.footer-legal { border-top: 1px solid #262b33; margin-top: 28px; padding-top: 18px; font-size: 13px; color: #8892a0; display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; }
.footer-legal p { margin: 0; }

/* ---------- misc ---------- */

.pagination { display: flex; gap: 8px; margin-top: 28px; flex-wrap: wrap; }
.pagination .page-numbers {
	padding: 8px 13px; border: 1px solid var(--line-2); border-radius: var(--radius);
	text-decoration: none; color: var(--ink); font-size: 14px;
}
.pagination .page-numbers.current { background: var(--ink); border-color: var(--ink); color: #fff; }
.empty { padding: 40px 0; color: var(--ink-2); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 22px; padding: 0; list-style: none; }
.chips a { display: inline-block; padding: 7px 12px; border: 1px solid var(--line-2); border-radius: 999px; font-size: 13.5px; text-decoration: none; color: var(--ink); }
.chips a:hover { border-color: var(--accent); color: var(--accent); }

.prose { max-width: 72ch; }
.prose h2 { margin-top: 32px; }
.prose p { color: var(--ink-2); }

/* ---------- floating WhatsApp ---------- */

.wa-fab {
	position: fixed; right: 18px; bottom: 18px; z-index: 80;
	display: inline-flex; align-items: center; justify-content: center;
	width: 52px; height: 52px; border-radius: 50%;
	background: #25d366; color: #fff; text-decoration: none;
	box-shadow: 0 6px 18px rgba(0, 0, 0, .22);
	transition: transform .15s ease, box-shadow .15s ease;
}
.wa-fab:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(0, 0, 0, .28); color: #fff; }
.wa-fab:focus-visible { outline: 3px solid #128c7e; outline-offset: 3px; }

@media (max-width: 600px) {
	.wa-fab { right: 14px; bottom: 14px; width: 48px; height: 48px; }
}

@media print {
	.wa-fab { display: none; }
}

/* ---------- breadcrumbs ---------- */

.breadcrumbs { border-bottom: 1px solid var(--line); background: var(--bg-2); }
.breadcrumbs ol { list-style: none; margin: 0; padding: 12px 0; display: flex; flex-wrap: wrap; gap: 8px; font-size: 13px; color: var(--ink-3); }
.breadcrumbs li { display: flex; align-items: center; gap: 8px; }
.breadcrumbs li:not(:last-child)::after { content: "/"; color: var(--line-2); }
.breadcrumbs a { color: var(--ink-2); text-decoration: none; }
.breadcrumbs a:hover { color: var(--accent); text-decoration: underline; }
