/*
 * Riggy Rigs Vehicles – front end.
 * Colours and shapes come from CSS variables so a theme can restyle everything:
 * --rr-accent, --rr-accent-text, --rr-dark, --rr-text, --rr-muted, --rr-border, --rr-bg-soft, --rr-radius, --rr-width.
 */

:root {
	--rr-accent: #f5b400;
	--rr-accent-text: #141414;
	--rr-dark: #17191c;
	--rr-text: #1f2328;
	--rr-muted: #646b73;
	--rr-border: #e2e5e9;
	--rr-bg-soft: #f5f6f8;
	--rr-ok: #1a7f37;
	--rr-danger: #c62828;
	--rr-radius: 10px;
	--rr-width: 1240px;
}

.rr-wrap { width: min(100% - 32px, var(--rr-width)); margin: 0 auto; padding: 32px 0 64px; color: var(--rr-text); }
.rr-wrap *, .rr-wrap *::before, .rr-wrap *::after { box-sizing: border-box; }
.rr-title { margin: 0 0 6px; font-size: clamp(26px, 4vw, 38px); line-height: 1.15; }
.rr-help { display: block; color: var(--rr-muted); font-size: 14px; margin: 6px 0 0; }

/* Buttons */
.rr-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 10px 20px; border: 2px solid transparent; border-radius: var(--rr-radius); font-weight: 700; font-size: 16px; line-height: 1.2; text-decoration: none; cursor: pointer; transition: filter .15s, background .15s; }
.rr-btn:hover { filter: brightness(.94); text-decoration: none; }
.rr-btn-primary { background: var(--rr-accent); color: var(--rr-accent-text); }
.rr-btn-whatsapp { background: #25d366; color: #fff; }
.rr-btn-outline { background: transparent; border-color: currentColor; color: var(--rr-text); }
.rr-btn:disabled { opacity: .6; cursor: wait; }

/* Badges */
.rr-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.rr-badge { padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; background: var(--rr-dark); color: #fff; }
.rr-badge-sold { background: var(--rr-danger); }
.rr-badge-offer { background: #d97706; }
.rr-badge-rent { background: #2563eb; }
.rr-badge-new { background: var(--rr-ok); }

/* Archive */
.rr-archive-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 18px; }
.rr-count { margin: 0; color: var(--rr-muted); }
.rr-filters-toggle { margin-bottom: 20px; border: 1px solid var(--rr-border); border-radius: var(--rr-radius); background: var(--rr-bg-soft); }
.rr-filters-toggle > summary { padding: 14px 18px; font-weight: 700; cursor: pointer; list-style: none; }
.rr-filters-toggle > summary::-webkit-details-marker { display: none; }
.rr-filters-toggle > summary::after { content: "+"; float: right; font-size: 20px; line-height: 1; }
.rr-filters-toggle[open] > summary::after { content: "–"; }
.rr-filters-toggle .rr-search { padding: 0 18px 18px; }
.rr-clear { margin: -8px 0 18px; }

/* Search form */
.rr-search { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; align-items: end; }
.rr-filters-more { display: contents; }
.rr-filter { display: flex; flex-direction: column; gap: 4px; margin: 0; font-size: 13px; font-weight: 700; color: var(--rr-muted); }
.rr-filter-q { grid-column: span 2; }
.rr-filter input, .rr-filter select { width: 100%; min-height: 46px; padding: 8px 12px; border: 1px solid var(--rr-border); border-radius: var(--rr-radius); background: #fff; color: var(--rr-text); font-size: 16px; font-weight: 400; }
.rr-search .rr-btn { width: 100%; }
.rr-search-compact { grid-template-columns: 2fr 1fr 1fr auto; padding: 16px; border-radius: var(--rr-radius); background: #fff; box-shadow: 0 10px 30px rgba(0,0,0,.12); }
.rr-search-compact .rr-filter-q { grid-column: auto; }
@media (max-width: 700px) {
	.rr-filter-q, .rr-search-compact .rr-filter-q { grid-column: 1 / -1; }
	.rr-search-compact { grid-template-columns: 1fr 1fr; }
	.rr-search-compact .rr-btn { grid-column: 1 / -1; }
}

/* Grid and cards */
.rr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 22px; }
.rr-card { margin: 0; border: 1px solid var(--rr-border); border-radius: var(--rr-radius); overflow: hidden; background: #fff; transition: box-shadow .2s, transform .2s; }
.rr-card:hover { box-shadow: 0 12px 28px rgba(0,0,0,.1); transform: translateY(-2px); }
.rr-card-link { display: flex; flex-direction: column; height: 100%; color: inherit; text-decoration: none; }
.rr-card-link:hover { text-decoration: none; }
.rr-card-media { position: relative; display: block; aspect-ratio: 4 / 3; background: var(--rr-bg-soft); }
.rr-card-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rr-card-media .rr-badges { position: absolute; top: 10px; left: 10px; }
.rr-card-nophoto { display: block; width: 100%; height: 100%; min-height: 160px; background: var(--rr-bg-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 40'%3E%3Cpath fill='%23c5cad1' d='M4 26V12h30v14h4l2-8h12l8 8v6h-4a5 5 0 0 0-10 0H22a5 5 0 0 0-10 0H4z'/%3E%3C/svg%3E") center / 30% no-repeat; }
.rr-sold .rr-card-media img, .rr-card.rr-is-sold .rr-card-media img { filter: grayscale(.6); }
.rr-card-body { display: flex; flex-direction: column; flex: 1; gap: 6px; padding: 14px 16px 16px; }
.rr-card-title { font-size: 18px; font-weight: 800; line-height: 1.25; }
.rr-card-meta { color: var(--rr-muted); font-size: 14px; margin: 0; }
.rr-card-foot { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 10px; margin-top: auto; padding-top: 8px; }
.rr-card-price { font-size: 19px; font-weight: 800; white-space: nowrap; }
.rr-card-location { color: var(--rr-muted); font-size: 13px; text-align: right; }

/* Pagination */
.rr-archive .navigation.pagination { margin-top: 32px; }
.rr-archive .nav-links { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.rr-archive .page-numbers { display: inline-flex; align-items: center; min-width: 44px; min-height: 44px; padding: 0 12px; justify-content: center; border: 1px solid var(--rr-border); border-radius: var(--rr-radius); text-decoration: none; color: var(--rr-text); }
.rr-archive .page-numbers.current { background: var(--rr-dark); border-color: var(--rr-dark); color: #fff; }

/* Empty states */
.rr-empty { padding: 28px; border: 1px dashed var(--rr-border); border-radius: var(--rr-radius); background: var(--rr-bg-soft); }
.rr-empty h2, .rr-empty h3 { margin-top: 0; }

/* Single vehicle */
.rr-crumbs { margin-bottom: 14px; font-size: 14px; color: var(--rr-muted); }
.rr-crumbs a { color: inherit; }
.rr-single-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(300px, 1fr); gap: 32px; align-items: start; }
.rr-single-grid > *, .rr-gallery, .rr-gallery-main { min-width: 0; max-width: 100%; }
.rr-single-lower { margin-top: 12px; }
.rr-single-side { position: sticky; top: 24px; }
.rr-single-lower .rr-single-side { position: static; }
@media (max-width: 900px) {
	.rr-single-grid { grid-template-columns: minmax(0, 1fr); gap: 20px; }
	.rr-single-side { position: static; }
}
.rr-buybox { padding: 22px; border: 1px solid var(--rr-border); border-radius: var(--rr-radius); background: #fff; }
.rr-buybox .rr-badges { margin-bottom: 10px; }
.rr-price { margin: 14px 0 4px; font-size: 32px; font-weight: 800; line-height: 1.1; }
.rr-price small { display: block; font-size: 14px; font-weight: 400; color: var(--rr-muted); }
.rr-location { margin: 0 0 16px; color: var(--rr-muted); }
.rr-location::before { content: "\1F4CD\FE0E  "; }
.rr-actions { display: grid; gap: 10px; }
.rr-section { margin: 28px 0 0; }
.rr-section h2 { font-size: 22px; margin: 0 0 14px; }
.rr-specs { display: grid; grid-template-columns: 1fr 1fr; column-gap: 32px; margin: 0; }
.rr-specs > div { display: flex; justify-content: space-between; gap: 12px; padding: 11px 2px; border-bottom: 1px solid var(--rr-border); }
@media (max-width: 600px) { .rr-specs { grid-template-columns: 1fr; } }
.rr-specs dt { color: var(--rr-muted); }
.rr-specs dd { margin: 0; font-weight: 700; text-align: right; }
.rr-embed iframe { width: 100%; aspect-ratio: 16 / 9; height: auto; }
.rr-similar { margin-top: 48px; }

/* Gallery */
.rr-gallery-main { position: relative; border-radius: var(--rr-radius); overflow: hidden; background: var(--rr-dark); }
.rr-gallery-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; outline: none; }
.rr-gallery-track::-webkit-scrollbar { display: none; }
.rr-gallery-slide { flex: 0 0 100%; scroll-snap-align: start; aspect-ratio: 4 / 3; cursor: zoom-in; }
.rr-gallery-slide img { width: 100%; height: 100%; max-width: none; object-fit: contain; display: block; }
.rr-gallery-slide { min-width: 0; }
.rr-gallery-empty { aspect-ratio: 4 / 3; border-radius: var(--rr-radius); overflow: hidden; }
.rr-gallery-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 46px; height: 46px; border: 0; border-radius: 50%; background: rgba(0,0,0,.55); color: #fff; font-size: 30px; line-height: 1; cursor: pointer; }
.rr-gallery-nav.rr-prev { left: 12px; }
.rr-gallery-nav.rr-next { right: 12px; }
.rr-gallery-count { position: absolute; right: 12px; bottom: 12px; padding: 3px 10px; border-radius: 999px; background: rgba(0,0,0,.6); color: #fff; font-size: 13px; }
.rr-gallery-thumbs { display: flex; gap: 8px; margin-top: 10px; overflow-x: auto; scrollbar-width: thin; }
.rr-gallery-thumbs button { flex: 0 0 84px; height: 64px; padding: 0; border: 2px solid transparent; border-radius: 6px; overflow: hidden; background: none; cursor: pointer; opacity: .7; }
.rr-gallery-thumbs button.is-active { border-color: var(--rr-accent); opacity: 1; }
.rr-gallery-thumbs img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rr-viewer { position: fixed; inset: 0; z-index: 100000; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,.94); }
.rr-viewer img { max-width: 96vw; max-height: 92vh; object-fit: contain; }
.rr-viewer-close { position: absolute; top: 12px; right: 16px; width: 46px; height: 46px; border: 0; background: none; color: #fff; font-size: 40px; cursor: pointer; }

/* Forms */
.rr-enquiry, .rr-sell { padding: 22px; border: 1px solid var(--rr-border); border-radius: var(--rr-radius); background: #fff; }
.rr-enquiry-title { margin: 0 0 14px; font-size: 20px; }
.rr-form p { margin: 0 0 14px; }
.rr-form label { display: block; margin-bottom: 5px; font-weight: 700; font-size: 14px; }
.rr-form input[type=text], .rr-form input[type=password], .rr-form input[type=tel], .rr-form input[type=email], .rr-form input[type=number], .rr-form input[type=date], .rr-form input[type=search], .rr-form select, .rr-form textarea { width: 100%; min-height: 46px; padding: 10px 12px; border: 1px solid var(--rr-border); border-radius: var(--rr-radius); background: #fff; color: var(--rr-text); font-size: 16px; font-family: inherit; }
.rr-form textarea { min-height: 110px; }
.rr-form input[type=file] { width: 100%; padding: 10px; border: 2px dashed var(--rr-border); border-radius: var(--rr-radius); background: var(--rr-bg-soft); }
.rr-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
@media (max-width: 520px) { .rr-form-row { grid-template-columns: 1fr; } }
.rr-form fieldset { margin: 0 0 18px; padding: 0; border: 0; }
.rr-form legend { margin-bottom: 12px; font-size: 20px; font-weight: 800; }
.rr-form .rr-check label { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
.rr-form .rr-check input { margin-top: 4px; }
.rr-optional { color: var(--rr-muted); font-weight: 400; }
.rr-form .rr-btn { width: 100%; }
.rr-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
.rr-notice { padding: 14px 16px; border-radius: var(--rr-radius); margin-bottom: 14px; background: #eef4fb; color: #163b63; }
.rr-notice-ok { background: #e9f7ee; color: #14532d; }
.rr-notice-error { background: #fdecec; color: #7f1d1d; }

/* Share */
.rr-share { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--rr-border); }
.rr-share-label { display: block; margin-bottom: 8px; font-size: 13px; font-weight: 700; color: var(--rr-muted); }
.rr-share-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.rr-share-btn { display: inline-flex; align-items: center; min-height: 38px; padding: 6px 14px; border: 1px solid var(--rr-border); border-radius: 999px; background: #fff; color: var(--rr-text); font: inherit; font-size: 14px; font-weight: 700; text-decoration: none; cursor: pointer; }
.rr-share-btn:hover { border-color: currentColor; text-decoration: none; }
.rr-share-whatsapp { color: #128c4b; }
.rr-share-facebook { color: #1863dc; }
.rr-share-btn[hidden] { display: none; }

/* Rentals: badge, availability calendar, date warning */
.rr-badge-booked { background: #6b21a8; }
.rr-cal { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 18px; }
.rr-cal-month h3 { margin: 0 0 8px; font-size: 16px; }
.rr-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; text-align: center; font-size: 14px; }
.rr-cal-grid span { padding: 6px 0; border-radius: 6px; }
.rr-cal-head { font-size: 12px; font-weight: 700; color: var(--rr-muted); }
.rr-cal .is-free { background: #e8f5ec; color: #14532d; }
.rr-cal .is-booked { background: #fde2e2; color: #991b1b; text-decoration: line-through; }
.rr-cal .is-past { color: #b6bcc3; }
.rr-cal .is-today { outline: 2px solid var(--rr-dark); outline-offset: -2px; font-weight: 800; }
.rr-cal-key { display: flex; align-items: center; gap: 6px 14px; flex-wrap: wrap; margin: 12px 0 0; font-size: 14px; color: var(--rr-muted); }
.rr-cal-key span { display: inline-block; width: 14px; height: 14px; margin-right: -8px; border-radius: 3px; vertical-align: middle; }
.rr-cal-key .is-free { background: #e8f5ec; border: 1px solid #a7d7b5; }
.rr-cal-key .is-booked { background: #fde2e2; border: 1px solid #f2a7a7; }
.rr-form button:disabled { opacity: .5; cursor: not-allowed; }
.rr-notice[hidden] { display: none; }
.rr-cal .is-prep { background: repeating-linear-gradient(45deg, #f1f2f4, #f1f2f4 4px, #e4e6ea 4px, #e4e6ea 8px); color: #8a9099; }
.rr-cal-key .is-prep { background: repeating-linear-gradient(45deg, #f1f2f4, #f1f2f4 3px, #d9dce1 3px, #d9dce1 6px); border: 1px solid #c9cdd3; }
.rr-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; }
.rr-chips a { padding: 8px 16px; border: 1px solid var(--rr-border); border-radius: 999px; background: #fff; color: var(--rr-text); font-weight: 700; text-decoration: none; }
.rr-chips a span { margin-left: 4px; color: var(--rr-muted); font-weight: 600; }
.rr-chips a.is-on { background: var(--rr-dark); border-color: var(--rr-dark); color: #fff; }
.rr-chips a.is-on span { color: #c9cdd3; }
.rr-availability .rr-btn { margin-top: 14px; }

/* Customer accounts */
.rr-card { position: relative; }
.rr-fav { display: inline-flex; align-items: center; gap: 6px; color: var(--rr-text); text-decoration: none; font-weight: 700; cursor: pointer; }
.rr-fav svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; }
.rr-fav[aria-pressed="true"] svg { fill: #e11d48; stroke: #e11d48; }
.rr-fav.is-busy { opacity: .5; }
.rr-fav-card { position: absolute; top: 10px; right: 10px; width: 38px; height: 38px; justify-content: center; border-radius: 50%; background: rgba(255,255,255,.92); box-shadow: 0 1px 4px rgba(0,0,0,.2); z-index: 2; }
.rr-fav-card span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.rr-fav-wide { margin: 14px 0 0; padding: 10px 16px; border: 1px solid var(--rr-border); border-radius: var(--rr-radius); }
.rr-account .rr-archive-head { align-items: baseline; }
.rr-account-out { color: var(--rr-muted); }
.rr-account-auth { display: grid; grid-template-columns: 1fr 1.2fr; gap: 24px; align-items: start; margin-top: 10px; }
@media (max-width: 860px) { .rr-account-auth { grid-template-columns: 1fr; } }
.rr-account-card { padding: 22px; border: 1px solid var(--rr-border); border-radius: var(--rr-radius); background: #fff; }
.rr-account-card h2 { margin: 0 0 14px; font-size: 22px; }
.rr-ticks { margin: 0 0 18px; padding: 0; list-style: none; }
.rr-ticks li { position: relative; margin: 0 0 6px; padding-left: 26px; }
.rr-ticks li::before { content: "✓"; position: absolute; left: 0; color: var(--rr-ok); font-weight: 800; }
.rr-account-panel { margin-top: 6px; }
.rr-account-panel h2 { font-size: 20px; margin: 22px 0 10px; }
.rr-account-list { margin: 0; padding: 0; list-style: none; }
.rr-account-list li { display: flex; align-items: center; gap: 14px; padding: 12px; margin: 0 0 10px; border: 1px solid var(--rr-border); border-radius: var(--rr-radius); background: #fff; }
.rr-account-list li > div { flex: 1; min-width: 0; color: var(--rr-muted); font-size: 14px; }
.rr-account-list li strong { color: var(--rr-text); font-size: 16px; }
.rr-account-thumb { flex: none; width: 72px; height: 56px; border-radius: 6px; object-fit: cover; background: var(--rr-bg-soft); }
.rr-state { display: inline-block; margin-top: 4px; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 800; }
.rr-state-ok { background: #e8f5ec; color: #14532d; }
.rr-state-wait { background: #fff7e0; color: #7a5a00; }
.rr-state-off { background: var(--rr-bg-soft); color: var(--rr-muted); }
@media (max-width: 560px) { .rr-account-list li { flex-wrap: wrap; } .rr-account-list li .rr-btn { width: 100%; text-align: center; } }
.rr-alert-box { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin: 22px 0; padding: 14px 18px; border: 1px dashed var(--rr-border); border-radius: var(--rr-radius); background: var(--rr-bg-soft); }
.rr-alert-box form { margin: 0; }
