/* --- LUXURY THEME VARIABLES --- */
:root {
  --wyb-primary: #0f172a;      /* Xanh đen (Deep Navy) */
  --wyb-gold: #c6a87c;         /* Vàng kim (Gold Luxury) */
  --wyb-gold-hover: #b08d55;   /* Vàng đậm hơn khi hover */
  --wyb-bg: #f8f9fa;           /* Trắng xám nhẹ (Off-white) */
  --wyb-text: #334155;         /* Xám đen chữ */
  --wyb-border: #e2e8f0;
  --wyb-shadow: 0 20px 40px -5px rgba(0, 0, 0, 0.1);
  --font-head: "Playfair Display", serif; /* Font tiêu đề sang trọng */
  --font-body: "Montserrat", sans-serif;  /* Font nội dung hiện đại */
}

/* Import Fonts */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700&family=Playfair+Display:wght@600;700&display=swap');

/* --- LAYOUT CHUNG --- */
.wyb-booking-wrapper {
  max-width: 1200px;
  margin: 40px auto;
  font-family: var(--font-body);
  background: #fff;
  border-radius: 16px;
  box-shadow: var(--wyb-shadow);
  overflow: hidden;
  color: var(--wyb-text);
  border: 1px solid var(--wyb-border);
}

/* --- 1. PROGRESS BAR (MỚI) --- */
.wyb-progress-bar {
  display: flex;
  justify-content: space-between;
  padding: 20px 40px;
  background: #fff;
  border-bottom: 1px solid var(--wyb-border);
  position: relative;
}

.wyb-progress-bar::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 60px;
  right: 60px;
  height: 2px;
  background: #e2e8f0;
  z-index: 1;
  transform: translateY(-50%);
}

.wyb-step {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  padding: 0 10px;
}

.step-num {
  width: 30px;
  height: 30px;
  background: #e2e8f0;
  color: #64748b;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  transition: 0.3s;
}

.step-text {
  font-weight: 600;
  color: #94a3b8;
  font-size: 14px;
  display: none; /* Ẩn text trên mobile nhỏ */
}

/* Active Step */
.wyb-step.active .step-num {
  background: var(--wyb-primary);
  color: #fff;
  box-shadow: 0 0 0 4px rgba(15, 23, 42, 0.1);
}
.wyb-step.active .step-text {
  color: var(--wyb-primary);
}

/* Completed Step */
.wyb-step.completed .step-num {
  background: var(--wyb-gold);
  color: #fff;
}

@media (min-width: 600px) {
  .step-text { display: block; }
}

/* --- HEADER --- */
.wyb-booking-header {
  background: #fff;
  padding: 30px 40px;
  border-bottom: 1px solid var(--wyb-border);
  display: flex;
  gap: 40px;
  align-items: flex-end;
  background: linear-gradient(to bottom, #fff, #fcfcfc);
}

.wyb-form-group {
  flex: 1;
  min-width: 250px;
}

.wyb-form-group label {
  display: block;
  font-family: var(--font-head);
  font-size: 18px;
  color: var(--wyb-primary);
  margin-bottom: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.wyb-form-group label .dashicons {
  color: var(--wyb-gold);
  margin-right: 8px;
}

.wyb-control-input {
  width: 100%;
  padding: 12px 0;
  border: none;
  border-bottom: 2px solid #cbd5e1;
  border-radius: 0;
  font-size: 16px;
  background: transparent;
  color: #333;
  transition: all 0.3s ease;
  font-family: var(--font-body);
  font-weight: 500;
}

.wyb-control-input:focus {
  border-bottom-color: var(--wyb-gold);
  box-shadow: none;
  outline: none;
}

/* --- BODY LAYOUT --- */
.wyb-booking-body {
  display: flex;
  align-items: stretch;
  min-height: 600px;
  background: var(--wyb-bg);
}

/* Cột Trái (Map) */
.wyb-main-content {
  flex: 1;
  max-width: 60%;
  padding: 40px;
  background: #fff;
  border-right: 1px solid var(--wyb-border);
  position: relative;
  display: flex;
  flex-direction: column;
}

/* DECK TABS (Pill Style) */
.wyb-deck-tabs-frontend {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-bottom: 30px;
}

.wyb-deck-tab-fe {
  background: transparent;
  border: 1px solid var(--wyb-border);
  padding: 10px 30px;
  border-radius: 50px;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  color: #64748b;
  cursor: pointer;
  transition: all 0.3s ease;
  letter-spacing: 1px;
}

.wyb-deck-tab-fe:hover {
  border-color: var(--wyb-gold);
  color: var(--wyb-gold);
}

.wyb-deck-tab-fe.active {
  background: var(--wyb-primary);
  color: var(--wyb-gold);
  border-color: var(--wyb-primary);
  box-shadow: 0 5px 15px rgba(15, 23, 42, 0.2);
}

/* --- MAP CONTAINER & VIEWPORT --- */

.wyb-map-container {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* MẶC ĐỊNH (DESKTOP) */
.wyb-map-viewport {
  position: relative;
  width: 100%;
  height: auto; /* Desktop: Cao tự động */
  min-height: 400px;
  overflow: visible; /* Desktop: Cho phép popover tràn */
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: var(--wyb-primary);
  cursor: default;
  touch-action: auto;
  box-shadow: inset 0 0 20px rgba(0,0,0,0.03);
}

.wyb-panzoom-content {
  position: relative;
  top: 0; left: 0;
  width: 100%;
  transform-origin: 0 0;
  transition: transform 0.1s ease-out;
}

.wyb-panzoom-content img {
  display: block;
  width: 100%;
  height: auto;
  user-select: none;
  pointer-events: auto;

  /* Tối ưu render ảnh */
  image-rendering: -webkit-optimize-contrast;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  transform: translateZ(0);
}

/* Layer ghế */
#wyb_frontend_seats_layer {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  z-index: 10;
}

/* Nút điều khiển Zoom (Mặc định ẩn trên Desktop) */
.wyb-map-controls {
  display: none;
}

/* CHẤM GHẾ (Dynamic) */
.wyb-seat-frontend {
  position: absolute;
  width: var(--wyb-seat-size);
  height: auto;
  aspect-ratio: 1 / 1;
  min-width: 16px;
  max-width: 40px;

  border-radius: var(--wyb-seat-radius); /* Bo góc động */

  display: flex;
  align-items: center;
  justify-content: center;

  font-size: 9px;
  font-weight: 700;
  line-height: 1;

  cursor: pointer;
  transform: translate(-50%, -50%);
  box-shadow: 0 4px 6px rgba(0,0,0,0.15);
  border: 1.5px solid #fff;
  z-index: 10;
  transition: background 0.2s, border 0.2s;
  color: var(--wyb-seat-text); /* Màu chữ động */
}

/* Trạng thái ghế (Màu động) */
.wyb-seat-frontend.available {
  background: #fff;
  border-color: var(--wyb-seat-bg-avail);
  color: var(--wyb-seat-bg-avail);
}
.wyb-seat-frontend.available:hover {
  background: var(--wyb-seat-bg-avail);
  color: var(--wyb-seat-text);
  transform: translate(-50%, -50%) scale(1.3);
  z-index: 20;
}

.wyb-seat-frontend.booked {
  background: var(--wyb-seat-bg-booked);
  border-color: var(--wyb-seat-bg-booked);
  color: #fff;
  cursor: not-allowed;
  pointer-events: none;
  opacity: 0.8;
}

.wyb-seat-frontend.selected {
  background: var(--wyb-seat-bg-select);
  border-color: var(--wyb-seat-bg-select);
  color: var(--wyb-seat-text);
  transform: translate(-50%, -50%) scale(1.3);
  z-index: 20;
}

/* LEGEND */
.wyb-legend {
  display: flex;
  justify-content: center;
  gap: 30px;
  margin-top: 20px;
  font-size: 13px;
  color: #64748b;
  font-weight: 500;
}
.legend-item { display: flex; align-items: center; }
.legend-item .dot {
  width: 12px; height: 12px; border-radius: 50%; display: inline-block; margin-right: 8px;
  border: 2px solid #fff; box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.dot.available { border-color: var(--wyb-seat-bg-avail); background: #fff; border-width: 2px; }
.dot.selected { background: var(--wyb-seat-bg-select); border-color: var(--wyb-seat-bg-select); }
.dot.booked { background: var(--wyb-seat-bg-booked); border-color: var(--wyb-seat-bg-booked); }

/* --- SIDEBAR (Menu Style) --- */
.wyb-sidebar {
  width: 35%;
  max-width: 400px;
  background: #f8fafc;
  border-left: 1px solid var(--wyb-border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  max-height: 800px;
}

.wyb-sidebar-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 30px;
}

.wyb-sidebar-section {
  margin-bottom: 40px;
}

.wyb-sidebar-title {
  margin-top: 0;
  font-family: var(--font-head);
  font-size: 20px;
  color: var(--wyb-primary);
  padding-bottom: 15px;
  border-bottom: 1px solid #e2e8f0;
  margin-bottom: 20px;
}

.wyb-sidebar-title .dashicons {
  color: var(--wyb-gold);
  margin-right: 8px;
}

/* ADDON ITEM */
.wyb-addon-item {
  display: flex;
  gap: 15px;
  padding: 15px;
  background: #fff;
  border-radius: 12px;
  margin-bottom: 15px;
  align-items: center;
  transition: all 0.3s ease;
  border: 1px solid transparent;
  box-shadow: 0 2px 5px rgba(0,0,0,0.02);
}

.wyb-addon-item:hover {
  border-color: var(--wyb-gold);
  box-shadow: 0 10px 20px rgba(0,0,0,0.05);
  transform: translateY(-2px);
}

.wyb-addon-item img {
  width: 60px;
  height: 60px;
  border-radius: 8px;
  object-fit: cover;
}

.wyb-addon-info { flex: 1; overflow: hidden; }
.wyb-addon-name { font-size: 14px; font-weight: 600; color: var(--wyb-primary); display: block; margin-bottom: 4px; }
.wyb-addon-price { font-size: 13px; color: var(--wyb-gold); font-weight: 700; }
.wyb-addon-qty input { width: 40px; text-align: center; border: 1px solid #e2e8f0; border-radius: 6px; padding: 8px 0; font-family: var(--font-body); font-weight: 600; color: var(--wyb-primary); }

/* SIDEBAR FOOTER */
.wyb-sidebar-footer {
  padding: 30px;
  background: #fff;
  border-top: 1px solid var(--wyb-border);
  box-shadow: 0 -10px 30px rgba(0,0,0,0.03);
}

.wyb-sidebar-total {
  font-family: var(--font-head);
  font-size: 18px;
  color: var(--wyb-primary);
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.wyb-sidebar-total span { color: var(--wyb-gold); font-size: 1.4em; font-weight: 700; }

#wyb_btn_add_addons {
  width: 100%; padding: 16px; background: var(--wyb-primary); color: #fff; border: none; border-radius: 8px; font-weight: 600; cursor: pointer; text-transform: uppercase; letter-spacing: 1px; font-size: 14px; transition: all 0.3s;
}
#wyb_btn_add_addons:hover { background: var(--wyb-gold); transform: translateY(-2px); box-shadow: 0 10px 20px rgba(198, 168, 124, 0.4); }

/* --- POPUP (Modal Mobile) --- */
.wyb-popup { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 9999; justify-content: center; align-items: center; }
.wyb-popup.active { display: flex; }
.wyb-popup-overlay { position: absolute; width: 100%; height: 100%; background: rgba(0,0,0,0.6); backdrop-filter: blur(2px); }
.wyb-popup-content.compact { position: relative; background: #fff; width: 90%; max-width: 350px; border-radius: 12px; overflow: hidden; box-shadow: 0 20px 50px rgba(0,0,0,0.3); z-index: 10000; animation: popupUp 0.3s; }
@keyframes popupUp { from { transform: scale(0.8); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.wyb-popup-header { background: var(--wyb-primary); color: #fff; padding: 15px 20px; display: flex; justify-content: space-between; align-items: center; font-family: var(--font-head); }
.wyb-popup-close { font-size: 24px; cursor: pointer; opacity: 0.8; }
.wyb-popup-close:hover { opacity: 1; }

.wyb-popup-img-wrapper { height: 160px; background: #f0f0f0; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.wyb-popup-img-wrapper img { width: 100%; height: 100%; object-fit: cover; }
.wyb-popup-details { padding: 20px; }
.wyb-detail-row { display: flex; justify-content: space-between; margin-bottom: 10px; color: #555; }
.price-text { color: var(--wyb-gold); font-size: 1.3em; font-weight: 700; }

#wyb_add_seat_btn { width: 100%; padding: 12px; background: var(--wyb-gold); color: #fff; border: none; border-radius: 6px; font-weight: 600; cursor: pointer; margin-top: 15px; transition: 0.3s; }
#wyb_add_seat_btn:hover { background: var(--wyb-primary); }

/* --- DESKTOP POPOVER --- */
/* --- DESKTOP POPOVER (Min-Width 769px) --- */
@media (min-width: 769px) {
  .wyb-popup.desktop-mode {
    position: absolute;
    z-index: 100;
    display: none;
    pointer-events: none;

    width: fit-content;
    height: fit-content;
    background: transparent;
  }

  .wyb-popup.desktop-mode.active {
    display: block ;
  }

  .wyb-popup.desktop-mode .wyb-popup-overlay {
    display: none;
  }

  .wyb-popup.desktop-mode .wyb-popup-content.compact {
    width: 320px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.2);
    border: 1px solid rgba(255,255,255,0.5);
    pointer-events: auto;
    animation: fadeIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    margin: 0; /* Reset margin auto của modal */
  }

  @keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
  }

  /* Đảm bảo viewport không cắt popup */
  .wyb-map-viewport {
    overflow: visible !important;
  }
}

/* --- MOBILE MODE (≤ 768px): Kích hoạt Pan & Zoom --- */
@media (max-width: 768px) {
  .wyb-booking-header { flex-direction: column; gap: 20px; align-items: stretch; padding: 20px; }
  .wyb-booking-body { flex-direction: column; }
  .wyb-main-content { border-right: none; padding: 15px; width: 100%; box-sizing: border-box; }
  .wyb-sidebar { width: 100%; max-width: none; border-left: none; border-top: 1px solid var(--wyb-border); }

  /* Viewport Mobile */
  .wyb-map-viewport {
    height: 450px; /* Chiều cao cố định */
    overflow: hidden; /* Che phần ảnh tràn */
    cursor: grab;
    touch-action: none; /* Ngăn cuộn trang */
  }

  .wyb-map-viewport:active { cursor: grabbing; }

  .wyb-panzoom-content {
    position: absolute;
    top: 0; left: 0; width: 100%;
    transform-origin: 0 0;
    z-index: 5;
  }

  .wyb-panzoom-content img { pointer-events: none; }

  #wyb_frontend_seats_layer { pointer-events: auto; }

  /* Controls Zoom */
  .wyb-map-controls {
    display: flex;
    position: absolute;
    bottom: 15px; right: 15px;
    flex-direction: column; gap: 10px;
    z-index: 100;
  }

  .wyb-map-controls button {
    width: 45px; height: 45px;
    background: #fff; color: #0f172a;
    border: 1px solid #ccc; border-radius: 50%;
    font-size: 24px; font-weight: bold;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    display: flex; align-items: center; justify-content: center;
    pointer-events: auto; cursor: pointer;
  }
}

/* --- MOBILE STICKY SUMMARY (MỚI) --- */
.wyb-mobile-summary {
  position: fixed;
  bottom: 0; left: 0; width: 100%;
  background: #fff;
  border-top: 1px solid #e2e8f0;
  box-shadow: 0 -5px 20px rgba(0,0,0,0.1);
  z-index: 99999;
  padding: 15px;
  box-sizing: border-box;
  display: none; /* Mặc định ẩn, JS sẽ hiện */
  align-items: center; justify-content: space-between; gap: 15px;
}
.wyb-ms-info { flex: 1; display: flex; flex-direction: column; }
.wyb-ms-label { font-size: 11px; color: #64748b; text-transform: uppercase; }
#wyb_ms_seat { font-size: 14px; color: var(--wyb-primary); font-weight: 700; }
.wyb-ms-total { font-size: 16px; font-weight: 700; color: var(--wyb-gold); }
#wyb_ms_btn { padding: 12px 20px; background: var(--wyb-primary); color: #fff; border: none; border-radius: 6px; font-weight: 600; font-size: 14px; text-transform: uppercase; }
#wyb_ms_btn:disabled { background: #cbd5e1; cursor: not-allowed; }

@media (min-width: 769px) {
  .wyb-mobile-summary { display: none !important; }
}
@media (max-width: 768px) {
  .wyb-booking-wrapper { margin-bottom: 80px; }
}

/* Loading */
.wyb-loading-overlay {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(255,255,255,0.9);
  display: none;
  flex-direction: column; align-items: center; justify-content: center;
  z-index: 200;
  font-family: var(--font-head);
  color: var(--wyb-primary);
}
.wyb-loading-overlay.active { display: flex; }
.spinner { width: 40px; height: 40px; border: 3px solid #e2e8f0; border-top: 3px solid var(--wyb-gold); border-radius: 50%; animation: spin 1s linear infinite; margin-bottom: 15px; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
/* Thêm vào cuối file */
#wyb_surcharge_notice {
    background: #fff8e1;
    color: #b45309;
    padding: 10px;
    border-radius: 6px;
    border: 1px solid #fcd34d;
    font-size: 13px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
    animation: fadeIn 0.3s;
}

#wyb_surcharge_notice .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}
/* --- ZONE OVERLAY (Hiển thị vùng Private) --- */
.wyb-zone-overlay {
  position: absolute;
  border: 2px dashed var(--wyb-gold);
  background-color: rgba(198, 168, 124, 0.15); /* Màu vàng nhạt mờ */
  border-radius: 8px;
  z-index: 5; /* Nằm dưới ghế (z-index ghế là 10) nhưng trên bản đồ */
  cursor: pointer;
  transition: all 0.3s ease;

  /* Flex để căn giữa tên Zone */
  display: flex;
  align-items: center;
  justify-content: center;
}

.wyb-zone-overlay:hover {
  background-color: rgba(198, 168, 124, 0.3);
  box-shadow: 0 0 15px rgba(198, 168, 124, 0.4);
  z-index: 15; /* Khi hover thì nổi lên trên */
}

.wyb-zone-overlay.active {
  background-color: rgba(198, 168, 124, 0.4);
  border-style: solid;
  border-width: 3px;
}

/* Label tên Zone nằm giữa vùng */
.wyb-zone-label {
  background: #fff;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: bold;
  color: var(--wyb-primary);
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  pointer-events: none; /* Để click xuyên qua vào Zone */
}

/* Khi hover vào ghế, ghế đó nổi lên */
.wyb-seat-frontend.in-zone-highlight {
  background-color: var(--wyb-gold) !important;
  border-color: #fff !important;
  transform: translate(-50%, -50%) scale(1.2);
  z-index: 20;
}

/* --- ADDONS GRID (Đồ ăn/Dịch vụ ở Main Content) --- */
.wyb-step-title {
  font-family: var(--font-head);
  font-size: 24px;
  margin: 0 0 5px;
  color: var(--wyb-primary);
}
.wyb-step-desc {
  margin: 0 0 20px;
  color: #666;
  font-size: 14px;
}

.wyb-addons-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 20px;
}

.wyb-addon-card {
  border: 1px solid #eee;
  border-radius: 8px;
  overflow: hidden;
  transition: all 0.2s;
  background: #fff;
}
.wyb-addon-card:hover { box-shadow: 0 5px 15px rgba(0,0,0,0.1); }

.wyb-addon-card img {
  width: 100%;
  height: 140px;
  object-fit: cover;
}

.wyb-addon-info {
  padding: 10px;
  text-align: center;
}

.wyb-addon-name {
  display: block;
  font-weight: 700;
  margin-bottom: 5px;
  font-size: 14px;
  color: var(--wyb-primary);
}

.wyb-addon-price {
  display: block;
  color: var(--wyb-gold);
  font-weight: bold;
  margin-bottom: 10px;
}

/* --- SIDEBAR MINI CART --- */
.wyb-sidebar.wyb-mini-cart {
  background: #f8f9fa;
  border-left: 1px solid #eee;
  display: flex;
  flex-direction: column;
}

.wyb-cart-title {
  margin: 0 0 15px 0;
  font-size: 18px;
  font-family: var(--font-head);
  border-bottom: 2px solid var(--wyb-gold);
  padding-bottom: 10px;
  color: var(--wyb-primary);
}

.wyb-cart-section {
  margin-bottom: 15px;
}

.wyb-cart-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 14px;
}

.wyb-cart-divider {
  height: 1px;
  background: #e5e7eb;
  margin: 15px 0;
}

.wyb-cart-item-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  margin-bottom: 6px;
  color: #555;
}

.wyb-sidebar-footer {
  margin-top: auto;
  padding-top: 15px;
  border-top: 1px solid #ddd;
}

.wyb-sidebar-total {
  display: flex;
  justify-content: space-between;
  font-size: 16px;
  font-weight: bold;
  margin-bottom: 15px;
  color: var(--wyb-primary);
}

.wyb-action-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.wyb-action-buttons button {
  width: 100%;
  justify-content: center;
}

#wyb_btn_continue {
  background: #fff;
  border: 1px solid #ccc;
  color: #333;
}
#wyb_btn_continue:hover {
  background: #f0f0f0;
  border-color: #bbb;
}
#wyb_btn_continue:disabled, #wyb_btn_checkout_now:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}