/* Viewer CSS Layout */

/* Header Section with Breadcrumbs & Title */
.tdm-viewer-header-section {
    background: #E7C5B0;
    padding: 40px 0;
    margin: 0;
}

header[data-elementor-type="header"] {
    background-color: #fff;
}

header[data-elementor-type="header"] * {
    color: #000 !important;
}

.tdm-header-container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 30px;
}

.tdm-breadcrumbs {
    margin-bottom: 16px;
}

.tdm-breadcrumbs nav ol {
    display: flex;
    align-items: center;
    gap: 8px;
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 0.95rem;
}

.tdm-breadcrumbs nav ol li:not(:last-child)::after {
    content: '/';
    margin: 0 8px;
    color: rgba(255, 255, 255, 0.7);
}

.tdm-breadcrumbs nav ol li a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    transition: color 0.2s;
}

.tdm-breadcrumbs nav ol li a:hover {
    color: #ffffff;
}

.tdm-breadcrumbs nav ol li span {
    color: #ffffff;
    font-weight: 600;
}

.tdm-viewer-page-title {
    margin: 0;
    color: #ffffff;
    font-size: clamp(1.8rem, 2.5vw, 2.8rem);
    font-weight: 700;
    line-height: 1.2;
}

body.tdm-viewer-page {
    background: #f6f7fb;
    font-family: 'Almoni DL AAA', 'Assistant', 'Heebo', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: #111827;
}

body.tdm-viewer-page #page,
body.tdm-viewer-page #content,
body.tdm-viewer-page .site-content,
body.tdm-viewer-page main,
body.tdm-viewer-page #primary {
    max-width: none !important;
    width: 100% !important;
}

.tdm-viewer-shell {
    max-width: 1440px;
    margin: 42px auto 64px;
    padding: 0 30px;
    --tdm-phone-width: 272px;
    --tdm-phone-height: 540px;
    --tdm-phone-shadow: 0 16px 30px rgba(15, 23, 42, 0.28);
    --tdm-phone-margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 26px;
}

.tdm-viewer-row {
    display: grid;
    gap: 24px;
    align-items: start;
}

.tdm-viewer-row-top {
    grid-template-columns: minmax(0, 60%) minmax(0, 40%);
}

.tdm-viewer-row-bottom {
    grid-template-columns: minmax(280px, 30%) minmax(0, 70%);
    margin-top:5%;
}

.tdm-viewer-map-col,
.tdm-viewer-phone-col,
.tdm-viewer-filters-col,
.tdm-viewer-cards-col {
    min-width: 0;
}

#tdm-viewer-map-area {
    width: 100%;
    margin: 0;
}

.tdm-viewer-map-frame {
    position: relative;
    background: #ffffff;
    border: 1px solid #e7e8ee;
    border-radius: 26px;
    padding: 14px;
    box-shadow: 0 28px 58px rgba(15, 23, 42, 0.1);
}

#tdm-viewer-map {
    width: 100%;
    height: 400px;
    border-radius: 20px;
    overflow: hidden;
}

.tdm-map-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.tdm-map-city-label {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 999px;
    background: #111827;
    color: #fff;
    font-size: 0.9rem;
    font-weight: 700;
}

.tdm-map-fullscreen-btn {
    border: 1px solid #d1d5db;
    background: #fff;
    color: #111827;
    border-radius: 999px;
    padding: 8px 14px;
    font-size: 0.86rem;
    font-weight: 700;
    cursor: pointer;
}

.tdm-map-fullscreen-btn:hover {
    border-color: #111827;
}

#tdm-map-frame:fullscreen {
    border-radius: 0;
    padding: 20px;
    background: #fff;
}

#tdm-map-frame:fullscreen #tdm-viewer-map {
    height: calc(100vh - 90px);
}

.tdm-category-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.tdm-category-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid #d1d5db;
    border-radius: 999px;
    padding: 6px 10px;
    background: #fff;
    color: #111827;
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 600;
}

.tdm-category-chip-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex: 0 0 10px;
}

.tdm-attractions-count {
    display: inline-flex;
    margin-inline-start: 8px;
    font-size: 0.9rem;
    color: #6b7280;
    font-weight: 600;
}

.tdm-viewer-cards-section {
    width: 100%;
    margin: 0;
}

.tdm-viewer-section-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    margin-bottom: 24px;
}

.tdm-viewer-eyebrow {
    margin: 0 0 6px;
    color: #d61f69;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

.tdm-viewer-section-title,
.tdm-sidebar-title {
    margin: 0;
    color: #111827;
    font-size: clamp(2rem, 2.2vw, 2.45rem);
    font-weight: 700;
    line-height: 1.1;
}

.tdm-viewer-cards-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
}

#tdm-viewer-sidebar {
    position: sticky;
    top: 28px;
}

.tdm-viewer-phone-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.tdm-slider-dot:hover {
    background: #fff;
}

@media (max-width: 768px) {
    .tdm-viewer-shell {
        --tdm-phone-width: 220px;
        --tdm-phone-height: 450px;
    }
}

@media (max-width: 640px) {
    .tdm-viewer-shell {
        --tdm-phone-width: 190px;
        --tdm-phone-height: 390px;
    }
}

.tdm-sidebar-filters {
    background: linear-gradient(180deg, #ffffff 0%, #fbfbfd 100%);
    border: 1px solid #e7e8ee;
    border-radius: 26px;
    padding: 30px;
    box-shadow: 0 24px 52px rgba(15, 23, 42, 0.09);
}

.tdm-sidebar-text {
    margin: 10px 0 24px;
    color: #6b7280;
    font-size: 1.02rem;
    line-height: 1.7;
}

.tdm-sidebar-filters input,
.tdm-sidebar-filters select {
    width: 100%;
    min-height: 56px;
    padding: 0 18px;
    margin-bottom: 14px;
    border: 1px solid #d6dae3;
    border-radius: 15px;
    box-sizing: border-box;
    background: #fff;
    color: #111827;
    font-size: 1rem;
}

.tdm-sidebar-filters input:focus,
.tdm-sidebar-filters select:focus {
    outline: none;
    border-color: #2271b1;
    box-shadow: 0 0 0 4px rgba(34, 113, 177, 0.12);
}

.tdm-filter-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.tdm-btn {
    display: block;
    width: 100%;
    padding: 15px 18px;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    font-weight: 700;
    text-align: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.tdm-btn:hover {
    transform: translateY(-2px);
}

.tdm-btn-geo {
    background: linear-gradient(135deg, #111827 0%, #1f2937 100%);
    color: #fff;
    box-shadow: 0 18px 36px rgba(15, 23, 42, 0.2);
}

.tdm-btn-geo:hover {
    background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 100%);
}

.tdm-btn-nav {
    background: linear-gradient(135deg, #16a34a 0%, #22c55e 100%);
    color: #fff;
}

.tdm-btn-nav:hover {
    background: linear-gradient(135deg, #15803d 0%, #16a34a 100%);
}

.tdm-card {
    position: relative;
    overflow: hidden;
    background: #fff;
    border: 1px solid #e7e8ee;
    border-bottom: 5px solid var(--tdm-card-accent, #2271b1);
    border-radius: 22px;
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.09);
    cursor: pointer;
    transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.tdm-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 30px 58px rgba(15, 23, 42, 0.16);
}

.tdm-card-locked {
    position: relative;
}

.tdm-card-locked::after {
    content: 'נעול - לרכישה';
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(17, 24, 39, 0.85);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    border-radius: 999px;
    padding: 4px 10px;
    z-index: 3;
}

.tdm-card-media {
    width: 100%;
    aspect-ratio: 3 / 2;
    background: #e5e7eb;
    overflow: hidden;
}

.tdm-card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.45s ease;
}

.tdm-card:hover .tdm-card-media img {
    transform: scale(1.05);
}

.tdm-price-pill {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    background: #ecfeff;
    color: #155e75;
    font-weight: 700;
}

.tdm-card-media-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: #6b7280;
    background: linear-gradient(135deg, #eceff5 0%, #dfe5ee 100%);
}

.tdm-card-body {
    padding: 18px 20px 20px;
}

.tdm-card-title {
    margin: 0 0 12px;
    color: #111827;
    font-size: 1.24rem;
    font-weight: 700;
    line-height: 1.35;
}

.tdm-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.tdm-card .cat,
.tdm-card .rating,
.tdm-card .dist {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 6px 11px;
    font-size: 0.86rem;
    font-weight: 600;
}

.tdm-card .cat {
    background: #eef2ff;
    color: #4338ca;
}

.tdm-card .rating {
    background: #fff7ed;
    color: #b45309;
}

.tdm-card .dist {
    background: #ecfdf5;
    color: #047857;
}

/* Custom Marker */
.tdm-client-marker {
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
    width: 24px !important;
    height: 24px !important;
    margin-left: -12px !important;
    margin-top: -12px !important;
    display: flex;
    justify-content: center;
    align-items: center;
    color: transparent;
    transition: transform 0.2s;
}
.tdm-client-marker.active { transform: scale(1.3); border-color: #2271b1; }

/* Modal specific */
.tdm-modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 10000;
    justify-content: center;
    align-items: center;
}
.tdm-modal-content {
    background: #fff;
    width: 860px;
    max-width: 90%;
    border-radius: 26px;
    box-shadow: 0 26px 60px rgba(0,0,0,0.24);
    position: relative;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}
.tdm-modal-close {
    position: absolute;
    top: 18px; left: 18px;
    background: rgba(255,255,255,0.92);
    border: none;
    color: #c2185b;
    font-size: 28px;
    font-weight: 300;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    padding: 0;
    cursor: pointer;
    z-index: 2;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.12);
}
.tdm-modal-close:hover { background: #fff; }
.tdm-modal-close:focus {
    outline: 2px solid #2271b1;
    outline-offset: 2px;
}

#tdm-modal-body {
    padding: 28px;
    overflow-y: auto;
}
.tdm-modal-header-img {
    width: 100%;
    aspect-ratio: 5 / 3;
    height: auto;
    object-fit: cover;
    border-radius: 18px;
    margin-bottom: 15px;
    background: #f0f0f1;
}
.tdm-modal-title {
    margin: 0 0 16px 0;
    font-size: clamp(1.95rem, 2.4vw, 2.5rem);
    line-height: 1.15;
    color: #111827;
}
.tdm-modal-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px 16px;
    font-size: 1rem;
    color: #555;
    margin-bottom: 14px;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}
.tdm-modal-summary {
    line-height: 1.7;
    font-size: 1.08rem;
    margin-bottom: 12px;
    color: #3f3f46;
    word-break: break-word;
}

.tdm-modal-gallery-row {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    margin: 0 0 18px;
    padding-bottom: 6px;
}

/* Ensure footer displays on viewer pages */
body.tdm-viewer-page #colophon,
body.tdm-viewer-page footer,
body.tdm-viewer-page footer.site-footer,
body.tdm-viewer-page .site-footer {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.tdm-modal-gallery-thumb {
    width: auto;
    max-width: none;
    height: 92px;
    object-fit: contain;
    background: #fff;
    border-radius: 8px;
    border: 1px solid #d4d4d8;
    flex: 0 0 auto;
}
.tdm-modal-footer {
    padding: 18px 26px 22px;
    border-top: 1px solid #eee;
    background: #fafbff;
    border-radius: 0 0 24px 24px;
    display: flex;
    gap: 10px;
}

@media (max-width: 768px) {
    .tdm-viewer-header-section {
        padding: 28px 0;
    }

    .tdm-header-container {
        padding: 0 16px;
    }

    .tdm-breadcrumbs nav ol {
        font-size: 0.85rem;
        gap: 4px;
    }

    .tdm-breadcrumbs nav ol li:not(:last-child)::after {
        margin: 0 4px;
    }

    .tdm-viewer-page-title {
        font-size: clamp(1.4rem, 2.2vw, 1.8rem);
    }

    .tdm-viewer-shell {
        gap: 22px;
        padding: 0 16px;
    }

    .tdm-viewer-row-top,
    .tdm-viewer-row-bottom {
        grid-template-columns: 1fr;
    }

    #tdm-viewer-sidebar {
        position: static;
    }

    #tdm-viewer-map-area,
    .tdm-viewer-cards-section {
        width: 100%;
    }

    .tdm-viewer-cards-grid {
        grid-template-columns: 1fr;
    }


    .tdm-filter-row {
        grid-template-columns: 1fr;
    }

    #tdm-viewer-map {
        height: 360px;
    }

    .tdm-modal-content {
        width: calc(100% - 20px);
        max-height: calc(100vh - 20px);
    }


    .tdm-modal-title {
        font-size: 1.7rem;
    }

    .tdm-modal-meta {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .tdm-viewer-shell {
        margin: 20px auto 32px;
    }

    .tdm-sidebar-filters,
    .tdm-viewer-map-frame,
    .tdm-card {
        border-radius: 18px;
    }

    #tdm-viewer-map {
        height: 320px;
    }


    .tdm-modal-close {
        width: 40px;
        height: 40px;
        font-size: 24px;
    }

    #tdm-mobile-list-btn {
        position: absolute;
        bottom: 12px;
        right: 12px;
        z-index: 400;
        background: rgba(255,255,255,0.95);
        border: 1px solid #ddd;
        border-radius: 20px;
        padding: 8px 16px;
        font-size: 0.88em;
        font-weight: bold;
        box-shadow: 0 2px 8px rgba(0,0,0,0.2);
        cursor: pointer;
    }

    #tdm-gallery-strip {
        display: none;
    }
}

#tdm-gallery-strip {
    display: none;
}

@media (min-width: 981px) {
    #tdm-mobile-list-btn {
        display: none;
    }
}

/* OSRM Routing Panel */
#tdm-route-info-panel {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 300px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    padding: 15px;
    z-index: 1000;
}

#tdm-route-info-panel h3 {
    margin: 0 0 10px 0;
    font-size: 1.1em;
    color: #2271b1;
}

.tdm-route-metrics {
    display: flex;
    justify-content: space-between;
    font-weight: bold;
    font-size: 1.1em;
    margin-bottom: 10px;
}

.tdm-route-loading, .tdm-route-error {
    text-align: center;
    padding: 10px;
    color: #666;
}
.tdm-route-error {
    color: #b32d2e;
}

/* Hide/restore map buttons */
.tdm-btn-hide-map { background: #f59e0b; color: #fff; border: none; border-radius: 6px; padding: 8px 14px; cursor: pointer; font-size: 0.85rem; transition: background 0.2s; }
.tdm-btn-hide-map:hover { background: #d97706; }
.tdm-btn-restore-map { background: #10b981; color: #fff; border: none; border-radius: 6px; padding: 8px 14px; cursor: pointer; font-size: 0.85rem; transition: background 0.2s; }
.tdm-btn-restore-map:hover { background: #059669; }

/* Hidden card state */
.tdm-card-hidden { opacity: 0.55; position: relative; }
.tdm-hidden-badge { display: inline-block; background: #f59e0b; color: #fff; border-radius: 4px; padding: 1px 6px; font-size: 0.72rem; margin-right: 4px; vertical-align: middle; }
