/* =========================================================
   Goodly Pool Villa — Villa detail page template styles
   (สกัดจาก villas/terra-house/ เพื่อใช้ร่วมกับหน้า /villas/view/)
   ========================================================= */
/* ── Design Tokens (match main site) ── */
    :root {
      --cream: #f7f1e8;
      --cream-2: #efe6d6;
      --sand: #e8dcc6;
      --beige: #d9c7a8;
      --tan: #b89b71;
      --brown: #8a6d45;
      --brown-deep: #5e4a2e;
      --espresso: #2e2419;
      --gold: #bd9b67;
      --bg: #faf7f1;
      --bg-soft: #f3ece0;
      --surface: #ffffff;
      --text: #2c2419;
      --text-soft: #5c5345;
      --text-muted: #8a8073;
      --line: #e6ddcd;
      --sh-sm: 0 4px 14px rgba(46,36,25,.06);
      --sh: 0 14px 40px rgba(46,36,25,.10);
      --sh-lg: 0 30px 70px rgba(46,36,25,.16);
    }
    *, *::before, *::after { box-sizing: border-box; }
    body { font-family: 'Kanit', sans-serif; background: var(--bg); color: var(--text); margin: 0; }

    /* ── Breadcrumb ── */
    .detail-breadcrumb {
      background: var(--surface); border-bottom: 1px solid var(--line);
      padding: 12px 0;
    }
    .detail-breadcrumb .bc-inner {
      max-width: 1200px; margin: 0 auto; padding: 0 24px;
      display: flex; align-items: center; gap: 8px;
      font-size: .85rem; color: #666;
    }
    .detail-breadcrumb a { color: #b89b71; text-decoration: none; }
    .detail-breadcrumb a:hover { text-decoration: underline; }
    .detail-breadcrumb .sep { color: #ccc; }

    /* ── Header ── */
    .detail-header {
      background: #fff; padding: 24px 0 0;
    }
    .detail-header .dh-inner {
      max-width: 1200px; margin: 0 auto; padding: 0 24px;
    }
    .detail-header h1 {
      font-size: 1.9rem; font-weight: 600;
      margin: 0 0 10px; color: var(--espresso);
    }
    .dh-meta {
      display: flex; align-items: center; gap: 16px;
      flex-wrap: wrap; margin-bottom: 16px;
    }
    .dh-tag {
      background: var(--cream-2); color: var(--brown);
      border-radius: 6px; padding: 3px 10px;
      font-size: .8rem; font-weight: 500;
    }
    .dh-rating {
      display: flex; align-items: center; gap: 4px;
      font-size: .88rem; color: var(--text-soft);
    }
    .dh-rating svg { color: var(--gold); width: 15px; height: 15px; }
    .dh-rating a { color: var(--brown); text-decoration: underline; }
    .dh-loc { display: flex; align-items: center; gap: 4px; font-size: .88rem; color: var(--text-muted); white-space: nowrap; }
    .dh-share {
      margin-left: auto;
      background: none; border: 1px solid var(--line); border-radius: 8px;
      padding: 6px 14px; cursor: pointer; font-size: .85rem; color: var(--text-soft);
      display: flex; align-items: center; gap: 6px;
    }
    .dh-share:hover { background: var(--cream); }

    /* ── Photo Gallery ── */
    .photo-gallery {
      background: #fff; padding: 0 24px 24px;
    }
    .photo-gallery .pg-inner {
      max-width: 1200px; margin: 0 auto;
    }
    .gallery-filters { display: flex; gap: 6px; margin-bottom: 12px; overflow-x: auto; padding-bottom: 4px; }
    .gallery-filters::-webkit-scrollbar { display: none; }
    .filter-btn { background: var(--surface); border: 1px solid var(--line); border-radius: 99px; padding: 4px 10px; font-size: .78rem; font-family: inherit; color: var(--text-soft); cursor: pointer; white-space: nowrap; transition: all .2s; }
    .filter-btn.active, .filter-btn:hover { background: var(--brown); color: #fff; border-color: var(--brown); }
    .gallery-grid {
      display: grid;
      grid-template-columns: 1fr 1fr;
      grid-template-rows: 220px 220px;
      gap: 8px;
      border-radius: 16px; overflow: hidden;
      position: relative;
    }
    .gallery-grid .g-main {
      grid-row: span 2;
    }
    .gallery-grid .g-right {
      display: grid;
      grid-template-columns: 1fr 1fr;
      grid-template-rows: 220px 220px;
      gap: 8px;
    }
    .gallery-item {
      position: relative; overflow: hidden; background: #eee; cursor: pointer;
    }
    .gallery-item img {
      width: 100%; height: 100%; object-fit: cover;
      transition: transform .4s ease;
    }
    .gallery-item:hover img { transform: scale(1.04); }
    .gallery-item.placeholder {
      background: #e8e8e8; display: flex; align-items: center; justify-content: center;
      flex-direction: column; gap: 8px; color: #aaa; cursor: default;
    }
    .gallery-item.placeholder svg { width: 40px; height: 40px; opacity: .4; }
    .gallery-item.placeholder span { font-size: .8rem; }
    .gallery-item.is-video-thumb::after {
      content: '▶';
      position: absolute; inset: 0;
      display: flex; align-items: center; justify-content: center;
      font-size: 2.5rem; color: #fff;
      background: rgba(0,0,0,.3);
      transition: background .2s;
    }
    .gallery-item.is-video-thumb:hover::after { background: rgba(0,0,0,.45); }
    .gallery-show-all {
      position: absolute; bottom: 16px; right: 16px;
      background: #fff; border: 1.5px solid #ddd;
      border-radius: 10px; padding: 8px 16px;
      font-size: .85rem; font-weight: 500; color: #333;
      cursor: pointer; display: flex; align-items: center; gap: 8px;
      box-shadow: 0 2px 8px rgba(0,0,0,.12);
    }
    .gallery-show-all:hover { background: #f5f5f5; }

    /* ── Lightbox ── */
    .lightbox {
      position: fixed; inset: 0; z-index: 9999;
      background: rgba(0,0,0,.8);
      display: none; align-items: center; justify-content: center;
    }
    .lightbox.is-open { display: flex; }
    .lb-img { max-width: 90vw; max-height: 85vh; border-radius: 12px; object-fit: contain; }
    .lb-close {
      position: absolute; top: 20px; right: 28px;
      background: rgba(255,255,255,.15); border: none; border-radius: 50%;
      width: 44px; height: 44px; color: #fff; font-size: 1.3rem; cursor: pointer;
    }
    .lb-nav {
      position: absolute; top: 50%; transform: translateY(-50%);
      background: rgba(255,255,255,.15); border: none; border-radius: 50%;
      width: 48px; height: 48px; color: #fff; font-size: 1.4rem; cursor: pointer;
    }
    .lb-nav.prev { left: 20px; }
    .lb-nav.next { right: 20px; }
    .lb-nav:hover, .lb-close:hover { background: rgba(255,255,255,.25); }

    /* ── Main 2-column Layout ── */
    .detail-main {
      max-width: 1200px; margin: 28px auto 60px;
      padding: 0 24px;
      display: grid;
      grid-template-columns: 1fr 360px;
      gap: 32px;
      align-items: start;
    }

    /* ── LEFT: content ── */
    .detail-content { background: #fff; border-radius: 16px; padding: 0; overflow: hidden; }

    /* Info box */
    .info-box {
      background: linear-gradient(135deg, #cfae82 0%, #dfc39a 100%);
      border-bottom: 1px solid #cfae82;
      padding: 20px 28px;
    }
    .info-box h2 {
      font-size: 1.05rem; font-weight: 600; margin: 0 0 14px; color: var(--espresso);
      display: flex; align-items: center; gap: 10px;
    }
    .info-box h2 .ib-icon {
      width: 36px; height: 36px; background: rgba(255,255,255,0.45); border-radius: 10px;
      display: flex; align-items: center; justify-content: center;
    }
    .info-box h2 .ib-icon svg { width: 20px; height: 20px; color: var(--espresso); }
    .ib-stats {
      display: flex; gap: 24px; flex-wrap: wrap;
    }
    .ib-stat {
      display: flex; align-items: center; gap: 7px;
      font-size: .88rem; color: var(--espresso);
    }
    .ib-stat .stat-ico {
      width: 28px; height: 28px; background: rgba(255,255,255,0.45); border-radius: 7px;
      display: flex; align-items: center; justify-content: center;
      box-shadow: 0 1px 4px rgba(0,0,0,.08);
    }
    .ib-stat .stat-ico svg { width: 16px; height: 16px; color: var(--espresso); }

    /* Section wrapper */
    .dc-section { padding: 24px 28px; border-bottom: 1px solid #f0f0f0; }
    .dc-section:last-child { border-bottom: none; }
    .dc-section h3 {
      font-size: 1.1rem; font-weight: 600; margin: 0 0 16px; color: #1a1a2e;
    }
    .dc-section p { font-size: .9rem; line-height: 1.75; color: #555; margin: 0 0 12px; }

    /* Feature list */
    .feature-list { list-style: none; margin: 0; padding: 0; }
    .feature-list li {
      font-size: .88rem; color: #444; padding: 5px 0;
      display: flex; align-items: flex-start; gap: 6px; line-height: 1.5;
    }

    /* Amenity grid */
    .amenity-grid {
      display: grid;
      grid-template-columns: repeat(2, 1fr);
      gap: 10px;
    }
    .amenity-card {
      border: 1.5px solid #e8e8e8; border-radius: 12px;
      padding: 14px 16px;
      display: flex; align-items: center; gap: 12px;
      font-size: .88rem; color: #333; font-weight: 500;
      transition: border-color .2s, background .2s;
    }
    .amenity-card:hover { border-color: #b89b71; background: #f7f1e8; }
    .amenity-card .ac-ico {
      width: 40px; height: 40px; background: #f7f1e8; border-radius: 10px;
      display: flex; align-items: center; justify-content: center; flex-shrink: 0;
    }
    .amenity-card .ac-ico svg { width: 22px; height: 22px; color: #b89b71; }

    /* ── Video Section ── */
    .video-section { padding: 24px 28px; border-bottom: 1px solid #f0f0f0; }
    .video-section h3 { font-size: 1.1rem; font-weight: 600; margin: 0 0 16px; color: #1a1a2e; }
    .video-wrapper {
      position: relative; padding-bottom: 56.25%;
      border-radius: 14px; overflow: hidden; background: #000;
    }
    .video-wrapper iframe,
    .video-wrapper .video-placeholder {
      position: absolute; inset: 0; width: 100%; height: 100%; border: none;
    }
    .video-placeholder {
      display: flex; flex-direction: column; align-items: center; justify-content: center;
      background: linear-gradient(135deg, #1a1a2e, #2a2a4e);
      color: #fff; gap: 14px; cursor: pointer; border-radius: 14px;
    }
    .video-placeholder .vp-icon {
      width: 68px; height: 68px; background: #e53935; border-radius: 50%;
      display: flex; align-items: center; justify-content: center;
      box-shadow: 0 4px 20px rgba(229,57,53,.4);
      transition: transform .2s, box-shadow .2s;
    }
    .video-placeholder:hover .vp-icon { transform: scale(1.1); box-shadow: 0 8px 28px rgba(229,57,53,.5); }
    .video-placeholder .vp-icon svg { width: 30px; height: 30px; color: #fff; margin-left: 4px; }
    .video-placeholder .vp-title { font-size: .95rem; font-weight: 500; opacity: .9; }
    .video-placeholder .vp-sub { font-size: .78rem; opacity: .6; }
    .video-input-box {
      margin-top: 14px; padding: 14px 16px;
      background: #f7f8fa; border-radius: 12px; border: 1.5px dashed #ccc;
    }
    .video-input-box label { font-size: .8rem; color: #888; display: block; margin-bottom: 6px; }
    .video-input-box input {
      width: 100%; padding: 8px 12px; border: 1.5px solid #ddd; border-radius: 8px;
      font-size: .85rem; font-family: inherit; color: #333;
      outline: none; transition: border-color .2s;
    }
    .video-input-box input:focus { border-color: #b89b71; }
    .video-input-box .vin-btn {
      margin-top: 8px; background: #b89b71; color: #fff; border: none;
      padding: 8px 18px; border-radius: 8px; font-family: inherit;
      font-size: .85rem; cursor: pointer;
    }
    .video-input-box .vin-btn:hover { background: #8a6d45; }

    /* Nearby grid */
    .nearby-grid {
      display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
      margin-top: 16px;
    }
    .nearby-card {
      border: 1.5px solid #e8e8e8; border-radius: 12px;
      padding: 12px 14px;
      display: flex; align-items: flex-start; gap: 10px;
      font-size: .83rem; transition: border-color .2s;
    }
    .nearby-card:hover { border-color: #b89b71; }
    .nearby-card .nc-ico {
      width: 34px; height: 34px; background: #f7f1e8; border-radius: 8px;
      display: flex; align-items: center; justify-content: center; flex-shrink: 0;
    }
    .nearby-card .nc-ico svg { width: 17px; height: 17px; color: #b89b71; }
    .nearby-card .nc-name { font-weight: 500; color: #333; line-height: 1.3; }
    .nearby-card .nc-dist { color: #888; font-size: .78rem; margin-top: 2px; }

    /* Rules */
    .rules-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
    .rules-col h4 { font-size: .9rem; font-weight: 600; margin: 0 0 12px; color: #1a1a2e; }
    .rules-list { list-style: none; margin: 0; padding: 0; }
    .rules-list li {
      font-size: .83rem; color: #555; padding: 5px 0;
      display: flex; align-items: flex-start; gap: 7px; line-height: 1.5;
    }
    .rules-list li .rl-ico { width: 16px; height: 16px; flex-shrink: 0; margin-top: 1px; }
    .cancel-list { list-style: none; margin: 0; padding: 0; }
    .cancel-list li {
      font-size: .83rem; color: #555; padding: 6px 0;
      display: flex; gap: 8px; line-height: 1.5; border-bottom: 1px solid #f0f0f0;
    }
    .cancel-list li:last-child { border-bottom: none; }

    /* ── RIGHT: Booking Sidebar ── */
    .booking-sidebar {
      position: sticky; top: 90px;
    }
    .bs-card {
      background: #fff; border-radius: 16px; padding: 24px;
      box-shadow: 0 4px 24px rgba(0,0,0,.10);
    }
    .bs-price {
      font-size: 1.6rem; font-weight: 700; color: #1a1a2e; margin-bottom: 4px;
    }
    .bs-price span { font-size: .95rem; font-weight: 400; color: #888; }
    .bs-pricing-list { margin: 14px 0; padding: 0; list-style: none; }
    .bs-pricing-list li {
      display: flex; align-items: flex-start; gap: 8px;
      font-size: .82rem; color: #444; padding: 5px 0;
    }
    .bs-pricing-list .bp-check {
      width: 16px; height: 16px; background: #b89b71; border-radius: 50%;
      display: flex; align-items: center; justify-content: center; flex-shrink: 0; margin-top: 1px;
    }
    .bs-pricing-list .bp-check svg { width: 10px; height: 10px; color: #fff; }
    .bs-divider { height: 1px; background: #f0f0f0; margin: 16px 0; }

    /* Mini Calendar */
    .bs-cal-label {
      font-size: .82rem; font-weight: 600; color: #1a1a2e; margin-bottom: 10px;
      display: flex; align-items: center; gap: 6px;
    }
    .bs-cal-label svg { width: 15px; height: 15px; color: #b89b71; }
    .bs-cal-label .cal-month-nav { margin-left: auto; display: flex; align-items: center; font-size: .88rem; font-weight: 600; color: var(--espresso); }
    .bs-cal-label .cal-month-nav button { background: none; border: none; font-size: 1rem; cursor: pointer; color: var(--text-muted); padding: 0 6px; line-height: 1; }
    .mini-cal { width: 100%; border-collapse: collapse; font-size: .8rem; table-layout: fixed; }
    .mini-cal caption {
      font-weight: 600; font-size: .88rem; color: #1a1a2e;
      padding: 6px 0 10px;
      display: flex; align-items: center; justify-content: space-between;
    }
    .mini-cal caption button {
      background: none; border: none; font-size: 1rem; cursor: pointer; color: #666; padding: 0 6px;
    }
    .mini-cal th { color: #999; font-weight: 400; padding: 4px 0; text-align: center; }
    .mini-cal td {
      text-align: center; padding: 5px 2px; border-radius: 6px; cursor: pointer;
      transition: background .15s;
    }
    .mini-cal td:hover:not(.disabled) { background: #f7f1e8; color: #b89b71; }
    .mini-cal td.today { font-weight: 700; color: #b89b71; }
    .mini-cal td.selected { background: #b89b71; color: #fff; border-radius: 6px; }
    .mini-cal td.has-price { position: relative; }
    .mini-cal td.has-price .day-price {
      display: block; font-size: .6rem; color: #b89b71; line-height: 1;
    }
    .mini-cal td.disabled { color: #ddd; cursor: default; }
    .cal-legend {
      display: flex; gap: 12px; margin-top: 10px;
      font-size: .73rem; color: #888;
    }
    .cal-legend .cl-dot {
      width: 10px; height: 10px; border-radius: 2px; display: inline-block; margin-right: 3px;
    }
    .cl-selected { background: #b89b71; }
    .cl-special { background: #fef3c7; border: 1px solid #fcd34d; }
    .cl-closed { background: #f0f0f0; }

    .bs-book-btn {
      display: flex; align-items: center; justify-content: center; gap: 8px;
      width: 100%; padding: 14px;
      background: linear-gradient(135deg, #b89b71, #8a6d45);
      color: #fff; border: none; border-radius: 12px;
      font-size: 1rem; font-weight: 600; font-family: inherit;
      cursor: pointer; text-align: center; text-decoration: none;
      margin-top: 14px;
      transition: transform .15s, box-shadow .15s;
    }
    .bs-book-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(42,125,225,.35); }
    .bs-line-btn {
      display: flex; align-items: center; justify-content: center; gap: 8px;
      width: 100%; padding: 12px;
      background: #06C755; color: #fff; border: none; border-radius: 12px;
      font-size: .9rem; font-weight: 500; font-family: inherit;
      cursor: pointer; text-decoration: none;
      margin-top: 10px;
      transition: background .2s;
    }
    .bs-line-btn:hover { background: #05b84d; }
    .bs-map-btn {
      display: flex; align-items: center; justify-content: center; gap: 8px;
      width: 100%; padding: 12px;
      background: transparent; color: var(--brown); border: 1.5px solid var(--brown); border-radius: 12px;
      font-size: .9rem; font-weight: 500; font-family: inherit;
      cursor: pointer; text-decoration: none;
      margin-top: 10px;
      transition: all .2s;
    }
    .bs-map-btn:hover { background: var(--cream); }
    .bs-note { font-size: .75rem; color: #999; text-align: center; margin-top: 8px; }

    /* ── Photo Upload Box ── */
    .photo-upload-area {
      margin-top: 14px; padding: 18px;
      background: #f7f8fa; border-radius: 12px; border: 2px dashed #ccc;
      text-align: center;
    }
    .photo-upload-area svg { width: 36px; height: 36px; color: #ccc; margin-bottom: 8px; }
    .photo-upload-area p { font-size: .82rem; color: #888; margin: 0 0 10px; }
    .photo-upload-area .pua-btn {
      background: #b89b71; color: #fff; border: none; border-radius: 8px;
      padding: 8px 20px; font-size: .85rem; font-family: inherit; cursor: pointer;
    }
    .photo-upload-area .pua-btn:hover { background: #8a6d45; }
    .photo-upload-area input[type="file"] { display: none; }
    .photo-preview-grid {
      display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px;
    }
    .photo-preview-item {
      position: relative; aspect-ratio: 1; border-radius: 8px; overflow: hidden;
    }
    .photo-preview-item img { width: 100%; height: 100%; object-fit: cover; }
    .photo-preview-item .ppi-del {
      position: absolute; top: 4px; right: 4px;
      background: rgba(0,0,0,.5); color: #fff; border: none; border-radius: 50%;
      width: 22px; height: 22px; font-size: .75rem; cursor: pointer;
      display: flex; align-items: center; justify-content: center;
    }

    /* ── Responsive ── */
    @media (max-width: 900px) {
      .detail-main { grid-template-columns: 1fr; }
      .booking-sidebar { position: static; }
      .gallery-grid { grid-template-rows: 200px 200px; }
      .nearby-grid { grid-template-columns: repeat(2,1fr); }
      .rules-grid { grid-template-columns: 1fr; }
      .amenity-grid { grid-template-columns: 1fr; }
    }
    .gs-text-mob { display: none; }
    @media (max-width: 600px) {
      .gallery-grid { grid-template-columns: 1fr; grid-template-rows: 240px 70px; height: auto; gap: 6px; }
      .gallery-grid .g-main { grid-row: 1; }
      .gallery-grid .g-right { display: grid; grid-template-columns: repeat(4, 1fr); grid-template-rows: 1fr; gap: 6px; }
      .gallery-item { border-radius: 6px; }
      .gallery-show-all { inset: 0; bottom: 0; right: 0; width: 100%; height: 100%; border-radius: 0; background: rgba(0,0,0,0.5); color: #fff; border: none; box-shadow: none; justify-content: center; }
      .gallery-show-all svg, .gs-text-desk { display: none; }
      .gs-text-mob { display: block; font-size: 1.1rem; font-weight: 600; }
      .nearby-grid { grid-template-columns: 1fr; }
      .ib-stats { gap: 14px; }
    }
    .full-gallery-modal {
      position: fixed; inset: 0; background: #fff; z-index: 1000;
      display: flex; flex-direction: column; opacity: 0; pointer-events: none;
      transition: opacity 0.3s;
    }
    .full-gallery-modal.is-open { opacity: 1; pointer-events: auto; }
    .fg-header {
      padding: 16px 24px; border-bottom: 1px solid var(--line);
      display: flex; align-items: center; gap: 16px;
    }
    .fg-close {
      background: none; border: none; font-size: 1.5rem; cursor: pointer; color: var(--text);
      width: 40px; height: 40px; border-radius: 50%; transition: background 0.2s;
    }
    .fg-close:hover { background: var(--cream-2); }
    .fg-header h3 { margin: 0; font-size: 1.2rem; font-weight: 600; color: var(--espresso); }
    .fg-body { flex: 1; overflow-y: auto; padding: 24px; }
    .fg-grid {
      display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px;
    }
    .fg-item {
      border-radius: 12px; overflow: hidden; cursor: pointer; aspect-ratio: 4/3;
      transition: opacity 0.2s;
    }
    .fg-item:hover { opacity: 0.9; }
    .fg-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
    @media (max-width: 768px) {
      .fg-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
      .fg-body { padding: 16px 12px; }
    }

    /* ── รวมจากหน้า detail เดิม (ให้ทุกหลังใช้ร่วม) ── */
    .video-wrapper video { position: absolute; inset: 0; width: 100%; height: 100%; border: none; }
    .mini-cal td.selected .day-price { color: var(--cream-2); }
    .lightbox .lb-img { box-shadow: 0 24px 70px rgba(20,15,9,.45); }

    /* ห้องนอน (umber / thunder) */
    .bedroom-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .bedroom-card { border: 1.5px solid var(--line); border-radius: 12px; padding: 14px 16px; }
    .bedroom-card .brc-name { font-weight: 600; font-size: .9rem; color: var(--espresso); margin-bottom: 4px; }
    .bedroom-card .brc-detail { font-size: .84rem; color: var(--text-soft); line-height: 1.6; }

    /* nearby section (umber / thunder) */
    .nearby-section { padding: 24px 28px; border-bottom: 1px solid var(--line); }
    .nearby-section h3 { font-size: 1.1rem; font-weight: 600; margin: 0 0 16px; color: var(--espresso); }
    @media (max-width: 900px) { .bedroom-grid { grid-template-columns: 1fr; } }
