/* ==========================================================================
   YachtFriends — Boat Archive Styles
   ========================================================================== */

.yf-boat-archive-container {
  max-width: 1200px;
  margin: 40px auto;
  padding: 0 20px;
}

.yf-boat-archive-header {
  margin-bottom: 40px;
  text-align: center;
}

.yf-boat-archive-header h1 {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--yf-primary, #6c9e9e);
  margin-bottom: 10px;
}

.yf-boat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 30px;
}

.yf-boat-card {
  background: #fff;
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
  border: 1px solid #f0f0f0;
}

.yf-boat-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.yf-boat-card-image {
  position: relative;
  height: 220px;
  overflow: hidden;
}

.yf-boat-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.yf-boat-card:hover .yf-boat-card-image img {
  transform: scale(1.1);
}

.yf-boat-card-price {
  position: absolute;
  bottom: 15px;
  left: 15px;
  background: rgba(255, 255, 255, 0.9);
  padding: 6px 12px;
  border-radius: 8px;
  font-weight: 700;
  color: var(--yf-text-main, #2d3436);
  font-size: 0.9rem;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.yf-boat-card-content {
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.yf-boat-card-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0 0 10px 0;
  color: var(--yf-text-main, #2d3436);
}

.yf-boat-card-title a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s;
}

.yf-boat-card-title a:hover {
  color: var(--yf-primary, #6c9e9e);
}

.yf-boat-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  margin-bottom: 15px;
  color: var(--yf-text-muted, #636e72);
  font-size: 0.85rem;
}

.yf-boat-card-meta-item {
  display: flex;
  align-items: center;
  gap: 5px;
}

.yf-boat-card-meta-item i {
  color: var(--yf-primary, #6c9e9e);
  font-size: 1rem;
}

.yf-boat-card-excerpt {
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--yf-text-muted, #636e72);
  margin-bottom: 20px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.yf-boat-card-footer {
  margin-top: auto;
  padding-top: 15px;
  border-top: 1px solid #f0f0f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.yf-boat-card-btn {
  background: var(--yf-primary, #6c9e9e);
  color: #fff !important;
  padding: 8px 18px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.85rem;
  text-decoration: none !important;
  transition: background 0.2s;
}

.yf-boat-card-btn:hover {
  background: var(--yf-primary-hover, #5a8a8a);
}

/* Pagination */
.yf-boat-pagination {
  margin-top: 50px;
  display: flex;
  justify-content: center;
}

.yf-boat-pagination .nav-links {
  display: flex;
  gap: 10px;
}

.yf-boat-pagination .page-numbers {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border: 1px solid #dfe6e9;
  border-radius: 8px;
  text-decoration: none;
  color: var(--yf-text-main, #2d3436);
  font-weight: 600;
  transition: all 0.2s;
}

.yf-boat-pagination .page-numbers.current,
.yf-boat-pagination .page-numbers:hover {
  background: var(--yf-primary, #6c9e9e);
  color: #fff;
  border-color: var(--yf-primary, #6c9e9e);
}

.yf-mobile-filter-toggle {
  display: none;
}

.yf-close-sidebar-btn {
  display: none;
}

.yf-sidebar-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(4px);
  z-index: 99998;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.yf-sidebar-backdrop.is-visible {
  opacity: 1;
  pointer-events: auto;
}

body.yf-sidebar-open {
  overflow: hidden;
}

/* Failsafe to restore CSS sticky behavior across Hello Elementor theme wrappers */
.post-type-archive-yf_boat #page,
.post-type-archive-yf_boat #content,
.post-type-archive-yf_boat .site-main,
.post-type-archive-yf_boat main,
.tax-yf_boat_category #page,
.tax-yf_boat_category #content,
.tax-yf_boat_category .site-main,
.tax-yf_boat_category main,
.tax-yf_boat_location #page,
.tax-yf_boat_location #content,
.tax-yf_boat_location .site-main,
.tax-yf_boat_location main {
  overflow: visible !important;
}

.yf-boat-archive-layout {
  display: flex;
  flex-wrap: wrap;
  gap: 30px;
  margin-top: 20px;
}

.yf-archive-sidebar {
  flex: 0 0 280px;
  width: 280px;
  position: -webkit-sticky;
  position: sticky;
  top: 120px; /* Offset for custom website fixed header nav bars */
  align-self: flex-start;
}

.yf-archive-results-column {
  flex: 1;
  min-width: 0; /* Prevents flex overflow */
}

/* Sticky Filter Sidebar Box */
.yf-filter-box {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 24px;
  box-shadow:
    0 4px 6px -1px rgba(0, 0, 0, 0.05),
    0 2px 4px -1px rgba(0, 0, 0, 0.02);
}

.yf-filter-box-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #1a6985;
  margin: 0 0 20px 0;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 12px;
}

.yf-filter-group {
  margin-bottom: 18px;
}

.yf-filter-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: #475569;
  margin-bottom: 8px;
}

.yf-filter-group label i {
  color: #6c9e9e;
  margin-right: 4px;
  width: 14px;
  text-align: center;
}

.yf-filter-input {
  width: 100%;
  height: 42px;
  padding: 8px 12px;
  background: #f8fafc;
  border: 1.5px solid #cbd5e1;
  border-radius: 8px;
  color: #334155;
  font-size: 0.9rem;
  outline: none;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.yf-filter-input:focus {
  background: #ffffff;
  border-color: #1a6985;
  box-shadow: 0 0 0 3px rgba(26, 105, 133, 0.1);
}

/* Range Inputs Side-by-Side */
.yf-filter-range-inputs {
  display: flex;
  align-items: center;
  gap: 8px;
}

.yf-range-input {
  flex: 1;
  text-align: center;
  padding: 8px;
  min-width: 0;
}

/* Stacked Date Availability Layout */
.yf-filter-date-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.yf-date-input {
  width: 100% !important;
  box-sizing: border-box;
}

.yf-date-arrow {
  color: #6c9e9e;
  font-size: 1.1rem;
  margin: 2px 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.yf-range-separator {
  color: #94a3b8;
  font-weight: 600;
}

/* Reset Button Style */
.yf-reset-btn {
  width: 100%;
  height: 42px;
  margin-top: 10px;
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.yf-reset-btn:hover {
  background: #e2e8f0;
  color: #1e293b;
  border-color: #94a3b8;
}

/* Loading Overlay and Fading */
.yf-grid-loading-container {
  position: relative;
}

.yf-loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.7);
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.yf-grid-loading-container.is-loading .yf-loading-overlay {
  opacity: 1;
  pointer-events: auto;
}

.yf-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(108, 158, 158, 0.2);
  border-top: 3px solid #6c9e9e;
  border-radius: 50%;
  animation: yfSpin 0.8s linear infinite;
}

@keyframes yfSpin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Results Header Bar */
.yf-results-bar {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 12px 18px;
  margin-bottom: 24px;
  font-weight: 600;
  font-size: 0.95rem;
  color: #475569;
}

/* No Results Block */
.yf-no-results {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  background: #f8fafc;
  border: 2px dashed #cbd5e1;
  border-radius: 12px;
  color: #64748b;
  font-size: 1.1rem;
}

/* Responsive collapse rules */
@media (max-width: 991px) {
  .yf-mobile-filter-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px 24px;
    background: #1a6985;
    color: #ffffff !important;
    border: none;
    border-radius: 8px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    margin-bottom: 20px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(26, 105, 133, 0.15);
  }

  .yf-mobile-filter-toggle:hover,
  .yf-mobile-filter-toggle:focus {
    background: #15546b;
  }

  .yf-mobile-filter-toggle.is-active {
    background: #ef4444;
    box-shadow: 0 4px 6px rgba(239, 68, 68, 0.15);
  }

  .yf-boat-archive-layout {
    flex-direction: column;
    margin-top: 10px;
  }

  .yf-archive-sidebar {
    display: block !important;
    position: fixed;
    top: 0;
    left: 0;
    width: 320px;
    max-width: 85%;
    height: 100vh;
    z-index: 99999;
    background: #ffffff;
    box-shadow: 5px 0 25px rgba(0, 0, 0, 0.15);
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    margin-bottom: 0;
  }

  .yf-archive-sidebar.is-open {
    transform: translateX(0);
  }

  .yf-close-sidebar-btn {
    display: flex;
    position: absolute;
    top: 24px;
    right: 24px;
    background: #f1f5f9;
    color: #475569;
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 10;
  }

  .yf-close-sidebar-btn:hover {
    background: #e2e8f0;
    color: #1e293b;
  }

  .yf-filter-box {
    position: relative;
    border: none;
    border-radius: 0;
    padding: 30px 24px;
    min-height: 100%;
    box-shadow: none;
    max-height: none;
    overflow-y: visible;
    box-sizing: border-box;
  }

  .yf-filter-box-title {
    padding-right: 40px;
  }

  #yf-boat-filter-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
  }

  .yf-filter-group {
    margin-bottom: 0;
  }

  .yf-reset-btn {
    margin-top: 10px;
  }
}

/* Custom styled inputs for range selection (Min/Max fields) */
.yf-archive-filter-range-input,
.yf-range-input {
    height: 44px !important;
    padding: 8px 12px !important;
    font-size: 14px !important;
    color: #1e293b !important;
    background-color: #ffffff !important;
    background-image: none !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 8px !important;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05) !important;
    box-sizing: border-box !important;
    text-align: left !important;
    outline: none !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.yf-archive-filter-range-input:hover,
.yf-range-input:hover {
    border-color: #cbd5e1 !important;
    background-color: #f8fafc !important;
}

.yf-archive-filter-range-input:focus,
.yf-range-input:focus {
    border-color: #0284c7 !important;
    background-color: #ffffff !important;
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15) !important;
}
