/* Trust Guardian Styles */
.trust-guardian-card {
    transition: all 0.3s ease;
}

.trust-badge {
    animation: fadeInScale 0.3s ease-out forwards;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

:root {
    --brand-orange: #FF6600;
    --brand-orange-hover: #E55A00;
    --brand-green: #059669;
    --brand-green-hover: #047857;
    --surface-white: #FFFFFF;
    --bg-gray: #F9FAFB;
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --border-gray: #e2e8f0;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --radius-lg: 16px;
    --radius-md: 12px;
}

/* Prevent horizontal scroll on page */
.main-content,
.listing-display-layout,
.image-gallery,
.main-image-container {
    max-width: 100%;
    box-sizing: border-box;
    position: relative;
}

/* Base Layout */
body {
    background-color: var(--bg-gray);
    color: var(--text-primary);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    -webkit-font-smoothing: antialiased;
    overflow-x: clip; /* clip no crea scroll context → no rompe position:sticky */
}
html { overflow-x: clip; }

/* overflow-x:clip no crea scroll context → no rompe position:sticky */
.main-content {
    max-width: 1110px !important;
    margin: 0 auto;
    padding: 0 15px 24px 15px !important;
    overflow-x: clip;
}

.listing-display-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 28px;
    align-items: start;
    max-width: 1110px;
    margin: 0 auto;
}

/* Colapsa a 1 columna cuando primary < 728px: 728+28+320+30pad=1106px */
@media (max-width: 1105px) {
    .listing-display-layout {
        grid-template-columns: 1fr;
        gap: 24px;
    }
}

/* Gallery Refresh */
.listing-primary-column {
    overflow: hidden;
    min-width: 0;
    max-width: 100%;
}

.image-gallery {
    background: #ffffff;
    border-radius: 16px;
    overflow: hidden !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    margin-bottom: 24px;
    position: relative;
    max-width: 100%;
    width: 100%;
}

.main-image-container {
    background: #f8fafc;
    height: 480px !important;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

@media (max-width: 768px) {
    .main-image-container {
        height: 400px !important;
    }
}

.main-image {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block;
    border-radius: inherit;
}

/* Video player (YouTube / local) — full size en ficha */
.ad-video-track {
    width: 100%;
    display: block;
}
.main-image-container:has(.ad-video-track) {
    height: auto !important;
    background: transparent;
    display: block;
    overflow: visible;
}
.youtube-video-container,
.local-video-container {
    width: 100%;
    max-width: 460px;
    aspect-ratio: 9 / 16;
    max-height: 80vh;
    background: #000;
    position: relative;
    margin: 0 auto;
    border-radius: 12px;
    overflow: hidden;
}
.youtube-video-wrapper,
.local-video-wrapper {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}
.youtube-video-player,
.local-video-player {
    position: absolute;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
    border: 0;
    display: block;
    background: #000;
}
@media (min-width: 769px) {
    .youtube-video-container,
    .local-video-container {
        aspect-ratio: 9 / 16;
        max-width: 420px;
        max-height: 75vh;
    }
}

/* Image overlay badges (sold, reserved) */
.image-overlay-badges {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 10;
    pointer-events: none;
}

.image-overlay-badges > * {
    pointer-events: auto;
}

/* Favorite button on image - Desktop (Wallapop style) */
.image-fav-btn {
    position: absolute;
    bottom: 16px;
    right: 16px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 24px;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    cursor: pointer;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
}

.image-fav-btn:hover {
    background: #f8fafc;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.image-fav-btn i {
    font-size: 18px;
    color: #64748b;
    transition: all 0.2s ease;
}

.image-fav-btn.active i {
    color: #ef4444;
}

.image-fav-btn .count {
    color: #1e293b;
    font-size: 14px;
    font-weight: 600;
}

/* Image counter pill - Desktop (compact badge) */
.image-counter {
    position: absolute;
    bottom: 16px;
    left: 16px;
    background: rgba(30, 41, 59, 0.75);
    backdrop-filter: blur(4px);
    color: white;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0;
    z-index: 10;
}

.image-counter i {
    display: none;
}

/* Thumbnail grid - hidden, replaced by dots */
.thumbnail-grid { display: none !important; }
.thumbnail-item { display: none !important; }

/* Gallery arrows — círculos perfectos */
.gallery-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 15;
    background: #fff;
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
    padding: 0;
    margin: 0;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #1e293b;
    font-size: 13px;
    line-height: 1;
    appearance: none;
    -webkit-appearance: none;
    transition: transform 0.15s, box-shadow 0.15s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.22), 0 0 0 1px rgba(0,0,0,0.04);
}
.gallery-arrow:hover { transform: translateY(-50%) scale(1.08); box-shadow: 0 4px 12px rgba(0,0,0,0.28); }
.gallery-arrow:active { transform: translateY(-50%) scale(0.95); }
.gallery-arrow-prev { left: 14px; }
.gallery-arrow-next { right: 14px; }

@media (max-width: 768px) {
    .gallery-arrow {
        width: 30px; height: 30px;
        min-width: 30px; min-height: 30px;
        font-size: 11px;
        box-shadow: 0 1px 6px rgba(0,0,0,0.20);
    }
    .gallery-arrow-prev { left: 10px; }
    .gallery-arrow-next { right: 10px; }
}

.image-dots-nav {
    position: absolute;
    bottom: 10px;
    left: 0;
    right: 0;
    z-index: 10;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0;
    padding: 0;
    min-height: 0;
    background: none;
    pointer-events: auto;
}

.img-dot {
    display: block;
    width: 7px;
    height: 7px;
    min-width: 7px;
    min-height: 7px;
    border-radius: 50%;
    background: rgba(255,255,255,0.85);
    border: none;
    padding: 0;
    margin: 0 3px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.45), 0 0 1px rgba(0,0,0,0.6);
    cursor: pointer;
    flex-shrink: 0;
    flex-grow: 0;
    line-height: 0;
    font-size: 0;
    box-sizing: border-box;
    transition: transform 0.3s ease, background 0.3s ease, opacity 0.3s ease, width 0.3s ease, margin 0.3s ease;
    transform-origin: center;
    -webkit-appearance: none;
    appearance: none;
}

.img-dot.active {
    background: var(--brand-orange, #f97316);
    transform: scale(1.5);
    box-shadow: 0 2px 5px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.4);
}

.img-dot.dot-near1 { transform: scale(1.15); opacity: 0.85; }
.img-dot.dot-near2 { transform: scale(0.85); opacity: 0.55; }
.img-dot.dot-hidden { transform: scale(0); width: 0 !important; min-width: 0 !important; height: 0 !important; min-height: 0 !important; margin: 0 !important; padding: 0 !important; opacity: 0; pointer-events: none; overflow: hidden; }

.img-dot-video {
    background: #94a3b8;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 5px;
    width: 10px;
    height: 10px;
}
.img-dot-video.active { background: #1877f2; }

/* Sidebar Styling */
.listing-secondary-column {
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: sticky;
    top: 100px;
}

@media (max-width: 1105px) {
    .listing-secondary-column {
        position: static;
    }
}

.sidebar-card {
    background: var(--surface-white);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
    border: none !important;
}

.sidebar-price {
    font-size: 32px;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
    margin-bottom: 16px;
}

.btn-chat,
.btn-favorite {
    width: 100%;
    border-radius: 9999px !important;
    padding: 14px 20px !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    text-transform: none !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: none !important;
}

.btn-chat {
    background: var(--brand-orange) !important;
    color: white !important;
}

.btn-chat:hover {
    background: var(--brand-orange-hover) !important;
}

.btn-favorite {
    background: #f1f5f9 !important;
    color: #475569 !important;
    margin-top: 12px;
}

.btn-chat:hover,
.btn-favorite:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Main Column Typography */
.listing-primary-column {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.listing-title-area h1 {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0 0 12px 0;
    line-height: 1.2;
}

/* Accordion collapsible sections */
.accordion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
    padding-bottom: 0;
    margin-bottom: 0;
}

.accordion-chevron {
    color: #94a3b8;
    font-size: 14px;
    transition: transform 0.25s ease;
    flex-shrink: 0;
}

.accordion-section.collapsed .accordion-chevron {
    transform: rotate(-90deg);
}

.accordion-body {
    overflow: hidden;
    max-height: 2000px;
    transition: max-height 0.3s ease, opacity 0.25s ease;
    opacity: 1;
    padding: 1rem 1.25rem 0rem 1.25rem;
}

.accordion-section.collapsed .accordion-body {
    max-height: 0;
    opacity: 0;
}

.accordion-section.collapsed {
    padding-bottom: 0 !important;
}

/* Section Styling */
.product-description,
.basic-data-section,
.duplicate-listings-section,
.related-ads,
.valuation-section {
    background: var(--surface-white);
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
    border: none !important;
    margin-bottom: 24px;
}

.description-title,
.basic-data-title,
.related-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 24px !important;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 10px;
}

.description-title::before,
.basic-data-title::before {
    content: '';
    display: block;
    width: 4px;
    height: 24px;
    background: var(--brand-orange);
    border-radius: 2px;
}

.description-content {
    font-size: 16px;
    line-height: 1.7;
    color: var(--text-secondary);
}

/* Grids and Items */
.basic-data-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.basic-data-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f1f5f9;
}

.basic-data-item:last-child {
    border-bottom: none;
}

.basic-data-label {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.basic-data-value {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

/* Responsive Fixes */
@media (max-width: 640px) {
    .basic-data-grid {
        grid-template-columns: 1fr;
    }

    .main-content {
        padding: 16px 12px !important;
    }

    .listing-title-area h1 {
        font-size: 22px;
    }
}

/* Mobile Ad Header */
.mobile-listing-top {
    display: none;
    background: var(--surface-white);
    padding: 24px;
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
    margin-bottom: 24px;
}

@media (max-width: 1105px) {
    .mobile-listing-top {
        display: block;
    }
}

/* Ad Meta Info Styling */
.listing-metadata {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: center;
    margin-top: 8px;
    color: var(--text-muted);
    font-size: 14px;
    padding: 0 4px;
}

.listing-metadata .meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.listing-metadata .meta-item i {
    color: var(--brand-orange);
    font-size: 16px;
}

/* Related Ads Slider */
.related-slider-container {
    position: relative;
    padding: 0 44px;
    margin-top: 20px;
    overflow: hidden;
}

.related-slider {
    display: flex;
    gap: 16px;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}

.related-slide {
    flex: 0 0 calc((100% - (3 * 16px)) / 4);
    min-width: 0;
}

.related-card {
    background: #ffffff;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    border: 1.5px solid #f1f5f9;
}

.related-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.1);
    border-color: var(--brand-orange);
}

.related-image {
    height: 160px;
    background: #f1f5f9;
    overflow: hidden;
    position: relative;
    flex-shrink: 0;
}

.related-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.35s ease;
}

.related-card:hover .related-image img {
    transform: scale(1.07);
}

.rc-no-img {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #cbd5e1;
    background: #f8fafc;
    font-size: 28px;
}

.related-content {
    padding: 12px 14px 14px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.related-card-title {
    font-size: 13px;
    font-weight: 600;
    color: #1e293b;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

.related-card-price {
    font-size: 17px;
    font-weight: 800;
    color: var(--brand-orange);
    margin-top: 2px;
}

.related-card-location {
    font-size: 11px;
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.related-card-location i {
    font-size: 10px;
    color: #cbd5e1;
    flex-shrink: 0;
}

.slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    color: #475569;
    transition: all 0.2s;
    font-size: 12px;
}

.slider-btn:hover {
    background: var(--brand-orange);
    border-color: var(--brand-orange);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.3);
}

.slider-btn-prev { left: 0; }
.slider-btn-next { right: 0; }

.slider-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 16px;
}

.slider-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #e2e8f0;
    cursor: pointer;
    transition: all 0.25s;
}

.slider-dot.active {
    background: var(--brand-orange);
    width: 22px;
    border-radius: 4px;
}

/* Related Listings SEO Section */
.related-listings-section {
    background: var(--surface-white);
    border-radius: var(--radius-lg);
    padding: 24px 28px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
    margin-bottom: 24px;
    margin-top: 8px;
}

.related-listings-title {
    font-size: 17px;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 18px 0;
    display: flex;
    align-items: center;
    gap: 9px;
}

.related-listings-title i {
    color: var(--brand-orange);
    font-size: 15px;
}

.related-listings-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.related-listing-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: #f8fafc;
    border: 1.5px solid #e8edf3;
    border-radius: 10px;
    text-decoration: none;
    color: #334155;
    font-size: 13px;
    transition: all 0.2s ease;
    min-width: 0;
}

.related-listing-card:hover {
    background: #fff7ed;
    border-color: var(--brand-orange);
    color: #c2410c;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.12);
}

.related-listing-card.rlc-location {
    background: #f0f9ff;
    border-color: #bae6fd;
    color: #0369a1;
}

.related-listing-card.rlc-location:hover {
    background: #e0f2fe;
    border-color: #0284c7;
    color: #0284c7;
}

.rlc-icon {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: rgba(249, 115, 22, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: var(--brand-orange);
    flex-shrink: 0;
}

.rlc-location .rlc-icon {
    background: rgba(3, 105, 161, 0.1);
    color: #0369a1;
}

.rlc-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.rlc-text {
    font-weight: 600;
    font-size: 13px;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rlc-rank {
    font-size: 11px;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 3px;
}

.rlc-rank i {
    color: #f59e0b;
    font-size: 10px;
}

.rlc-arrow {
    font-size: 10px;
    color: #cbd5e1;
    flex-shrink: 0;
    transition: transform 0.2s;
}

.related-listing-card:hover .rlc-arrow {
    transform: translateX(3px);
    color: currentColor;
}

@media (max-width: 1024px) {
    .related-slide {
        flex: 0 0 calc((100% - (2 * 16px)) / 3);
    }
    .related-listings-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .related-slider-container {
        padding: 0 36px;
    }

    .related-slide {
        flex: 0 0 calc((100% - 16px) / 2);
    }

    .related-slider {
        gap: 12px;
    }

    .related-listings-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
}

@media (max-width: 560px) {
    .related-slider-container {
        padding: 0;
    }

    .slider-btn {
        display: none !important;
    }

    .related-slide {
        flex: 0 0 calc((100% - 12px) / 2);
    }

    .related-slider {
        gap: 12px;
    }

    .related-listings-grid {
        grid-template-columns: 1fr;
    }

    .related-listings-section {
        padding: 20px 16px;
    }
}

@media (max-width: 400px) {
    .related-slide {
        flex: 0 0 85%;
    }
}

.related-grid {
    grid-template-columns: repeat(4, 1fr);
}
@media (max-width: 1024px) {
    .related-grid { grid-template-columns: repeat(3, 1fr) !important; }
}
@media (max-width: 768px) {
    .related-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 12px !important; }
}
@media (max-width: 480px) {
    .related-grid { grid-template-columns: 1fr !important; }
}

/* ===========================================
   PREMIUM MOBILE REDESIGN - Ad Detail Page
   =========================================== */

/* Default: Hide mobile-only elements on desktop */
.mobile-seller-card {
    display: none;
}

.mobile-delivery-options {
    display: none;
}

/* Mobile: Reset paddings for immersive experience */
@media (max-width: 768px) {

    /* Make the main site header scroll away on detail pages */
    .header {
        position: relative !important;
        top: auto !important;
    }

    /* Hide bottom nav bar completely on ad detail pages */
    .mobile-footer,
    .mobile-bottom-nav {
        display: none !important;
    }

    .cn-chat {
        transform: translateY(calc(100% + 20px));
        transition: transform 0.3s ease;
    }

    .cn-chat.show-on-scroll {
        transform: translateY(0);
    }

    /* Show mobile seller card */
    .mobile-seller-card {
        display: flex;
    }

    .main-content {
        padding: 0 !important;
        background: #f8fafc;
    }

    .listing-display-layout {
        gap: 0;
    }

    /* Hide desktop sidebar on mobile - will use floating bar instead */
    .listing-secondary-column {
        display: none !important;
    }

    /* ==================
       GALLERY REDESIGN
       ================== */
    .image-gallery {
        border-radius: 12px;
        margin: 8px 12px 16px;
        width: calc(100% - 24px);
        box-sizing: border-box;
        box-shadow: 0 2px 12px rgba(0,0,0,0.10);
        position: relative;
        overflow: hidden !important;
        background: #000;
        line-height: 0;
        font-size: 0;
    }

    .main-image-container {
        height: auto !important;
        aspect-ratio: 4 / 3;
        background: #000;
        min-height: 260px;
        max-height: 420px;
        border-radius: 12px;
        overflow: hidden;
        line-height: 0;
    }

    .main-image {
        width: 100% !important;
        height: 100% !important;
        max-width: 100%;
        object-fit: cover !important;
        object-position: center;
        display: block;
    }

    /* Overlay badges repositioning */
    .image-overlay-badges {
        position: absolute;
        top: 12px;
        left: 12px;
        z-index: 10;
    }

    .sold-badge {
        background: linear-gradient(135deg, #ef4444, #dc2626);
        color: white;
        padding: 6px 12px;
        border-radius: 6px;
        font-size: 12px;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
    }

    /* Favorite button on image - Mobile (Wallapop style) */
    .image-fav-btn {
        display: flex !important;
        bottom: 12px;
        right: 12px;
        padding: 6px 12px;
        border-radius: 20px;
        font-size: 13px;
        gap: 5px;
    }

    .image-fav-btn i {
        font-size: 18px;
        color: #64748b;
        transition: all 0.2s ease;
    }

    .image-fav-btn.active i,
    .image-fav-btn:hover i {
        color: #ef4444;
    }

    .image-fav-btn .count {
        color: #1e293b;
        font-size: 13px;
        font-weight: 600;
    }

    /* Image counter pill - Mobile (compact badge) */
    .image-counter {
        position: absolute;
        bottom: 12px;
        left: 12px;
        right: auto;
        width: fit-content;
        background: rgba(30, 41, 59, 0.75);
        color: white;
        padding: 5px 10px;
        border-radius: 6px;
        font-size: 12px;
        font-weight: 600;
        display: flex;
        align-items: center;
        gap: 0;
        backdrop-filter: blur(8px);
        z-index: 10;
    }

    .image-counter i {
        display: none;
    }

    /* Dots en móvil: ocultos — solo counter + flechas */
    .image-dots-nav {
        display: none !important;
    }

    /* ==================
       MOBILE AD HEADER
       ================== */
    .mobile-listing-top {
        display: block !important;
        background: #ffffff;
        padding: 20px 16px;
        border-radius: 0;
        box-shadow: none;
        margin-bottom: 0;
        border-bottom: 1px solid #f1f5f9;
    }

    .mobile-listing-top h1 {
        font-size: 20px;
        font-weight: 700;
        color: #1e293b;
        line-height: 1.35;
        margin: 0 0 12px 0;
        display: -webkit-box;
        -webkit-line-clamp: 3;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .mobile-listing-top .price {
        font-size: 26px;
        font-weight: 800;
        color: #1e293b;
        letter-spacing: -0.5px;
    }

    /* ==================
       AD META INFO - CHIPS STYLE
       ================== */
    .listing-metadata {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        gap: 10px;
        padding: 16px;
        background: #ffffff;
        margin: 0;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        border-bottom: 1px solid #f1f5f9;
    }

    .listing-metadata::-webkit-scrollbar {
        display: none;
    }

    .listing-metadata .meta-item {
        flex-shrink: 0;
        display: flex;
        align-items: center;
        gap: 6px;
        background: #f8fafc;
        padding: 10px 14px;
        border-radius: 10px;
        font-size: 13px;
        font-weight: 500;
        color: #475569;
        border: 1px solid #e2e8f0;
    }

    .listing-metadata .meta-item i {
        font-size: 14px;
        color: #64748b;
    }

    /* ==================
       CONTENT SECTIONS
       ================== */
    .listing-primary-column {
        gap: 0;
        padding: 0;
    }

    .product-description,
    .basic-data-section,
    .valuation-section,
    .property-details,
    .product-map,
    .category-location-tree,
    .duplicate-listings-section,
    .related-ads,
    .related-search-section {
        border-radius: 0 !important;
        margin-bottom: 0 !important;
        padding: 20px 16px !important;
        box-shadow: none !important;
        border: none !important;
        border-bottom: 8px solid #f1f5f9 !important;
    }

    .description-title,
    .basic-data-title,
    .related-title {
        font-size: 17px;
        margin-bottom: 16px !important;
    }

    .description-content {
        font-size: 15px;
        line-height: 1.6;
    }

    /* Basic data grid mobile */
    .basic-data-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 0 !important;
    }

    .basic-data-grid>div {
        display: contents;
    }

    .basic-data-item {
        padding: 14px 0;
        border-bottom: 1px solid #f1f5f9;
    }

    .basic-data-label {
        font-size: 11px;
        letter-spacing: 0.08em;
    }

    .basic-data-value {
        font-size: 15px;
    }

    /* Property features grid */
    .property-features-grid {
        grid-template-columns: 1fr !important;
        gap: 24px !important;
    }

    /* Related ads mobile */
    .related-ads {
        overflow: hidden;
    }

    .related-slider {
        gap: 12px !important;
        padding: 0 16px;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
    }

    .related-slide {
        flex: 0 0 calc(50% - 6px) !important;
        scroll-snap-align: start;
    }

    .related-image {
        height: 140px;
    }

    .related-content {
        padding: 12px;
    }

    .related-card-title {
        font-size: 13px;
        height: auto;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .related-card-price {
        font-size: 16px;
    }
}

/* ===========================================
   STICKY CONTACT BAR - MOBILE ONLY
   =========================================== */
.mobile-contact-bar {
    display: none;
}

@media (max-width: 768px) {
    .mobile-contact-bar {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 9998;
        background: #ffffff;
        box-shadow: 0 -2px 16px rgba(0, 0, 0, 0.1);
        padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px)) 16px;
        align-items: center;
        gap: 12px;
        border-top: 1px solid #f1f5f9;
    }

    .mobile-contact-bar .contact-bar-cta {
        flex: 1;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        padding: 14px 20px;
        border-radius: 12px;
        font-weight: 700;
        font-size: 16px;
        border: none;
        cursor: pointer;
        transition: all 0.2s ease;
        text-decoration: none;
        color: white;
        background: linear-gradient(135deg, #FF6600, #E55A00);
        box-shadow: 0 4px 12px rgba(255, 102, 0, 0.35);
    }

    .mobile-contact-bar .contact-bar-cta:active {
        transform: scale(0.97);
        box-shadow: 0 2px 8px rgba(255, 102, 0, 0.4);
    }

    .mobile-contact-bar .contact-bar-cta i {
        font-size: 18px;
    }

    .mobile-contact-bar .contact-bar-cta.cta-external {
        background: linear-gradient(135deg, #10b981, #059669);
        box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
    }

    .mobile-contact-bar .contact-bar-cta.cta-external:active {
        box-shadow: 0 2px 8px rgba(16, 185, 129, 0.4);
    }

    /* Add bottom padding to main content to avoid contact bar overlap */
    .main-content {
        padding-bottom: 80px !important;
    }
}

/* ===========================================
   TOUCH OPTIMIZATIONS
   =========================================== */
@media (max-width: 768px) {

    /* Ensure all interactive elements meet 44px minimum touch target */
    button,
    a,
    .meta-item {
        min-height: 44px;
    }

    /* Smooth scroll behavior */
    .listing-metadata,
    .related-slider {
        scroll-behavior: smooth;
    }

    .related-card:active {
        transform: scale(0.98);
    }
}

/* ===========================================
   RICH CARD PLACEHOLDER - MOBILE
   =========================================== */
@media (max-width: 768px) {
    .rich-card-fallback {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        height: 100%;
        background: linear-gradient(135deg, #f8fafc, #e2e8f0);
        color: #94a3b8;
        gap: 12px;
    }

    .rich-card-fallback i {
        font-size: 48px;
    }

    .rich-card-fallback p {
        font-size: 14px;
        margin: 0;
    }
}

/* ===========================================
   SELLER INLINE CARD - MOBILE
   =========================================== */
@media (max-width: 768px) {
    .mobile-delivery-options {
        display: block;
    }

    .mobile-seller-card {
        display: flex;
        align-items: center;
        gap: 14px;
        background: #ffffff;
        padding: 16px;
        border-bottom: 1px solid #f1f5f9;
    }

    .mobile-seller-card .seller-avatar {
        width: 48px;
        height: 48px;
        border-radius: 50%;
        background: #f1f5f9;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 18px;
        font-weight: 600;
        color: #64748b;
        overflow: hidden;
        flex-shrink: 0;
    }

    .mobile-seller-card .seller-avatar img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .mobile-seller-card .seller-info {
        flex: 1;
        min-width: 0;
    }

    .mobile-seller-card .seller-name {
        font-size: 15px;
        font-weight: 600;
        color: #1e293b;
        margin: 0 0 4px 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .mobile-seller-card .seller-stats {
        font-size: 13px;
        color: #64748b;
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .mobile-seller-card .seller-stats i {
        color: #fbbf24;
        font-size: 12px;
    }

    .mobile-seller-card .view-profile {
        color: #1877f2;
        font-size: 13px;
        font-weight: 600;
        text-decoration: none;
        flex-shrink: 0;
    }
}

/* ===========================================
   PREMIUM IMAGE LIGHTBOX - Modal
   =========================================== */
.image-lightbox-modal {
    display: none;
    position: fixed;
    inset: 0;
    top: 0 !important;
    left: 0 !important;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    background: #000;
    z-index: 2147483647;
    flex-direction: column;
    backdrop-filter: blur(10px);
}

/* Cuando lightbox abierto: ocultar TODO excepto modal y bloquear scroll */
html.lightbox-open,
body.lightbox-open {
    overflow: hidden !important;
    height: 100% !important;
    position: fixed !important;
    width: 100% !important;
    top: 0;
    left: 0;
}
body.lightbox-open > *:not(.image-lightbox-modal):not(script):not(style) {
    visibility: hidden !important;
}
body.lightbox-open .image-lightbox-modal {
    visibility: visible !important;
    display: flex !important;
}

.image-lightbox-modal.active {
    display: flex;
}

.lightbox-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: calc(env(safe-area-inset-top) + 12px) 16px 12px;
    color: white;
    z-index: 10;
}

.lightbox-spacer { width: 44px; height: 44px; display: inline-block; }

.lightbox-counter {
    font-size: 16px;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.1);
    padding: 6px 16px;
    border-radius: 20px;
}

.lightbox-close {
    background: rgba(0, 0, 0, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: white;
    width: 44px;
    height: 44px;
    min-width: 44px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: background 0.2s;
    position: relative;
    z-index: 2;
}

.lightbox-close:hover {
    background: rgba(0, 0, 0, 0.75);
}

.lightbox-back:hover { transform: none; }

.lightbox-content {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow: hidden;
}

.lightbox-slides {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}

.lightbox-slide {
    min-width: 100%;
    flex: 0 0 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 20px;
    box-sizing: border-box;
}

.lightbox-slide img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    user-select: none;
}

.lightbox-caption {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.75);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    backdrop-filter: blur(4px);
    z-index: 20;
    max-width: 80%;
    text-align: center;
}

.contact-slide {
    flex-direction: column;
    color: white;
    text-align: center;
    gap: 16px;
}

.contact-slide h3 {
    font-size: 24px;
    font-weight: 700;
    margin: 0;
}

.contact-slide p {
    font-size: 16px;
    color: #cbd5e1;
    max-width: 500px;
    margin: 0;
    line-height: 1.6;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    transition: all 0.2s;
    backdrop-filter: blur(10px);
    z-index: 10;
}

.lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.2);
    scale: 1.1;
}

.lightbox-nav.prev {
    left: 40px;
}

.lightbox-nav.next {
    right: 40px;
}

.lightbox-ad {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    background: transparent;
    overflow: hidden;
}
.lightbox-ad:empty { display: none; }
.lightbox-ad ins.adsbygoogle {
    background: #ffffff;
    border-radius: 6px;
    width: 320px !important;
    max-width: 100% !important;
    height: 100px !important;
    display: inline-block;
    overflow: hidden;
}
.lightbox-ad.is-unfilled { display: none; }

@media (max-width: 768px) {
    .lightbox-ad { padding: 6px; }
}

.lightbox-thumbnails {
    height: 100px;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    display: flex;
    justify-content: flex-start;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
}

.lightbox-thumbnails::-webkit-scrollbar { display: none; }

.lightbox-thumbnail {
    width: 64px;
    height: 64px;
    aspect-ratio: 1 / 1;
    flex: 0 0 64px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    opacity: 0.55;
    transition: all 0.2s;
    border: 2px solid transparent;
    scroll-snap-align: start;
}

.lightbox-thumbnail.active {
    opacity: 1;
    border-color: #1877f2;
}

.lightbox-thumbnail:hover {
    opacity: 0.8;
}

.lightbox-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

@media (max-width: 768px) {
    .lightbox-nav {
        display: none; /* en mobile usamos swipe, no botones */
    }

    .lightbox-content {
        padding: 0;
    }

    .lightbox-slide {
        padding: 0;
    }

    .lightbox-slide img {
        border-radius: 0;
        box-shadow: none;
        max-width: 100vw;
        max-height: 100%;
    }

    .lightbox-header {
        padding: calc(env(safe-area-inset-top) + 10px) 12px 14px;
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        z-index: 100;
        background: linear-gradient(to bottom, rgba(0,0,0,0.7), rgba(0,0,0,0));
        pointer-events: none;
    }
    .lightbox-header > * { pointer-events: auto; }

    .lightbox-counter {
        background: rgba(0, 0, 0, 0.5);
        font-size: 14px;
    }

    .lightbox-thumbnails {
        height: 84px;
    }

    .lightbox-thumbnail {
        width: 56px;
        height: 56px;
        flex: 0 0 56px;
    }
}

/* Contener AdSense sin crear scroll context que rompa sticky */
.adsense-horizontal-wrapper {
    max-width: 100%;
    max-height: 90px;
    overflow: clip;
}

/* Ad Navigation Bar (Coches.net style) */
.ad-navigation-bar {
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    padding: 10px 0;
    margin-bottom: 24px;
    position: sticky;
    top: 70px;
    z-index: 2147483644;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.3s ease, background 0.3s ease;
}

.nav-container {
    max-width: 980px;
    margin: 0 auto;
    padding: 0 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-left {
    flex: 1;
}

.nav-center {
    flex: 1;
    text-align: center;
}

.nav-right {
    flex: 1;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 20px;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    color: #475569;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.action-btn i,
.nav-btn i,
.nav-back-link i {
    font-weight: 900 !important;
}

.action-btn i {
    font-size: 16px;
}

.action-btn:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #1e293b;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.action-favorite.is-active,
.action-favorite.active {
    background: #fff1f2;
    border-color: #fecdd3;
    color: #e11d48;
}

.action-favorite.is-active i,
.action-favorite.active i {
    color: #e11d48;
}

.action-discard:hover {
    background: #fef2f2;
    border-color: #fecaca;
    color: #dc2626;
}

.nav-divider {
    width: 1px;
    height: 24px;
    background: #e2e8f0;
    margin: 0 16px;
}

.nav-back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #64748b;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.2s;
}

.nav-back-link:hover {
    color: #0f172a;
}

.nav-counter {
    color: #64748b;
    font-size: 14px;
}

.nav-counter strong {
    color: #1e293b;
}

.nav-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    color: #475569;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s;
}

.nav-btn:hover:not(.nav-btn-disabled) {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #1e293b;
    transform: translateY(-1px);
}

.nav-btn-disabled {
    opacity: 0.5;
    cursor: default;
    background: #f8fafc;
    color: #94a3b8;
}

@media (max-width: 768px) {
    .ad-navigation-bar {
        padding: 0;
        margin-bottom: 0;
        position: sticky;
        top: 0;
        left: 0;
        right: 0;
        width: 100%;
        z-index: 2147483644;
        background: rgba(255,255,255,0.98);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        border-bottom: 1px solid rgba(0,0,0,0.08);
        box-shadow: 0 1px 0 rgba(0,0,0,0.06), 0 4px 16px rgba(0,0,0,0.06);
        height: 52px;
    }

    /* Ensure parent containers don't break sticky positioning */
    .main-content,
    .page-flex-container {
        overflow: visible !important;
    }

    .ad-navigation-bar .nav-container {
        display: flex !important;
        padding: 0 8px;
        align-items: center;
        justify-content: space-between;
        height: 52px;
        gap: 0;
    }

    .nav-left {
        flex: 0 0 auto;
    }

    .nav-center {
        display: none;
    }

    .nav-right {
        flex: 1;
        justify-content: flex-end;
        gap: 6px;
    }

    .nav-controls {
        flex: 0 0 auto;
        gap: 4px;
        display: flex;
        align-items: center;
        margin-left: 4px;
        padding-left: 8px;
        border-left: 1px solid #e2e8f0;
    }

    .nav-divider { display: none; }

    .nav-btn-text, .action-text { display: none; }

    .nav-back-link span { display: none; }

    .nav-back-link {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 38px;
        height: 38px;
        border-radius: 50%;
        color: #1e293b;
        text-decoration: none;
        transition: background 0.15s;
    }
    .nav-back-link:hover { background: #f1f5f9; }
    .nav-back-link i { font-size: 17px; }

    .action-btn {
        padding: 0;
        box-sizing: border-box;
        border: none;
        background: transparent;
        color: #4b5563;
        border-radius: 50%;
        width: 38px;
        height: 38px;
        min-width: 38px;
        min-height: 38px;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: background 0.15s;
        appearance: none;
        -webkit-appearance: none;
    }
    .action-btn:hover { background: #f1f5f9; box-shadow: none; transform: none; }
    .action-btn i { font-size: 16px; }

    .action-favorite.is-active,
    .action-favorite.active {
        background: transparent;
        border: none;
    }

    .nav-btn {
        padding: 0;
        box-sizing: border-box;
        border: none;
        background: transparent;
        color: #4b5563;
        border-radius: 50%;
        width: 36px;
        height: 36px;
        min-width: 36px;
        min-height: 36px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 14px;
        transition: background 0.15s;
        appearance: none;
        -webkit-appearance: none;
        text-decoration: none;
    }
    .nav-btn:hover:not(.nav-btn-disabled) { background: #f1f5f9; box-shadow: none; transform: none; }
    .nav-btn-disabled { opacity: 0.3; pointer-events: none; }
}
