/* ============================================
   FF PRÓXIMAS SALIDAS - Formentera Faster
   Plugin WP: ff-proximas-salidas
   Version: 1.1.0

   Incluye estilos para:
   - Widget expandido (.ff-salidas)        -> [ff_proximas_salidas]
   - Horarios completos (.ff-horarios)     -> [ff_horarios_completos]
   ============================================ */

:root {
  --ff-azul: #263C89;
  --ff-azul-oscuro: #0A2540;
  --ff-naranja: #E0984C;
  --ff-naranja-hover: #c9853e;
  --ff-gris-bg: #f8f9fa;
  --ff-gris-borde: #e5e7eb;
  --ff-gris-texto: #666;
  --ff-gris-claro: #999;
}

/* ===== Tipografía base para ambos widgets ===== */
.ff-salidas,
.ff-horarios {
  font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  box-sizing: border-box;
}

.ff-salidas *,
.ff-horarios * {
  box-sizing: border-box;
}

/* ============================================
   WIDGET COMPACTO — [ff_proximas_salidas]
   Barra horizontal tipo Formentera Express para la HOME
   ============================================ */

.ff-compact {
  max-width: 900px;
  margin: 20px auto;
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  overflow: hidden;
  font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.ff-compact__header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  background: var(--ff-azul);
  color: white;
}

.ff-compact__icon {
  width: 36px;
  height: 36px;
  background: rgba(255,255,255,0.15);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ff-compact__icon svg {
  width: 20px;
  height: 20px;
  fill: white;
}

.ff-compact__title-wrap {
  display: flex;
  align-items: baseline;
  gap: 16px;
  flex: 1;
  justify-content: space-between;
}

.ff-compact__title-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ff-compact__title {
  font-size: 18px;
  font-weight: 700;
  color: white;
  margin: 0;
  line-height: 1.1;
}

.ff-compact__subtitle {
  font-size: 12px;
  font-weight: 500;
  color: white;
  opacity: 0.85;
  text-transform: capitalize;
}

.ff-compact__countdown {
  font-size: 12px;
  font-weight: 700;
  color: var(--ff-naranja);
  margin-bottom: 4px;
  display: inline-block;
  padding: 3px 10px;
  background: rgba(224, 152, 76, 0.12);
  border-radius: 4px;
}

.ff-compact__link {
  color: white;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  opacity: 0.9;
}

.ff-compact__link:hover {
  opacity: 1;
  text-decoration: underline;
  color: white;
}

.ff-compact__body {
  display: flex;
  align-items: center;
  padding: 20px;
  gap: 20px;
}

.ff-compact__side {
  flex: 1;
  min-width: 0;
}

.ff-compact__route {
  font-size: 13px;
  color: var(--ff-gris-texto);
  font-weight: 600;
  margin-bottom: 4px;
}

.ff-compact__time {
  font-size: 32px;
  font-weight: 700;
  color: var(--ff-azul-oscuro);
  line-height: 1;
  margin-bottom: 6px;
}

.ff-compact__next {
  font-size: 12px;
  color: var(--ff-gris-texto);
}

.ff-compact__next strong {
  color: var(--ff-azul);
  font-weight: 700;
}

.ff-compact__no-data {
  font-size: 14px;
  color: var(--ff-gris-claro);
  font-style: italic;
  margin-top: 4px;
}

.ff-compact__divider {
  width: 1px;
  align-self: stretch;
  background: linear-gradient(to bottom, transparent, #e5e7eb, transparent);
}

/* Responsive compacto */
@media (max-width: 640px) {
  .ff-compact__body {
    flex-direction: column;
    gap: 16px;
    padding: 16px;
  }
  .ff-compact__divider {
    width: 100%;
    height: 1px;
    background: linear-gradient(to right, transparent, #e5e7eb, transparent);
  }
  .ff-compact__time { font-size: 28px; }
  .ff-compact__title-wrap {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
  }
}

/* ============================================
   WIDGET EXPANDIDO — [ff_proximas_salidas]
   ============================================ */

.ff-salidas {
  max-width: 900px;
  margin: 0 auto;
  padding: 20px;
}

.ff-salidas__header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.ff-salidas__icon {
  width: 40px;
  height: 40px;
  background: var(--ff-azul);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ff-salidas__icon svg {
  width: 22px;
  height: 22px;
  fill: white;
}

.ff-salidas__title {
  font-size: 22px;
  font-weight: 700;
  color: var(--ff-azul-oscuro);
  margin: 0;
}

.ff-salidas__link {
  margin-left: auto;
  color: var(--ff-naranja);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

.ff-salidas__link:hover {
  text-decoration: underline;
}

.ff-salidas__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 640px) {
  .ff-salidas__grid { grid-template-columns: 1fr; }
}

.ff-salidas__card {
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  overflow: hidden;
}

.ff-salidas__card-header {
  padding: 14px 20px;
  color: white;
  font-weight: 700;
  font-size: 15px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.ff-salidas__card-header svg {
  width: 20px;
  height: 20px;
  fill: white;
  flex-shrink: 0;
}

.ff-salidas__card--ida .ff-salidas__card-header { background: var(--ff-azul); }
.ff-salidas__card--vuelta .ff-salidas__card-header { background: var(--ff-azul-oscuro); }

.ff-salidas__departure {
  display: flex;
  align-items: center;
  padding: 14px 20px;
  border-bottom: 1px solid #f0f0f0;
  gap: 16px;
}

.ff-salidas__departure:last-child { border-bottom: none; }

.ff-salidas__time {
  font-size: 24px;
  font-weight: 700;
  color: var(--ff-azul-oscuro);
  min-width: 70px;
}

.ff-salidas__details {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ff-salidas__route {
  font-size: 13px;
  color: var(--ff-gris-texto);
}

.ff-salidas__ship {
  font-size: 12px;
  color: var(--ff-gris-claro);
}

.ff-salidas__price {
  font-size: 16px;
  font-weight: 700;
  color: var(--ff-naranja);
  text-align: right;
  min-width: 70px;
}

.ff-salidas__price small {
  display: block;
  font-size: 10px;
  font-weight: 400;
  color: var(--ff-gris-claro);
}

.ff-salidas__next {
  padding: 10px 20px;
  background: var(--ff-gris-bg);
  font-size: 13px;
  color: var(--ff-gris-texto);
}

.ff-salidas__next strong { color: var(--ff-azul); }

.ff-salidas__loading,
.ff-salidas__error {
  text-align: center;
  padding: 40px 20px;
  color: var(--ff-gris-texto);
  font-size: 14px;
}

.ff-salidas__cta {
  display: block;
  text-align: center;
  margin-top: 16px;
  padding: 14px;
  background: var(--ff-naranja);
  color: white;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 700;
  font-size: 16px;
  transition: background 0.2s;
}

.ff-salidas__cta:hover {
  background: var(--ff-naranja-hover);
  color: white;
}

.ff-salidas__pulse {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: var(--ff-azul);
  border-radius: 50%;
  animation: ff-pulse 1.2s infinite;
  margin-right: 8px;
}

@keyframes ff-pulse {
  0%, 100% { opacity: 0.3; transform: scale(0.8); }
  50%      { opacity: 1;   transform: scale(1.2); }
}

/* ============================================
   MÉTODOS DE PAGO (footer) — [ff_metodos_pago]
   ============================================ */
.ff-metodos-pago {
  display: flex !important;
  flex-direction: column !important;
  gap: 10px !important;
  font-family: 'Montserrat', system-ui, -apple-system, sans-serif;
  margin: 10px 0;
  width: 100%;            /* OJO: ocupar todo el ancho para que align funcione */
  box-sizing: border-box;
}
.ff-metodos-pago--center { align-items: center !important;     text-align: center; }
.ff-metodos-pago--left   { align-items: flex-start !important; text-align: left; }
.ff-metodos-pago--right  { align-items: flex-end !important;   text-align: right; }

.ff-metodos-pago__titulo {
  display: block;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: rgba(255, 255, 255, 0.75); /* footer suele ser oscuro */
  margin: 0;
  line-height: 1.2;
}

.ff-metodos-pago__lista {
  display: inline-flex !important;
  align-items: center;
  gap: 28px;                /* separación entre iconos */
  flex-wrap: wrap;
  padding: 0;
  margin: 0;
}
.ff-metodos-pago--left   .ff-metodos-pago__lista { justify-content: flex-start; }
.ff-metodos-pago--center .ff-metodos-pago__lista { justify-content: center; }
.ff-metodos-pago--right  .ff-metodos-pago__lista { justify-content: flex-end; }

.ff-metodos-pago__lista img {
  height: var(--ff-pago-altura, 28px) !important;
  width: auto !important;
  max-width: 100%;
  display: inline-block;
  object-fit: contain;
  vertical-align: middle;
  background: transparent;
  border-radius: 0;
  padding: 0;
  box-sizing: content-box;
  margin: 0;
}

@media (max-width: 640px) {
  .ff-metodos-pago__lista { gap: 14px; }
}

/* ============================================
   SKELETON LOADERS — estructura visible mientras carga la API
   ============================================ */
.ff-sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

.ff-skeleton {
  display: inline-block;
  background: linear-gradient(90deg,
      rgba(200, 210, 225, 0.5) 0%,
      rgba(220, 228, 240, 0.9) 50%,
      rgba(200, 210, 225, 0.5) 100%);
  background-size: 200% 100%;
  animation: ff-skeleton-shimmer 1.4s ease-in-out infinite;
  border-radius: 6px;
  vertical-align: middle;
}

/* Variante sobre fondo oscuro (header azul) */
.ff-compact__header .ff-skeleton {
  background: linear-gradient(90deg,
      rgba(255, 255, 255, 0.18) 0%,
      rgba(255, 255, 255, 0.38) 50%,
      rgba(255, 255, 255, 0.18) 100%);
  background-size: 200% 100%;
}

@keyframes ff-skeleton-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.ff-skeleton--line { height: 12px; display: block; }
.ff-skeleton--title    { width: 180px; height: 18px; }
.ff-skeleton--subtitle { width: 120px; height: 12px; margin-top: 6px; }
.ff-skeleton--link     { width: 90px;  height: 14px; border-radius: 999px; }

.ff-skeleton--route { width: 100px; height: 12px; margin-bottom: 8px; }
.ff-skeleton--time  {
    display: block;
    width: 120px;
    height: 34px;
    border-radius: 8px;
    margin-bottom: 8px;
}
.ff-skeleton--next  { width: 140px; height: 12px; }

/* Skeleton para horarios completos (tabla) */
.ff-horarios__skeleton-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}
@media (max-width: 1100px) {
    .ff-horarios__skeleton-grid { grid-template-columns: 1fr; }
}
.ff-horarios__skeleton-rows {
    padding: 4px 0;
}
.ff-skeleton-row {
    display: grid;
    grid-template-columns: 70px 1fr 70px;
    align-items: center;
    gap: 14px;
    padding: 14px 20px;
    border-bottom: 1px solid #f0f0f0;
}
.ff-skeleton-row:last-child { border-bottom: 0; }
.ff-skeleton--hora-lg {
    width: 56px;
    height: 22px;
    border-radius: 6px;
    display: block;
}
.ff-skeleton--barco { height: 14px; width: 80%; }
.ff-skeleton--precio {
    width: 60px;
    height: 18px;
    border-radius: 6px;
    display: block;
    justify-self: end;
}
.ff-skeleton--col-title {
    width: 200px;
    height: 16px;
}
.ff-horarios__loading {
    padding: 0 !important;
}

/* ============================================
   HORARIOS COMPLETOS — [ff_horarios_completos]
   ============================================ */

.ff-horarios {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

.ff-horarios__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 2px solid var(--ff-gris-borde);
}

.ff-horarios__title-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
}

.ff-horarios__icon {
  width: 48px;
  height: 48px;
  background: var(--ff-azul);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ff-horarios__icon svg {
  width: 26px;
  height: 26px;
  fill: white;
}

.ff-horarios__title {
  font-size: 26px;
  font-weight: 700;
  color: var(--ff-azul-oscuro);
  margin: 0;
}

/* Date picker */
.ff-horarios__date-picker {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ff-horarios__date-picker label {
  font-size: 14px;
  font-weight: 600;
  color: var(--ff-gris-texto);
}

.ff-horarios__date {
  padding: 10px 14px;
  border: 2px solid var(--ff-gris-borde);
  border-radius: 8px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  color: var(--ff-azul-oscuro);
  background: white;
  cursor: pointer;
  transition: border-color 0.2s;
}

.ff-horarios__date:focus {
  outline: none;
  border-color: var(--ff-azul);
}

.ff-horarios__date:hover {
  border-color: var(--ff-azul);
}

/* Banner fecha */
.ff-horarios__date-banner {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  background: linear-gradient(135deg, rgba(38, 60, 137, 0.08), rgba(224, 152, 76, 0.08));
  border-left: 4px solid var(--ff-naranja);
  border-radius: 8px;
  margin-bottom: 20px;
  color: var(--ff-azul-oscuro);
  font-weight: 600;
  font-size: 15px;
}

.ff-horarios__date-banner-icon {
  width: 20px;
  height: 20px;
  fill: var(--ff-azul);
  flex-shrink: 0;
}

.ff-horarios__date-banner-text {
  text-transform: capitalize;
}

/* Grid 2 columnas (ida / vuelta) */
.ff-horarios__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

@media (max-width: 1100px) {
  .ff-horarios__grid { grid-template-columns: 1fr; }
}

.ff-horarios__direction {
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  overflow: hidden;
}

.ff-horarios__direction-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 16px 20px;
  font-size: 17px;
  font-weight: 700;
  color: white;
}

.ff-horarios__direction-title--ida { background: var(--ff-azul); }
.ff-horarios__direction-title--vuelta { background: var(--ff-azul-oscuro); }

.ff-horarios__direction-icon {
  width: 22px;
  height: 22px;
  fill: white;
  flex-shrink: 0;
}

.ff-horarios__count {
  margin-left: auto;
  font-weight: 400;
  font-size: 13px;
  opacity: 0.9;
}

/* Tabla */
.ff-horarios__table-wrap {
  overflow-x: auto;
}

.ff-horarios__table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.ff-horarios__table thead {
  background: var(--ff-gris-bg);
  border-bottom: 2px solid var(--ff-gris-borde);
}

.ff-horarios__table th {
  padding: 12px 14px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--ff-gris-texto);
}

.ff-horarios__table td {
  padding: 14px 14px;
  border-bottom: 1px solid #f0f0f0;
  vertical-align: middle;
}

.ff-horarios__table th:first-child,
.ff-horarios__table td:first-child {
  padding-left: 20px;
}

.ff-horarios__table th:last-child,
.ff-horarios__table td:last-child {
  padding-right: 20px;
}

.ff-horarios__col-cta {
  padding-left: 20px !important;
}

.ff-horarios__row:hover { background: var(--ff-gris-bg); }
.ff-horarios__row:last-child td { border-bottom: none; }

.ff-horarios__row--past {
  opacity: 0.5;
  background: #fafafa;
}

.ff-horarios__row--past:hover { background: #fafafa; }

.ff-horarios__col-hora {
  font-size: 18px;
  font-weight: 700;
  color: var(--ff-azul-oscuro);
  white-space: nowrap;
  width: 75px;
  line-height: 1.1;
}

.ff-horarios__col-hora small {
  display: block;
  font-size: 11px;
  font-weight: 400;
  color: var(--ff-gris-claro);
  margin-top: 2px;
}

.ff-horarios__col-barco {
  font-size: 13px;
  line-height: 1.2;
}

.ff-horarios__col-barco strong {
  display: block;
  font-weight: 600;
  color: var(--ff-azul-oscuro);
}

.ff-horarios__col-barco small {
  display: block;
  font-size: 11px;
  color: var(--ff-gris-claro);
  font-weight: 400;
  margin-top: 2px;
}

.ff-horarios__col-precio {
  text-align: right;
  white-space: nowrap;
  width: 70px;
  padding-right: 4px !important;
}

.ff-horarios__precio-value {
  display: block;
  font-size: 15px;
  font-weight: 700;
  color: var(--ff-naranja);
  line-height: 1.1;
}

.ff-horarios__col-precio small {
  display: block;
  font-size: 9px;
  color: var(--ff-gris-claro);
  font-weight: 400;
  margin-top: 2px;
}

.ff-horarios__col-cta {
  text-align: right;
  white-space: nowrap;
  width: 90px;
}

.ff-horarios__reserve-btn {
  display: inline-block;
  padding: 9px 18px;
  background: var(--ff-naranja);
  color: white;
  text-decoration: none;
  border-radius: 6px;
  font-weight: 700;
  font-size: 13px;
  transition: background 0.2s;
  white-space: nowrap;
}

.ff-horarios__reserve-btn:hover {
  background: var(--ff-naranja-hover);
  color: white;
}

.ff-horarios__past-label {
  font-size: 12px;
  color: var(--ff-gris-claro);
  font-style: italic;
}

/* Estados */
.ff-horarios__loading,
.ff-horarios__error,
.ff-horarios__empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--ff-gris-texto);
  font-size: 14px;
}

.ff-horarios__error p {
  margin: 0 0 16px;
}

.ff-horarios__direction--empty {
  padding-bottom: 20px;
}

.ff-horarios__empty {
  padding: 30px 20px;
  font-style: italic;
}

/* CTA final */
.ff-horarios__cta-wrap {
  margin-top: 30px;
  text-align: center;
}

.ff-horarios__cta {
  display: inline-block;
  padding: 16px 40px;
  background: var(--ff-naranja);
  color: white;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 700;
  font-size: 16px;
  transition: background 0.2s;
}

.ff-horarios__cta:hover {
  background: var(--ff-naranja-hover);
  color: white;
}

/* Responsive: movil */
@media (max-width: 600px) {
  .ff-horarios__col-hora { font-size: 16px; width: 65px; }
  .ff-horarios__col-barco small { display: none; } /* Ocultar operadora en movil */
  .ff-horarios__reserve-btn { padding: 6px 10px; font-size: 11px; }
  .ff-horarios__table th,
  .ff-horarios__table td { padding: 10px 6px; }
}
