/*
Theme Name: Car For Rent
Theme URI: https://example.com/carforrent
Author: Car For Rent
Description: ธีมสำหรับเว็บเช่ารถ (car for rent) ใช้คู่กับปลั๊กอิน Car For Rent - Rental System
Version: 1.0.0
License: GNU General Public License v2 or later
Text Domain: carforrent
Tags: custom-theme, car-rental
*/

:root {
	--cfr-primary: #2563eb;
	--cfr-dark: #111827;
	--cfr-bg: #f9fafb;
}

* { box-sizing: border-box; }

body {
	margin: 0;
	font-family: "Segoe UI", "Sarabun", system-ui, sans-serif;
	color: var(--cfr-dark);
	background: #fff;
	line-height: 1.6;
}

a { color: var(--cfr-primary); }

.cfr-container {
	max-width: 1100px;
	margin: 0 auto;
	padding: 0 20px;
}

/* Header */
.cfr-site-header {
	background: rgba(17, 24, 39, .96);
	backdrop-filter: blur(8px);
	color: #fff;
	position: sticky;
	top: 0;
	z-index: 1000;
	box-shadow: 0 1px 0 rgba(255, 255, 255, .06), 0 6px 20px rgba(0, 0, 0, .18);
}
.cfr-header-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 14px 0;
}
.cfr-brand {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-size: 1.35rem;
	font-weight: 800;
	color: #fff;
	text-decoration: none;
}
.cfr-brand-mark {
	background: linear-gradient(135deg, #2563eb, #1d4ed8);
	width: 38px;
	height: 38px;
	border-radius: 10px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 1.1rem;
}

.cfr-nav {
	display: flex;
	align-items: center;
	gap: 6px;
	flex-wrap: wrap;
}
.cfr-nav a {
	color: #d1d5db;
	text-decoration: none;
	padding: 8px 12px;
	border-radius: 8px;
	font-size: .95rem;
	transition: color .12s, background .12s;
}
.cfr-nav a:hover { color: #fff; background: rgba(255, 255, 255, .08); }
.cfr-nav-cta {
	background: linear-gradient(180deg, #2563eb, #1d4ed8);
	color: #fff !important;
	font-weight: 700;
	margin-left: 6px;
}
.cfr-nav-cta:hover { background: #1d4ed8 !important; }

/* เมนูมือถือ */
.cfr-menu-burger { display: none; font-size: 1.6rem; color: #fff; cursor: pointer; user-select: none; }
@media (max-width: 820px) {
	.cfr-menu-burger { display: block; }
	.cfr-nav {
		display: none;
		width: 100%;
		flex-direction: column;
		align-items: stretch;
		gap: 2px;
		padding-top: 10px;
	}
	.cfr-menu-toggle:checked ~ .cfr-nav { display: flex; }
	.cfr-header-inner { flex-wrap: wrap; padding-left: 8px; padding-right: 8px; }
	.cfr-brand-text { font-size: 1.05rem; }
	.cfr-nav {
		margin: 8px 4px 4px;
		padding: 8px 12px;
		background: rgba(255, 255, 255, .04);
		border: 1px solid rgba(255, 255, 255, .08);
		border-radius: 12px;
	}
	.cfr-nav a { padding: 12px 14px; }
	.cfr-nav-cta { margin: 6px 0 0; text-align: center; }
}

/* เมนูผู้ใช้ (dropdown จากชื่อผู้ใช้) */
.cfr-user-menu { position: relative; }
.cfr-user-menu > summary {
	list-style: none;
	cursor: pointer;
	color: #d1d5db;
	padding: 8px 12px;
	border-radius: 8px;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: .95rem;
	border: 1px solid rgba(255, 255, 255, .14);
	transition: color .12s, background .12s;
}
.cfr-user-menu > summary::-webkit-details-marker { display: none; }
.cfr-user-menu > summary::after { content: "▾"; font-size: .75rem; opacity: .75; }
.cfr-user-menu > summary:hover,
.cfr-user-menu[open] > summary { color: #fff; background: rgba(255, 255, 255, .1); }
.cfr-user-ava { font-size: 1.05rem; }
.cfr-user-name { font-weight: 600; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cfr-user-drop {
	position: absolute;
	right: 0;
	top: calc(100% + 8px);
	min-width: 230px;
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 12px;
	box-shadow: 0 14px 34px rgba(0, 0, 0, .18);
	padding: 6px;
	z-index: 200;
	display: flex;
	flex-direction: column;
}
.cfr-user-drop a {
	color: #111827 !important;
	background: none;
	padding: 11px 12px;
	border-radius: 8px;
	font-size: .92rem;
	text-decoration: none;
	white-space: nowrap;
}
.cfr-user-drop a:hover { background: var(--cfr-bg); }
.cfr-user-drop .cfr-user-logout { color: #dc2626 !important; border-top: 1px solid #f1f5f9; margin-top: 4px; padding-top: 12px; }
@media (max-width: 820px) {
	.cfr-user-menu { width: 100%; }
	.cfr-user-menu > summary { justify-content: space-between; }
	.cfr-user-drop { position: static; min-width: 0; box-shadow: none; margin-top: 6px; border-radius: 10px; }
}

/* Hero */
.cfr-hero {
	background: linear-gradient(135deg, #1e3a8a, #2563eb);
	color: #fff;
	padding: 64px 0;
	text-align: center;
}
.cfr-hero h1 { font-size: 2.4rem; margin: 0 0 12px; }
.cfr-hero p { font-size: 1.1rem; opacity: .9; }

/* Content */
.cfr-main { padding: 40px 0; }

/* Single car */
.cfr-car-single { display: grid; grid-template-columns: 1fr 420px; gap: 40px; }
.cfr-car-single img { width: 100%; border-radius: 12px; }
.cfr-car-meta { list-style: none; padding: 0; }
.cfr-car-meta li { padding: 8px 0; border-bottom: 1px solid #eee; }

/* Footer */
.cfr-site-footer {
	background: var(--cfr-dark);
	color: #9ca3af;
	margin-top: 56px;
}
.cfr-footer-grid {
	display: grid;
	grid-template-columns: 2fr 1fr 1fr 1.4fr;
	gap: 32px;
	padding: 48px 20px;
}
.cfr-footer-brand { font-size: 1.3rem; font-weight: 800; color: #fff; margin-bottom: 12px; }
.cfr-footer-about p { line-height: 1.7; max-width: 320px; }
.cfr-footer-col h4 { color: #fff; font-size: 1rem; margin: 0 0 14px; }
.cfr-footer-col ul { list-style: none; padding: 0; margin: 0; }
.cfr-footer-col li { margin: 8px 0; }
.cfr-footer-col a { color: #9ca3af; text-decoration: none; transition: color .12s; }
.cfr-footer-col a:hover { color: #fff; }
.cfr-footer-contact li { color: #cbd5e1; }
.cfr-footer-bottom {
	border-top: 1px solid rgba(255, 255, 255, .08);
	padding: 18px 0;
	text-align: center;
	font-size: .88rem;
	color: #6b7280;
}

@media (max-width: 800px) {
	.cfr-car-single { grid-template-columns: 1fr; }
	.cfr-footer-grid { grid-template-columns: 1fr 1fr; gap: 24px; padding: 32px 20px; }
}
@media (max-width: 480px) {
	.cfr-footer-grid { grid-template-columns: 1fr; }
}
