/* =========================================================
   PREMIUM DYNAMIC BOATS GALLERY (boats-gallery.js)
   ========================================================= */

.dn-gallery-wrap {
  width: 100%;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

/* --- FILTERS --- */
.dn-filters {
  display: flex;
  gap: 16px;
  margin-bottom: 40px;
  position: sticky;
  top: 80px; 
  z-index: 100;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 16px 24px;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(255,255,255,0.4);
}

.dn-filter-group {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.dn-filter-label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

.dn-filter-select {
  flex: 1;
  padding: 14px 20px;
  border-radius: 10px;
  border: 1px solid #e1e6eb;
  background-color: #f8fafc;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  color: #1e293b;
  cursor: pointer;
  outline: none;
  transition: all 0.2s ease;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='20' height='20' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 18px;
}

.dn-filter-select:focus,
.dn-filter-select:hover {
  border-color: #cbd5e1;
  background-color: #ffffff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}

/* --- GRID --- */
.dn-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-bottom: 50px;
}

/* --- CARD --- */
.dn-card {
  background: #ffffff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 12px 30px rgba(0,0,0,0.08);
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(0,0,0,0.04);
}

.dn-card:hover {
  transform: translateY(-10px) scale(1.02);
  box-shadow: 0 25px 60px rgba(0,0,0,0.15);
  border-color: rgba(0,0,0,0.08);
}

/* --- CARD IMAGE --- */
.dn-card-img {
  width: 100%;
  height: 180px;
  position: relative;
  background: #f8fafc;
  overflow: hidden;
}

.dn-carousel-container {
  display: flex;
  position: relative;
}

.dn-carousel-track {
  display: flex;
  width: 100%;
  height: 100%;
  transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
  will-change: transform;
}

.dn-carousel-track img {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.dn-card:hover .dn-carousel-track img {
  transform: scale(1.05);
}

.dn-carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.75);
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #1e293b;
  font-size: 1.2rem;
  font-weight: bold;
  opacity: 0;
  transition: opacity 0.3s ease, background 0.2s ease, transform 0.2s ease;
  z-index: 10;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  pointer-events: none;
}

.dn-card:hover .dn-carousel-btn {
  opacity: 1;
  pointer-events: auto;
}

.dn-carousel-btn:hover {
  background: #ffffff;
  transform: translateY(-50%) scale(1.1);
}

.dn-carousel-btn.dn-prev { left: 8px; }
.dn-carousel-btn.dn-next { right: 8px; }

.dn-carousel-dots {
  position: absolute;
  bottom: 12px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 6px;
  z-index: 10;
  pointer-events: none;
}

.dn-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  transition: all 0.3s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.dn-dot.active {
  background: #ffffff;
  transform: scale(1.3);
}

.dn-card-img::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.2) 0%, rgba(0,0,0,0) 30%, rgba(0,0,0,0) 70%, rgba(0,0,0,0.4) 100%);
  pointer-events: none;
}

/* --- BADGES --- */
.dn-badge-destacado {
  position: absolute;
  top: 16px;
  left: 16px;
  background: linear-gradient(135deg, #111 0%, #333 100%);
  color: #e8c68c;
  padding: 6px 14px;
  font-size: 0.72rem;
  font-weight: 800;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  z-index: 2;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

.dn-badge-tipo {
  position: absolute;
  bottom: 16px;
  right: 16px;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #fff;
  padding: 6px 12px;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 8px;
  z-index: 2;
  letter-spacing: 0.02em;
}

/* --- CARD BODY --- */
.dn-card-body {
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.dn-title {
  margin: 0 0 10px 0;
  font-size: 1.15rem;
  color: #0f172a;
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

/* --- SPECS --- */
.dn-specs {
  display: flex;
  flex-wrap: wrap;
  column-gap: 16px;
  row-gap: 8px;
  color: #64748b;
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 16px;
}

.dn-specs span {
  display: inline-flex;
  align-items: center;
}

.dn-skipper-badge {
  display: inline-flex;
  align-items: center;
  background: #f1f5f9;
  color: #475569;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-bottom: 20px;
  align-self: flex-start;
  border: 1px solid #e2e8f0;
}

/* --- PRICE --- */
.dn-price {
  margin-top: auto;
  font-size: 0.85rem;
  color: #64748b;
  margin-bottom: 20px;
  border-top: 1px solid #f1f5f9;
  padding-top: 16px;
  line-height: 1.4;
}

.dn-price strong {
  font-size: 1.25rem;
  color: #000;
  font-weight: 900;
  letter-spacing: -0.02em;
}

/* --- CTA BUTTON --- */
.dn-btn-cta {
  display: block;
  text-align: center;
  background: #000;
  color: #ffffff;
  padding: 12px 16px;
  border-radius: 8px;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.dn-btn-cta:hover {
  background: #e8c68c;
  color: #000;
  box-shadow: 0 8px 20px rgba(232, 198, 140, 0.4);
  transform: translateY(-3px);
}

/* --- PAGINATION & EMPTY STATE --- */
.dn-pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 40px;
  flex-wrap: wrap;
}

.dn-page-btn {
  padding: 10px 18px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  color: #475569;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s ease;
  font-size: 0.9rem;
}

.dn-page-btn:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #0f172a;
}

.dn-page-btn.active {
  background: #0f172a;
  color: #ffffff;
  border-color: #0f172a;
}

.dn-no-results {
  grid-column: 1 / -1;
  text-align: center;
  padding: 80px 20px;
  background: #f8fafc;
  border-radius: 16px;
  color: #334155;
  border: 1px dashed #e2e8f0;
}

.dn-no-results p {
  font-size: 1.15rem;
  margin-bottom: 24px;
  font-weight: 500;
}

/* --- SKELETON --- */
.dn-skeleton-img {
  width: 100%;
  height: 220px;
  background: #f1f5f9;
  animation: dn-pulse 1.5s infinite ease-in-out;
}

.dn-skeleton-text {
  height: 20px;
  background: #f1f5f9;
  margin: 16px 24px;
  border-radius: 6px;
  animation: dn-pulse 1.5s infinite ease-in-out;
}

@keyframes dn-pulse {
  0% { opacity: 1; }
  50% { opacity: 0.6; }
  100% { opacity: 1; }
}

/* --- RESPONSIVE --- */
@media (max-width: 1024px) {
  .dn-filters { padding: 12px 16px; }
}

@media (max-width: 820px) {
  /* Mantenemos 4 columnas */
}

@media (max-width: 640px) {
  .dn-filters { 
    display: grid; 
    grid-template-columns: repeat(4, 1fr); 
    gap: 4px; 
    position: relative; 
    top: 0; 
    padding: 6px; 
    background: rgba(255, 255, 255, 0.85); 
    backdrop-filter: blur(12px); 
    -webkit-backdrop-filter: blur(12px); 
    border-radius: 8px; 
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.05); 
    border: 1px solid rgba(255,255,255,0.4); 
    margin-bottom: 12px; 
  }
  .dn-filter-select {
    padding: 6px 12px 6px 4px;
    font-size: 0.55rem;
    background-position: right 2px center;
    background-size: 10px;
    border-radius: 6px;
  }
  .dn-grid { gap: 8px; margin-bottom: 20px; grid-template-columns: repeat(3, 1fr); }
  
  /* Achicar fichas de los barcos para 3 columnas */
  .dn-card-img { height: 110px; } 
  .dn-card-body { padding: 8px 6px; }
  
  /* Textos y títulos */
  .dn-title { font-size: 0.75rem; margin-bottom: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 1.1; }
  .dn-specs { font-size: 0.55rem; gap: 4px; margin-bottom: 6px; flex-direction: column; align-items: flex-start; }
  .dn-skipper-badge { font-size: 0.5rem; padding: 3px 6px; margin-bottom: 6px; border-radius: 4px; border-width: 0.5px;}
  
  /* Precio */
  .dn-price { padding-top: 4px; font-size: 0.5rem; margin-bottom: 6px; margin-top: auto; }
  .dn-price strong { font-size: 0.65rem; }
  
  /* Botones y Badges */
  .dn-btn-cta { padding: 4px 2px; font-size: 0.5rem; letter-spacing: 0; border-radius: 4px; }
  .dn-badge-destacado { padding: 2px 4px; font-size: 0.45rem; top: 4px; left: 4px; border-radius: 4px; }
  .dn-badge-tipo { padding: 2px 4px; font-size: 0.45rem; bottom: 4px; right: 4px; border-radius: 4px; }
  
  /* Botones del carrusel más pequeños para no tapar todo */
  .dn-carousel-btn { width: 20px; height: 20px; font-size: 0.55rem; }
  .dn-dot { width: 4px; height: 4px; }
  
}


/* =========================================================
   MODAL FLOTANTE (DETALLE COMPLETO)
   ========================================================= */
.dn-modal-overlay {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(15, 23, 42, 0.9);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  z-index: 99999;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  opacity: 0; pointer-events: none;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 20px;
}

.dn-modal-overlay.active {
  opacity: 1; pointer-events: auto;
}

.dn-modal {
  background: #fff;
  width: 100%;
  max-width: 1100px;
  height: 85vh;
  display: flex;
  flex-direction: row; /* Desktop standard */
  border-radius: 24px;
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.5);
  position: relative;
  transform: translateY(20px) scale(0.98);
  transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
  font-family: 'Inter', system-ui, sans-serif;
}

.dn-modal-overlay.active .dn-modal {
  transform: translateY(0) scale(1);
}

.dn-modal-close {
  position: absolute; top: 20px; right: 20px;
  width: 44px; height: 44px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(4px);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.8rem; color: #000;
  cursor: pointer; border: 1px solid rgba(0,0,0,0.1);
  z-index: 100000; transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.dn-modal-close:hover { background: #000; color: #fff; transform: rotate(90deg); }

/* --- LEFT COLUMN: GALERÍA --- */
.dn-modal-left {
  flex: 1.2;
  height: 100%;
  background: #000;
  position: relative;
  overflow: hidden;
}

.dn-modal-gallery {
  width: 100%;
  height: 100%;
  position: relative;
}

.dn-modal-img {
  width: 100%; height: 100%; object-fit: cover;
  position: absolute; top: 0; left: 0;
  opacity: 0; transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}
.dn-modal-img.active { opacity: 1; z-index: 1; }

.dn-modal-img-counter {
  position: absolute; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: rgba(0,0,0,0.5); color: #fff;
  padding: 8px 20px; border-radius: 30px;
  font-size: 0.85rem; font-weight: 700; letter-spacing: 0.15em;
  z-index: 10; backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.2);
}

.dn-modal-gallery-btn {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.2);
  width: 50px; height: 50px; border-radius: 50%;
  cursor: pointer; font-size: 1.4rem; color: #fff;
  z-index: 10; transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex; align-items: center; justify-content: center;
}
.dn-modal-gallery-btn:hover { background: rgba(255,255,255,1); color: #000; transform: translateY(-50%) scale(1.1); }
.dn-modal-btn-prev { left: 20px; }
.dn-modal-btn-next { right: 20px; }

/* --- RIGHT COLUMN: INFO --- */
.dn-modal-right {
  flex: 1;
  min-height: 0; /* Important for inner scroll in flex column */
  display: flex;
  flex-direction: column;
  background: #fff;
  position: relative;
}

.dn-modal-header {
  padding: 40px 40px 20px;
  border-bottom: 1px solid #f1f5f9;
}

.dn-modal-top-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.dn-modal-type {
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #64748b;
  background: #f1f5f9;
  padding: 4px 10px;
  border-radius: 4px;
}

.dn-modal-badge {
  font-size: 0.7rem;
  font-weight: 700;
  color: #0f172a;
  background: #e8c68c;
  padding: 4px 10px;
  border-radius: 4px;
}

.dn-modal-title {
  font-size: 2rem;
  font-weight: 900;
  color: #0f172a;
  margin: 0 0 8px 0;
  letter-spacing: -0.03em;
  line-height: 1.1;
  font-family: 'Outfit', sans-serif;
}

.dn-modal-location {
  font-size: 0.9rem;
  color: #64748b;
  font-weight: 500;
}

.dn-modal-scroll-area {
  flex: 1;
  overflow-y: auto;
  padding: 20px 40px 40px;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
}

.dn-modal-scroll-area::-webkit-scrollbar { width: 6px; }
.dn-modal-scroll-area::-webkit-scrollbar-thumb { background-color: #cbd5e1; border-radius: 10px; }

.dn-modal-section {
  margin-bottom: 40px;
}

.dn-modal-section-title {
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #94a3b8;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.dn-modal-section-title::after { content: ''; height: 1px; background: #f1f5f9; flex: 1; }

.dn-modal-text {
  font-size: 1rem;
  line-height: 1.6;
  color: #334155;
  white-space: pre-line;
}

/* Specs Grid */
.dn-modal-specs-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.dn-modal-spec-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: #f8fafc;
  border-radius: 12px;
  border: 1px solid #f1f5f9;
}

.dn-modal-spec-icon { font-size: 1.25rem; }
.dn-modal-spec-info { display: flex; flex-direction: column; }
.dn-modal-spec-label { font-size: 0.7rem; color: #64748b; font-weight: 600; text-transform: uppercase; }
.dn-modal-spec-value { font-size: 0.95rem; color: #0f172a; font-weight: 700; }

/* Amenities */
.dn-modal-amenities {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.dn-amenity-tag {
  background: #f1f5f9;
  color: #475569;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 8px;
}

/* Pricing */
.dn-modal-pricing {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dn-price-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
}

.dn-price-season { font-weight: 700; color: #1e293b; font-size: 0.95rem; }
.dn-price-values { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.dn-price-values span { font-size: 0.8rem; color: #64748b; }
.dn-price-values strong { font-size: 1.1rem; color: #000; font-weight: 900; }

.dn-price-extras {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.85rem;
  color: #475569;
  background: #fef9c3;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid #fde047;
}

/* Footer CTA */
.dn-modal-footer {
  padding: 30px 40px;
  background: #fff;
  border-top: 1px solid #f1f5f9;
}

.dn-modal-cta {
  display: block;
  width: 100%;
  text-align: center;
  background: #000;
  color: #fff;
  padding: 18px;
  border-radius: 14px;
  text-decoration: none;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 1rem;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.dn-modal-cta:hover {
  background: #e8c68c;
  color: #000;
  transform: translateY(-4px);
  box-shadow: 0 15px 35px rgba(232, 198, 140, 0.4);
}

/* --- RESPONSIVE MODAL --- */
@media (max-width: 900px) {
  .dn-modal-overlay { padding: 20px 10px; }
  .dn-modal {
    flex-direction: column;
    max-width: 550px;
    width: 100%;
    height: 92vh;
    border-radius: 20px;
  }
  .dn-modal-left {
    flex: 0 0 320px;
    height: 320px;
  }
  .dn-modal-right {
    flex: 1;
    min-height: 0;
  }
  .dn-modal-header { padding: 24px 24px 12px; }
  .dn-modal-scroll-area { padding: 12px 24px 24px; }
  .dn-modal-footer { padding: 16px 24px; }
  .dn-modal-title { font-size: 1.6rem; }
  .dn-modal-close { 
    top: 12px; right: 12px; 
    width: 36px; height: 36px; 
    font-size: 1.4rem; 
    background: rgba(255,255,255,0.8);
  }
}

@media (max-width: 500px) {
  .dn-modal-overlay { padding: 12px 6px; }
  .dn-modal { height: 94vh; }
  .dn-modal-left { height: 260px; flex: 0 0 260px; }
  .dn-modal-specs-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .dn-modal-spec-item { padding: 8px; gap: 8px; }
  .dn-modal-spec-icon { font-size: 1rem; }
  .dn-modal-spec-value { font-size: 0.8rem; }
  .dn-modal-header { padding: 20px 20px 10px; }
  .dn-modal-scroll-area { padding: 8px 20px 24px; }
  .dn-modal-footer { padding: 12px 20px 20px; }
  .dn-modal-title { font-size: 1.4rem; }
  .dn-modal-gallery-btn { width: 40px; height: 40px; font-size: 1.1rem; }
  .dn-modal-cta { padding: 14px; font-size: 0.9rem; }
}

/* --- FULLSCREEN PHOTO OVERLAY --- */
.dn-fs-overlay {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.95);
  z-index: 200000;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s ease;
  cursor: zoom-out;
}
.dn-fs-overlay.active { opacity: 1; pointer-events: auto; }
.dn-fs-overlay img { max-width: 95%; max-height: 95%; object-fit: contain; box-shadow: 0 0 40px rgba(0,0,0,0.5); }
.dn-fs-close {
  position: absolute; top: 20px; right: 20px; color: #fff; font-size: 3rem; cursor: pointer; line-height: 1;
  z-index: 200002;
}
.dn-fs-btn {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.3);
  color: #fff; width: 60px; height: 60px; border-radius: 50%;
  font-size: 1.5rem; cursor: pointer; transition: all 0.3s;
  display: flex; align-items: center; justify-content: center;
  z-index: 200001;
}
.dn-fs-btn:hover { background: #fff; color: #000; }
.dn-fs-prev { left: 30px; }
.dn-fs-next { right: 30px; }

@media (max-width: 768px) {
  .dn-fs-btn { width: 44px; height: 44px; font-size: 1.2rem; }
  .dn-fs-prev { left: 10px; }
  .dn-fs-next { right: 10px; }
}



