/* v2 boats-for-sale styles: card/modal rules extracted from frontend/css/styles.css
   (markup generated by shared te-koop.js), variables mapped to v2 brand tokens. */
:root {
    --primary-color: #0071bb; --primary-dark: #005a94; --secondary-color: #003366; --text-primary: #0c2a48;
    --text-secondary: #5b6b7a; --text-color: #2b4560; --bg-light: #f7f2e9; --light-gray: #efe7d8; --white: #fff;
    --radius-sm: 6px; --radius-md: 10px; --radius-lg: 14px; --border-radius: 14px; --transition-fast: 150ms ease;
    --shadow-md: 0 1px 2px rgba(0, 51, 102, 0.05), 0 18px 40px -18px rgba(0, 51, 102, 0.24);
    --shadow-lg: 0 1px 2px rgba(0, 51, 102, 0.05), 0 28px 50px -22px rgba(0, 51, 102, 0.32);
    --shadow-xl: 0 30px 60px -20px rgba(0, 51, 102, 0.45); --radius-xl: 18px; --radius-full: 999px;
}
.no-boats-message {
    background: var(--light-gray);
    border: 2px solid var(--primary-color);
    border-radius: var(--border-radius);
    padding: 40px;
    text-align: center;
    margin: 40px 0;
}

.message-content h3 {
    color: var(--primary-color);
    font-size: 1.8rem;
    margin-bottom: 20px;
}

.message-content p {
    color: var(--text-color);
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 15px;
}

.btn-call {
    display: inline-block;
    background: var(--primary-color);
    color: var(--white);
    padding: 12px 32px;
    border-radius: var(--border-radius);
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
    margin-top: 15px;
    transition: var(--transition-fast);
}

.btn-call:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.message-content p:last-child {
    margin-bottom: 0;
}

.for-sale-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

/* For Sale Card */
.for-sale-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    display: flex;
    flex-direction: column;
}

.for-sale-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
}

.for-sale-card.featured {
    border: 2px solid #f59e0b;
    box-shadow: 0 0 20px rgba(245, 158, 11, 0.2);
}

.featured-badge {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    padding: 0.4rem 0.8rem;
    border-radius: 2rem;
    font-size: 0.85rem;
    font-weight: 600;
    z-index: 10;
    box-shadow: 0 2px 10px rgba(245, 158, 11, 0.3);
}

/* Image Container */
.for-sale-image-container {
    position: relative;
    width: 100%;
    height: 220px;
    overflow: hidden;
}

.for-sale-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.for-sale-card:hover .for-sale-image {
    transform: scale(1.05);
}

/* Content Section */
.for-sale-content {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.for-sale-category {
    display: inline-block;
    background: var(--bg-light);
    color: var(--primary-color);
    padding: 0.3rem 0.8rem;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.75rem;
    width: fit-content;
}

.for-sale-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.for-sale-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--success-color);
    margin-bottom: 1rem;
}

.for-sale-description {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1rem;
    flex-grow: 1;
}

.for-sale-description-short {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 1rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Meta Info */
.for-sale-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: var(--bg-light);
    border-radius: var(--radius-md);
}

.for-sale-meta .meta-item {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Features List */
.for-sale-features {
    list-style: none;
    padding: 0;
    margin: 0 0 1rem 0;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
}

.for-sale-features li {
    font-size: 0.9rem;
    color: var(--text-secondary);
    padding: 0.25rem 0;
}

.for-sale-features .more-features {
    color: var(--primary-color);
    font-weight: 500;
}

/* Contact Button */
.for-sale-contact-btn {
    width: 100%;
    padding: 0.9rem 1.5rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: auto;
}

.for-sale-contact-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 113, 187, 0.3);
}

/* ========================================================================
   FOR SALE ITEM MODAL
   ======================================================================== */

.item-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    backdrop-filter: blur(5px);
}

.item-modal-content {
    background: var(--white);
    border-radius: var(--radius-xl);
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(20px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.item-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
    background: var(--white);
    border: none;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
}

.item-modal-close:hover {
    background: var(--error-color);
    color: white;
    transform: rotate(90deg);
}

/* Modal Header */
.modal-header {
    padding: 3.5rem 2rem 2rem 2rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    position: relative;
}

.modal-category {
    display: inline-block;
    background: rgba(255, 255, 255, 0.2);
    padding: 0.3rem 0.8rem;
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.modal-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0 0 0.5rem 0;
}

.modal-price {
    font-size: 1.5rem;
    font-weight: 700;
}

/* Modal Body */
.modal-body {
    padding: 2rem;
    display: grid;
    grid-template-columns: minmax(0, 1fr); /* photos full width on top, details below */
    gap: 2rem;
}

.modal-image-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.modal-main-image {
    width: 100%;
    height: 300px;
    object-fit: cover;
    border-radius: var(--radius-lg);
}

/* v2 headings are navy: keep the title readable on the blue modal header. */
body.v2 .item-modal .modal-title { color: #fff; font-weight: 500; }

/* Modal Slideshow Styles (markup from te-koop.js: img.slide inside .modal-slideshow-main, one shown at a time) */
.modal-slideshow { position: relative; background: var(--bg-light); border-radius: var(--radius-lg); overflow: hidden; }
.modal-slideshow-main { position: relative; aspect-ratio: 4 / 3; max-height: 60vh; width: 100%; overflow: hidden; background: var(--light-gray); cursor: zoom-in; }
.modal-slideshow-main .slide {
    position: absolute; inset: 0; width: 100%; height: 100%;
    object-fit: contain; background: var(--light-gray);
    opacity: 0; transition: opacity 0.45s ease; z-index: 1;
}
.modal-slideshow-main .slide.active { opacity: 1; z-index: 2; }
.modal-slideshow-btn {
    position: absolute; top: 50%; z-index: 10; transform: translateY(-50%);
    display: grid; place-items: center; width: 44px; height: 44px; padding: 0;
    border: 0; border-radius: 50%; background: rgba(255, 255, 255, 0.94); color: var(--secondary-color);
    box-shadow: 0 6px 16px -6px rgba(0, 25, 51, 0.55); cursor: pointer;
    transition: transform 200ms ease, background 200ms ease;
}
.modal-slideshow-btn:hover { background: #fff; transform: translateY(-50%) scale(1.06); }
.modal-slideshow-btn:focus-visible, .modal-fullscreen-btn:focus-visible, .modal-slideshow-thumbnail:focus-visible { outline: 3px solid var(--secondary-color); outline-offset: 2px; }
.modal-slideshow-btn.prev { left: 0.75rem; }
.modal-slideshow-btn.next { right: 0.75rem; }
.modal-slideshow-btn svg { width: 20px; height: 20px; }
.modal-fullscreen-btn {
    position: absolute; top: 0.75rem; right: 0.75rem; z-index: 10;
    display: grid; place-items: center; width: 40px; height: 40px; padding: 0;
    border: 0; border-radius: 10px; background: rgba(0, 25, 51, 0.72); color: #fff; cursor: pointer;
    transition: background 200ms ease;
}
.modal-fullscreen-btn:hover { background: rgba(0, 25, 51, 0.9); }
.modal-fullscreen-btn svg { width: 18px; height: 18px; }
.modal-slideshow-thumbnails {
    display: flex; gap: 0.5rem; padding: 0.75rem;
    overflow-x: auto; scrollbar-width: thin; scrollbar-color: var(--secondary-color) transparent;
}
.modal-slideshow-thumbnail {
    flex: 0 0 72px; height: 54px; border-radius: 8px; overflow: hidden; cursor: pointer;
    border: 2px solid transparent; opacity: 0.6; transition: opacity 200ms ease, border-color 200ms ease;
}
.modal-slideshow-thumbnail:hover { opacity: 0.85; }
.modal-slideshow-thumbnail.active { border-color: var(--secondary-color); opacity: 1; }
.modal-slideshow-thumbnail img { display: block; width: 100%; height: 100%; object-fit: cover; }

/* Fullscreen slideshow (te-koop.js openFullscreen) */
.fullscreen-slideshow-overlay {
    position: fixed; inset: 0; z-index: 10002;
    display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
    padding: 20px 20px 0; background: rgba(0, 16, 32, 0.96);
}
.fullscreen-close {
    position: absolute; top: 16px; right: 16px; z-index: 10003;
    display: grid; place-items: center; width: 48px; height: 48px; padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.35); border-radius: 50%;
    background: rgba(255, 255, 255, 0.1); color: #fff; font-size: 28px; line-height: 1; cursor: pointer;
}
.fullscreen-close:hover { background: rgba(255, 255, 255, 0.2); }
.fullscreen-slideshow-main { position: relative; flex: 1 1 0; min-height: 0; width: 100%; max-width: 1400px; margin: 48px auto 16px; }
.fullscreen-slide { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; opacity: 0; transition: opacity 0.45s ease; z-index: 1; }
.fullscreen-slide.active { opacity: 1; z-index: 2; }
.fullscreen-btn {
    position: absolute; top: 50%; z-index: 10003; transform: translateY(-50%);
    display: grid; place-items: center; width: 56px; height: 56px; padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.35); border-radius: 50%;
    background: rgba(255, 255, 255, 0.1); color: #fff; cursor: pointer;
}
.fullscreen-btn:hover { background: rgba(255, 255, 255, 0.2); }
.fullscreen-btn.prev { left: 16px; }
.fullscreen-btn.next { right: 16px; }
.fullscreen-btn svg { width: 28px; height: 28px; }
.fullscreen-close:focus-visible, .fullscreen-btn:focus-visible, .fullscreen-thumbnail:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.fullscreen-thumbnails {
    flex-shrink: 0; display: flex; gap: 10px; max-width: 90%; margin-bottom: 20px; padding: 10px 16px;
    overflow-x: auto; border-radius: 12px; background: rgba(0, 0, 0, 0.4);
    scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.5) transparent;
}
.fullscreen-thumbnail { flex: 0 0 88px; height: 66px; border-radius: 8px; overflow: hidden; cursor: pointer; border: 2px solid transparent; opacity: 0.6; }
.fullscreen-thumbnail:hover { opacity: 0.85; }
.fullscreen-thumbnail.active { border-color: #fff; opacity: 1; }
.fullscreen-thumbnail img { display: block; width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 760px) {
    .modal-body { grid-template-columns: minmax(0, 1fr); gap: 1.25rem; padding: 1.25rem; }
    .modal-header { padding: 3rem 1.25rem 1.5rem; }
    body.v2 .item-modal .modal-title { font-size: 1.45rem; }
}
@media (max-width: 640px) {
    .modal-slideshow-btn { width: 40px; height: 40px; }
    .fullscreen-btn { width: 44px; height: 44px; }
    .fullscreen-btn.prev { left: 8px; }
    .fullscreen-btn.next { right: 8px; }
}
@media (prefers-reduced-motion: reduce) {
    .modal-slideshow-main .slide, .fullscreen-slide { transition: none; }
}
.modal-info-section h4 {
    font-size: 1.1rem;
    color: var(--text-primary);
    margin: 0 0 0.75rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--bg-light);
}

.modal-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--bg-light);
    border-radius: var(--radius-md);
}

.modal-meta .meta-item {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.modal-description {
    margin-bottom: 1.5rem;
}

.modal-description p {
    color: var(--text-secondary);
    line-height: 1.7;
}

.modal-features-section {
    margin-bottom: 1.5rem;
}

.modal-features {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
}

.modal-features li {
    font-size: 0.95rem;
    color: var(--text-secondary);
    padding: 0.25rem 0;
}

.modal-contact {
    background: var(--bg-light);
    padding: 1.25rem;
    border-radius: var(--radius-md);
    border-left: 4px solid var(--primary-color);
}

.modal-contact p {
    margin: 0.5rem 0;
    color: var(--text-secondary);
}

/* ---------- Photo slideshow on every listing card (v2/js/v2-forsale.js) ---------- */
.for-sale-image-container { height: auto; aspect-ratio: 4 / 3; background: var(--light-gray); }
.v2-fs__track {
    display: flex;
    height: 100%;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
    touch-action: manipulation;
}
.v2-fs__track::-webkit-scrollbar { display: none; }
.v2-fs__track:focus-visible { outline: 3px solid var(--primary-color); outline-offset: -3px; }
@media (prefers-reduced-motion: no-preference) { .v2-fs__track { scroll-behavior: smooth; } }
.v2-fs__slide { flex: 0 0 100%; scroll-snap-align: center; scroll-snap-stop: always; }
.v2-fs__slide img { display: block; width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; user-select: none; }
.v2-fs__nav {
    position: absolute; inset: 0; z-index: 2;
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 0.6rem; pointer-events: none;
}
.v2-fs__btn {
    pointer-events: auto;
    display: grid; place-items: center;
    width: 40px; height: 40px; padding: 0;
    border: 0; border-radius: 50%;
    background: rgba(255, 255, 255, 0.94); color: var(--secondary-color);
    box-shadow: 0 6px 16px -6px rgba(0, 25, 51, 0.55);
    cursor: pointer; touch-action: manipulation;
    transition: opacity 200ms ease, transform 200ms ease, background 200ms ease;
}
.v2-fs__btn:hover { background: #fff; transform: scale(1.06); }
.v2-fs__btn:disabled { opacity: 0.35; cursor: default; transform: none; box-shadow: none; }
.v2-fs__btn:focus-visible { outline: 3px solid var(--secondary-color); outline-offset: 2px; }
.v2-fs__count {
    position: absolute; right: 0.75rem; bottom: 0.75rem; z-index: 2;
    padding: 0.2rem 0.6rem; border-radius: 999px;
    background: rgba(0, 25, 51, 0.74); color: #fff;
    font-size: 0.8rem; font-weight: 500; font-variant-numeric: tabular-nums; letter-spacing: 0.02em;
    pointer-events: none;
}
@media (forced-colors: active) {
    .v2-fs__btn, .v2-fs__count { border: 1px solid CanvasText; }
}
