/* ==========================================================================
   CRUISE COMPANION - DESIGN SYSTEM & RESPONSIVE STYLES
   Dark Cyan Theme, Mobile-First + Tablet/Desktop Adaptive Layout
   ========================================================================== */

:root {
  --bg-dark: #0a0e17;
  --bg-header: #111726;
  --bg-card: #141d2d;
  --bg-input: #0e1522;
  --border-card: rgba(255, 255, 255, 0.08);

  --text-primary: #ffffff;
  --text-muted: #8e9bb0;
  --text-cyan: #06b6d4;
  --text-cyan-glow: #22d3ee;

  --accent-cyan: #06b6d4;
  --accent-cyan-light: #22d3ee;
  --accent-cyan-bg: rgba(6, 182, 212, 0.15);
  
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --nav-height: 64px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* Reset Global Estricto (Sin Desbordamiento Horizontal) */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  min-height: 100%;
  max-width: 100vw;
  background-color: var(--bg-dark);
  color: var(--text-primary);
  font-family: var(--font-family);
  overflow-x: hidden;
  user-select: none;
  -webkit-user-select: none;
  scroll-behavior: smooth;
}

/* App Root Contenedor Con Relleno Inferior Adecuado */
#app-root {
  min-height: 100vh;
  width: 100%;
  display: flex;
  flex-direction: column;
  max-width: 1100px;
  margin: 0 auto;
  position: relative;
  overflow-x: hidden;
  padding-bottom: calc(var(--nav-height) + var(--safe-bottom) + 50px);
}

/* --------------------------------------------------------------------------
   1. ENCABEZADO SUPERIOR NATIVO (TOP HEADER)
   -------------------------------------------------------------------------- */
.top-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: var(--bg-header);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(var(--safe-top) + 8px) 12px 8px 12px;
  border-bottom: 1px solid var(--border-card);
  width: 100%;
  gap: 8px;
}

.header-action-btn {
  background: var(--bg-input);
  border: 1px solid var(--border-card);
  border-radius: 12px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s ease, color 0.2s ease;
}

.header-action-btn:active {
  background: var(--accent-cyan-bg);
  color: var(--accent-cyan);
}

.header-brand {
  text-align: center;
  overflow: hidden;
  flex: 1;
  padding: 0 4px;
}

.brand-title {
  font-size: clamp(0.8rem, 3.5vw, 1.05rem);
  font-weight: 900;
  letter-spacing: 0.5px;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-title .accent-cyan { color: var(--accent-cyan); }

.brand-status {
  font-size: clamp(0.6rem, 2.5vw, 0.68rem);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* --------------------------------------------------------------------------
   2. PESTAÑAS SUPERIORES SECUNDARIAS (TOP TAB BAR RESPONSIVA TIPO PÍLDORAS)
   -------------------------------------------------------------------------- */
.top-tab-bar {
  background-color: var(--bg-header);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  overflow-x: auto;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  padding: 10px 12px 10px 12px;
  gap: 8px;
  border-bottom: 1px solid var(--border-card);
  width: 100%;
  box-sizing: border-box;
}

@media (min-width: 768px) {
  .top-tab-bar {
    justify-content: center;
    flex-wrap: wrap;
    overflow-x: visible;
    white-space: normal;
    padding: 12px 20px;
    gap: 10px;
  }
}

.top-tab-bar::-webkit-scrollbar {
  height: 3px;
}

.top-tab-bar::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
}

.top-tab-bar::-webkit-scrollbar-thumb {
  background: var(--accent-cyan);
  border-radius: 2px;
}

.top-tab-item {
  flex: 0 0 auto;
  background: var(--bg-input);
  border: 1px solid var(--border-card);
  padding: 6px 14px;
  border-radius: 20px;
  color: var(--text-muted);
  font-size: clamp(0.68rem, 2.5vw, 0.8rem);
  font-weight: 800;
  letter-spacing: 0.3px;
  cursor: pointer;
  white-space: nowrap;
  text-align: center;
  transition: all 0.2s ease;
}

@media (min-width: 768px) {
  .top-tab-item {
    font-size: 0.82rem;
    padding: 8px 16px;
  }
}

.top-tab-item.active {
  background: var(--accent-cyan-bg);
  color: var(--accent-cyan);
  border-color: var(--accent-cyan);
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.25);
}

.top-tab-item.active::after { display: none; }

/* Selector de Barco y Fecha con Texto Blanco Nítido en Móvil/Tablet/PC */
.cruise-select-box,
#select-cruise-ship,
#select-cruise-date {
  color: #ffffff !important;
  background-color: rgba(15, 23, 42, 0.9) !important;
  border: 1.5px solid var(--accent-cyan) !important;
  font-weight: 800 !important;
  font-size: 0.84rem !important;
  border-radius: 10px !important;
}

#select-cruise-ship option,
#select-cruise-date option {
  background-color: #0f172a !important;
  color: #ffffff !important;
  font-weight: 700 !important;
}

/* --------------------------------------------------------------------------
   3. CONTENEDOR DE VISTAS Y CARDS (RESPONSIVO MÓVIL/TABLET/PC)
   -------------------------------------------------------------------------- */
.content-container {
  flex: 1;
  padding: 14px;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

.view-panel {
  display: none;
  animation: fadeIn 0.25s ease-out;
  width: 100%;
}

.view-panel.active { display: block; }

/* Tarjetas Base (App Card) Adaptables */
.app-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 18px;
  padding: 16px 14px;
  margin-bottom: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.card-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  gap: 8px;
  flex-wrap: wrap;
}

.card-title {
  font-size: clamp(0.95rem, 3.8vw, 1.1rem);
  font-weight: 800;
  letter-spacing: 0.5px;
  color: #ffffff;
  word-break: break-word;
}

.card-menu-btn {
  background: var(--bg-input);
  border: 1px solid var(--border-card);
  color: var(--text-muted);
  border-radius: 8px;
  min-width: 44px;
  min-height: 44px;
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: 2px;
  cursor: pointer;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s, color 0.2s;
}

.card-menu-btn:hover,
.card-menu-btn:active {
  background: var(--accent-cyan-bg);
  color: var(--accent-cyan);
  border-color: var(--accent-cyan);
}

.sub-label {
  font-size: 0.68rem;
  color: var(--text-muted);
  display: block;
  font-weight: 600;
}

.section-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-muted);
  margin: 16px 0 10px 0;
}

/* --------------------------------------------------------------------------
   VISTA: GUÍA DE DESTINOS POR PUERTO
   -------------------------------------------------------------------------- */
.dest-port-selector {
  display: flex;
  gap: 6px;
  margin: 12px 0 16px 0;
  overflow-x: auto;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 4px;
  width: 100%;
}

.dest-btn {
  flex: 1 0 auto;
  min-width: 80px;
  background: var(--bg-input);
  border: 1px solid var(--border-card);
  color: var(--text-muted);
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 0.8rem;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  text-align: center;
}

.dest-btn.active {
  background: var(--accent-cyan-bg);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

.destinations-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.dest-card {
  padding: 14px 12px;
  border-radius: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.dest-card h4, .dest-card p, .dest-card div, .dest-card span {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  word-break: break-word;
  overflow-wrap: break-word;
}

.dest-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  flex-wrap: wrap;
  gap: 6px;
}

.dest-title {
  font-size: 0.92rem;
  font-weight: 800;
  color: #ffffff;
}

.dest-duration {
  font-size: 0.65rem;
  font-weight: 700;
  background: rgba(6, 182, 212, 0.15);
  color: var(--accent-cyan);
  padding: 3px 8px;
  border-radius: 8px;
}

.dest-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.35;
  margin: 4px 0;
}

.dest-tip {
  font-size: 0.7rem;
  color: var(--accent-cyan-light);
  font-weight: 600;
  margin-top: 4px;
  display: block;
}

/* --------------------------------------------------------------------------
   VISTA 1: TIEMPOS & ITINERARIO
   -------------------------------------------------------------------------- */
.hero-clock-box { text-align: center; padding: 20px 14px; }

.card-tag-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  gap: 8px;
}

.tag-title {
  font-size: clamp(0.6rem, 2.5vw, 0.68rem);
  font-weight: 800;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

.tag-badge {
  font-size: 0.62rem;
  font-weight: 700;
  background: rgba(6, 182, 212, 0.2);
  color: var(--accent-cyan);
  padding: 3px 8px;
  border-radius: 10px;
  white-space: nowrap;
}

.time-readout {
  font-size: clamp(2.2rem, 10vw, 3rem);
  font-weight: 900;
  letter-spacing: 1px;
  color: var(--accent-cyan);
  text-shadow: 0 0 16px rgba(6, 182, 212, 0.4);
  margin: 6px 0;
  font-variant-numeric: tabular-nums;
}

.date-readout { font-size: clamp(0.78rem, 3vw, 0.9rem); color: var(--text-muted); }

.itinerary-timeline {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
  width: 100%;
}

.timeline-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--bg-input);
  border: 1px solid var(--border-card);
  width: 100%;
}

.t-badge {
  font-size: 0.68rem;
  font-weight: 800;
  padding: 4px 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  flex-shrink: 0;
}

.t-badge.active {
  background: var(--accent-cyan);
  color: #0a0e17;
}

.t-info strong { display: block; font-size: clamp(0.8rem, 3.2vw, 0.88rem); word-break: break-word; }
.t-info small { font-size: 0.7rem; color: var(--text-muted); }

.ports-grid-container {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  width: 100%;
}

.port-box { padding: 12px; margin-bottom: 0; display: flex; flex-direction: column; justify-content: space-between; }
.port-top { display: flex; align-items: center; gap: 8px; }
.port-flag-badge { font-size: 1.4rem; line-height: 1; flex-shrink: 0; }
.port-meta h4 { font-size: clamp(0.8rem, 3vw, 0.9rem); font-weight: 800; word-break: break-word; }
.port-meta small { font-size: 0.65rem; color: var(--text-muted); }

.port-time-val {
  font-size: clamp(1rem, 4vw, 1.22rem);
  font-weight: 900;
  color: #ffffff;
  margin-top: 6px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.port-diff-tag {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--accent-cyan);
  display: block;
  margin-top: 4px;
}

/* --------------------------------------------------------------------------
   VISTA 2: FINANZAS & PROPINAS
   -------------------------------------------------------------------------- */
.budget-summary-wrapper {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 12px 0 16px 0;
  flex-wrap: wrap;
}

.progress-ring-box {
  position: relative;
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ring-svg { transform: rotate(-90deg); width: 80px; height: 80px; }
.ring-bg { fill: none; stroke: rgba(255, 255, 255, 0.08); stroke-width: 10; }
.ring-progress {
  fill: none;
  stroke: var(--accent-cyan);
  stroke-width: 10;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.5s ease;
}
.ring-text { position: absolute; font-size: 0.95rem; font-weight: 900; color: #ffffff; }

.budget-text-details { flex: 1; min-width: 140px; }
.total-spent-heading { font-size: clamp(1.6rem, 6vw, 2.2rem); font-weight: 900; color: #ffffff; margin: 2px 0; }
.budget-limit-text { font-size: 0.75rem; color: var(--text-muted); }

.tip-percent-selector { display: flex; gap: 6px; margin: 12px 0; }
.tip-btn {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border-card);
  color: var(--text-muted);
  padding: 8px 4px;
  border-radius: 10px;
  font-size: 0.8rem;
  font-weight: 800;
  cursor: pointer;
}
.tip-btn.active {
  background: var(--accent-cyan-bg);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

.tip-results-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tip-res-card { padding: 10px; border-radius: 12px; background: var(--bg-input); text-align: center; }
.tip-res-card small { display: block; font-size: 0.68rem; color: var(--text-muted); }
.tip-res-card strong { font-size: 1rem; font-weight: 900; margin-top: 2px; display: block; }

.usd-input-wrapper { position: relative; display: flex; align-items: center; width: 100%; }
.currency-prefix { position: absolute; left: 14px; font-size: 1.1rem; font-weight: 800; color: var(--text-cyan); }

.custom-input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-card);
  border-radius: 12px;
  padding: 10px 12px 10px 32px;
  color: #ffffff;
  font-size: 0.95rem;
  font-weight: 700;
  outline: none;
  font-family: inherit;
}

.custom-textarea { padding-left: 12px; resize: none; }

.currency-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 8px;
  width: 100%;
}

.currency-card {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px;
  border-radius: 12px;
  background: var(--bg-input);
  border: 1px solid var(--border-card);
}

.c-flag { font-size: 1.3rem; flex-shrink: 0; }
.c-details { display: flex; flex-direction: column; overflow: hidden; }
.c-country { font-size: 0.65rem; color: var(--text-muted); white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }
.c-val { font-size: 0.88rem; font-weight: 800; color: var(--text-cyan); }
.c-rate { font-size: 0.6rem; color: var(--text-muted); }

/* --------------------------------------------------------------------------
   VISTA 3: NAVEGACIÓN & MUSTER STATION
   -------------------------------------------------------------------------- */
.compass-box { text-align: center; padding: 20px 14px; }
.compass-dial-container { display: flex; justify-content: center; margin: 12px 0 20px 0; }

.compass-bezel {
  width: clamp(170px, 50vw, 210px);
  height: clamp(170px, 50vw, 210px);
  border-radius: 50%;
  border: 4px solid var(--accent-cyan);
  background: radial-gradient(circle, #151f33 0%, #0a0e17 100%);
  box-shadow: 0 0 24px rgba(6, 182, 212, 0.35);
  position: relative;
  transition: transform 0.1s linear;
}

.dial-mark { position: absolute; font-weight: 900; font-size: 0.8rem; color: var(--text-muted); }
.dial-mark.N { top: 6px; left: 50%; transform: translateX(-50%); color: #ef4444; }
.dial-mark.NE { top: 22px; right: 22px; font-size: 0.68rem; }
.dial-mark.E { right: 8px; top: 50%; transform: translateY(-50%); }
.dial-mark.SE { bottom: 22px; right: 22px; font-size: 0.68rem; }
.dial-mark.S { bottom: 6px; left: 50%; transform: translateX(-50%); }
.dial-mark.SW { bottom: 22px; left: 22px; font-size: 0.68rem; }
.dial-mark.W { left: 8px; top: 50%; transform: translateY(-50%); }
.dial-mark.NW { top: 22px; left: 22px; font-size: 0.68rem; }

.compass-needle-arrow {
  position: absolute;
  top: 50%; left: 50%;
  width: 6px; height: 110px;
  margin-left: -3px; margin-top: -55px;
  background: linear-gradient(to bottom, var(--accent-cyan) 50%, #ffffff 50%);
  clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
}

.compass-center-cap {
  position: absolute;
  top: 50%; left: 50%;
  width: 12px; height: 12px;
  margin-left: -6px; margin-top: -6px;
  border-radius: 50%;
  background: var(--accent-cyan);
  border: 2px solid #ffffff;
}

.form-row-2 {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
  width: 100%;
}

@media (min-width: 640px) {
  .form-row-2 {
    flex-direction: row;
  }
}

.readonly-input {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: var(--bg-input);
  border: 1px solid var(--border-card);
  border-radius: 12px;
  padding: 10px 14px;
  color: var(--accent-cyan);
  font-size: clamp(0.85rem, 3.4vw, 0.95rem);
  font-weight: 800;
  width: 100%;
  box-sizing: border-box;
}
.form-row-2 .form-group { flex: 1; min-width: 120px; }

.weather-forecast-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin: 14px 0;
  width: 100%;
}

.forecast-card {
  padding: 10px 4px;
  border-radius: 12px;
  background: var(--bg-input);
  text-align: center;
  border: 1px solid var(--border-card);
}

.f-day { display: block; font-size: 0.65rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.f-icon { font-size: 1.3rem; display: block; margin: 2px 0; }
.f-temp { font-size: 0.75rem; font-weight: 800; color: #ffffff; }

/* --------------------------------------------------------------------------
   VISTA 4: CHECKLISTS & BITÁCORA
   -------------------------------------------------------------------------- */
.cl-subtitle { display: block; font-size: 0.82rem; color: var(--accent-cyan); font-weight: 700; margin: 2px 0 6px 0; }
.cl-category-selector { display: flex; gap: 6px; margin-bottom: 14px; overflow-x: auto; }

.cl-cat-btn {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border-card);
  padding: 8px;
  border-radius: 10px;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.cl-cat-btn.active {
  background: var(--accent-cyan-bg);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

.todo-items-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }

.todo-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--bg-input);
  border: 1px solid var(--border-card);
  cursor: pointer;
  width: 100%;
}

.todo-left { display: flex; align-items: center; gap: 10px; flex: 1; overflow: hidden; }

.custom-checkbox {
  width: 20px; height: 20px;
  border-radius: 6px;
  border: 2px solid var(--text-muted);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem; color: #ffffff;
  flex-shrink: 0;
}

.todo-item-row.completed .custom-checkbox {
  background: var(--accent-cyan);
  border-color: var(--accent-cyan);
  color: #0a0e17;
}

.todo-text { font-size: 0.85rem; font-weight: 600; word-break: break-word; }
.todo-item-row.completed .todo-text { text-decoration: line-through; opacity: 0.5; }

.journal-entries-list { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }

.journal-card-entry {
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--bg-input);
  border: 1px solid var(--border-card);
}

.journal-card-entry h5 { font-size: 0.85rem; font-weight: 800; color: var(--accent-cyan); }
.journal-card-entry p { font-size: 0.78rem; color: var(--text-primary); margin-top: 4px; word-break: break-word; }
.journal-card-entry small { font-size: 0.65rem; color: var(--text-muted); display: block; margin-top: 4px; }

/* --------------------------------------------------------------------------
   VISTA 5: FRASES DE PUERTO (TRADUCTOR OFFLINE)
   -------------------------------------------------------------------------- */
.phrase-category-list { display: flex; flex-direction: column; gap: 12px; }

.phrase-card {
  padding: 12px;
  border-radius: 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-card);
}

.phrase-cat-tag {
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--accent-cyan);
  letter-spacing: 0.5px;
  display: block;
  margin-bottom: 6px;
}

.phrase-row { margin-bottom: 8px; }
.phrase-row:last-child { margin-bottom: 0; }
.phrase-row strong { display: block; font-size: 0.84rem; color: #ffffff; word-break: break-word; }
.phrase-row small { font-size: 0.72rem; color: var(--text-muted); display: block; margin-top: 2px; word-break: break-word; }

/* --------------------------------------------------------------------------
   VISTA 6: COMPARTIR & BOTONES
   -------------------------------------------------------------------------- */
.share-box { text-align: center; padding: 20px 14px; }
.share-desc { font-size: 0.8rem; color: var(--text-muted); line-height: 1.35; margin-bottom: 14px; }

.qr-canvas-holder {
  background: #ffffff;
  padding: 12px;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 6px auto 16px auto;
  max-width: 210px;
  width: 100%;
}

#qr-canvas {
  display: block;
  max-width: 180px;
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  margin: 0 auto;
}

.qr-url-label {
  display: block;
  font-size: 0.62rem;
  color: #0a0e17;
  font-weight: 800;
  margin-top: 6px;
  word-break: break-all;
  overflow-wrap: anywhere;
}

.btn-cyan {
  background-color: var(--accent-cyan);
  color: #0a0e17;
  border: none;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 800;
  padding: 12px 16px;
  border-radius: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: transform 0.15s ease;
  box-shadow: 0 0 16px rgba(6, 182, 212, 0.3);
  text-align: center;
}

.btn-cyan:active { transform: scale(0.96); }
.btn-full { width: 100%; }
.btn-sm { padding: 8px 12px; font-size: 0.75rem; }
.btn-lg { padding: 12px 16px; font-size: 0.95rem; }

.flex-1 { flex: 1; }
.flex-2 { flex: 2; }

/* Bottom Nav Bar Fija */
.bottom-nav-bar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 1100px;
  height: calc(var(--nav-height) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background-color: var(--bg-header);
  border-top: 1px solid var(--border-card);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 100;
}

.nav-btn {
  background: none;
  border: none;
  outline: none;
  cursor: pointer;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--text-muted);
  padding: 4px 0;
  transition: color 0.2s ease;
}

.nav-svg { width: 20px; height: 20px; transition: transform 0.2s ease; }
.nav-text { font-size: clamp(0.6rem, 2.4vw, 0.68rem); font-weight: 700; white-space: nowrap; }
.nav-btn.active { color: var(--accent-cyan); }
.nav-btn.active .nav-svg { transform: translateY(-2px); filter: drop-shadow(0 0 6px var(--accent-cyan)); }

/* Modal & Toast */
.modal-overlay {
  position: fixed; top: 0; left: 0;
  width: 100vw; height: 100vh;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  z-index: 200;
  display: flex; align-items: center; justify-content: center;
  padding: 14px;
}

.modal-overlay.hidden { display: none; }
.modal-card { background: var(--bg-card); border: 1px solid var(--border-card); border-radius: 20px; padding: 18px; width: 100%; max-width: 400px; }
.modal-card h3 { margin-bottom: 12px; font-size: 1rem; }
.form-group { margin-bottom: 10px; }
.form-group label { display: block; font-size: 0.72rem; color: var(--text-muted); margin-bottom: 4px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 14px; }

.btn-secondary-dark {
  background: var(--bg-input);
  color: var(--text-muted);
  border: 1px solid var(--border-card);
  padding: 10px 14px;
  border-radius: 12px;
  font-weight: 700;
  cursor: pointer;
  font-size: 0.8rem;
}

/* Drawer Menu Overlay Responsivo */
.drawer-overlay {
  position: fixed; top: 0; left: 0;
  width: 100vw; height: 100vh;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  z-index: 9999;
  display: flex;
  justify-content: flex-start;
  transition: opacity 0.25s ease;
}

.drawer-overlay.hidden {
  display: none;
}

.drawer-panel {
  width: 80%;
  max-width: 320px;
  height: 100%;
  background: var(--bg-card);
  border-right: 1px solid var(--border-card);
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.5);
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-card);
}

.drawer-header h3 {
  font-size: 0.95rem;
  font-weight: 800;
  color: #ffffff;
}

.drawer-close-btn {
  background: var(--bg-input);
  border: 1px solid var(--border-card);
  color: var(--text-muted);
  width: 32px; height: 32px;
  border-radius: 50%;
  font-size: 0.9rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}

.drawer-menu-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 410px;
  overflow-y: scroll;
  padding-right: 6px;
  scrollbar-width: thin;
  scrollbar-color: var(--accent-cyan-glow) rgba(255, 255, 255, 0.05);
}

/* Scrollbar personalizado delgado para el menú lateral */
.drawer-menu-list::-webkit-scrollbar {
  width: 4px;
  display: block;
}

.drawer-menu-list::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
}

.drawer-menu-list::-webkit-scrollbar-thumb {
  background-color: var(--accent-cyan-glow);
  border-radius: 4px;
}

.drawer-item {
  background: var(--bg-input);
  border: 1px solid var(--border-card);
  color: #ffffff;
  padding: 12px 14px;
  border-radius: 14px;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  text-align: left;
  transition: background 0.2s ease;
}

.drawer-item:active {
  background: var(--accent-cyan-bg);
  color: var(--accent-cyan);
}

.toast-box {
  position: fixed;
  bottom: calc(var(--nav-height) + var(--safe-bottom) + 14px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent-cyan);
  color: #0a0e17;
  font-size: 0.82rem;
  font-weight: 800;
  padding: 10px 16px;
  border-radius: 20px;
  box-shadow: 0 4px 20px rgba(6, 182, 212, 0.4);
  z-index: 300;
  transition: opacity 0.3s ease, transform 0.3s ease;
  white-space: normal;
  text-align: center;
  line-height: 1.3;
  width: auto;
  max-width: 92vw;
  word-break: break-word;
}

.toast-box.hidden { opacity: 0; transform: translate(-50%, 20px); pointer-events: none; }

/* Pie de Página Desarrollador (100% Responsivo & Centrado) */
.app-dev-footer {
  background: rgba(255, 255, 255, 0.03);
  border: 1.5px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  padding: 12px 16px;
  margin: 18px auto 10px auto;
  text-align: center;
  width: 100%;
  max-width: 100%;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.app-dev-footer p {
  font-size: clamp(0.78rem, 3.2vw, 0.88rem);
  margin: 0 auto;
  text-align: center;
  width: 100%;
  display: block;
}

.dev-text-dark {
  color: #94a3b8;
  font-weight: 800;
}

.dev-link {
  color: #06b6d4;
  font-weight: 900;
  text-decoration: none;
  transition: color 0.15s ease;
  margin-left: 3px;
}

.dev-link:hover, .dev-link:active, .dev-link:focus {
  color: #38bdf8;
  text-decoration: underline;
}

@media (min-width: 768px) {
  .ports-grid-container { grid-template-columns: repeat(4, 1fr); }
  .currency-cards-grid { grid-template-columns: repeat(4, 1fr); }
  .content-container { padding: 20px 24px; }
  .app-card { padding: 22px 20px; }
}

/* Botón Volver Arriba Animado */
.btn-scroll-top {
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.2), rgba(6, 182, 212, 0.4));
  border: 1.5px solid var(--accent-cyan);
  color: var(--text-cyan-glow);
  border-radius: 50%;
  width: 42px;
  height: 42px;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 12px rgba(34, 211, 238, 0.3);
  animation: pulse-glow-btn 2s infinite;
}

.btn-scroll-top:hover {
  transform: translateY(-4px) scale(1.08);
  box-shadow: 0 0 20px rgba(34, 211, 238, 0.7);
  background: var(--accent-cyan-light);
  color: #0a0e17;
  border-color: var(--accent-cyan-light);
}

.btn-scroll-top:active {
  transform: translateY(-1px) scale(0.95);
}

@keyframes pulse-glow-btn {
  0% { box-shadow: 0 0 10px rgba(34, 211, 238, 0.2); }
  50% { box-shadow: 0 0 20px rgba(34, 211, 238, 0.6); }
  100% { box-shadow: 0 0 10px rgba(34, 211, 238, 0.2); }
}

/* Estilos de Insignias Doradas del Pasaporte de Crucero */
.passport-badge-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 14px;
  padding: 12px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.passport-badge-card.unlocked {
  border-color: #eab308;
  background: linear-gradient(135deg, rgba(234, 179, 8, 0.12), rgba(15, 23, 42, 0.9));
  box-shadow: 0 0 14px rgba(234, 179, 8, 0.25);
}

.passport-badge-icon {
  font-size: 2.2rem;
  margin-bottom: 6px;
  filter: grayscale(1) opacity(0.4);
  transition: all 0.3s ease;
}

.passport-badge-card.unlocked .passport-badge-icon {
  filter: grayscale(0) opacity(1);
  transform: scale(1.1);
}

.passport-badge-title {
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.passport-badge-card.unlocked .passport-badge-title {
  color: #eab308;
}

.passport-badge-desc {
  font-size: 0.68rem;
  color: var(--text-muted);
  line-height: 1.3;
}

/* Grilla Responsiva Equilibrada para Pasaporte (2 cols en móvil, 4 cols en PC/Tablet) */
.passport-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  width: 100%;
}

@media (min-width: 640px) {
  .passport-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
  }
}

@media (min-width: 1024px) {
  .passport-grid {
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
  }
}

/* Grilla del diccionario náutico: 2 columnas en celular (2 arriba, 2 abajo), 4 columnas en PC */
.nautical-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

@media (min-width: 768px) {
  .nautical-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
  }
}

/* Hover effects responsivos para tarjetas del diccionario náutico */
.nautical-term-card {
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s ease, border-color 0.2s ease;
  user-select: none;
}
.nautical-term-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(6, 182, 212, 0.25);
  border-color: var(--accent-cyan) !important;
}
.nautical-term-card:active {
  transform: scale(0.97);
}

/* --------------------------------------------------------------------------
   REGLAS RESPONSIVAS UNIVERSALES (MÓVIL, TABLET Y PC/DESKTOP)
   -------------------------------------------------------------------------- */
/* Dispositivos Móviles Pequeños y Medianos (hasta 639px) */
@media (max-width: 639px) {
  #indoor-map-svg-container {
    height: 380px !important;
  }
  .deck-btn {
    padding: 6px 10px !important;
    font-size: 0.75rem !important;
  }
  .top-tab-item {
    font-size: 0.72rem !important;
    padding: 8px 12px !important;
  }
  .search-destination-modal {
    padding: 12px !important;
  }
}

/* Tablets e iPads (640px a 1023px) */
@media (min-width: 640px) and (max-width: 1023px) {
  #indoor-map-svg-container {
    height: 480px !important;
  }
  .content-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px 24px;
  }
}

/* Pantallas Grandes, Laptops y Monitores PC (1024px o superior) */
@media (min-width: 1024px) {
  #indoor-map-svg-container {
    height: 560px !important;
  }
  .content-container {
    max-width: 1150px;
    margin: 0 auto;
    padding: 24px 32px;
  }
  .app-card {
    border-radius: 20px;
  }
}

/* ==========================================================================
   COMPONENT: SMART ADVERTISING ROTATOR (CAROUSEL / SLIDER)
   ========================================================================== */

#ad-banner-container {
  position: relative;
  margin: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box;
  z-index: 10;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.95) 0%, rgba(6, 182, 212, 0.12) 100%);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1.5px solid var(--accent-cyan);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5), 0 0 12px rgba(6, 182, 212, 0.2);
  border-radius: 16px;
  padding: 14px 20px !important;
  display: flex !important;
  align-items: center !important;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  user-select: none;
  font-family: inherit;
  min-height: auto !important;
  height: auto !important;
}

/* Ocultar completamente los dots (rotación 100% automática) */
.ad-dots, .ad-dot {
  display: none !important;
}

/* ---- WRAPPER PRINCIPAL ---- */
.ad-wrapper {
  position: relative;
  display: flex;
  width: 100%;
  gap: 12px;
  align-items: center;
}

/* MOBILE (< 768px): columna centrada */
@media (max-width: 767px) {
  #ad-banner-container {
    padding: 14px 14px !important;
  }
  .ad-wrapper {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
  }
}

/* TABLET / DESKTOP (>= 768px): fila - texto izquierda, botones derecha */
@media (min-width: 768px) {
  .ad-wrapper {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
  }
}

/* Etiqueta exterior */
.ad-badge {
  font-size: 0.68rem;
  font-weight: 800;
  color: #00D2FF;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  background: rgba(0, 210, 255, 0.15);
  border: 1px solid rgba(0, 210, 255, 0.4);
  padding: 4px 10px;
  border-radius: 8px;
  display: inline-block;
  margin: 0;
}

/* ---- CONTENIDO DEL SLIDE ---- */
.ad-slide-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 0;
  background: transparent !important;
}

/* Mobile: centrado */
@media (max-width: 767px) {
  .ad-slide-content {
    align-items: center;
    text-align: center;
    width: 100%;
  }
}

/* Desktop: izquierda */
@media (min-width: 768px) {
  .ad-slide-content {
    align-items: flex-start;
    text-align: left;
  }
}

.ad-text-box {
  display: flex;
  flex-direction: column;
  background: transparent !important;
  min-width: 0;
  width: 100%;
}

/* Mobile */
@media (max-width: 767px) {
  .ad-text-box {
    align-items: center;
    text-align: center;
  }
}

/* Desktop */
@media (min-width: 768px) {
  .ad-text-box {
    align-items: flex-start;
    text-align: left;
  }
}

.ad-title {
  font-size: 0.95rem;
  font-weight: 900;
  color: #ffffff;
  margin: 0 0 3px 0;
  line-height: 1.25;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

@media (max-width: 767px) {
  .ad-title {
    justify-content: center;
  }
}

@media (min-width: 768px) {
  .ad-title {
    justify-content: flex-start;
  }
}

.ad-desc {
  font-size: 0.82rem;
  color: #cbd5e1;
  margin: 0;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

@media (max-width: 767px) {
  .ad-desc {
    text-align: center;
  }
}

@media (min-width: 768px) {
  .ad-desc {
    text-align: left;
    font-size: 0.84rem;
  }
}

/* ---- GRUPO DE BOTONES ---- */
.ad-action-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* Mobile: fila centrada, botones en la misma fila */
@media (max-width: 767px) {
  .ad-action-group {
    width: 100%;
    justify-content: center;
    flex-direction: row;
  }
  .ad-action-group > div {
    display: flex !important;
    flex-direction: row !important;
    width: 100% !important;
    justify-content: center !important;
    gap: 6px !important;
  }
}

/* Desktop: fila a la derecha */
@media (min-width: 768px) {
  .ad-action-group {
    justify-content: flex-end;
  }
  .ad-action-group > div {
    display: flex !important;
    flex-direction: row !important;
    gap: 8px !important;
    justify-content: flex-end !important;
  }
}

/* ---- BOTONES ---- */
.ad-btn-action {
  background: linear-gradient(135deg, #06b6d4, #10b981);
  color: #0f172a !important;
  border: none;
  font-size: 0.78rem;
  font-weight: 900;
  padding: 8px 14px;
  border-radius: 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 12px rgba(6, 182, 212, 0.25);
  white-space: nowrap;
}

/* Mobile: botones iguales en ancho */
@media (max-width: 767px) {
  .ad-btn-action {
    flex: 1 1 0%;
    min-width: 0;
    width: auto;
    max-width: 50%;
    font-size: 0.7rem;
    padding: 8px 6px;
  }
}

.ad-btn-action:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(34, 211, 238, 0.4);
}
.ad-btn-action:active {
  transform: translateY(1px);
}

/* Animaciones del Slider */
.ad-slide-animation {
  animation: adFadeEffect 0.4s ease-in-out;
}

@keyframes adFadeEffect {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}
