:root {
  --fg-blue: #fd4902;
  --accent: #ff4b00;
  --ink: #111;
}

.ferry-app {
  position: relative;
  width: 100%;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  border: 1px solid #eee;
  border-radius: 18px;
}

.ferry-map {
  position: absolute;
  inset: 0;
  border-radius: inherit;
}

.leaflet-interactive:focus,
.leaflet-interactive,
path.leaflet-interactive {
  outline: none !important;
}

.leaflet-tooltip.ferry-porttip {
  background: rgba(255, 255, 255, 0.95); /* 5% transparency */
  border: 1px solid #e9e9e9;
  color: var(--ink);
  border-radius: 999px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.12);
  padding: 4px 8px;
  font-family: inherit;
  line-height: 1;
  font-weight: 600; 
  font-size: 11px;
  pointer-events: none;
  white-space: nowrap;
}

.leaflet-tooltip.ferry-porttip:before {
  display: none !important;
}

.ferry-topbar {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 900;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ferry-pill {
  background: #fff;
  border: 1px solid #e6e6e6;
  border-radius: 999px;
  padding: 9px 11px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  cursor: pointer;
  font-size: 14px;
  user-select: none;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  transition: transform 0.08s ease, filter 0.08s ease, border-color 0.12s ease;
}

.ferry-pill:hover {
  border-color: #cfcfcf;
  transform: scale(0.985);
  filter: brightness(0.985);
}

.ferry-pill:active {
  transform: scale(0.975);
}

.ferry-pill .hamb {
  font-weight: 900;
  font-size: 16px;
  line-height: 1;
}

.ferry-pill .txt {
  font-weight: 900;
  color: var(--ink);
}

.ferry-pill .badgecount {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  background: var(--fg-blue);
  color: #fff;
  font-weight: 900;
  font-size: 11px;
  padding: 0 6px;
}

.ferry-drawer {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 360px;
  max-width: 86vw;
  z-index: 950;
  background: #fff;
  transform: translateX(-102%);
  transition: transform 0.22s ease;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.18);
  border-right: 1px solid #eee;
}

.ferry-drawer.open {
  transform: translateX(0);
}

@media (max-width: 900px) {
  .ferry-drawer {
    width: 70vw;
    max-width: 70vw;
  }
}

.ferry-drawer .hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 14px;
  border-bottom: 1px solid #f0f0f0;
}

.ferry-drawer .hd b {
  font-size: 15px;
}

.ferry-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.ferry-btn-ico {
  cursor: pointer;
  border: 1px solid #e6e6e6;
  border-radius: 12px;
  padding: 6px 10px;
  background: #fff;
  color: var(--ink);
  transition: transform 0.08s ease, filter 0.08s ease, border-color 0.12s ease;
}

.ferry-btn-ico:hover {
  border-color: #cfcfcf;
  transform: scale(0.985);
  filter: brightness(0.985);
}

.ferry-btn-ico:active {
  transform: scale(0.975);
}

.ferry-drawer .bd {
  padding: 12px 14px;
}

.ferry-row {
  margin-bottom: 14px;
}

.ferry-row .label {
  font-size: 12px;
  color: #666;
  margin-bottom: 8px;
}

.ferry-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid #e3e3e3;
  border-radius: 999px;
  margin: 0 8px 8px 0;
  font-size: 13px;
  cursor: pointer;
  user-select: none;
  color: var(--ink);
  transition: transform 0.08s ease, filter 0.08s ease, border-color 0.12s ease;
}

.ferry-chip:hover {
  border-color: #cfcfcf;
  transform: scale(0.985);
  filter: brightness(0.99);
}

.ferry-chip:active {
  transform: scale(0.975);
}

.ferry-chip input {
  margin: 0;
}

.ferry-chip.disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.ferry-chip.disabled:hover {
  transform: none;
  filter: none;
  border-color: #e3e3e3;
}

.ferry-chip.disabled input {
  cursor: not-allowed;
}

.route-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border-radius: 999px;
  padding: 8px 10px;
  border: 1px solid #e6e6e6;
  background: #fff;
  cursor: pointer;
  user-select: none;
  transition: transform 0.08s ease, filter 0.08s ease, border-color 0.12s ease;
}

.route-toggle:hover {
  border-color: #cfcfcf;
  transform: scale(0.985);
  filter: brightness(0.99);
}

.route-toggle:active {
  transform: scale(0.975);
}

.route-toggle .lbl {
  font-size: 13px;
  font-weight: 900;
  color: var(--ink);
  white-space: nowrap;
}

.switch {
  position: relative;
  width: 44px;
  height: 24px;
  border-radius: 999px;
  background: #ddd;
  flex-shrink: 0;
}

.switch.on {
  background: var(--accent);
}

.knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: #fff;
  transition: left 0.18s ease;
}

.switch.on .knob {
  left: 22px;
}

.ferry-detail {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 920;
  width: 520px;
  max-width: 56vw;
  max-height: 50vh;
  background: #ffffffe6;
  border: 1px solid #e7e7e7;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.10);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.ferry-detail.hidden {
  display: none;
}

.ferry-detail .hd {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid #f1f1f1;
  flex-shrink: 0;
}

.ferry-detail .hd .title {
  font-size: 15px;
  font-weight: 900;
  line-height: 1.2;
  display: flex;
  gap: 10px;
  align-items: center;
  color: var(--ink);
}

.ferry-ico {
  width: 18px;
  height: 18px;
  display: inline-block;
}

.ferry-detail .hd .sub {
  font-size: 12px;
  color: #666;
  margin-top: 3px;
}

.ferry-detail .bd {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  min-height: 0;
}

@media (max-width: 900px) {
  .ferry-detail {
    left: 10px;
    right: 10px;
    top: auto;
    bottom: 10px;
    width: auto;
    max-width: none;
    max-height: 34vh;
  }

  .ferry-detail .bd {
    overflow-y: scroll;
  }
}

.ferry-list {
  display: flex;
  flex-direction: column;
  gap: 0px;
}

.ferry-item {
  padding: 6px 6px 6px 2px;
  border-bottom: 1px solid #f2f2f2;
  transition: border-color 0.15s ease;
  background: transparent; /* important */
  margin-bottom: 4px;  /* spacing instead of gap */
}

.ferry-item:hover {
  background: #fffffffa;
  /* keep bottom border to avoid layout jump */
  border-bottom: 1px solid #f2f2f2;
}

/* Multi-route detail wraps service cards in a parent item.
   Remove the inner last divider so only one line is shown at group end. */
.ferry-route-group > .ferry-item:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

/* remove any focus outline that might appear when clicking inside item */
.ferry-item, .ferry-item * {
  outline: none !important;
}

.seasonality-label {
  display: inline-block;
  margin-top: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #fff4ee;
  border: 1px solid #ffd5c2;
  color: #9b3200;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
}

.card-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.left-pack {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
}

.operator-logo {
  width: 80px;
  height: 40px;
  border-radius: 10px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid #e0e0e0;
  margin-left: 10px;
}

.operator-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 8px;
  display: block;
}

.operator-logo.placeholder {
  background: #f2f2f2;
}

.ferry-item:hover .operator-logo.placeholder {
  background: #eaeaea;
}

.name {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 320px;
  color: var(--ink);
}

.badge {
  display: inline-block;
  font-size: 11px;
  border: 1px solid #e0e0e0;
  border-radius: 999px;
  padding: 2px 8px;
  margin-left: 6px;
  color: #444;
  background-color: #ffffff;
}

.meta {
  font-size: 12px;
  color: #666;
  margin-top: 4px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 8px;
  border-radius: 9px;
  border: 1px solid #ff4b00;
  background: #fff;
  text-decoration: none;
  font-size: 11px;
  color: #ff4b00;
  white-space: nowrap;
  transition: transform 0.08s ease, filter 0.08s ease;
  margin-right: 10px;
}

.btn:hover {
  transform: scale(0.985);
  filter: brightness(0.97);
}

.btn:active {
  transform: scale(0.975);
}

.empty {
  padding: 12px;
  border: 1px dashed #ddd;
  border-radius: 14px;
  color: #666;
  font-size: 13px;
  background: #fff;
}

.stopovers-wrap {
  margin-top: 4px;
  padding-left: 0;
}

details.stopovers {
  margin: 0;
}

details.stopovers summary {
  cursor: pointer;
  list-style: none;
  font-size: 11px;
  color: #555;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

details.stopovers summary::-webkit-details-marker {
  display: none;
}

.stopchev {
  width: 16px;
  height: 16px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #e6e6e6;
  color: #666;
  flex-shrink: 0;
  transition: transform 0.15s ease;
}

details.stopovers[open] .stopchev {
  transform: rotate(90deg);
}

.stoplist {
  margin-top: 4px;
  font-size: 11px;
  color: #666;
  line-height: 1.30;
  padding-left: 24px;
}

.ferry-app * {
  box-sizing: border-box;
}

/* Pulsing selected port */
.leaflet-interactive.ferry-port-selected {
  stroke: var(--fg-blue);
  stroke-width: 2px;
  transform-origin: center center;
  transform-box: fill-box;
  animation: ferry-port-pulse 1.2s ease-out infinite;
}

@keyframes ferry-port-pulse {
  0% { transform: scale(1); stroke-opacity: 0.95; }
  50% { transform: scale(1.6); stroke-opacity: 0.35; }
  100% { transform: scale(2.2); stroke-opacity: 0; }
}

/* Connection highlight color class (in case we style paths directly) */
.leaflet-interactive.ferry-connection {
  stroke: #fd4902 !important;
}

/* Pulse circle used as a separate overlay */
.leaflet-interactive.ferry-pulse,
.ferry-pulse {
  stroke-width: 2px;
  fill-opacity: 0;
  transform-origin: center center;
  transform-box: fill-box;
  animation: ferry-port-pulse 1.2s ease-out infinite;
}

.leaflet-interactive.ferry-pulse.delay,
.ferry-pulse.delay {
  animation-delay: 0.36s;
}

/* Confirmation popup styled small, similar to port tooltip */
.ferry-conn-popup .leaflet-popup-content-wrapper {
  background: rgba(255,255,255,0.98);
  border: 1px solid #e9e9e9;
  padding: 6px 8px;
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}
.ferry-conn-popup .leaflet-popup-tip-container { display: none; }
.ferry-conn-popup .leaflet-popup-content { margin: 0; }
/* Pulse animation for ferry icon in detail header */
.ferry-ico.ferry-icon-pulse {
  animation: ferry-icon-pulse 1.5s ease-in-out infinite;
}

@keyframes ferry-icon-pulse {
  0%, 100% { 
    opacity: 1;
    transform: scale(1);
  }
  50% { 
    opacity: 0.6;
    transform: scale(1.15);
  }
}

/* Connection summary styling */
.connection-summary {
  background: #fafafa;
  padding: 8px 10px;
  border-radius: 5px;
  margin-top: 8px;
}

.summary-item {
  margin-bottom: 8px;
}

.summary-item:last-child {
  margin-bottom: 0;
}

.summary-label {
  font-size: 11px;
  font-weight: 700;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-bottom: 6px;
  display: block;
}

.summary-value {
  font-size: 12px;
  color: var(--ink);
  line-height: 1.3;
}

.ferry-app .meta .pricing-toggle,
.ferry-app .meta a.pricing-toggle,
.ferry-app .ferry-item .pricing-toggle {
  cursor: pointer;
  list-style: none;
  font-size: 11px !important;
  color: #555 !important;
  font-weight: 600 !important;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none !important;
  line-height: 1.2;
}

.ferry-app .pricing-toggle:hover,
.ferry-app .pricing-toggle:focus,
.ferry-app .pricing-toggle:visited,
.ferry-app .pricing-toggle:active {
  color: #555 !important;
  text-decoration: none !important;
}

.ferry-app .pricing-toggle .stopchev {
  width: 16px;
  height: 16px;
}

.ferry-app .pricing-toggle.open .stopchev {
  transform: rotate(90deg);
}

.ferry-port-icon {
  background: transparent !important;
  border: 0 !important;
}

.ferry-port-icon .ferry-port-icon-shape {
  display: block;
  width: 17px;
  height: 24px;
  max-height: 24px;
  background-repeat: no-repeat;
  background-position: center bottom;
  background-size: auto 100%;
}

.ferry-port-icon-orange .ferry-port-icon-shape {
  background-image: url('https://testcorner.nl/wp-content/uploads/2026/03/orange_marker.png');
}

.pricing-panel {
  margin-top: 6px;
  padding: 7px 9px;
  border: 1px solid #ffd5c2;
  background: #fff7f2;
  border-radius: 8px;
}

.pricing-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  line-height: 1.35;
}

.pricing-row + .pricing-row {
  margin-top: 4px;
}

.pricing-row .p-label {
  color: #666;
}

.pricing-row .p-value {
  color: #111;
  font-weight: 700;
  white-space: nowrap;
}

/* Share buttons styling */
.share-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid #e6e6e6;
  background: #fff;
  color: var(--ink);
  text-decoration: none;
  transition: all 0.15s ease;
  cursor: pointer;
}

.share-btn svg {
  width: 16px;
  height: 16px;
}

.share-btn:hover {
  transform: scale(1.08);
}

.share-btn:active {
  transform: scale(0.95);
}

/* WhatsApp specific styling - green */
.share-btn.share-whatsapp {
  color: #25d366;
  border-color: #25d366;
  background: rgba(37, 211, 102, 0.08);
}

.share-btn.share-whatsapp:hover {
  border-color: #25d366;
  background: rgba(37, 211, 102, 0.15);
  color: #25d366;
}

/* Email styling */
.share-btn.share-email {
  color: #666;
}

.share-btn.share-email:hover {
  border-color: #fd4902;
  background: rgba(253, 73, 2, 0.08);
  color: #fd4902;
}

/* Operator link styling */
.operator-link {
  font-weight: 400;
  color: #001f62;
  text-decoration: none;
}
.operator-link:hover {
  text-decoration: underline;
  color: #001f62;
}

/* Smaller style for the stopovers 'Select route' / clear link */
.select-entire-route,
.reset-selection {
  font-size: 11px !important;
  color: #001f62 !important;
  font-weight: 400 !important;
  text-decoration: none !important;
}

/* Hide filters UI (drawer and topbar filter pill) */
.ferry-topbar,
.ferry-topbar .ferry-pill,
.ferry-drawer {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}