/* Single Yacht Layout */
body.single-yacht {
  overflow: hidden;
  background: var(--color-dark);
}

@media (max-width: 1023px) {
  body.single-yacht { overflow: auto; }
}

.ayc-yacht-layout {
  display: flex;
  height: 100vh;
  padding-top: var(--header-height);
  overflow: hidden;
  background: var(--color-dark);
}

@media (max-width: 1023px) {
  .ayc-yacht-layout {
    flex-direction: column;
    height: auto;
    overflow: visible;
  }
}

/* ─── Slider ─── */
.ayc-yacht-slider {
  flex: 1;
  position: relative;
  overflow: hidden;
  background: #000;
  min-height: 300px;
}

.ayc-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.6s cubic-bezier(0.16,1,0.3,1);
}

.ayc-slide.is-active {
  opacity: 1;
}

.ayc-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ayc-slide--no-image {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-silver);
  font-size: var(--text-sm);
}

.ayc-slider__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
  background: rgba(13,17,23,0.55);
  border: 1px solid rgba(255,255,255,0.25);
  color: white;
  font-size: 1.25rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
  transition: all 0.3s ease;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  user-select: none;
}

.ayc-slider__arrow--prev { left: var(--space-4); }
.ayc-slider__arrow--next { right: var(--space-4); }

.ayc-slider__arrow:hover {
  background: rgba(13,17,23,0.9);
  border-color: var(--color-gold);
  color: var(--color-gold);
}

.ayc-slider__counter {
  position: absolute;
  bottom: var(--space-6);
  right: var(--space-6);
  color: rgba(255,255,255,0.7);
  font-family: var(--font-body);
  font-size: var(--text-xs);
  letter-spacing: 0.1em;
  background: rgba(0,0,0,0.4);
  padding: var(--space-1) var(--space-3);
  backdrop-filter: blur(4px);
}

/* ─── Right Panel ─── */
.ayc-yacht-panel {
  width: var(--panel-right-width);
  height: 100%;
  overflow-y: auto;
  background: var(--color-dark);
  border-left: 1px solid rgba(255,255,255,0.08);
  padding: var(--space-8) var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  flex-shrink: 0;
}

@media (max-width: 1023px) {
  .ayc-yacht-panel {
    width: 100%;
    height: auto;
    border-left: none;
    border-top: 1px solid rgba(255,255,255,0.08);
    padding-bottom: calc(var(--mobile-cta-height) + var(--space-8));
  }
}

.ayc-yacht-panel__header { margin-bottom: var(--space-2); }

.ayc-panel-title {
  font-family: var(--font-heading);
  font-size: var(--text-2xl);
  font-weight: 400;
  color: var(--color-white);
  margin: 0 0 var(--space-2);
  letter-spacing: 0.03em;
}

.ayc-panel-builder,
.ayc-panel-flag {
  color: var(--color-silver);
  font-size: var(--text-sm);
  margin: 0;
  letter-spacing: 0.05em;
}

.ayc-panel-divider {
  height: 1px;
  background: rgba(255,255,255,0.1);
  margin: var(--space-2) 0;
}

/* ─── Panel Buttons ─── */
.ayc-yacht-panel__actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.ayc-panel-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  background: transparent;
  border: 1px solid rgba(255,255,255,0.15);
  color: var(--color-white);
  padding: var(--space-4) var(--space-4);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: all var(--transition-base);
  text-decoration: none;
  text-align: left;
}

.ayc-panel-btn:hover,
.ayc-panel-btn--active {
  border-color: var(--color-gold);
  color: var(--color-gold);
}

.ayc-panel-btn--wa:hover {
  border-color: #25D366;
  color: #25D366;
}

.ayc-panel-btn__icon {
  font-size: var(--text-base);
  flex-shrink: 0;
  width: 20px;
  text-align: center;
}

/* ─── Specs Accordion ─── */
.ayc-specs-accordion {
  max-height: 0;
  overflow: hidden;
  visibility: hidden;
  transition: max-height 0.4s ease, visibility 0.4s ease;
}

.ayc-specs-accordion--open {
  max-height: 800px;
  visibility: visible;
}

.ayc-specs-list {
  padding: var(--space-3) 0;
}

.ayc-spec-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-3) 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  gap: var(--space-4);
}

.ayc-spec-row:last-child { border-bottom: none; }

.ayc-spec-label {
  color: var(--color-silver);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  flex-shrink: 0;
}

.ayc-spec-value {
  color: var(--color-white);
  font-size: var(--text-sm);
  text-align: right;
}

/* Mobile slider height */
@media (max-width: 1023px) {
  .ayc-yacht-slider {
    height: 60vh;
    flex: none;
  }
}

/* ─── Panel Gallery View (inside right panel) ─── */
#ayc-panel-view {
  position: absolute;
  inset: 0;
  padding: 10px;
  background: var(--color-dark);
  z-index: 10;
  display: none;
  flex-direction: column;
}

.ayc-panel-gallery,
.ayc-panel-specs-view {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
}

.ayc-panel-gallery__topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}

.ayc-panel-back {
  background: none;
  border: none;
  color: var(--color-silver);
  font-family: var(--font-body);
  font-size: var(--text-xs);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  cursor: pointer;
  padding: 0;
  transition: color var(--transition-base);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.ayc-panel-back:hover {
  color: var(--color-gold);
}

.ayc-panel-gallery__counter {
  color: var(--color-silver);
  font-size: var(--text-xs);
  letter-spacing: 0.1em;
}

.ayc-panel-gallery__main {
  flex: 1;
  position: relative;
  overflow: hidden;
  background: #000;
  min-height: 0;
}

.ayc-panel-gallery__main img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ayc-pg-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  background: rgba(13,17,23,0.7);
  border: 1px solid rgba(255,255,255,0.2);
  color: white;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-base);
  z-index: 5;
}
.ayc-pg-arrow--prev { left: var(--space-2); }
.ayc-pg-arrow--next { right: var(--space-2); }
.ayc-pg-arrow:hover {
  border-color: var(--color-gold);
  color: var(--color-gold);
}

.ayc-panel-gallery__thumbs {
  display: flex;
  gap: 2px;
  padding: var(--space-2);
  background: rgba(0,0,0,0.5);
  overflow-x: auto;
  flex-shrink: 0;
  height: 72px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.2) transparent;
}

.ayc-pgallery-thumb {
  flex-shrink: 0;
  width: 60px;
  height: 56px;
  border: 2px solid transparent;
  cursor: pointer;
  overflow: hidden;
  padding: 0;
  background: none;
  transition: border-color var(--transition-base);
}
.ayc-pgallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.ayc-pgallery-thumb.is-active {
  border-color: var(--color-gold);
}
.ayc-pgallery-thumb:hover {
  border-color: rgba(255,255,255,0.4);
}

/* Specs view inside panel */
.ayc-panel-specs-view {
  padding: 0;
}
.ayc-panel-specs-view .ayc-specs-list {
  padding: var(--space-4) var(--space-6);
  overflow-y: auto;
  flex: 1;
}

/* Make panel relative for absolute panel-view */
.ayc-yacht-panel {
  position: relative;
}

/* ─── Panel View Transitions ─── */
#ayc-panel-view {
  position: absolute;
  inset: 0;
  background: var(--color-dark);
  z-index: 10;
  display: none;
  flex-direction: column;
  opacity: 0;
  transition: opacity 0.35s ease;
}
#ayc-panel-view.is-visible {
  opacity: 1;
}

/* ─── Improved Panel Buttons ─── */
.ayc-panel-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  background: transparent;
  border: 1px solid rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.8);
  padding: var(--space-4) var(--space-5);
  font-family: var(--font-body);
  font-size: var(--text-xs);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all var(--transition-base);
  text-decoration: none;
  text-align: left;
  position: relative;
  overflow: hidden;
}
.ayc-panel-btn::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  width: 2px;
  height: 100%;
  background: var(--color-gold);
  transform: scaleY(0);
  transition: transform 0.25s ease;
  transform-origin: bottom;
}
.ayc-panel-btn:hover {
  border-color: rgba(201,169,110,0.35);
  color: var(--color-white);
  background: rgba(201,169,110,0.06);
  padding-left: calc(var(--space-5) + 6px);
}
.ayc-panel-btn:hover::before {
  transform: scaleY(1);
}
.ayc-panel-btn--active {
  border-color: var(--color-gold);
  color: var(--color-gold);
  background: rgba(201,169,110,0.08);
}
.ayc-panel-btn--active::before {
  transform: scaleY(1);
}
.ayc-panel-btn--wa {
  color: rgba(37,211,102,0.85);
  border-color: rgba(37,211,102,0.2);
}
.ayc-panel-btn--wa::before {
  background: #25D366;
}
.ayc-panel-btn--wa:hover {
  color: #25D366;
  border-color: rgba(37,211,102,0.5);
  background: rgba(37,211,102,0.06);
}
.ayc-panel-btn__icon {
  font-size: 1rem;
  flex-shrink: 0;
  width: 22px;
  text-align: center;
  opacity: 0.75;
}

/* ─── Back Button ─── */
.ayc-panel-back {
  background: none;
  border: none;
  color: var(--color-silver);
  font-family: var(--font-body);
  font-size: var(--text-xs);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  cursor: pointer;
  padding: 0;
  transition: color var(--transition-base);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.ayc-panel-back:hover { color: var(--color-gold); }

/* ─── Panel Gallery View ─── */
.ayc-panel-gallery,
.ayc-panel-specs-view {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
}
.ayc-panel-gallery__topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid rgba(255,255,255,0.07);
  flex-shrink: 0;
  background: rgba(0,0,0,0.3);
}
.ayc-panel-gallery__counter {
  color: var(--color-silver);
  font-size: var(--text-xs);
  letter-spacing: 0.12em;
  font-family: var(--font-body);
}
.ayc-panel-gallery__main {
  flex: 1;
  position: relative;
  overflow: hidden;
  background: #000;
  min-height: 0;
  cursor: zoom-in;
}
.ayc-panel-gallery__main img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity 0.3s ease;
}
.ayc-panel-gallery__main img.is-loading {
  opacity: 0.5;
}
.ayc-pg-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 38px;
  height: 38px;
  background: rgba(13,17,23,0.75);
  border: 1px solid rgba(255,255,255,0.15);
  color: white;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-base);
  z-index: 5;
  backdrop-filter: blur(4px);
}
.ayc-pg-arrow--prev { left: var(--space-2); }
.ayc-pg-arrow--next { right: var(--space-2); }
.ayc-pg-arrow:hover {
  border-color: var(--color-gold);
  color: var(--color-gold);
  background: rgba(13,17,23,0.95);
}
.ayc-panel-gallery__thumbs {
  display: flex;
  gap: 2px;
  padding: var(--space-2);
  background: rgba(0,0,0,0.6);
  overflow-x: auto;
  flex-shrink: 0;
  height: 74px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.15) transparent;
}
.ayc-pgallery-thumb {
  flex-shrink: 0;
  width: 62px;
  height: 58px;
  border: 2px solid transparent;
  cursor: pointer;
  overflow: hidden;
  padding: 0;
  background: none;
  transition: border-color var(--transition-base), opacity var(--transition-base);
  opacity: 0.65;
}
.ayc-pgallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.ayc-pgallery-thumb:hover { opacity: 0.9; }
.ayc-pgallery-thumb.is-active {
  border-color: var(--color-gold);
  opacity: 1;
}

/* ─── Specs view ─── */
.ayc-panel-specs-view .ayc-specs-list {
  padding: var(--space-4) var(--space-6);
  overflow-y: auto;
  flex: 1;
}
.ayc-yacht-panel { position: relative; }

/* ─── Fullscreen Lightbox ─── */
.ayc-fullscreen-lb {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0,0,0,0.97);
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}
.ayc-fullscreen-lb.is-open {
  opacity: 1;
  visibility: visible;
}
.ayc-fullscreen-lb__topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-6);
  flex-shrink: 0;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2;
  background: linear-gradient(to bottom, rgba(0,0,0,0.7), transparent);
}
.ayc-fullscreen-lb__counter {
  color: rgba(255,255,255,0.7);
  font-family: var(--font-body);
  font-size: var(--text-xs);
  letter-spacing: 0.15em;
}
.ayc-fullscreen-lb__close {
  background: none;
  border: 1px solid rgba(255,255,255,0.2);
  color: white;
  width: 40px;
  height: 40px;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-base);
}
.ayc-fullscreen-lb__close:hover {
  border-color: var(--color-gold);
  color: var(--color-gold);
}
.ayc-fullscreen-lb__main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.ayc-fullscreen-lb__img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
  transition: opacity 0.25s ease;
  user-select: none;
}
.ayc-fullscreen-lb__img.is-switching {
  opacity: 0;
}
.ayc-fullscreen-lb__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
  background: rgba(13,17,23,0.6);
  border: 1px solid rgba(255,255,255,0.2);
  color: white;
  font-size: 1.3rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-base);
  backdrop-filter: blur(4px);
  z-index: 5;
}
.ayc-fullscreen-lb__arrow--prev { left: var(--space-6); }
.ayc-fullscreen-lb__arrow--next { right: var(--space-6); }
.ayc-fullscreen-lb__arrow:hover {
  border-color: var(--color-gold);
  color: var(--color-gold);
  background: rgba(13,17,23,0.9);
}
.ayc-fullscreen-lb__thumbs {
  display: flex;
  gap: 3px;
  padding: var(--space-3);
  background: rgba(0,0,0,0.8);
  overflow-x: auto;
  flex-shrink: 0;
  height: 90px;
  align-items: center;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.15) transparent;
}
.ayc-fullscreen-lb__thumb {
  flex-shrink: 0;
  width: 72px;
  height: 70px;
  border: 2px solid transparent;
  cursor: pointer;
  overflow: hidden;
  padding: 0;
  background: none;
  opacity: 0.55;
  transition: all var(--transition-base);
}
.ayc-fullscreen-lb__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.ayc-fullscreen-lb__thumb:hover { opacity: 0.85; }
.ayc-fullscreen-lb__thumb.is-active {
  border-color: var(--color-gold);
  opacity: 1;
}
@media (max-width: 640px) {
  .ayc-fullscreen-lb__arrow { width: 40px; height: 40px; font-size: 1rem; }
  .ayc-fullscreen-lb__arrow--prev { left: var(--space-2); }
  .ayc-fullscreen-lb__arrow--next { right: var(--space-2); }
}

/* ─── Thumbnail Grid (replaces big preview + thumbs) ─── */
.ayc-panel-thumb-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
  padding: var(--space-3);
  overflow-y: auto;
  flex: 1;
}

.ayc-thumb-item {
  aspect-ratio: 1 / 1;
  overflow: hidden;
  padding: 0;
  background: rgba(255,255,255,0.04);
  border: 2px solid transparent;
  cursor: pointer;
  transition: border-color 0.2s ease, opacity 0.2s ease;
  opacity: 0.85;
}
.ayc-thumb-item:hover {
  border-color: var(--color-gold);
  opacity: 1;
}
.ayc-thumb-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}
.ayc-thumb-item:hover img {
  transform: scale(1.05);
}

/* ─── Specifications Panel ─── */
.ayc-specs-list {
  padding: var(--space-4) var(--space-5);
  overflow-y: auto;
  flex: 1;
}
.ayc-spec-group {
  margin-bottom: var(--space-6);
}
.ayc-spec-group__title {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--color-gold);
  margin-bottom: var(--space-3);
  padding-bottom: var(--space-2);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.ayc-spec-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: var(--space-2) 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  gap: var(--space-4);
}
.ayc-spec-row:last-child {
  border-bottom: none;
}
.ayc-spec-row__label {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  color: var(--color-silver);
  letter-spacing: 0.05em;
  flex-shrink: 0;
}
.ayc-spec-row__value {
  font-family: var(--font-heading);
  font-size: var(--text-sm);
  color: var(--color-white);
  font-weight: 400;
  text-align: right;
}

/* ─── Mobile Optimizations ─── */
@media (max-width: 768px) {

  /* Gallery thumb grid: 3 cols on mobile too, slightly tighter */
  .ayc-panel-thumb-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 2px;
    padding: var(--space-2);
  }

  /* Specs: full-width rows, larger touch targets */
  .ayc-spec-row {
    padding: var(--space-3) 0;
    flex-direction: row;
    flex-wrap: wrap;
  }
  .ayc-spec-row__label {
    font-size: var(--text-xs);
    color: rgba(168,178,192,0.7);
    min-width: 40%;
  }
  .ayc-spec-row__value {
    font-size: var(--text-base);
    text-align: right;
    flex: 1;
  }

  /* Fullscreen lightbox on mobile */
  .ayc-fullscreen-lb__thumbs {
    height: 72px;
  }
  .ayc-fullscreen-lb__thumb {
    width: 58px;
    height: 56px;
  }
  .ayc-fullscreen-lb__arrow {
    width: 38px;
    height: 38px;
    font-size: 0.9rem;
  }
  .ayc-fullscreen-lb__arrow--prev { left: var(--space-1); }
  .ayc-fullscreen-lb__arrow--next { right: var(--space-1); }

  /* Panel topbar on mobile */
  .ayc-panel-gallery__topbar {
    padding: var(--space-3) var(--space-4);
  }

  /* Panel specs topbar */
  .ayc-panel-specs-view .ayc-panel-gallery__topbar {
    padding: var(--space-3) var(--space-4);
  }
}

/* Mobile specs should be a full list, not an inner scroll box */
@media (max-width: 1023px) {
  #ayc-panel-view {
    position: relative;
    inset: auto;
    display: block;
    opacity: 1;
    transition: none;
  }

  #ayc-panel-view[style*="display: none"] {
    display: none !important;
  }

  .ayc-panel-specs-view {
    height: auto;
    min-height: 0;
  }

  .ayc-panel-specs-view .ayc-specs-list,
  .ayc-specs-list {
    overflow: visible;
    max-height: none;
    height: auto;
    flex: none;
  }
}

