/* ============================================================
   Pre-Owned Yacht List Block — style.css
   Figma-accurate: filters as inline dropdowns/popups
   ============================================================ */

/* ── Editor placeholder ── */
.pyl-editor-placeholder {
    padding: 24px;
    background: #f9f9f9;
    border: 1px dashed #ccc;
    border-radius: 4px;
    color: #666;
    font-size: 14px;
    text-align: center;
}

/* ── Section wrapper ── */
.pyl-section {
    background: #ffffff;
    max-width: 1140px;
    margin: 0 auto;
}

.pyl-container {
    margin: 0 auto;
}

/* ── Page header ── */
.pyl-header {
    margin-bottom: 36px;
}

/* ── Toolbar: title LEFT, all controls RIGHT on same row ── */
.pyl-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e8e8e8;
    flex-wrap: wrap;
    position: relative;
    z-index: 200;
}

.pyl-page-title {
    font-family: 'Playfair Display', Georgia, serif !important;
    font-size: 34px !important;
    font-weight: 600 !important;
    color: #917240 !important;
    text-align: left !important;
    margin: 0 !important;
    line-height: 1.15 !important;
    text-transform: none !important;
    letter-spacing: 0.01em !important;
    flex-shrink: 0;
}

/* All controls sit together on the right */
.pyl-toolbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* ── Dropdown wrappers (Length, Price, Location) ── */
.pyl-dropdown-wrap {
    position: relative;
    display: inline-block;
}

.pyl-dropdown-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 14px;
    background: transparent;
    border: 1px solid #d0d0d0;
    border-radius: 4px;
    font-family: inherit;
    font-size: 14px;
    color: #031D41;
    cursor: pointer;
    white-space: nowrap;
    transition: border-color 0.2s, background 0.2s;
    outline: none;
    min-width: 110px;
    justify-content: space-between;
}

.pyl-dropdown-btn:hover,
.pyl-dropdown-btn.is-open {
    border-color: #917240;
    background: #917240;
}

.pyl-dropdown-btn svg {
    flex-shrink: 0;
    transition: transform 0.2s;
}

.pyl-dropdown-btn.is-open svg {
    transform: rotate(180deg);
}

/* ── Dropdown Panel (popup) ── */
.pyl-dropdown-panel {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    min-width: 340px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.12);
    padding: 24px;
    z-index: 300;
    animation: pylDropIn 0.18s ease;
}

.pyl-dropdown-panel--location {
    min-width: 220px;
    padding: 16px;
}

.pyl-dropdown-panel.is-open {
    display: block;
}

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

.pyl-dropdown-panel-title {
    font-size: 15px;
    font-weight: 700;
    color: #031D41;
    margin-bottom: 16px;
    letter-spacing: 0.01em;
}

/* ── Location checkboxes in dropdown ── */
.pyl-loc-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.pyl-check-label {
    display: flex;
    align-items: center;
    gap: 9px;
    cursor: pointer;
    font-size: 14px;
    color: #333;
    user-select: none;
}

.pyl-check-label input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.pyl-check-box {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border: 1.5px solid #ccc;
    border-radius: 3px;
    flex-shrink: 0;
    background: #fff;
    transition: border-color 0.15s, background 0.15s;
}

.pyl-check-label input:checked + .pyl-check-box {
    background: #031D41;
    border-color: #031D41;
}

.pyl-check-label input:checked + .pyl-check-box::after {
    content: '';
    display: block;
    width: 10px;
    height: 6px;
    border-left: 2px solid #fff;
    border-bottom: 2px solid #fff;
    transform: rotate(-45deg) translate(1px, -1px);
}

.pyl-check-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Show more */
.pyl-show-more {
    margin-top: 8px;
    background: none;
    border: none;
    color: #917240;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* ── Range label row ── */
.pyl-range-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 14px;
}

.pyl-range-from,
.pyl-range-to {
    font-size: 13px;
    color: #555;
}

.pyl-range-from strong,
.pyl-range-to strong {
    color: #031D41;
    font-weight: 600;
}

/* ── Double range slider ── */
.pyl-double-range {
    position: relative;
    height: 20px;
    display: flex;
    align-items: center;
}

.pyl-range-track {
    position: absolute;
    left: 0;
    right: 0;
    height: 3px;
    background: #e8e2d8;
    border-radius: 2px;
    overflow: hidden;
}

.pyl-range-fill {
    position: absolute;
    height: 100%;
    background: #917240;
    left: 0%;
    width: 100%;
    transition: left 0.05s, width 0.05s;
}

.pyl-range {
    position: absolute;
    left: 0;
    width: 100%;
    height: 3px;
    background: transparent !important;
    border: none !important;
    outline: none !important;
    -webkit-appearance: none;
    appearance: none;
    pointer-events: none;
    box-shadow: none !important;
}

.pyl-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #917240;
    border: 2px solid #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,0.22);
    cursor: pointer;
    pointer-events: all;
    transition: transform 0.15s;
}

.pyl-range::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #917240;
    border: 2px solid #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,0.22);
    cursor: pointer;
    pointer-events: all;
}

.pyl-range::-webkit-slider-thumb:hover {
    transform: scale(1.25);
}

/* ── Filter icon button (opens full filters popup) ── */
.pyl-filter-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: 1px solid #d0d0d0;
    border-radius: 4px;
    background: transparent;
    color: #031D41;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    padding: 0;
}

.pyl-filter-toggle:hover,
.pyl-filter-toggle.is-open {
    border-color: #917240;
    background: #917240;
}

/* ── Full Filters Popup (from filter icon) ── */
.pyl-filter-wrap {
    position: relative;
}

.pyl-filters-popup {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    width: 420px;
    max-height: 75vh;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.14);
    z-index: 300;
    animation: pylDropIn 0.18s ease;
    scrollbar-width: thin;
    scrollbar-color: #d0c4b0 transparent;
}

.pyl-filters-popup::-webkit-scrollbar { width: 4px; }
.pyl-filters-popup::-webkit-scrollbar-thumb { background: #d0c4b0; border-radius: 2px; }

.pyl-filters-popup.is-open {
    display: block;
}

.pyl-filters-popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px 14px;
    border-bottom: 1px solid #f0ece4;
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 2;
}

.pyl-filters-popup-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 18px;
    font-weight: 600;
    color: #031D41;
    letter-spacing: 0.01em;
}

.pyl-filters-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: none;
    background: transparent;
    color: #888;
    cursor: pointer;
    padding: 0;
    border-radius: 4px;
    transition: color 0.2s, background 0.2s;
}

.pyl-filters-close:hover {
    color: #031D41;
    background: #f5f5f5;
}

.pyl-filter-group {
    padding: 18px 20px;
    border-bottom: 1px solid #f0ece4;
}

.pyl-filter-label {
    font-size: 13px;
    font-weight: 700;
    color: #031D41;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 12px;
}

.pyl-checkbox-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 10px;
}

.pyl-filter-actions {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    padding: 16px 20px 20px;
    border-top: 1px solid #f0ece4;
}

.pyl-clear-btn {
    background: transparent;
    border: 1px solid #d0d0d0;
    border-radius: 30px;
    padding: 10px 16px;
    flex: 1;
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    color: #031D41;
    cursor: pointer;
    letter-spacing: 0.05em;
    transition: border-color 0.2s, color 0.2s;
}

.pyl-clear-btn:hover {
    border-color: #917240;
    color: #ffffff;
}

.pyl-apply-btn {
    background: #031D41;
    border: none;
    border-radius: 30px;
    padding: 12px 20px;
    flex: 1.5;
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    color: #ffffff;
    cursor: pointer;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    transition: background 0.2s;
}

.pyl-apply-btn:hover {
    background: #917240;
}

/* ── Sort toggle button ── */
.pyl-sort-wrap {
    position: relative;
}

.pyl-sort-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: 1px solid #d0d0d0;
    border-radius: 4px;
    background: transparent;
    color: #031D41;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    padding: 0;
}

.pyl-sort-toggle:hover,
.pyl-sort-toggle.is-open {
    border-color: #917240;
    background: #917240;
}

.pyl-sort-popup {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 200px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.12);
    z-index: 300;
    animation: pylDropIn 0.18s ease;
    overflow: hidden;
}

.pyl-sort-popup.is-open {
    display: block;
}

.pyl-sort-option {
    display: block;
    width: 100%;
    padding: 12px 18px;
    background: none;
    border: none;
    text-align: left;
    font-family: inherit;
    font-size: 14px;
    color: #031D41;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.pyl-sort-option:hover,
.pyl-sort-option.is-active {
    background: #fdf9f3;
    color: #917240;
}

/* ── View toggle ── */
.pyl-view-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    background: transparent;
    color: #888;
    cursor: pointer;
    padding: 0;
    transition: all 0.2s;
}

.pyl-view-toggle.active,
.pyl-view-toggle:hover {
    border-color: #917240;
    color: #917240;
    background: #fdf9f3;
}

/* ── Overlay (closes popups) ── */
.pyl-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: transparent;
    z-index: 150;
}

.pyl-overlay.is-visible {
    display: block;
}

/* ── Body / Main ── */
.pyl-body {
    display: block;
    margin-bottom: 30px;
}

.pyl-main {
    width: 100%;
}

.pyl-results-bar {
    font-size: 14px;
    color: #888;
    margin-bottom: 20px;
}

.pyl-results-bar strong {
    color: #031D41;
}

/* ── GRID ── */
.pyl-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.pyl-grid[data-view="list"] {
    grid-template-columns: 1fr;
}

.pyl-grid[data-view="list"] .pyl-card {
    display: flex;
    flex-direction: row;
}

.pyl-grid[data-view="list"] .pyl-slider {
    width: 280px;
    min-width: 280px;
    aspect-ratio: unset;
    height: 180px;
}

.pyl-grid[data-view="list"] .pyl-card-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* ── Card ── */
.pyl-card {
    background: #ffffff;
    border: 1px solid #e8e8e8;
    border-radius: 4px;
    overflow: hidden;
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.pyl-card:hover {
    box-shadow: 0 8px 32px rgba(0,0,0,0.10);
    transform: translateY(-4px);
}

/* ── Slider ── */
.pyl-slider {
    position: relative;
    overflow: hidden;
    background: #d8d8d8;
    aspect-ratio: 5 / 3;
    line-height: 0;
}

.pyl-slides-track {
    position: relative;
    width: 100%;
    height: 100%;
}

.pyl-slide {
    display: none;
    position: absolute;
    inset: 0;
    text-decoration: none;
}

.pyl-slide.is-active {
    display: block;
}

.pyl-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}

.pyl-card:hover .pyl-slide.is-active img {
    transform: scale(1.04);
}

.pyl-no-img {
    width: 100%;
    height: 100%;
    background: #d0d0d0;
}

/* Slider arrows */
.pyl-sl-prev,
.pyl-sl-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    border: none;
    border-radius: 50%;
    width: 0px;
    height:0px;
    font-size: 38px;
    line-height: 1;
    color: #222;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    opacity: 0;
    transition: opacity 0.25s, color 0.2s;
    background-color: transparent !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.pyl-card:hover .pyl-sl-prev,
.pyl-card:hover .pyl-sl-next {
    opacity: 1;
}

.pyl-sl-prev { left: 10px; }
.pyl-sl-next { right: 10px; }

.pyl-sl-prev:hover,
.pyl-sl-next:hover { color: #031D41; }

/* Dots */
.pyl-sl-dots {
    position: absolute;
    bottom: 14px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 5px;
    z-index: 10;
}

.pyl-sl-dot {
    display: block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: rgba(145,114,64,0.65);
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
}

.pyl-sl-dot.is-active,
.pyl-sl-dot:hover {
    background: #b8945a;
    transform: scale(1.35);
}

/* Top icons */
.pyl-top-icons {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 12;
    display: flex;
    flex-direction: column;
    pointer-events: none;
}

.pyl-top-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 0px !important;
    backdrop-filter: blur(2px);
}

.pyl-ti-wave { background: #fff; color: #98723D; }
.pyl-ti-cabin { background: #98723D; color: #fff; }

/* Bottom badges */
.pyl-img-badges {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 11;
    display: flex;
    align-items: center;
    gap: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.55) 0%, transparent 100%);
    padding: 20px 12px 10px;
    pointer-events: none;
}

.pyl-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #fff;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.03em;
    white-space: nowrap;
}

.pyl-badge + .pyl-badge::before {
    content: '\00B7';
    margin-right: 4px;
    opacity: 0.7;
}

.pyl-badge svg { flex-shrink: 0; opacity: 0.9; }

/* Card info row */
.pyl-card-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 18px 18px;
    gap: 10px;
}

.pyl-info-left { flex: 1; min-width: 0; }

.pyl-card-name {
    font-family: 'Inter', sans-serif;
    font-size: 19px !important;
    font-weight: 600 !important;
    color: #917240 !important;
    margin: 0 0 10px !important;
    line-height: 1.3 !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: 0.05em !important;
    text-transform: uppercase !important;
}

.pyl-card-price {
    font-size: 15px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0;
    line-height: 1.4;
}

.pyl-price-cur { font-weight: 400; color: #1a1a1a; margin-left: 3px; }
.pyl-price-vat { font-weight: 400; margin-left: 4px; letter-spacing: 0.04em; font-size: 13px; }

.pyl-info-right { flex-shrink: 0; }

.pyl-view-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 15px;
    font-weight: 500;
    color: #031D41 !important;
    text-decoration: none !important;
    letter-spacing: 0.02em;
    transition: color 0.2s;
    white-space: nowrap;
}

.pyl-view-arrow { transition: transform 0.25s ease; flex-shrink: 0; }

.pyl-view-btn:hover { color: #b8945a !important; }
.pyl-view-btn:hover .pyl-view-arrow { transform: translateX(4px); }

/* No results */
.pyl-no-results {
    padding: 48px 24px;
    text-align: center;
    color: #666;
    font-size: 15px;
    background: #fafafa;
    border: 1px dashed #ddd;
    border-radius: 4px;
    grid-column: 1 / -1;
}

.pyl-reset-link {
    background: none;
    border: none;
    color: #917240;
    cursor: pointer;
    font-size: inherit;
    font-weight: 600;
    text-decoration: underline;
    padding: 0;
}

.pyl-api-error {
    padding: 24px;
    background: #f9f9f9;
    border: 1px dashed #ccc;
    border-radius: 4px;
    color: #666;
    font-size: 14px;
    text-align: center;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
    .pyl-page-title { font-size: 28px !important; }
    .pyl-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
    .pyl-toolbar { flex-direction: column; align-items: flex-start; }
    .pyl-section { padding: 40px 0 56px; }
    .pyl-container { padding: 0 16px; }
    .pyl-page-title { font-size: 20px !important; }
    .pyl-grid { grid-template-columns: 1fr; gap: 16px; }
    .pyl-dropdown-panel { min-width: 280px; }
    .pyl-grid[data-view="list"] .pyl-slider { width: 140px; min-width: 140px; height: 130px; }
}
@media (max-width: 640px) {
  .pyl-filters-popup {
    width: 100% !important;
    left: 0 !important;
    right: 0 !important;
    max-width: 100vw !important;
    border-radius: 0 !important;
  }
}
@media (max-width: 768px) {
  .pyl-filters-popup {
    position: fixed !important;
    top: 10% !important;
    left: 5% !important;
    transform: none !important;
    width: 90% !important;
    max-width: none !important;
    max-height: 80vh !important;
    overflow-y: auto !important;
    right: 5% !important;
  }
}
.pyl-hidden-item { display: none; }


/* ── Top icon buttons (clickable) ── */
.pyl-gallery-btn {
    border: none;
    padding: 0;
    cursor: pointer;
    pointer-events: all;
    transition: transform 0.15s, opacity 0.15s;
}
.pyl-gallery-btn:hover {
    transform: scale(1.12);
        background: #fff;
    color: #917240;
}

/* ── Gallery Lightbox ── */
.pyl-lb {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 99999;
    align-items: center;
    justify-content: center;
}
.pyl-lb.is-open {
    display: flex;
}
.pyl-lb__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.88);
    backdrop-filter: blur(3px);
}
.pyl-lb__box {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 900px;
    padding: 0 16px;
}
.pyl-lb__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 860px;
    margin-bottom: 14px;
}
.pyl-lb__label {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 20px;
    font-weight: 600;
    color: #fff;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.pyl-lb__close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    background: transparent;
    color: #fff;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
    padding: 0;
}
.pyl-lb__close:hover {
    background: rgba(255,255,255,0.1);
    border-color: #fff;
}
.pyl-lb__stage {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 860px;
}
.pyl-lb__img {
    display: block;
    max-width: 100%;
    max-height: 72vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.5);
}
.pyl-lb__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.25);
    border-radius: 50%;
    color: #fff;
    font-size: 30px;
    line-height: 1;
    width: 46px;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    transition: background 0.2s;
    z-index: 2;
}
.pyl-lb__nav:hover {
    background: rgba(255,255,255,0.22);
}
.pyl-lb__nav--prev { left: -52px; }
.pyl-lb__nav--next { right: -52px; }
.pyl-lb__count {
    margin-top: 14px;
    font-size: 13px;
    color: rgba(255,255,255,0.6);
    letter-spacing: 0.06em;
}

@media (max-width: 640px) {
    .pyl-lb__nav--prev { left: 6px; }
    .pyl-lb__nav--next { right: 6px; }
    .pyl-lb__nav { width: 36px; height: 36px; font-size: 22px; }
    .pyl-sort-popup {left:0 !important;}
}

/* ── Icon active state (clicked, showing that image set) ── */
.pyl-top-icon.pyl-icon-active {
    background: #c9a96e;
    color: #0b213d;
    border-color: #c9a96e;
}
.pyl-top-icon.pyl-icon-active svg {
    stroke: #0b213d;
}
