/* ============================================================
   DRAWER (สาระแนะนำ)
   ============================================================ */
.drawer {
  position: fixed;
  left: 50%;
  top: 50%;
  right: auto;
  width: min(92vw, 430px);
  max-width: 430px;
  height: auto;
  max-height: 78vh;
  z-index: 600;

  padding: 0;
  overflow: hidden;

  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translate(-50%, -46%) scale(.94);

  border: 1px solid rgba(125, 211, 252, .20);
  border-radius: 24px;

  background:
    linear-gradient(180deg, rgba(4, 12, 19, .78), rgba(3, 10, 16, .94)),
    url('https://images.unsplash.com/photo-1448375240586-882707db888b?auto=format&fit=crop&w=1200&q=82')
      center center / cover no-repeat;

  box-shadow:
    0 30px 80px rgba(0, 0, 0, .62),
    inset 0 1px 0 rgba(255, 255, 255, .04);

  transition:
    opacity .18s ease,
    transform .24s cubic-bezier(.2,.85,.2,1),
    visibility 0s linear .24s;
}
.drawer.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
  transition:
    opacity .18s ease,
    transform .24s cubic-bezier(.2,.85,.2,1);
}

/* ชั้นทึบด้านหลัง popup */
.ov {
  position: fixed;
  inset: 0;
  z-index: 599;
  display: none;
  background: rgba(1, 5, 10, .76);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.ov.show {
  display: block;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  animation: tnhOvFadeIn .18s ease both;
}
@keyframes tnhOvFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* หัว popup สาระแนะนำ */
.drawer-popup-head {
  position: sticky;
  top: 0;
  z-index: 5;
  min-height: 62px;
  display: flex;
  align-items: center;
  padding: 16px 62px 14px 17px;
  border-bottom: 1px solid rgba(148,163,184,.11);
  background: linear-gradient(180deg, rgba(3,10,17,.96), rgba(4,13,21,.82));
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.drawer-popup-head h3 {
  margin: 0 !important;
  color: #fbbf24 !important;
  font-size: 15px !important;
  line-height: 1.3;
}
.drawer-popup-close {
  position: absolute;
  top: 11px;
  right: 11px;
  width: 39px;
  height: 39px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(148,163,184,.20);
  border-radius: 13px;
  background: rgba(8,18,30,.82);
  color: #e5edf7;
  font-size: 25px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(0,0,0,.26);
  transition: transform .14s ease, background .18s ease, border-color .18s ease;
}
.drawer-popup-close:active { transform: scale(.90); }
.drawer-popup-close:hover {
  border-color: rgba(125,211,252,.38);
  background: rgba(11,27,43,.94);
}
.drawer-popup-body {
  max-height: calc(78vh - 62px);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 15px 15px 20px;
  background: linear-gradient(180deg, rgba(4,12,19,.16), rgba(3,10,16,.42));
}
.drawer-popup-body::-webkit-scrollbar { width: 5px; }
.drawer-popup-body::-webkit-scrollbar-thumb {
  background: rgba(125,211,252,.22);
  border-radius: 99px;
}
@media (max-width: 480px) {
  .drawer {
    width: calc(100vw - 28px);
    max-height: 80vh;
    border-radius: 22px;
  }
  .drawer-popup-body { max-height: calc(80vh - 62px); }
}
.info-block { background: rgba(255, 255, 255, .02); padding: 12px; border-radius: 10px; margin-bottom: 8px; border-left: 3px solid var(--yellow); font-size: 12px; line-height: 1.5; }
.mem-grid { display: grid; grid-template-columns: 1fr; gap: 12px; margin-top: 10px; }
.mem-grid img { width: 100%; border-radius: 12px; border: 1px solid var(--border); }

/* ============================================================
   EQUIPMENT RENTAL PAGE (เช่าอุปกรณ์)
   ============================================================ */
#equipPage { position: fixed; inset: 0; z-index: 950; background: var(--bg); overflow-y: auto; display: none; }
#equipPage.show { display: block; animation: fadeUp .25s ease; }

.eq-sec-title { font-size: 14px; color: var(--blue); font-weight: 700; margin: 22px 0 12px; display: flex; align-items: center; gap: 8px; }

.eq-trip-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg2);
  border: 1.5px solid var(--border);
  border-radius: 16px;
  padding: 12px 14px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: .15s;
}
.eq-trip-card.selected { border-color: var(--blue); background: rgba(56, 189, 248, .08); }
.eq-trip-radio { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--muted); flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.eq-trip-card.selected .eq-trip-radio { border-color: var(--blue); }
.eq-trip-radio::after { content: ''; width: 10px; height: 10px; border-radius: 50%; background: var(--blue); display: none; }
.eq-trip-card.selected .eq-trip-radio::after { display: block; }
.eq-trip-info h4 { font-size: 13px; color: #fff; font-weight: 700; }
.eq-trip-info p { font-size: 11px; color: var(--sub); margin-top: 2px; }

.eq-item-card { display: flex; gap: 12px; background: var(--bg2); border: 1px solid var(--border); border-radius: 18px; padding: 12px; margin-bottom: 12px; }
.eq-item-img { width: 74px; height: 74px; border-radius: 14px; overflow: hidden; flex-shrink: 0; background: #fff; display: flex; align-items: center; justify-content: center; }
.eq-item-img img { width: 100%; height: 100%; object-fit: contain; }
.eq-item-info { flex: 1; min-width: 0; }
.eq-item-info h4 { font-size: 14px; color: #fff; font-weight: 700; }
.eq-item-info p.model { font-size: 11px; color: var(--sub); margin-top: 2px; }
.eq-item-info p.price { font-size: 12px; color: var(--blue); font-weight: 700; margin-top: 4px; }
.eq-stepper { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.eq-step-btn { width: 30px; height: 30px; border-radius: 10px; border: none; background: var(--bg3); color: #fff; font-size: 17px; font-weight: 700; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.eq-step-val { min-width: 22px; text-align: center; font-size: 15px; font-weight: 800; color: #fff; }

.eq-summary-card {
  background: linear-gradient(180deg, rgba(56, 189, 248, .1), rgba(56, 189, 248, .03));
  border: 1px solid rgba(56, 189, 248, .18);
  border-radius: 18px;
  padding: 14px 16px;
  margin: 18px 0 100px;
}
.eq-summary-row { display: flex; justify-content: space-between; font-size: 12px; color: var(--sub); padding: 4px 0; }
.eq-summary-row.total { font-size: 15px; font-weight: 800; color: #fff; border-top: 1px solid var(--border); margin-top: 8px; padding-top: 10px; }
.eq-summary-row.total span:last-child { color: var(--blue); }

.eq-note { font-size: 11px; color: #fbbf24; background: rgba(245, 158, 11, .08); border: 1px solid rgba(245, 158, 11, .25); border-radius: 12px; padding: 10px 12px; margin-top: 10px; line-height: 1.6; }

/* ใบเสร็จค่าเช่าอุปกรณ์ */
#equipReceiptPage { position: fixed; inset: 0; z-index: 1150; background: var(--bg); display: none; overflow-y: auto; }
#equipReceiptPage.show { display: block; animation: fadeUp .3s ease; }
.r-item-row { display: flex; justify-content: space-between; font-size: 13px; padding: 6px 0; border-bottom: 1px dashed #e2e8f0; color: #334155; }
.r-item-row:last-of-type { border-bottom: none; }
.r-total-row { display: flex; justify-content: space-between; font-size: 16px; font-weight: 800; color: #15803d; padding-top: 10px; margin-top: 6px; }

/* ============================================================
   REVIEW PAGE (รีวิว & แชร์ทริป)
   ============================================================ */
#reviewPage { position: fixed; inset: 0; z-index: 960; background: var(--bg); overflow-y: auto; display: none; }
#reviewPage.show { display: block; animation: fadeUp .25s ease; }

.review-summary-card {
  text-align: center;
  background: linear-gradient(135deg, rgba(245, 158, 11, .14), rgba(245, 158, 11, .04));
  border: 1px solid rgba(245, 158, 11, .28);
  border-radius: 20px;
  padding: 22px;
  margin-bottom: 18px;
}
.review-summary-card .avg { font-size: 42px; font-weight: 900; color: #f7b500; line-height: 1; }
.review-summary-card .stars { font-size: 20px; margin: 6px 0; letter-spacing: 2px; color: #f7b500; }
.review-summary-card .count { font-size: 12px; color: var(--sub); }

.star-picker { text-align: center; font-size: 36px; letter-spacing: 8px; margin: 12px 0 6px; }
.star-picker span { cursor: pointer; color: #475569; transition: color .15s, transform .1s; display: inline-block; }
.star-picker span:active { transform: scale(1.15); }

.review-card { background: var(--bg2); border: 1px solid var(--border); border-radius: 18px; padding: 14px; margin-bottom: 12px; }
.review-card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; gap: 8px; }
.review-avatar { width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, var(--blue2), var(--blue)); display: flex; align-items: center; justify-content: center; font-size: 15px; color: #fff; font-weight: 700; flex-shrink: 0; overflow: hidden; }
.review-avatar img { width: 100%; height: 100%; object-fit: cover; }
.review-name { font-size: 13px; font-weight: 700; color: #fff; }
.review-date { font-size: 10px; color: var(--muted); }
.review-stars { color: #f7b500; font-size: 14px; flex-shrink: 0; white-space: nowrap; }
.review-comment { font-size: 13px; color: #e2e8f0; line-height: 1.65; }
.review-photo { width: 100%; border-radius: 12px; max-height: 280px; object-fit: cover; margin-top: 10px; }

.review-actions { display: flex; align-items: center; gap: 6px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); }
.review-action-btn { display: flex; align-items: center; gap: 5px; background: transparent; border: none; color: var(--muted); font-size: 12px; font-weight: 600; padding: 6px 10px; border-radius: 10px; cursor: pointer; transition: .15s; }
.review-action-btn:active { transform: scale(.94); }
.review-action-btn.liked { color: #f43f5e; }
.review-action-btn.liked .review-like-ico { animation: reviewLikePop .35s ease; }
.review-action-btn.funny { color: #f59e0b; }
.review-action-btn.funny .review-like-ico { animation: reviewLikePop .35s ease; }
@keyframes reviewLikePop { 0% { transform: scale(1); } 40% { transform: scale(1.35); } 100% { transform: scale(1); } }
.review-comments-box { display: none; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); }
.review-comments-box.show { display: block; }
.review-comment-item { display: flex; gap: 8px; margin-bottom: 10px; }
.review-comment-avatar { width: 26px; height: 26px; border-radius: 50%; background: linear-gradient(135deg, var(--blue2), var(--blue)); display: flex; align-items: center; justify-content: center; font-size: 11px; color: #fff; font-weight: 700; flex-shrink: 0; overflow: hidden; }
.review-comment-avatar img { width: 100%; height: 100%; object-fit: cover; }
.review-comment-bubble { background: rgba(255,255,255,.04); border-radius: 12px; padding: 8px 12px; flex: 1; min-width: 0; }
.review-comment-bubble .rc-name { font-size: 11.5px; font-weight: 700; color: #fff; margin-bottom: 2px; }
.review-comment-bubble .rc-text { font-size: 12.5px; color: #cbd5e1; line-height: 1.5; overflow-wrap: anywhere; }
.review-comment-input-row { display: flex; gap: 8px; margin-top: 4px; }
.review-comment-input-row input { flex: 1; background: var(--bg3); border: 1px solid var(--border); border-radius: 20px; padding: 9px 14px; color: #fff; font-size: 12.5px; font-family: inherit; }
.review-comment-input-row input:focus { outline: none; border-color: var(--blue); }
.review-comment-send-btn { background: linear-gradient(135deg, var(--blue2), var(--blue)); border: none; color: #fff; width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0; display: flex; align-items: center; justify-content: center; cursor: pointer; font-size: 14px; }
.review-comment-send-btn:disabled { opacity: .5; cursor: default; }

/* ============================================================
   FLOATING ADMIN TAB — แถบลอยจางๆ ริมจอ กดแล้วค่อยกางเป็นปุ่ม
   ============================================================ */
.admin-tab {
  position: fixed;
  top: 50%;
  right: 0;
  transform: translateY(-50%);
  z-index: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 52px;
  padding: 0 9px;
  background: rgba(56, 189, 248, .1);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(56, 189, 248, .18);
  border-right: none;
  border-radius: 16px 0 0 16px;
  cursor: pointer;
  opacity: .6;
  transition: opacity .25s ease, padding .25s ease, background .25s ease;
  overflow: hidden;
  white-space: nowrap;
}
.admin-tab:active { opacity: .8; }
.admin-tab .admin-tab-dots { font-size: 13px; color: var(--blue); letter-spacing: -1px; flex-shrink: 0; }
.admin-tab .admin-tab-label {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--blue);
  max-width: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-width .25s ease, opacity .2s ease .05s;
}
.admin-tab.expanded {
  opacity: 1;
  padding: 0 14px 0 10px;
  background: rgba(56, 189, 248, .16);
  border-color: rgba(56, 189, 248, .35);
  box-shadow: -4px 0 16px rgba(2, 132, 199, .25);
}
.admin-tab.expanded .admin-tab-label { max-width: 120px; opacity: 1; }

