/* Popular Express - Custom Styles */

/* Global font override - replace Raleway (old-style figures) with clean sans-serif */
body, h1, h2, h3, h4, h5, h6, p, a, span, div, td, th, li, input, select, textarea, button, label {
  font-family: 'Open Sans', Arial, Helvetica, sans-serif !important;
}

/* Page Preloader */
#preloader {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  background: #fff;
  z-index: 999999999;
}
#preloader .sk-spinner {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}
#preloader .sk-spinner img {
  width: 90px;
  animation: preloaderPulse 1.5s ease-in-out infinite;
}
@keyframes preloaderPulse {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}

/* WhatsApp floating button */
.popex-whatsapp {
  position: fixed;
  bottom: 25px;
  right: 25px;
  width: 60px;
  height: 60px;
  background: #25D366;
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  z-index: 9999;
  transition: transform 0.2s;
  text-decoration: none;
}
.popex-whatsapp:hover {
  transform: scale(1.1);
  color: #fff;
  text-decoration: none;
}

/* Hero slider (FlexSlider on homepage) */
.popex-hero-slider {
  position: relative;
  width: 100%;
  height: 70vh;
  min-height: 400px;
  overflow: hidden;
}
.popex-hero-flexslider {
  margin: 0;
  border: none;
  border-radius: 0;
  height: 100%;
}
.popex-hero-flexslider .flex-viewport {
  height: 100% !important;
}
.popex-hero-flexslider .slides li {
  position: relative;
  height: 70vh;
  min-height: 400px;
}
.popex-hero-flexslider .slides li > a {
  display: block;
  position: relative;
  height: 100%;
}
.popex-hero-flexslider .slides img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}
.popex-hero-caption {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  padding: 25px 40px;
  color: #fff !important;
}
a .popex-hero-caption, a .popex-hero-caption h2, a .popex-hero-caption p {
  color: #fff !important;
}
.popex-hero-caption h2 {
  font-size: 36px;
  font-weight: 700;
  margin: 0 0 8px;
  color: #fff !important;
  text-shadow: 0 2px 8px rgba(0,0,0,0.7), 0 0 30px rgba(0,0,0,0.4);
}
.popex-hero-caption p {
  font-size: 18px;
  margin: 0;
  color: #fff !important;
  text-shadow: 0 2px 8px rgba(0,0,0,0.7), 0 0 30px rgba(0,0,0,0.4);
}
.popex-hero-flexslider .flex-direction-nav a {
  width: auto;
  height: auto;
  border: none;
  background: transparent;
  overflow: visible;
  bottom: auto;
  top: 50%;
  transform: translateY(-50%);
  margin-top: 0;
  padding: 15px;
  opacity: 0.7;
  transition: opacity 0.3s;
}
.popex-hero-flexslider .flex-direction-nav a:hover { opacity: 1; }
.popex-hero-flexslider .flex-direction-nav a:before { font-size: 36px; line-height: 1; }
.popex-hero-flexslider .flex-direction-nav .flex-prev { left: 20px; }
.popex-hero-flexslider .flex-direction-nav .flex-next { right: 20px; }
.popex-hero-flexslider .flex-control-nav {
  position: absolute;
  bottom: 20px;
  left: 0;
  z-index: 10;
  margin: 0 !important;
}
/* Background-image hero slides (2ToGo pages) */
.popex-hero { position: relative; width: 100%; height: 70vh; min-height: 400px; overflow: hidden; }
.popex-hero-slide { position: absolute; top: 0; left: 0; width: 100%; height: 100%; opacity: 0; transition: opacity 1s ease; background-size: cover; background-position: center 30%; }
.popex-hero-slide.active { opacity: 1; }
.popex-hero-nav { position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%); display: flex; gap: 8px; z-index: 5; }
.popex-hero-dot { width: 12px; height: 12px; border-radius: 50%; background: rgba(255,255,255,0.4); cursor: pointer; border: 2px solid transparent; transition: all 0.3s; }
.popex-hero-dot.active { background: #fff; border-color: #fff; }
.popex-hero-arrow { position: absolute; top: 50%; transform: translateY(-50%); z-index: 5; color: #fff; font-size: 36px; cursor: pointer; padding: 15px; opacity: 0.7; transition: opacity 0.3s; }
.popex-hero-arrow:hover { opacity: 1; }
.popex-hero-arrow.prev { left: 20px; }
.popex-hero-arrow.next { right: 20px; }
/* Clickable slide link overlay (for background-image slides) */
.popex-hero-slide-link {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
}
.popex-hero-slide .popex-hero-caption { z-index: 3; pointer-events: none; }

@media (max-width: 768px) {
  .popex-hero { height: auto; min-height: unset; aspect-ratio: 16/9; }
  .popex-hero-slider { height: auto; min-height: unset; aspect-ratio: 16/9; }
  .popex-hero-flexslider .slides li { height: auto; min-height: unset; aspect-ratio: 16/9; }
  .popex-hero-caption {
    padding: 20px 25px;
  }
  .popex-hero-caption h2 {
    font-size: 22px;
  }
  .popex-hero-caption p {
    font-size: 14px;
  }
}

/* Room configuration blocks (enquiry forms) */
.eq-room-block {
  background: #f9f9f9; border: 1px solid #eee; border-radius: 6px;
  padding: 12px 15px; margin-bottom: 10px;
}
.eq-room-header {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px;
}
.eq-room-header strong { font-size: 15px; }
.eq-room-pax-grid {
  display: flex; gap: 12px; flex-wrap: wrap;
}
.eq-pax-input {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; margin-bottom: 6px;
}
.eq-pax-input label {
  font-size: 12px; color: #555;
}
.eq-pax-input .pax-btn-group {
  display: flex; align-items: center;
}
.eq-pax-input button {
  width: 28px; height: 28px; border: 1px solid #ccc; background: #f5f5f5;
  font-size: 16px; font-weight: bold; cursor: pointer; line-height: 1; border-radius: 3px;
  display: flex; align-items: center; justify-content: center;
}
.eq-pax-input button:hover { background: #e0e0e0; }
.eq-pax-input input {
  width: 40px; height: 28px; text-align: center; border: 1px solid #ccc;
  border-left: none; border-right: none; font-size: 13px; font-weight: bold;
}
.eq-pax-input input::-webkit-outer-spin-button,
.eq-pax-input input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* Hero banner - center parallax images vertically */
#page_caption .parallax-block .parallax-image,
.parallax-block .parallax-image {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover;
  object-position: center;
}

/* Hero banner - remove dark overlay, use text shadow instead */
.parallax_overlay_header {
  background-color: transparent !important;
}
#page_caption.hasbg h1,
#page_caption .tour_country_subheader {
  text-shadow: 0 2px 8px rgba(0,0,0,0.7), 0 1px 3px rgba(0,0,0,0.5);
}

/* Hero banner - show title centered in hero image */
#page_caption.hasbg .page_title_wrapper {
  visibility: visible !important;
  position: absolute !important;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
  margin-top: 0 !important;
  text-align: center;
}

/* Tour cards (legacy) */
.popex-tour-card {
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}
.popex-tour-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

/* Package/Destination card grid */
.popex-card-grid { display: flex; flex-wrap: wrap; gap: 20px; justify-content: center; padding: 0 20px; }
.popex-card { position: relative; flex: 0 0 calc(16.666% - 17px); min-width: 180px; cursor: pointer; transition: transform 0.2s, box-shadow 0.2s; border-radius: 8px; overflow: hidden; background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
.popex-card:hover { transform: translateY(-5px); box-shadow: 0 8px 25px rgba(0,0,0,0.15); }
.popex-card-img { width: 100%; height: 180px; object-fit: cover; display: block; }
.popex-card-img-placeholder { width: 100%; height: 180px; background: #eee; display: flex; align-items: center; justify-content: center; }
.popex-card-body { padding: 12px 14px; }
.popex-card-body h4 { margin: 0 0 4px; font-size: 12px; color: #999; text-transform: uppercase; letter-spacing: 0.5px; }
.popex-card-body h3 { margin: 0 0 8px; font-size: 15px; color: #1a237e; font-weight: 700; line-height: 1.3; }
.popex-card-price { color: #b63327; font-weight: 700; font-size: 15px; }
.popex-card-price .from { font-size: 11px; font-weight: 400; color: #999; }
.popex-card-price .original { text-decoration: line-through; color: #999; font-weight: 400; font-size: 12px; margin-right: 5px; }
.popex-card-price .discounted { color: #27ae60; }
.popex-card-price .extras { display: block; font-size: 11px; font-weight: 400; color: #777; }
.popex-card-ribbon { --ribbon: #e74c3c; position: absolute; top: 10px; left: 0; padding: 5px 16px 5px 10px; color: #fff; font-size: 11px; font-weight: 700; text-transform: uppercase; z-index: 2; background: var(--ribbon); clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 50%, calc(100% - 8px) 100%, 0 100%); }
@media (max-width: 768px) {
  .popex-card { flex: 0 0 calc(50% - 10px); min-width: 150px; }
}

/* Wider content containers — override theme's 960px default */
#page_content_wrapper,
.page_content_wrapper {
  width: 95% !important;
  max-width: 1400px !important;
  box-sizing: border-box;
}
.ppb_wrapper .page_content_wrapper,
.ppb_wrapper .page_content_wrapper.full_width {
  width: 95% !important;
  max-width: 1400px !important;
  margin-left: auto !important;
  margin-right: auto !important;
  box-sizing: border-box;
}

/* Full-width page content override (for package listing pages) */
.popex-fullwidth #page_content_wrapper {
  width: 100% !important;
  max-width: 100% !important;
  padding: 0 30px !important;
  box-sizing: border-box;
}
.popex-fullwidth #page_content_wrapper .inner,
.popex-fullwidth #page_content_wrapper .inner_wrapper,
.popex-fullwidth #page_content_wrapper .sidebar_content.full_width {
  width: 100% !important;
  max-width: 100% !important;
  padding: 0 !important;
  box-sizing: border-box;
}

/* Package row/list view (highlightRow packages on country pages) */
.popex-card-grid + .popex-row-list {
  margin-top: 40px;
}
.popex-row-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-bottom: 30px;
}
.popex-row-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  background: #fff;
  overflow: hidden;
  cursor: pointer;
  transition: background 0.15s;
  text-decoration: none;
  color: inherit;
  padding: 10px 0;
}
.popex-row-item:hover {
  background: #f8f9fa;
  text-decoration: none;
  color: inherit;
}
.popex-row-img {
  flex-shrink: 0;
  width: 140px;
  height: 90px;
  object-fit: cover;
  display: block;
  border-radius: 4px;
}
.popex-row-img-placeholder {
  flex-shrink: 0;
  width: 140px;
  height: 90px;
  background: #eee;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
}
.popex-row-body {
  flex: 1;
  min-width: 0;
  padding: 4px 0;
  text-align: left;
}
.popex-row-code {
  font-size: 12px;
  color: #999;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 3px;
}
.popex-row-name {
  font-size: 14px;
  font-weight: 600;
  color: #333;
  line-height: 1.3;
}
.popex-row-price {
  flex-shrink: 0;
  text-align: right;
  padding: 0 10px;
  font-weight: 700;
  font-size: 15px;
  color: #b63327;
  white-space: nowrap;
}
.popex-row-price .from {
  font-size: 11px;
  font-weight: 400;
  color: #999;
}
.popex-row-price .original { text-decoration: line-through; color: #999; font-weight: 400; font-size: 12px; margin-right: 5px; }
.popex-row-price .discounted { color: #27ae60; }
.popex-row-price .extras {
  display: block;
  font-size: 11px;
  font-weight: 400;
  color: #777;
}
@media (max-width: 767px) {
  .popex-row-item {
    gap: 10px;
    padding: 8px 0;
    align-items: flex-start;
  }
  .popex-row-img,
  .popex-row-img-placeholder {
    width: 90px;
    height: 60px;
  }
  .popex-row-name {
    font-size: 12px;
  }
  .popex-row-item .popex-card-ribbon {
    font-size: 7px;
    padding: 2px 8px 2px 4px;
    top: 8px;
  }
  .popex-row-price {
    font-size: 13px;
    padding: 0 5px;
  }
}

/* Widen nav to full width */
#menu_wrapper {
  width: 100% !important;
  max-width: 100%;
  box-sizing: border-box;
}
/* Desktop only (>960px): flexbox layout for nav */
@media (min-width: 961px) {
  #menu_wrapper {
    display: flex !important;
    align-items: center;
    padding: 8px 30px;
  }
  #menu_wrapper .logo_wrapper { order: 1; flex-shrink: 0; margin: 0 !important; }
  #menu_wrapper #nav_wrapper { order: 2; float: none !important; margin-right: auto; }
  #menu_wrapper #nav_wrapper .nav_wrapper_inner,
  #menu_wrapper #nav_wrapper #menu_border_wrapper { float: none !important; }
  #menu_wrapper div .nav { margin-top: 0 !important; }
  #menu_wrapper div .nav li a { padding-bottom: 0 !important; }
  #menu_wrapper > a { order: 3; float: none !important; flex-shrink: 0; }
  #menu_wrapper #header-user-action { order: 4; float: none !important; flex-shrink: 0; }
  #menu_wrapper .header_action { float: none !important; margin: 0 0 0 10px !important; }
}

/* Transparent top bar (override custom-css.css white background) */
.top_bar.hasbg {
  background: rgba(0, 0, 0, 0.3) !important;
  border-bottom: none !important;
  position: absolute;
  width: 100%;
  z-index: 100;
}
.top_bar.hasbg.fixed {
  background: rgba(0, 0, 0, 0.85) !important;
  position: fixed;
  top: 0;
}
.top_bar.hasbg #menu_wrapper div .nav > li > a,
.top_bar.hasbg .header_action,
.top_bar.hasbg i,
.top_bar.hasbg #mobile_nav_icon {
  color: #fff !important;
  border-color: #fff;
}
.top_bar.hasbg .header_action {
  background: rgba(255,255,255,0.2) !important;
  color: #fff !important;
}
.top_bar.hasbg .header_action:hover {
  background: rgba(255,255,255,0.35) !important;
}
.top_bar.hasbg.fixed .header_action {
  background: rgba(255,255,255,0.15) !important;
}

/* Header user action styling - match phone button alignment */
.header_action#header-user-action {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-left: 10px;
}

/* Tour price styling */
.tour_price {
  color: #b63327;
  font-weight: 700;
}
.tour_price .from-label {
  font-size: 12px;
  font-weight: 400;
  color: #999;
}

/* Departure table in package detail */
.popex-departure-table {
  width: 100%;
  border-collapse: collapse;
  font-family: Arial, Helvetica, sans-serif;
}
.popex-departure-table th {
  background: #f5f5f5;
  padding: 10px 12px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 2px solid #ddd;
}
.popex-departure-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #eee;
  font-size: 14px;
  text-align: center;
}
.popex-departure-table tr:hover td {
  background: #fafafa;
}
.popex-departure-table .dep-date-cell {
  white-space: nowrap;
  min-width: 70px;
}
.dep-date-main {
  font-weight: 600;
  font-size: 14px;
}
.dep-date-year {
  font-size: 12px;
  color: #999;
}
.popex-departure-table .price-cell {
  white-space: nowrap;
}
.popex-departure-table .price-original {
  text-decoration: line-through;
  color: #999;
  font-size: 12px;
}
.popex-departure-table .price-discounted {
  color: #000;
  font-weight: 600;
}
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.table-responsive .popex-departure-table {
  min-width: 100%;
}

/* Departure status badges */
.dep-status {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 3px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}
.dep-status-book { background: #2ecc71; color: #fff; }
.dep-status-selling { background: #f39c12; color: #fff; }
.dep-status-request { background: #9b59b6; color: #fff; }
.dep-status-full { background: #e74c3c; color: #fff; }

/* Status color legend */
.dep-status-legend {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  font-size: 13px;
  color: #555;
}
.dep-status-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}
.dep-status-legend-box {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  flex-shrink: 0;
}

/* Airline modal table compact rows */
#airline-modal-body table tr,
#airline-modal-body table td,
#airline-modal-body table th {
  height: auto !important;
  padding: 4px 8px !important;
  font-size: 13px;
}
#airline-modal-body table {
  height: auto !important;
}

/* Gallery grid */
.popex-gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.popex-gallery-grid a {
  display: block;
  overflow: hidden;
  border-radius: 6px;
}
.popex-gallery-grid img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  transition: transform 0.3s;
}
.popex-gallery-grid a:hover img {
  transform: scale(1.05);
}
@media (max-width: 768px) {
  .popex-gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .popex-gallery-grid img { height: 140px; }
}

/* Itinerary day cards */
#itinerary-content {
  max-width: 100%;
  overflow: hidden;
}
.popex-itinerary-day {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid #eee;
  max-width: 100%;
}
.popex-itinerary-day:last-child { border-bottom: none; }
.itin-day-badge {
  flex-shrink: 0;
  width: 70px;
  height: 70px;
  background: #b63327;
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  text-align: center;
}
.itin-day-content { flex: 1; min-width: 0; overflow: hidden; }
.itin-day-title { margin-bottom: 8px; font-size: 16px; word-wrap: break-word; overflow-wrap: break-word; }
.itin-day-desc { font-size: 14px; line-height: 1.6; margin-bottom: 8px; word-wrap: break-word; overflow-wrap: break-word; }
.itin-day-desc img { max-width: 100%; height: auto; }
.itin-day-desc table { max-width: 100%; display: block; overflow-x: auto; }
.itin-day-meta { font-size: 13px; color: #777; margin-top: 4px; }
.itin-day-meta i { margin-right: 5px; }
@media (max-width: 480px) {
  .popex-itinerary-day { flex-direction: column; gap: 10px; }
  .itin-day-badge { width: auto; height: auto; border-radius: 4px; padding: 6px 14px; }
}

/* Collapsible itinerary day — collapsed by default */
.popex-itinerary-day { cursor: pointer; }
.popex-itinerary-day .itin-toggle {
  float: right;
  font-size: 18px;
  color: #999;
  transition: transform 0.2s;
  margin-left: 10px;
  transform: rotate(-90deg);
}
.popex-itinerary-day.expanded .itin-toggle { transform: rotate(0deg); }
.popex-itinerary-day .itin-day-desc,
.popex-itinerary-day .itin-day-meta { display: none; }
.popex-itinerary-day.expanded .itin-day-desc,
.popex-itinerary-day.expanded .itin-day-meta { display: block; }
.itin-expand-all {
  display: inline-block;
  font-size: 13px;
  color: #b63327;
  cursor: pointer;
  margin-bottom: 10px;
}
.itin-expand-all:hover { text-decoration: underline; }

/* Print styles */
@media print {
  body * { visibility: hidden; }
  .print-target, .print-target * { visibility: visible !important; }
  .print-target {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    padding: 20px;
    background: #fff !important;
  }
  .print-target .no-print { display: none !important; }
  @page { size: portrait; margin: 15mm; }
}

/* Ad badge in header */
.popex-ad-badge {
  display: inline-block;
  background: #e63946;
  color: #fff !important;
  font-weight: 700;
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 4px;
  letter-spacing: 0.5px;
  line-height: 1.4;
}

/* Announcements page */
#announcements-container {
  max-width: 100%;
  overflow: hidden;
}
.popex-announcements-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}
.popex-announcement-card {
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
}
.popex-announcement-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.12);
}
.popex-announcement-card-img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
}
.popex-announcement-card-body {
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.popex-announcement-card-date {
  font-size: 12px;
  color: #999;
  margin-bottom: 6px;
}
.popex-announcement-card-title {
  font-size: 17px;
  font-weight: 600;
  margin: 0 0 10px;
  color: #333;
  line-height: 1.4;
}
.popex-announcement-card-excerpt {
  font-size: 14px;
  color: #666;
  line-height: 1.6;
  flex: 1;
}
.popex-announcement-card-footer {
  padding: 12px 20px;
  border-top: 1px solid #f0f0f0;
  text-align: right;
}
.popex-announcement-card-footer a {
  font-size: 13px;
  font-weight: 600;
  color: #e63946;
  text-decoration: none;
}
.popex-announcement-card-footer a:hover { text-decoration: underline; }
@media (max-width: 480px) {
  .popex-announcements-grid { grid-template-columns: 1fr; gap: 16px; }
}

/* Accordion sections (highlights, pricing info) */
.popex-accordion-item {
  margin-bottom: 20px;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  overflow: hidden;
}
.popex-accordion-title {
  background: #f5f5f5;
  padding: 15px 20px;
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: #003366;
}
.popex-accordion-body {
  padding: 20px;
  font-size: 14px;
  line-height: 1.7;
}
.popex-accordion-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 10px 0;
}
.popex-accordion-body table td,
.popex-accordion-body table th {
  border: 1px solid #ddd;
  padding: 8px 12px;
  font-size: 14px;
}
.popex-accordion-body table tr:nth-child(even) {
  background: #f9f9f9;
}

/* Section headers */
.popex-section-title {
  font-size: 26px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 5px;
}
.popex-section-subtitle {
  font-size: 14px;
  color: #999;
  font-style: italic;
  margin-bottom: 30px;
}

/* Loading spinner */
.popex-loading {
  text-align: center;
  padding: 60px 20px;
  color: #999;
}
.popex-loading > i {
  font-size: 30px;
  animation: spin 1s linear infinite;
}
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Enquiry/Booking modal */
.popex-modal-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.7);
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
}
.popex-modal-overlay.active {
  display: flex;
}
.popex-modal-content {
  background: #fff;
  border-radius: 8px;
  max-width: 700px;
  width: 90%;
  max-height: 85vh;
  overflow-y: auto;
  padding: 30px;
  position: relative;
}
.popex-modal-close {
  position: absolute;
  top: 15px;
  right: 20px;
  font-size: 24px;
  cursor: pointer;
  color: #999;
}
.popex-modal-close:hover { color: #333; }

/* Ensure SweetAlert2 popups appear above modals */
.swal2-container { z-index: 10001 !important; }

/* Ensure Magnific Popup lightbox appears above modals */
.mfp-bg { z-index: 10002 !important; }
.mfp-wrap { z-index: 10003 !important; }

/* Room selector */
.popex-room-row {
  border: 1px solid #eee;
  border-radius: 6px;
  padding: 15px;
  margin-bottom: 10px;
  background: #fafafa;
}

/* Auth pages */
.popex-auth-wrapper {
  width: 90%;
  max-width: 400px;
  margin: 0 auto;
  padding: 40px;
  box-sizing: border-box;
}
.popex-auth-wrapper input {
  width: 100%;
  padding: 12px 15px;
  border: 1px solid #ddd;
  border-radius: 4px;
  margin-bottom: 15px;
  font-size: 14px;
  box-sizing: border-box;
}
.popex-auth-wrapper input:focus {
  border-color: #b63327;
  outline: none;
}
.popex-auth-wrapper .button {
  width: 100%;
  text-align: center;
  box-sizing: border-box;
}

/* Slider card overlays */
.popex-slider-item {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
}
.popex-slider-item img {
  width: 100%;
  height: 250px;
  object-fit: cover;
  transition: transform 0.3s;
}
.popex-slider-item:hover img {
  transform: scale(1.05);
}
.popex-slider-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 20px;
  background: linear-gradient(transparent, rgba(0,0,0,0.7));
  color: #fff;
}

/* Footer policy links bar */
.popex-policy-bar {
  background: #e74c3c;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 14px 20px;
  gap: 10px;
  flex-wrap: wrap;
}
.popex-policy-bar a {
  color: #fff;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  padding: 6px 20px;
  white-space: nowrap;
}
.popex-policy-bar a:hover {
  color: #fff;
  text-decoration: underline;
}
.popex-policy-bar a i {
  margin-right: 5px;
}
@media (max-width: 768px) {
  .popex-policy-bar {
    flex-direction: column;
    gap: 5px;
  }
  .popex-policy-bar a {
    padding: 4px 10px;
    font-size: 13px;
  }
}

/* ============================
   Mobile Responsive Overrides
   ============================ */

/* Prevent horizontal overflow on all screen sizes */
html {
  overflow-x: hidden;
}
body {
  overflow-x: hidden;
  max-width: 100vw;
}
#wrapper {
  overflow-x: hidden;
  max-width: 100vw;
}

/* Tablet */
@media only screen and (min-width: 768px) and (max-width: 960px) {
  /* --- Header action buttons: align both at same height --- */
  .header_action#header-user-action {
    margin-top: 15px !important;
  }
  #page_content_wrapper, .page_content_wrapper {
    width: 95% !important;
    max-width: 960px;
  }
  #page_content_wrapper .inner {
    width: 100% !important;
  }
  #page_content_wrapper .inner .sidebar_content,
  #page_content_wrapper .inner .sidebar_content.full_width {
    width: 100% !important;
  }
  #footer ul.sidebar_widget {
    width: 95% !important;
  }
  .footer_bar_wrapper {
    width: 95% !important;
  }
}

/* Tablet (768-960px) — hamburger menu visible, logo alignment */
@media only screen and (min-width: 768px) and (max-width: 960px) {
  #mobile_nav_icon {
    margin-top: 14px !important;
    margin-left: 15px !important;
  }
  .logo_wrapper {
    margin: 9px 0 5px 8px !important;
  }
  .logo_wrapper img {
    max-height: 28px !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain;
  }
}

/* Mobile (all) */
@media only screen and (max-width: 767px) {
  /* --- Logo fix: constrain on mobile (logo is 200x200 square) --- */
  .logo_wrapper img {
    max-width: 80px !important;
    max-height: 28px !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain;
  }
  /* --- Mobile: align hamburger + logo on same line --- */
  #mobile_nav_icon {
    margin-top: 14px !important;
    margin-left: 15px !important;
  }
  .logo_wrapper {
    margin: 9px 0 5px 8px !important;
  }

  /* --- Header: overlay on hero on mobile --- */
  .top_bar.hasbg {
    position: absolute !important;
    width: 100%;
    z-index: 100;
  }
  .top_bar.hasbg.fixed {
    position: fixed !important;
    top: 0;
  }
  .header_style_wrapper {
    position: relative;
  }

  /* --- Page content: fluid widths --- */
  #page_content_wrapper, .page_content_wrapper {
    width: 100% !important;
    max-width: 100vw !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding: 0 10px !important;
    box-sizing: border-box;
    min-height: 0 !important;
    float: none !important;
    overflow-x: hidden;
  }
  #page_content_wrapper .inner {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box;
    overflow: hidden;
  }
  #page_content_wrapper .inner .inner_wrapper {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden;
  }
  #page_content_wrapper .inner .sidebar_content,
  #page_content_wrapper .inner .sidebar_content.full_width {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 15px 0 !important;
    box-sizing: border-box;
    overflow: hidden;
  }
  #page_content_wrapper .inner .sidebar_content img,
  #page_content_wrapper .inner .sidebar_content.full_width img {
    max-width: 100% !important;
    height: auto !important;
  }
  #page_content_wrapper .inner .sidebar_wrapper {
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  /* --- Hero banner --- */
  #page_caption.hasbg {
    height: 250px !important;
  }
  #page_caption .page_title_wrapper {
    width: 90% !important;
    margin: auto;
  }
  #page_caption h1 {
    font-size: 20px !important;
    text-shadow: 0 1px 4px rgba(0,0,0,0.5) !important;
  }
  #page_caption .tour_country_subheader {
    text-shadow: 0 1px 4px rgba(0,0,0,0.5) !important;
    font-size: 14px !important;
  }
  #page_caption #pkg-name-en {
    font-size: 16px !important;
  }
  /* Let grid.css handle hasbg margin-top (140px on mobile) for pages with hero banners */

  /* --- Menu wrapper --- */
  #menu_wrapper {
    width: 100% !important;
    padding: 0 10px;
    box-sizing: border-box;
  }

  /* --- Footer --- */
  #footer {
    width: 100% !important;
    padding: 20px 15px !important;
    box-sizing: border-box;
    float: none !important;
  }
  #footer ul.sidebar_widget {
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  #footer .sidebar_widget.four > li {
    width: 100% !important;
    margin-right: 0 !important;
    margin-bottom: 20px;
    float: none !important;
  }
  .footer_bar_wrapper {
    width: 100% !important;
    padding: 0 15px;
    box-sizing: border-box;
  }
  #copyright {
    width: 100% !important;
    text-align: center;
  }

  /* --- Fullwidth pages: tighter padding on mobile --- */
  .popex-fullwidth .page_content_wrapper {
    padding: 0 10px !important;
  }

  /* --- Cards: 2 per row on mobile --- */
  .popex-card-grid {
    gap: 10px;
    padding: 0;
  }
  .popex-card {
    flex: 0 0 calc(50% - 5px) !important;
    min-width: 0 !important;
  }
  .popex-card-img,
  .popex-card-img-placeholder {
    height: 140px !important;
  }
  .popex-card-body h3 {
    font-size: 13px !important;
  }

  /* --- Gallery --- */
  .popex-gallery-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px;
  }

  /* --- Departure table: smaller text --- */
  .popex-departure-table th,
  .popex-departure-table td {
    padding: 8px 6px !important;
    font-size: 12px !important;
  }

  /* --- Modal --- */
  .popex-modal-content {
    width: 95% !important;
    padding: 20px !important;
    max-height: 90vh;
  }

  /* --- Responsive images everywhere --- */
  img {
    max-width: 100%;
    height: auto;
  }

  /* --- Comment section --- */
  .comment {
    width: 100% !important;
    box-sizing: border-box;
  }

  /* Hide entire meta bar on mobile (duration, deposit, departures, enquire - all redundant) */
  .tour_meta_wrapper {
    display: none !important;
  }

  /* --- One-column layout for content sections --- */
  .one.withsmallpadding, .one.withpadding {
    padding: 15px !important;
    box-sizing: border-box;
  }

  /* --- Enquiry/auth forms --- */
  .popex-auth-wrapper {
    padding: 20px 15px;
  }

  /* --- WhatsApp button: smaller on mobile --- */
  .popex-whatsapp {
    width: 50px;
    height: 50px;
    font-size: 24px;
    bottom: 15px;
    right: 15px;
  }

  /* --- Photo wall / portfolio --- */
  #photo_wall_wrapper {
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 15px;
    box-sizing: border-box;
  }
  #portfolio_filter_wrapper {
    width: 100% !important;
    box-sizing: border-box;
  }

  /* --- Respond / comment form --- */
  #respond {
    width: 100% !important;
    box-sizing: border-box;
  }
}

/* Mobile landscape */
@media only screen and (min-width: 480px) and (max-width: 767px) {
  .logo_wrapper img {
    max-width: 160px !important;
    max-height: 40px !important;
  }
  #page_content_wrapper .inner {
    width: 100% !important;
  }
  #page_content_wrapper .inner .sidebar_content,
  #page_content_wrapper .inner .sidebar_content.full_width {
    width: 100% !important;
  }
  #page_content_wrapper .inner .sidebar_wrapper {
    width: 100% !important;
  }
  .gallery_mansory_wrapper {
    width: 100% !important;
  }
  #footer ul.sidebar_widget {
    width: 100% !important;
  }
}

/* Hide meta bar on landscape phones (viewport too wide for max-width:767 but still mobile) */
@media (max-height: 500px) and (orientation: landscape) {
  .tour_meta_wrapper {
    display: none !important;
  }
}
