/* ==========================================================================
   CRUISELINE TRIP - COMPONENTS STYLESHEET
   Search Widget, Autocomplete, Calendar, Travelers, Modals & Results Cards
   ========================================================================== */

/* ==========================================================================
   CRUISE SEARCH WIDGET (HERO & STANDALONE)
   ========================================================================== */
.cruise-search-box {
  background-color: var(--bg-white);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  padding: 24px;
  max-width: 1140px;
  margin: 0 auto;
  position: relative;
  z-index: 100;
  border: 1px solid rgba(255, 255, 255, 0.8);
}

.search-box-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 14px;
  flex-wrap: wrap;
  gap: 12px;
}

.search-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
}

.search-tab-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  font-weight: 700;
  font-size: 0.9rem;
  background-color: var(--primary-navy);
  color: var(--text-white);
}

.search-tab-item svg {
  width: 16px;
  height: 16px;
  fill: var(--accent-gold);
}

.search-call-prompt {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.search-call-prompt a {
  color: var(--call-green);
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.search-call-prompt a:hover {
  text-decoration: underline;
}

/* Search Form Grid */
.search-form-grid {
  display: grid;
  grid-template-columns: 1.4fr 1.4fr 1.1fr 1fr 1fr 1.2fr;
  gap: 12px;
  align-items: flex-start;
}

.search-form-actions {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border-light);
  flex-wrap: wrap;
  gap: 12px;
}

.search-action-btns {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

.search-guarantee-text {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.search-guarantee-text svg {
  width: 16px;
  height: 16px;
  fill: var(--call-green);
}

/* Individual Search Field */
.search-field-group {
  position: relative;
  display: flex;
  flex-direction: column;
}

.search-label {
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--primary-navy);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.search-label svg {
  width: 14px;
  height: 14px;
  fill: var(--accent-coral);
}

.search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  background-color: var(--bg-light);
  border: 1.5px solid var(--border-medium);
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
  min-height: 52px;
  cursor: pointer;
}

.search-input-wrapper:hover {
  border-color: var(--primary-blue);
  background-color: var(--bg-white);
}

.search-input-wrapper.active,
.search-input-wrapper:focus-within {
  border-color: var(--accent-cyan);
  background-color: var(--bg-white);
  box-shadow: 0 0 0 3px rgba(0, 166, 251, 0.2);
}

.search-input-wrapper.has-error {
  border-color: var(--accent-coral);
  background-color: #FEF2F2;
}

.search-field-icon {
  padding-left: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  flex-shrink: 0;
}

.search-field-icon svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.search-input {
  width: 100%;
  border: none;
  background: transparent;
  padding: 12px 10px;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-dark);
  outline: none;
}

.search-input::placeholder {
  color: var(--text-light);
  font-weight: 500;
}

/* Clear button on autocomplete inputs */
.search-field-clear {
  display: none;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  margin-right: 6px;
  border-radius: 50%;
  color: var(--text-muted);
  background: transparent;
  transition: all 0.2s ease;
}

.search-field-clear.visible {
  display: flex;
}

.search-field-clear:hover {
  background-color: var(--border-light);
  color: var(--accent-coral);
}

.search-field-clear svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

.field-error-msg {
  font-size: 0.75rem;
  color: #DC2626;
  font-weight: 600;
  margin-top: 4px;
  display: none;
}

.field-error-msg.visible {
  display: block;
}

/* ==========================================================================
   APPLICATION AUTOCOMPLETE POPUP / LISTBOX
   ========================================================================== */
.autocomplete-panel {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  width: 100%;
  min-width: 300px;
  max-height: 340px;
  background-color: var(--bg-white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--border-medium);
  z-index: 1000;
  overflow-y: auto;
  display: none;
  animation: dropdown-fade-in 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes dropdown-fade-in {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.autocomplete-panel.open {
  display: block;
}

.autocomplete-header {
  padding: 8px 14px;
  background-color: var(--bg-light);
  border-bottom: 1px solid var(--border-light);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.autocomplete-list {
  padding: 6px 0;
}

.autocomplete-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  cursor: pointer;
  transition: background-color 0.15s ease;
  gap: 12px;
}

.autocomplete-item:hover,
.autocomplete-item.active {
  background-color: #F1F5F9;
}

.autocomplete-item.selected {
  background-color: rgba(0, 166, 251, 0.1);
}

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

.item-icon {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  background-color: rgba(19, 64, 116, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-blue);
  flex-shrink: 0;
}

.item-icon svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.item-text {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.item-primary {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text-dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.item-primary mark {
  background: rgba(246, 174, 45, 0.4);
  color: inherit;
  padding: 0 1px;
  border-radius: 2px;
}

.item-secondary {
  font-size: 0.8125rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.item-badge {
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background-color: var(--bg-light);
  color: var(--text-muted);
  font-weight: 600;
  white-space: nowrap;
}

.autocomplete-empty {
  padding: 20px 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.875rem;
}

.autocomplete-empty-call {
  margin-top: 8px;
  font-weight: 700;
  color: var(--call-green);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* ==========================================================================
   DATE PICKER / CALENDAR POPUP (CLICK ANYWHERE TO OPEN)
   ========================================================================== */
.calendar-panel {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  width: 320px;
  background-color: var(--bg-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--border-medium);
  z-index: 1000;
  padding: 16px;
  display: none;
  animation: dropdown-fade-in 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.calendar-panel.open {
  display: block;
}

.cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.cal-nav-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-navy);
  border: 1px solid var(--border-light);
  background-color: var(--bg-light);
  transition: all 0.2s ease;
}

.cal-nav-btn:hover {
  background-color: var(--primary-blue);
  color: var(--text-white);
  border-color: var(--primary-blue);
}

.cal-nav-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.cal-nav-btn svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

.cal-month-title {
  font-size: 1rem;
  font-weight: 800;
  color: var(--primary-navy);
}

.cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.cal-days-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.cal-day-cell {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  color: var(--text-dark);
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.cal-day-cell:hover:not(.disabled) {
  background-color: rgba(0, 166, 251, 0.15);
  color: var(--primary-navy);
}

.cal-day-cell.today {
  border: 1.5px solid var(--accent-cyan);
  font-weight: 800;
}

.cal-day-cell.selected {
  background-color: var(--primary-blue);
  color: var(--text-white);
  font-weight: 800;
}

.cal-day-cell.disabled {
  color: var(--border-medium);
  cursor: not-allowed;
  background-color: transparent;
}

.cal-day-cell.empty {
  cursor: default;
}

.cal-footer {
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cal-today-btn {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--primary-blue);
}

.cal-today-btn:hover {
  color: var(--accent-coral);
}

/* ==========================================================================
   TRAVELERS POPOVER
   ========================================================================== */
.travelers-panel {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: 290px;
  background-color: var(--bg-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--border-medium);
  z-index: 1000;
  padding: 18px;
  display: none;
  animation: dropdown-fade-in 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.travelers-panel.open {
  display: block;
}

.traveler-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-light);
}

.traveler-row:last-child {
  border-bottom: none;
}

.traveler-info h5 {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--primary-navy);
}

.traveler-info p {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.stepper-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-step {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1.5px solid var(--border-medium);
  background-color: var(--bg-light);
  color: var(--primary-navy);
  font-weight: 800;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.btn-step:hover:not(:disabled) {
  border-color: var(--primary-navy);
  background-color: var(--primary-navy);
  color: var(--text-white);
}

.btn-step:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.step-count {
  font-size: 1rem;
  font-weight: 800;
  width: 20px;
  text-align: center;
}

.travelers-apply-btn {
  width: 100%;
  margin-top: 14px;
}

/* ==========================================================================
   DURATION & CRUISE LINE DROPDOWNS
   ========================================================================== */
.select-panel {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  width: 100%;
  min-width: 220px;
  background-color: var(--bg-white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--border-medium);
  z-index: 1000;
  padding: 6px 0;
  max-height: 280px;
  overflow-y: auto;
  display: none;
}

.select-panel.open {
  display: block;
}

.select-option {
  padding: 10px 16px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-dark);
  cursor: pointer;
  transition: background-color 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.select-option:hover,
.select-option.active {
  background-color: #F1F5F9;
  color: var(--primary-blue);
}

.select-option.selected {
  background-color: rgba(0, 166, 251, 0.1);
  font-weight: 700;
}

/* ==========================================================================
   CRUISE SEARCH RESULTS CARD (HORIZONTAL & VERTICAL)
   ========================================================================== */
.results-card {
  background-color: var(--bg-white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  display: grid;
  grid-template-columns: 300px 1fr 240px;
  overflow: hidden;
  transition: all 0.3s ease;
  margin-bottom: 20px;
}

.results-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent-cyan);
}

.rc-media {
  position: relative;
  min-height: 220px;
  background-color: var(--primary-navy);
}

.rc-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.rc-badge-deal {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
}

.rc-ship-tag {
  position: absolute;
  bottom: 12px;
  left: 12px;
  background: rgba(11, 37, 69, 0.85);
  color: var(--text-white);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 700;
  backdrop-filter: blur(4px);
  z-index: 2;
}

.rc-content {
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.rc-header {
  margin-bottom: 12px;
}

.rc-line-dest {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--accent-coral);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.rc-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--primary-navy);
  line-height: 1.3;
}

.rc-itinerary-preview {
  margin-bottom: 16px;
}

.rc-ports-list {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.rc-port-chip {
  background-color: var(--bg-light);
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-dark);
  border: 1px solid var(--border-light);
}

.rc-features {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.rc-feature-item {
  display: flex;
  align-items: center;
  gap: 5px;
}

.rc-feature-item svg {
  width: 14px;
  height: 14px;
  fill: var(--primary-blue);
}

.rc-pricing-col {
  background-color: #FAFBFD;
  border-left: 1px solid var(--border-light);
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-align: right;
}

.rc-price-header {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.rc-price-tag-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 700;
}

.rc-price-amount {
  font-size: 1.8rem;
  font-weight: 900;
  color: var(--primary-navy);
  line-height: 1;
}

.rc-price-unit {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
}

.rc-price-taxes {
  font-size: 0.75rem;
  color: var(--text-light);
  margin-top: 4px;
}

.rc-price-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
}

.btn-view-cruise {
  width: 100%;
}

.btn-card-call {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background-color: rgba(16, 185, 129, 0.12);
  color: #065F46;
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 10px;
  border-radius: var(--radius-md);
  font-weight: 800;
  font-size: 0.875rem;
  transition: all 0.2s ease;
}

.btn-card-call:hover {
  background-color: var(--call-green);
  color: var(--text-white);
}

.btn-card-call svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

/* ==========================================================================
   MODAL DIALOG (REQUEST QUOTE / CALL CONCIERGE)
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(7, 23, 44, 0.75);
  backdrop-filter: blur(4px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-dialog {
  background-color: var(--bg-white);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  max-width: 580px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  transform: scale(0.95);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-backdrop.open .modal-dialog {
  transform: scale(1);
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--primary-navy);
}

.modal-close-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: var(--bg-light);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.modal-close-btn:hover {
  background-color: var(--accent-coral);
  color: var(--text-white);
}

.modal-body {
  padding: 24px;
}

.modal-call-banner {
  background: linear-gradient(135deg, var(--primary-navy) 0%, var(--primary-blue) 100%);
  color: var(--text-white);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.modal-call-banner a {
  color: #A7F3D0;
  font-weight: 800;
  font-size: 1.1rem;
}

.modal-form-group {
  margin-bottom: 16px;
}

.modal-form-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 6px;
}

.modal-form-input {
  width: 100%;
  border: 1.5px solid var(--border-medium);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  font-size: 0.9375rem;
  background-color: var(--bg-light);
}

.modal-form-input:focus {
  outline: none;
  border-color: var(--accent-cyan);
  background-color: var(--bg-white);
}

.modal-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* ==========================================================================
   RESPONSIVE COMPONENT ADJUSTMENTS
   ========================================================================== */
@media (max-width: 1100px) {
  .search-form-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .results-card {
    grid-template-columns: 240px 1fr 200px;
  }
}

@media (max-width: 820px) {
  .search-form-grid {
    grid-template-columns: 1fr 1fr;
  }
  .results-card {
    grid-template-columns: 1fr;
  }
  .rc-media {
    height: 200px;
  }
  .rc-pricing-col {
    border-left: none;
    border-top: 1px solid var(--border-light);
    text-align: left;
  }
  .rc-pricing-col {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
  .rc-price-actions {
    flex-direction: row;
    margin-top: 0;
  }
}

@media (max-width: 768px) {
  .cruise-search-box {
    padding: 16px 14px;
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  }

  .search-box-header {
    margin-bottom: 14px;
    padding-bottom: 10px;
    gap: 8px;
  }

  .search-tab-item {
    font-size: 0.8rem;
    padding: 6px 12px;
  }

  .search-call-prompt {
    font-size: 0.8rem;
  }

  .search-form-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .search-label {
    font-size: 0.72rem;
    margin-bottom: 4px;
  }

  .search-input-wrapper {
    min-height: 48px;
  }

  .search-input {
    font-size: 0.9rem;
    padding: 10px 8px;
  }

  .search-form-actions {
    margin-top: 12px;
    padding-top: 12px;
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
  }

  .search-action-btns {
    width: 100%;
    margin-left: 0;
  }

  .search-action-btns .btn {
    width: 100%;
    padding: 14px 20px;
    font-size: 1.05rem;
    font-weight: 800;
  }

  .search-guarantee-text {
    justify-content: center;
    font-size: 0.75rem;
    text-align: center;
  }

  .autocomplete-panel,
  .cal-panel,
  .travelers-panel,
  .duration-panel {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100vw;
    max-width: 100vw;
    border-radius: 20px 20px 0 0;
    max-height: 80vh;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.35);
    z-index: 999999;
    padding-bottom: max(20px, env(safe-area-inset-bottom));
  }

  .rc-pricing-col {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }

  .rc-price-actions {
    width: 100%;
    flex-direction: column;
  }

  .rc-price-actions .btn {
    width: 100%;
    text-align: center;
  }

  .modal-form-row {
    grid-template-columns: 1fr;
  }
}

/* Skeleton Loading Animation */
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.skeleton-box {
  background: linear-gradient(90deg, #E2E8F0 25%, #F1F5F9 50%, #E2E8F0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-md);
}

