/*
Theme Name: AutoPav
Theme URI: http://localhost/autopav
Author: AutoPav
Description: Tema su misura per AutoPav, noleggio auto a breve termine. Catalogo flotta, contatti rapidi (telefono, WhatsApp, modulo) e impostazioni aziendali dal Personalizza.
Version: 1.0.0
Requires at least: 6.4
Requires PHP: 8.0
License: GPLv2 or later
Text Domain: autopav
*/

:root {
	--ap-accent: #1d5fd1;
	--ap-accent-dark: color-mix(in srgb, var(--ap-accent) 80%, #000);
	--ap-accent-soft: color-mix(in srgb, var(--ap-accent) 9%, #fff);
	--ap-ink: #0f1b2d;
	--ap-text: #3d4a5c;
	--ap-muted: #6b7789;
	--ap-line: #e4e8ef;
	--ap-bg: #ffffff;
	--ap-bg-alt: #f5f7fa;
	--ap-wa: #1fa855;
	--ap-radius: 14px;
	--ap-shadow: 0 1px 2px rgba(15, 27, 45, .05), 0 8px 24px rgba(15, 27, 45, .06);
	--ap-wrap: 1180px;
}

*, *::before, *::after { box-sizing: border-box; }
html { overflow-x: clip; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
	margin: 0;
	font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	font-size: 17px;
	line-height: 1.6;
	color: var(--ap-text);
	background: var(--ap-bg);
	-webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; height: auto; display: block; }
a { color: var(--ap-accent); text-decoration: none; }
a:hover { color: var(--ap-accent-dark); }
h1, h2, h3, h4 { color: var(--ap-ink); line-height: 1.15; margin: 0 0 .5em; letter-spacing: -.02em; font-weight: 800; }
h1 { font-size: clamp(2.1rem, 4.6vw, 3.4rem); }
h2 { font-size: clamp(1.7rem, 3.2vw, 2.4rem); }
h3 { font-size: 1.2rem; font-weight: 700; letter-spacing: -.01em; }
p { margin: 0 0 1em; }
.ico { width: 1.15em; height: 1.15em; flex: none; display: inline-block; vertical-align: -.2em; }

.wrap { width: min(var(--ap-wrap), 100% - 32px); margin-inline: auto; }
.section { padding: clamp(56px, 8vw, 96px) 0; }
.section--alt { background: var(--ap-bg-alt); }
.section-head { max-width: 640px; margin-bottom: 40px; }
.section-head--center { margin-inline: auto; text-align: center; }
.eyebrow { display: inline-block; font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--ap-accent); margin-bottom: 10px; }
.lead { font-size: 1.15rem; color: var(--ap-muted); }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link:focus { position: fixed; top: 8px; left: 8px; width: auto; height: auto; clip: auto; z-index: 999; background: #fff; padding: 8px 14px; border-radius: 8px; }

/* Bottoni */
.btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	padding: 13px 22px; border-radius: 10px; border: 2px solid transparent;
	font: inherit; font-weight: 600; font-size: 1rem; line-height: 1.2;
	cursor: pointer; transition: background .15s, color .15s, border-color .15s, transform .15s;
	white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--ap-accent); color: #fff; }
.btn--primary:hover { background: var(--ap-accent-dark); color: #fff; }
.btn--wa { background: var(--ap-wa); color: #fff; }
.btn--wa:hover { background: #178a45; color: #fff; }
.btn--ghost { border-color: var(--ap-line); color: var(--ap-ink); background: #fff; }
.btn--ghost:hover { border-color: var(--ap-accent); color: var(--ap-accent); }
.btn--light { background: #fff; color: var(--ap-ink); }
.btn--light:hover { background: #eef2f8; color: var(--ap-ink); }
.btn--block { width: 100%; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }

/* Header */
.topbar { background: var(--ap-ink); color: #c9d2df; font-size: .85rem; }
.topbar .wrap { display: flex; justify-content: space-between; gap: 16px; padding: 7px 0; }
.topbar a { color: #fff; }
.topbar span { display: inline-flex; align-items: center; gap: 6px; }
.topbar__items { display: flex; gap: 22px; flex-wrap: wrap; }

.site-header { position: sticky; top: 0; z-index: 50; background: #fff; border-bottom: 1px solid var(--ap-line); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 72px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.45rem; color: var(--ap-ink); letter-spacing: -.03em; }
.brand:hover { color: var(--ap-ink); }
.brand__mark { width: 38px; height: 38px; border-radius: 10px; background: var(--ap-accent); color: #fff; display: grid; place-items: center; }
.brand__mark svg { width: 24px; height: 24px; }
.brand b { color: var(--ap-accent); font-weight: 800; }
.custom-logo { max-height: 48px; width: auto; }

.main-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; }
.main-nav a { display: block; white-space: nowrap; padding: 8px 14px; border-radius: 8px; color: var(--ap-ink); font-weight: 500; font-size: .98rem; }
.main-nav a:hover, .main-nav .current-menu-item > a, .main-nav .current_page_item > a { background: var(--ap-accent-soft); color: var(--ap-accent); }
.header-cta { display: flex; gap: 10px; align-items: center; }
.header-cta .btn { padding: 10px 16px; font-size: .95rem; }
.nav-toggle { display: none; background: none; border: 0; padding: 8px; color: var(--ap-ink); cursor: pointer; }
.nav-toggle .ico { width: 28px; height: 28px; }

@media (max-width: 1080px) {
	.topbar__hours { display: none; }
	.nav-toggle { display: inline-flex; }
	.header-cta .btn--ghost { display: none; }
	.main-nav { position: fixed; inset: 0 0 0 auto; width: min(320px, 85vw); background: #fff; padding: 84px 20px 20px; box-shadow: -10px 0 40px rgba(0,0,0,.15); transform: translateX(100%); visibility: hidden; transition: transform .25s ease, visibility .25s; z-index: 60; overflow-y: auto; }
	.main-nav.is-open { transform: none; visibility: visible; }
	.main-nav ul { flex-direction: column; }
	.main-nav a { font-size: 1.1rem; padding: 12px 14px; }
	.nav-close { position: absolute; top: 18px; right: 16px; }
	body.nav-open::after { content: ""; position: fixed; inset: 0; background: rgba(15,27,45,.4); z-index: 49; }
}
@media (min-width: 1081px) { .nav-close { display: none; } }
@media (max-width: 560px) {
	.topbar { display: none; }
	.header-cta .btn--primary span { display: none; }
	.header-cta .btn--primary { padding: 10px 12px; }
}

/* Hero */
.hero { position: relative; overflow: hidden; background: linear-gradient(180deg, var(--ap-accent-soft), #fff 85%); padding: clamp(48px, 7vw, 88px) 0 clamp(40px, 6vw, 72px); }
.hero .wrap { display: grid; grid-template-columns: 1.05fr 1fr; gap: 48px; align-items: center; }
.hero h1 { margin-bottom: 18px; }
.hero .lead { max-width: 34em; margin-bottom: 28px; }
.hero__badges { display: flex; flex-wrap: wrap; gap: 10px 22px; margin-top: 28px; font-size: .95rem; color: var(--ap-ink); font-weight: 500; }
.hero__badges span { display: inline-flex; gap: 6px; align-items: center; }
.hero__badges .ico { color: var(--ap-accent); }
.hero__visual { position: relative; }
.hero__visual::before { content: ""; position: absolute; inset: 8% -10% 4% 6%; border-radius: 40px; background: var(--ap-accent); opacity: .1; transform: rotate(-4deg); }
.hero__visual .car-svg { position: relative; width: 100%; filter: drop-shadow(0 20px 30px rgba(15,27,45,.15)); }
.hero__price { position: absolute; right: 4%; top: 2%; background: #fff; border-radius: 14px; padding: 12px 18px; box-shadow: var(--ap-shadow); font-size: .85rem; color: var(--ap-muted); }
.hero__price strong { white-space: nowrap; display: block; font-size: 1.6rem; color: var(--ap-ink); line-height: 1.1; }
@media (max-width: 860px) {
	.hero .wrap { grid-template-columns: 1fr; gap: 24px; }
	.hero__visual { max-width: 520px; }
	.hero__price { padding: 8px 14px; }
	.hero__price strong { font-size: 1.25rem; }
}

/* Griglia vantaggi */
.features { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.feature { background: #fff; border: 1px solid var(--ap-line); border-radius: var(--ap-radius); padding: 26px; }
.feature__icon { width: 46px; height: 46px; border-radius: 12px; background: var(--ap-accent-soft); color: var(--ap-accent); display: grid; place-items: center; margin-bottom: 16px; }
.feature__icon .ico { width: 24px; height: 24px; }
.feature p { margin: 0; font-size: .96rem; color: var(--ap-muted); }
@media (max-width: 960px) { .features { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .features { grid-template-columns: 1fr; } }

/* Flotta */
.fleet-filter { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; }
.chip { border: 1px solid var(--ap-line); background: #fff; color: var(--ap-ink); border-radius: 999px; padding: 8px 16px; font: inherit; font-size: .92rem; font-weight: 500; cursor: pointer; }
.chip:hover { border-color: var(--ap-accent); color: var(--ap-accent); }
.chip.is-active { background: var(--ap-ink); border-color: var(--ap-ink); color: #fff; }
.fleet { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.car-card { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--ap-line); border-radius: var(--ap-radius); overflow: hidden; transition: box-shadow .2s, transform .2s; }
.car-card:hover { box-shadow: var(--ap-shadow); transform: translateY(-2px); }
.car-card[hidden] { display: none; }
.car-card__media { display: block; aspect-ratio: 16 / 10; background: linear-gradient(180deg, var(--ap-bg-alt), #fff); padding: 18px; }
.car-card__media .car-img { width: 100%; height: 100%; object-fit: contain; }
.car-card__media img.car-img { object-fit: cover; border-radius: 8px; }
.car-card__body { padding: 20px 22px 22px; display: flex; flex-direction: column; flex: 1; }
.car-card__cat { font-size: .78rem; font-weight: 700; color: var(--ap-accent); text-transform: uppercase; letter-spacing: .08em; }
.car-card h3 { margin: 4px 0 12px; font-size: 1.25rem; }
.car-card h3 a { color: var(--ap-ink); }
.specs { list-style: none; margin: 0 0 18px; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; font-size: .9rem; color: var(--ap-muted); }
.specs li { display: flex; gap: 7px; align-items: center; }
.specs .ico { color: var(--ap-ink); opacity: .6; }
.car-card__foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 16px; border-top: 1px solid var(--ap-line); }
.price { color: var(--ap-muted); font-size: .85rem; line-height: 1.2; }
.price strong { display: block; color: var(--ap-ink); font-size: 1.5rem; font-weight: 800; }
.car-card__foot .btn { padding: 10px 16px; font-size: .92rem; }
@media (max-width: 960px) { .fleet { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .fleet { grid-template-columns: 1fr; } }

/* Passaggi */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; counter-reset: step; }
.step { position: relative; padding: 28px; border-radius: var(--ap-radius); background: #fff; border: 1px solid var(--ap-line); }
.step::before { counter-increment: step; content: counter(step); display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--ap-accent); color: #fff; font-weight: 800; margin-bottom: 16px; }
.step p { margin: 0; color: var(--ap-muted); font-size: .96rem; }
@media (max-width: 860px) { .steps { grid-template-columns: 1fr; } }

/* Banda CTA */
.cta-band { background: var(--ap-ink); color: #c9d2df; border-radius: 22px; padding: clamp(32px, 5vw, 56px); display: flex; align-items: center; justify-content: space-between; gap: 28px; flex-wrap: wrap; background-image: radial-gradient(circle at 90% 10%, color-mix(in srgb, var(--ap-accent) 55%, transparent), transparent 55%); }
.cta-band h2 { color: #fff; margin-bottom: 8px; }
.cta-band p { margin: 0; max-width: 36em; }

/* FAQ */
.faq { max-width: 820px; margin-inline: auto; }
.faq details { border-bottom: 1px solid var(--ap-line); padding: 4px 0; }
.faq summary { cursor: pointer; list-style: none; padding: 18px 40px 18px 0; font-weight: 600; color: var(--ap-ink); font-size: 1.05rem; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 6px; top: 50%; transform: translateY(-50%); font-size: 1.5rem; font-weight: 400; color: var(--ap-accent); }
.faq details[open] summary::after { content: "–"; }
.faq details p { margin: 0 0 18px; color: var(--ap-muted); }

/* Pagine interne */
.page-hero { background: var(--ap-bg-alt); padding: clamp(40px, 6vw, 72px) 0 clamp(32px, 5vw, 56px); border-bottom: 1px solid var(--ap-line); }
.page-hero h1 { margin-bottom: 10px; }
.page-hero .lead { margin: 0; max-width: 40em; }
.breadcrumb { font-size: .88rem; color: var(--ap-muted); margin-bottom: 14px; }
.breadcrumb a { color: var(--ap-muted); }
.prose { max-width: 760px; }
.prose h2 { font-size: 1.6rem; margin-top: 1.6em; }
.prose h3 { margin-top: 1.4em; }
.prose ul { padding-left: 1.2em; }
.prose li { margin-bottom: .4em; }
.prose img { border-radius: var(--ap-radius); }
.entry-content > *:first-child { margin-top: 0; }

/* Scheda auto */
.car-detail { display: grid; grid-template-columns: 1.4fr 1fr; gap: 40px; align-items: start; }
.car-detail__media { background: linear-gradient(180deg, var(--ap-bg-alt), #fff); border: 1px solid var(--ap-line); border-radius: 20px; padding: 32px; }
.car-detail__media img.car-img { border-radius: 12px; width: 100%; }
.book-box { position: sticky; top: 96px; border: 1px solid var(--ap-line); border-radius: 20px; padding: 28px; box-shadow: var(--ap-shadow); background: #fff; }
.book-box .price strong { font-size: 2.2rem; }
.book-box .btn { margin-top: 10px; }
.book-box__note { font-size: .85rem; color: var(--ap-muted); margin: 14px 0 0; }
.spec-table { width: 100%; border-collapse: collapse; margin: 20px 0; font-size: .95rem; }
.spec-table th, .spec-table td { text-align: left; padding: 10px 0; border-bottom: 1px solid var(--ap-line); }
.spec-table th { font-weight: 500; color: var(--ap-muted); }
.spec-table td { color: var(--ap-ink); font-weight: 600; text-align: right; }
.included { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.included li { display: flex; gap: 10px; align-items: flex-start; }
.included .ico { color: var(--ap-wa); margin-top: 3px; }
@media (max-width: 900px) { .car-detail { grid-template-columns: 1fr; } .book-box { position: static; } }

/* Contatti */
.contact-grid { display: grid; grid-template-columns: 1fr 1.3fr; gap: 40px; align-items: start; }
.contact-cards { display: grid; gap: 14px; }
.contact-card { display: flex; gap: 16px; align-items: flex-start; padding: 20px; border: 1px solid var(--ap-line); border-radius: var(--ap-radius); background: #fff; color: var(--ap-text); }
a.contact-card:hover { border-color: var(--ap-accent); color: var(--ap-text); }
.contact-card__icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--ap-accent-soft); color: var(--ap-accent); flex: none; }
.contact-card__icon--wa { background: #e5f6ec; color: var(--ap-wa); }
.contact-card strong { display: block; color: var(--ap-ink); }
.contact-card span { font-size: .95rem; white-space: pre-line; }
.map { border: 0; width: 100%; height: 320px; border-radius: var(--ap-radius); margin-top: 14px; background: var(--ap-bg-alt); }
@media (max-width: 900px) { .contact-grid { grid-template-columns: 1fr; } }

.form-card { background: #fff; border: 1px solid var(--ap-line); border-radius: 20px; padding: clamp(22px, 4vw, 36px); box-shadow: var(--ap-shadow); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid .full { grid-column: 1 / -1; }
.field label { display: block; font-size: .9rem; font-weight: 600; color: var(--ap-ink); margin-bottom: 6px; }
.field input, .field select, .field textarea {
	width: 100%; font: inherit; font-size: 1rem; color: var(--ap-ink);
	padding: 12px 14px; border: 1px solid #cfd6e0; border-radius: 10px; background: #fff;
}
.field textarea { min-height: 120px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 3px solid color-mix(in srgb, var(--ap-accent) 25%, transparent); border-color: var(--ap-accent); }
.field--check { display: flex; gap: 10px; align-items: flex-start; font-size: .9rem; }
.field--check input { width: auto; margin-top: 4px; }
.field--check label { font-weight: 400; color: var(--ap-text); margin: 0; }
.hp { position: absolute; left: -9999px; }
.notice { padding: 14px 18px; border-radius: 10px; margin-bottom: 20px; font-weight: 500; }
.notice--ok { background: #e5f6ec; color: #11672f; }
.notice--err { background: #fdecec; color: #9b1c1c; }
@media (max-width: 560px) { .form-grid { grid-template-columns: 1fr; } }

/* Chi siamo */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.stat { background: #fff; border: 1px solid var(--ap-line); border-radius: var(--ap-radius); padding: 22px; text-align: center; }
.stat strong { display: block; font-size: 2rem; color: var(--ap-accent); font-weight: 800; line-height: 1.1; }
.stat span { font-size: .9rem; color: var(--ap-muted); }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }

/* Footer */
.site-footer { background: var(--ap-ink); color: #a9b4c4; font-size: .95rem; padding: 64px 0 0; margin-top: 0; }
.site-footer a { color: #dfe5ee; }
.site-footer a:hover { color: #fff; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 36px; padding-bottom: 48px; }
.site-footer h4 { color: #fff; font-size: 1rem; margin-bottom: 14px; letter-spacing: 0; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.site-footer .brand { color: #fff; margin-bottom: 14px; }
.site-footer li { display: flex; gap: 8px; align-items: flex-start; }
.site-footer li .ico { margin-top: 4px; color: #6d7d93; }
.footer-hours { white-space: pre-line; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); padding: 20px 0; font-size: .85rem; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .footer-grid { grid-template-columns: 1fr; } }

/* WhatsApp fisso */
.wa-float { position: fixed; right: 20px; bottom: 20px; z-index: 40; width: 58px; height: 58px; border-radius: 50%; background: var(--ap-wa); color: #fff; display: grid; place-items: center; box-shadow: 0 8px 24px rgba(31,168,85,.4); transition: transform .15s; }
.wa-float:hover { color: #fff; transform: scale(1.06); }
.wa-float .ico { width: 30px; height: 30px; }

/* Blog / fallback */
.post-list { display: grid; gap: 28px; }
.post-list article { border-bottom: 1px solid var(--ap-line); padding-bottom: 24px; }
.pagination { margin-top: 32px; display: flex; gap: 8px; }
.pagination .page-numbers { padding: 8px 14px; border: 1px solid var(--ap-line); border-radius: 8px; }
.pagination .current { background: var(--ap-ink); color: #fff; }

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}
