/* ctv-theme.css — cweb.bosscar.co (dev template ตัวที่ 3)
 * ดีไซน์ตามแนว ctv1999.com: ส้ม #e57632 บนพื้นเข้ม #22292d, input เข้ม, Kanit
 * โหลดท้าย css/bootstrap.css (BS3) — override ด้วย specificity, !important เฉพาะจุดจำเป็น
 * ห้ามคัดลอก CSS/asset ของ ctv1999 มาโดยตรง — ได้แรงบันดาลใจ layout/สี/ฟอนต์เท่านั้น
 */

:root {
  --ctv-orange: #e57632;
  --ctv-orange-hover: #f25720;
  --ctv-dark: #22292d;
  --ctv-header: #333333;
  --ctv-input: #353c40;
  --ctv-body: #666666;
  --ctv-bg: #f4f4f4;
  --ctv-border: #e5e5e5;
  --ctv-green: #2dda8f;
  --ctv-blue: #36a5d9;
  --ctv-red: #e36060;
}

/* ── base ─────────────────────────────────────────────── */
body {
  font-family: 'Kanit', Helvetica, Arial, sans-serif;
  font-weight: 300;
  color: var(--ctv-body);
  background: #fff;
  padding-top: 0; /* topbar + nav ยึดบน */
}
h1, h2, h3, h4, h5, h6 { font-family: 'Kanit', Helvetica, Arial, sans-serif; color: var(--ctv-dark); font-weight: 500; }
a { color: var(--ctv-orange); }
a:hover, a:focus { color: var(--ctv-orange-hover); text-decoration: none; }
img { max-width: 100%; }

.ctv-container { max-width: 1200px; }

/* หัว section + เส้นคั่นส้ม */
.ctv-section { padding: 34px 0; background: #fff; }
.ctv-section-alt { background: var(--ctv-bg); }
.ctv-section-title { text-align: center; margin-bottom: 22px; }
.ctv-section-title h2 { font-size: 24px; font-weight: 500; margin: 0; }
.uni-divider { display: block; width: 44px; height: 3px; background: var(--ctv-orange); margin: 10px auto 0; }

/* ── topbar (LINE / โทร / ที่ตั้ง) ─────────────────────── */
.ctv-topbar { background: var(--ctv-dark); color: #cfd6da; font-size: 13px; padding: 5px 0; }
.ctv-topbar a { color: #fff; }
.ctv-topbar .ctv-topbar-item { display: inline-block; margin-right: 18px; }
.ctv-topbar .fa { color: var(--ctv-orange); margin-right: 6px; }

/* ── header / nav หลัก (sticky #333) ─────────────────── */
.ctv-nav {
  background: var(--ctv-header);
  border: 0;
  border-radius: 0;
  margin: 0;
  min-height: 66px;
  border-bottom: 3px solid var(--ctv-orange);
}
.ctv-nav .navbar-nav { margin: 0 auto; }
.ctv-nav .navbar-nav > li > a {
  color: #e8e8e8;
  font-size: 15px;
  font-weight: 400;
  line-height: 36px;
  padding: 15px 18px;
}
.ctv-nav .navbar-nav > li > a:hover,
.ctv-nav .navbar-nav > li.active > a,
.ctv-nav .navbar-nav > li > a:focus {
  color: #fff;
  background: transparent;
  border-bottom: 3px solid var(--ctv-orange);
}
.ctv-nav .navbar-toggle { border-color: #777; }
.ctv-nav .navbar-toggle .icon-bar { background: #fff; }
.ctv-nav .navbar-collapse, .ctv-nav .navbar-form { border-color: #444; }
/* โลโก้ text (Kanit) — เปลี่ยนเป็นรูปได้ภายหลัง */
.ctv-logo {
  font-size: 24px;
  font-weight: 600;
  color: #fff !important;
  line-height: 36px;
  padding: 15px 15px;
  display: inline-block;
}
.ctv-logo span { color: var(--ctv-orange); }
.ctv-logo:hover, .ctv-logo:focus { color: #fff; }

/* ── hero carousel ────────────────────────────────────── */
.ctv-hero { background: var(--ctv-dark); }
.ctv-hero .carousel-inner > .item > img { width: 100%; height: 480px; object-fit: cover; }
.ctv-hero .carousel-caption {
  left: 0; right: 0; bottom: 60px;
  text-shadow: 0 2px 6px rgba(0,0,0,.7);
}
.ctv-hero .carousel-caption h2 { color: #fff; font-size: 30px; font-weight: 500; }
@media (max-width: 767px) {
  .ctv-hero .carousel-inner > .item > img { height: 260px; }
  .ctv-hero .carousel-caption h2 { font-size: 18px; }
}

/* ── แถบค้นหาเข้ม ช้อนทับ hero ─────────────────────────── */
.ctv-search {
  position: relative;
  z-index: 5;
  margin: -64px auto 0;
  max-width: 1140px;
  background: var(--ctv-dark);
  padding: 20px 22px 22px;
  border-radius: 6px;
  box-shadow: 0 10px 26px rgba(0,0,0,.28);
}
.ctv-search h3 { color: #fff; font-size: 18px; font-weight: 400; margin: 0 0 4px; }
.ctv-search .ctv-count-badge {
  display: inline-block;
  background: var(--ctv-orange);
  color: #fff;
  border-radius: 3px;
  font-size: 13px;
  font-weight: 400;
  padding: 3px 10px;
  margin-bottom: 12px;
}
.ctv-search .form-control,
.ctv-search select,
.ctv-search input[type=text] {
  height: 46px;
  background: var(--ctv-input);
  border: 1px solid #454d52;
  border-radius: 4px;
  color: #fff;
  font-family: 'Kanit', sans-serif;
  font-weight: 300;
  font-size: 14px;
  padding: 6px 12px;
  -webkit-appearance: none; appearance: none;
  box-shadow: none;
}
.ctv-search select {
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23aab4ba' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 14px;
  padding-right: 30px;
}
.ctv-search .form-control:focus, .ctv-search select:focus, .ctv-search input:focus {
  border-color: var(--ctv-orange);
  box-shadow: 0 0 0 1px var(--ctv-orange);
  background: var(--ctv-input);
  color: #fff;
}
.ctv-search select option { background: var(--ctv-dark); color: #fff; }
.ctv-search ::-webkit-input-placeholder { color: #9aa4aa; }
.ctv-search .btn-ctv-search {
  height: 46px;
  width: 100%;
  background: var(--ctv-orange);
  color: #fff;
  font-family: 'Kanit', sans-serif;
  font-weight: 400;
  font-size: 16px;
  border: 0;
  border-radius: 4px;
}
.ctv-search .btn-ctv-search:hover { background: var(--ctv-orange-hover); }
@media (max-width: 767px) { .ctv-search { margin: -40px 12px 0; } }

/* ── ตารางโลโก้ยี่ห้อ ──────────────────────────────────── */
.ctv-brands { background: #fff; padding: 26px 0 34px; }
.ctv-brand-box {
  background: #fff;
  border: 1px solid #eee;
  border-top: 3px solid transparent;
  border-radius: 4px;
  padding: 12px 6px;
  margin-bottom: 14px;
  text-align: center;
  transition: border-color .15s ease;
}
.ctv-brand-box:hover { border-top-color: var(--ctv-orange); }
.ctv-brand-box img { max-height: 42px; max-width: 84px; opacity: .85; }
.ctv-brand-box:hover img { opacity: 1; }

/* ── การ์ดรถ (grid) ───────────────────────────────────── */
.ctv-cars .row > div { margin-bottom: 26px; }
.ctv-item {
  background: #fff;
  border: 1px solid var(--ctv-border);
  border-radius: 5px;
  overflow: hidden;
  transition: box-shadow .18s ease, transform .18s ease;
}
.ctv-item:hover { box-shadow: 0 8px 22px rgba(34,41,45,.14); transform: translateY(-2px); }
.ctv-item-img { position: relative; overflow: hidden; background: #eceff0; }
.ctv-item-img img { width: 100%; height: 200px; object-fit: cover; display: block; }
.ctv-item-img-caption {
  position: absolute; left: 0; bottom: 0;
  background: rgba(229,118,50,.92);
  color: #fff;
  font-size: 16px;
  font-weight: 500;
  padding: 6px 14px;
  border-top-right-radius: 4px;
}
.ctv-item-status {
  position: absolute; top: 10px; right: 10px;
  font-size: 12px; font-weight: 400;
  color: #fff; padding: 2px 10px; border-radius: 3px;
}
.ctv-item-info { padding: 14px 16px 16px; }
.ctv-item-info h3 {
  font-size: 16px;
  font-weight: 500;
  margin: 0 0 6px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ctv-item-info h3 a { color: var(--ctv-dark); }
.ctv-item-info h3 a:hover { color: var(--ctv-orange); }
.ctv-item-divider { width: 40px; height: 2px; background: var(--ctv-orange); margin: 0 0 10px; }
.ctv-item-spec { list-style: none; padding: 0; margin: 0 0 8px; font-size: 13px; color: var(--ctv-body); }
.ctv-item-spec li { margin-bottom: 4px; }
.ctv-item-spec .fa { color: var(--ctv-orange); width: 18px; text-align: center; margin-right: 6px; }
.ctv-item-meta { font-size: 12.5px; color: #999; border-top: 1px solid #f0f0f0; padding-top: 8px; }

/* ผลค้นหาไม่พบ */
.ctv-notfound { text-align: center; color: var(--ctv-red); padding: 30px 0; font-size: 16px; }

/* ── CTA ขายรถ ─────────────────────────────────────────── */
.ctv-cta { background: var(--ctv-dark); color: #cfd6da; text-align: center; padding: 40px 20px; }
.ctv-cta h2 { color: #fff; font-size: 24px; font-weight: 500; margin: 0 0 6px; }
.ctv-cta p { margin-bottom: 16px; }
.ctv-btn-orange {
  display: inline-block;
  background: var(--ctv-orange);
  color: #fff;
  font-weight: 400;
  font-size: 15px;
  padding: 10px 26px;
  border-radius: 4px;
  border: 0;
}
.ctv-btn-orange:hover, .ctv-btn-orange:focus { background: var(--ctv-orange-hover); color: #fff; }

/* ── section FB (แทนที่ branches ของต้นแบบ) ───────────── */
.ctv-fb { padding: 30px 0; }

/* ── ภาพรับรถ (review) ────────────────────────────────── */
.ctv-review-grid img {
  width: 100%; height: 220px; object-fit: cover;
  border-radius: 5px; border: 1px solid var(--ctv-border);
  margin-bottom: 14px;
}

/* ── หน้ารถ (car_detail) ──────────────────────────────── */
.ctv-detail { background: #fff; border: 1px solid var(--ctv-border); border-radius: 5px; padding: 22px; margin-top: 24px; }
.ctv-detail h1 { font-size: 22px; margin: 0 0 4px; }
.ctv-detail-price { font-size: 26px; font-weight: 600; color: var(--ctv-orange); margin: 4px 0 12px; }
.ctv-detail-spec { width: 100%; font-size: 14px; }
.ctv-detail-spec th { width: 130px; font-weight: 400; color: #999; text-align: left; padding: 6px 8px 6px 0; vertical-align: top; }
.ctv-detail-spec td { padding: 6px 0; color: var(--ctv-dark); }
.ctv-detail h3.ctv-h3 { font-size: 18px; border-left: 4px solid var(--ctv-orange); padding-left: 10px; margin: 22px 0 10px; }
.ctv-feature-text { line-height: 1.9; font-size: 14px; }

/* gallery: รูปหลัก + แถว thumbnail */
.ctv-gallery .carousel-inner > .item > img { width: 100%; height: 460px; object-fit: cover; border-radius: 5px; background: #eceff0; }
.ctv-gallery-thumbs { margin-top: 10px; }
.ctv-gallery-thumbs img {
  width: 100%; height: 68px; object-fit: cover;
  border: 2px solid transparent; border-radius: 4px; cursor: pointer; opacity: .75;
}
.ctv-gallery-thumbs .active img, .ctv-gallery-thumbs img:hover { border-color: var(--ctv-orange); opacity: 1; }
@media (max-width: 767px) { .ctv-gallery .carousel-inner > .item > img { height: 240px; } }

/* ตัวคำนวณค่างวด */
.ctv-calc { background: var(--ctv-dark); color: #cfd6da; border-radius: 5px; padding: 20px 22px; margin-top: 22px; }
.ctv-calc h3 { color: #fff; font-size: 17px; margin: 0 0 14px; }
.ctv-calc .radio-inline { color: #fff; font-weight: 300; }
.ctv-calc .radio-inline input[type=radio] { accent-color: var(--ctv-orange); }
.ctv-calc select {
  height: 40px; width: 100%;
  background: var(--ctv-input); color: #fff;
  border: 1px solid #454d52; border-radius: 4px;
  font-family: 'Kanit', sans-serif; padding: 4px 10px;
}
.ctv-calc .ctv-calc-result {
  background: rgba(229,118,50,.12);
  border: 1px dashed var(--ctv-orange);
  border-radius: 5px;
  padding: 12px 16px;
  margin-top: 14px;
  text-align: center;
}
.ctv-calc .ctv-calc-result .ctv-monthly { color: var(--ctv-orange); font-size: 28px; font-weight: 600; }
.ctv-calc .ctv-calc-note { font-size: 12px; color: #98a1a7; margin-top: 8px; }
.ctv-detail-contact { margin-top: 18px; }
.ctv-detail-contact .ctv-btn-orange { margin-right: 10px; margin-bottom: 10px; }

/* ── footer ────────────────────────────────────────────── */
.ctv-footer { background: var(--ctv-dark); color: #aab4ba; padding: 40px 0 0; margin-top: 30px; }
.ctv-footer h4 { color: #fff; font-size: 17px; font-weight: 500; margin: 0 0 16px; }
.ctv-footer h4 span { color: var(--ctv-orange); }
.ctv-footer a { color: #cfd6da; }
.ctv-footer a:hover { color: var(--ctv-orange); }
.ctv-footer ul { list-style: none; padding: 0; margin: 0; font-size: 14px; }
.ctv-footer ul li { margin-bottom: 8px; }
.ctv-footer .fa { color: var(--ctv-orange); width: 20px; }
.ctv-footer .ctv-footer-bottom {
  border-top: 1px solid #31383c;
  text-align: center;
  font-size: 13px;
  padding: 14px 0;
  margin-top: 30px;
}

/* ── ปุ่มแชตลอยตัว + pulse ─────────────────────────────── */
.ctv-chat-fab {
  position: fixed; right: 20px; bottom: 20px;
  width: 56px; height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f25720, #e55317);
  color: #fff; font-size: 24px;
  text-align: center; line-height: 56px;
  z-index: 9999;
  box-shadow: 0 6px 18px rgba(229,118,50,.45);
}
.ctv-chat-fab:hover, .ctv-chat-fab:focus { color: #fff; }
.ctv-chat-fab::before {
  content: "";
  position: absolute; left: -6px; top: -6px;
  width: 68px; height: 68px;
  border-radius: 50%;
  border: 2px solid rgba(242,87,32,.55);
  animation: ctv-pulse 2s infinite;
}
@keyframes ctv-pulse {
  0%   { transform: scale(.9); opacity: .8; }
  70%  { transform: scale(1.45); opacity: 0; }
  100% { transform: scale(1.45); opacity: 0; }
}

/* modal ติดต่อ (โทร/LINE/FB) */
.ctv-chat-modal .modal-content { border-radius: 8px; }
.ctv-chat-modal .modal-header { background: var(--ctv-dark); color: #fff; border-radius: 7px 7px 0 0; border: 0; }
.ctv-chat-modal .modal-title { font-weight: 400; }
.ctv-chat-modal .close { color: #fff; opacity: .9; text-shadow: none; }
.ctv-chat-channel {
  display: block;
  border: 1px solid var(--ctv-border);
  border-radius: 5px;
  padding: 14px 16px;
  margin-bottom: 10px;
  color: var(--ctv-dark);
  font-size: 15px;
}
.ctv-chat-channel:hover { border-color: var(--ctv-orange); color: var(--ctv-dark); }
.ctv-chat-channel .fa { width: 26px; font-size: 18px; color: var(--ctv-orange); }

/* ── หน้า static (contact/branch/about) ────────────────── */
.ctv-page { background: #fff; border: 1px solid var(--ctv-border); border-radius: 5px; padding: 26px; margin: 24px 0; }
.ctv-page h1 { font-size: 22px; margin-top: 0; }
.ctv-page h1 span { color: var(--ctv-orange); }
.ctv-contact-table { width: 100%; font-size: 15px; }
.ctv-contact-table td { padding: 8px 10px 8px 0; vertical-align: top; }
.ctv-contact-table .fa { color: var(--ctv-orange); width: 24px; }
.ctv-map-frame { width: 100%; height: 380px; border: 1px solid var(--ctv-border); border-radius: 5px; }
.ctv-placeholder-card {
  border: 1px dashed #d5dbde;
  border-radius: 5px;
  min-height: 150px;
  text-align: center;
  padding: 30px 16px;
  color: #9aa4aa;
  background: #fafbfb;
}
