/* =============================================
   AD DETAIL PAGE — ad-detail.css
   ============================================= */

/* Page wrapper */
.ad-detail-page {
    background: var(--bg-light);
    min-height: 100vh;
}

/* Breadcrumb */
.ad-detail__breadcrumb {
    background: #ffffff;
    border-bottom: 1px solid #eef2f6;
    padding: 14px 0;
}

.breadcrumb__container {
    max-width: 1350px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 13px;
    color: var(--text-muted);
}

.breadcrumb__container a {
    color: var(--primary);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: var(--transition);
}

.breadcrumb__container a:hover {
    color: var(--primary-dark);
}

.breadcrumb__container a i {
    width: 14px;
    height: 14px;
}

.breadcrumb-sep {
    width: 14px;
    height: 14px;
    color: #bbb;
    flex-shrink: 0;
}

.breadcrumb-current {
    color: var(--text-muted);
    font-weight: 500;
}

/* Two-column layout */
.ad-detail__container {
    max-width: 1350px;
    width: 100%;
    margin: 30px auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 28px;
    align-items: start;
    box-sizing: border-box;
}

/* Sticky right sidebar */
.ad-detail__right {
    position: sticky;
    top: 20px;
}

/* ---- GALLERY ---- */
.ad-gallery {
    background: #fff;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid #eef2f6;
    box-shadow: var(--shadow-sm);
    margin-bottom: 24px;
}

.gallery-main {
    position: relative;
    height: 460px;
    background: #f8f9fa;
    overflow: hidden;
}

.gallery-main img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.4s ease;
}

.gallery-main:hover img {
    transform: scale(1.03);
}

.gallery-badge {
    position: absolute;
    top: 16px;
    left: 16px;
    background: linear-gradient(135deg, #6db34d 0%, #5a943e 100%);
    color: white;
    padding: 5px 14px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(109, 179, 77, 0.3);
}

.gallery-fav-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 15;
    transition: var(--transition);
    border: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.gallery-fav-btn:hover,
.gallery-fav-btn.active {
    background: #fff0f0;
    transform: scale(1.1);
}

.gallery-fav-btn i {
    width: 18px;
    height: 18px;
    color: var(--text-muted);
    transition: var(--transition);
}

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

.gallery-thumbs {
    display: flex;
    gap: 10px;
    padding: 12px;
    overflow-x: auto;
    background: #fafafa;
    border-top: 1px solid #f0f0f0;
    scrollbar-width: thin;
}

.gallery-thumb {
    width: 80px;
    height: 65px;
    flex-shrink: 0;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: var(--transition);
}

.gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-thumb:hover {
    border-color: var(--primary-dark);
}

.gallery-thumb.active {
    border-color: #6db34d;
    box-shadow: 0 0 0 2px rgba(109, 179, 77, 0.25);
}

/* ---- SECTIONS ---- */
.ad-detail__section {
    background: #fff;
    border-radius: var(--radius-md);
    border: 1px solid #eef2f6;
    box-shadow: var(--shadow-sm);
    padding: 24px;
    margin-bottom: 24px;
}

.ad-detail__section-title {
    font-size: 22px;
    font-weight: 700;
    color: #1b4d3e;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 15px;
    border-bottom: 1.5px solid #f1f3f5;
}

.ad-detail__section-title i {
    width: 22px;
    height: 22px;
    color: #6db34d;
}

.ad-description {
    font-size: 16px;
    color: var(--text-main);
    line-height: 1.8;
    white-space: pre-line;
}

/* Specs grid */
.ad-specs-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
}

.spec-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 14px 0;
    border-bottom: 1px solid #f5f6f8;
}

.spec-item:nth-child(odd) {
    padding-right: 20px;
    border-right: 1px solid #f5f6f8;
}

.spec-item:nth-child(even) {
    padding-left: 20px;
}

.spec-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

.spec-value {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-main);
}

/* ---- RIGHT COLUMN ---- */

/* Price & Title Card */
.ad-info-card {
    background: #fff;
    border-radius: var(--radius-md);
    border: 1px solid #eef2f6;
    box-shadow: var(--shadow-sm);
    padding: 24px;
    margin-bottom: 24px;
}

.ad-info-card__price {
    font-size: 36px;
    font-weight: 800;
    color: #1a2b1f;
    margin-bottom: 12px;
    line-height: 1;
}

.ad-info-card__title {
    font-size: 26px;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.3;
    margin-bottom: 18px;
}

.ad-info-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding-top: 14px;
    border-top: 1px solid #f1f3f5;
    margin-bottom: 20px;
}

/* Share Box */
.ad-share {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ad-share__label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
}

.ad-share__links {
    display: flex;
    gap: 8px;
}

.share-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #eef2f6;
    background: #fff;
    color: var(--text-muted);
    transition: var(--transition);
    cursor: pointer;
    text-decoration: none;
    padding: 0;
}

.share-btn i,
.share-btn svg {
    width: 16px;
    height: 16px;
}

.share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

.share-btn--whatsapp:hover {
    color: #25d366;
    border-color: #25d366;
    background: #f0fdf4;
}

.share-btn--facebook:hover {
    color: #1877f2;
    border-color: #1877f2;
    background: #eff6ff;
}

.share-btn--x:hover {
    color: #000;
    border-color: #000;
    background: #f8f8f8;
}

.share-btn--copy:hover {
    color: var(--primary);
    border-color: var(--primary);
    background: #f0f7ee;
}

.meta-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: var(--text-muted);
    background: #f5f8f5;
    border-radius: 20px;
    padding: 5px 12px;
    font-weight: 500;
}

.meta-chip i {
    width: 13px;
    height: 13px;
    color: #6db34d;
}

/* Contact Card */
.contact-card {
    background: #fff;
    border-radius: var(--radius-md);
    border: 1px solid #eef2f6;
    box-shadow: var(--shadow-sm);
    padding: 22px;
    margin-bottom: 18px;
}

.contact-card__header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
    padding-bottom: 18px;
    border-bottom: 1px solid #f1f3f5;
}

.contact-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: #f0f7ee;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--primary);
}

.contact-avatar i {
    width: 28px;
    height: 28px;
}

.contact-name {
    font-size: 19px;
    font-weight: 700;
    color: var(--text-main);
}

.contact-member {
    font-size: 12px;
    color: var(--text-muted);
}

/* Contact Buttons */
.contact-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 13px 20px;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    margin-bottom: 10px;
    text-decoration: none;
}

.contact-btn--phone {
    background: linear-gradient(135deg, #6db34d 0%, #5a943e 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(109, 179, 77, 0.25);
}

.contact-btn--phone:hover {
    background: linear-gradient(135deg, #5a943e 0%, #4a7b32 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(109, 179, 77, 0.35);
    color: white;
}

.contact-btn--whatsapp {
    background: linear-gradient(135deg, #25d366 0%, #128c7e 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.25);
}

.contact-btn--whatsapp:hover {
    background: linear-gradient(135deg, #1ebe5d 0%, #0e7a6e 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.35);
    color: white;
}

.contact-btn--email {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.contact-btn--email:hover {
    background: #f0f7ee;
    transform: translateY(-2px);
}

.contact-btn--sold {
    background: #1e293b !important;
    color: #ffffff !important;
    cursor: not-allowed !important;
    opacity: 0.8;
}

.sold-banner {
    background: #1e293b;
    color: #ffffff;
    text-align: center;
    padding: 15px;
    border-radius: var(--radius-md);
    margin-bottom: 24px;
    font-weight: 800;
    font-size: 20px;
    letter-spacing: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    box-shadow: var(--shadow-md);
}

.sold-banner i {
    width: 28px;
    height: 28px;
}

/* Safety Tips */
.safety-card {
    background: #f8fbf6;
    border-radius: var(--radius-md);
    border: 1px solid #d9edcf;
    padding: 20px;
    margin-bottom: 18px;
}

.safety-card__title {
    font-size: 14px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 7px;
}

.safety-card__title i {
    width: 16px;
    height: 16px;
}

.safety-list {
    list-style: none;
    padding: 0;
}

.safety-list li {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 8px;
    line-height: 1.5;
}

.safety-list li i {
    width: 14px;
    height: 14px;
    color: #6db34d;
    flex-shrink: 0;
    margin-top: 2px;
}

/* Safety Tips Hide on Mobile sidebar fix */
@media (max-width: 1024px) {
    .safety-card {
        display: none;
    }
}

/* Sidebar Sections */
.sidebar-section {
    background: #fff;
    border-radius: var(--radius-md);
    border: 1px solid #eef2f6;
    box-shadow: var(--shadow-sm);
    padding: 20px;
    margin-bottom: 18px;
}

.sidebar-section__title {
    font-size: 17px;
    font-weight: 700;
    color: #1b4d3e;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f1f3f5;
}

.sidebar-section__title i {
    width: 16px;
    height: 16px;
    color: #6db34d;
}

.sidebar-ads-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.sidebar-ad-card {
    display: flex;
    gap: 12px;
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
    padding: 5px;
    border-radius: 8px;
}

.sidebar-ad-card:hover {
    background: #f8fbf6;
    transform: translateX(4px);
}

.sidebar-ad-img {
    width: 75px;
    height: 65px;
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
}

.sidebar-ad-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sidebar-ad-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.sidebar-ad-price {
    font-size: 14px;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 2px;
}

.sidebar-ad-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.3;
}

.sidebar-ad-location {
    font-size: 10px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}

.sidebar-ad-location i {
    width: 10px;
    height: 10px;
}

.sidebar-map-container {
    width: 100%;
    margin-bottom: 12px;
}

.sidebar-map-footer {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}

.sidebar-map-footer i {
    width: 14px;
    height: 14px;
    color: #6db34d;
}

/* Recommend Ads Section (Horizontal Scroll) */
.related-ads-section {
    padding: 60px 0;
    background: #fff;
    border-top: 1px solid #eef2f6;
    margin-top: 10px;
}

.related-ads__container {
    max-width: 1350px;
    margin: 0 auto;
    padding: 0 20px;
}

.related-ads-nav-wrapper {
    position: relative;
    width: 100%;
}

.related-title {
    margin-bottom: 28px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.related-title i {
    width: 22px;
    height: 22px;
    color: #6db34d;
}

.related-ads-section .featured-ads__grid {
    display: flex;
    overflow-x: auto;
    gap: 24px;
    padding: 10px 4px 30px;
    margin: 0 -4px;
    scrollbar-width: thin;
    scrollbar-color: #6db34d #f0f0f0;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}

.related-ads-section .featured-ads__grid::-webkit-scrollbar {
    height: 6px;
}

.related-ads-section .featured-ads__grid::-webkit-scrollbar-track {
    background: #f0f0f0;
    border-radius: 10px;
}

.related-ads-section .featured-ads__grid::-webkit-scrollbar-thumb {
    background: #6db34d;
    border-radius: 10px;
}

.related-ads-section .ad-card {
    flex: 0 0 300px;
    /* Fixed width for scrollable cards */
    scroll-snap-align: start;
    height: auto;
    display: flex;
    flex-direction: column;
}

@media (max-width: 768px) {
    .related-ads-section .ad-card {
        flex: 0 0 260px;
    }
}


/* Email / Modal */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
}

.modal-box {
    background: #fff;
    border-radius: var(--radius-md);
    padding: 32px;
    width: 100%;
    max-width: 500px;
    position: relative;
    animation: modalSlideIn 0.25s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: #f5f5f5;
    border: none;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.modal-close:hover {
    background: #eee;
}

.modal-box h3 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 22px;
}

.email-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.email-form input,
.email-form textarea {
    border: 1.5px solid #e5e7eb;
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    color: var(--text-main);
    transition: var(--transition);
    outline: none;
    resize: vertical;
}

.email-form input:focus,
.email-form textarea:focus {
    border-color: #6db34d;
    box-shadow: 0 0 0 3px rgba(109, 179, 77, 0.12);
}

/* ---- RESPONSIVE ---- */
@media (max-width: 1024px) {
    .ad-detail__container {
        grid-template-columns: 1fr;
        margin: 20px auto;
    }

    .ad-detail__right {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 20px;
    }

    .ad-info-card {
        grid-column: 1 / -1;
    }
}

@media (max-width: 768px) {
    .ad-detail__container {
        padding: 0 15px;
        gap: 15px;
        margin: 15px auto;
    }

    .breadcrumb__container {
        padding: 0 15px;
    }

    .gallery-main {
        height: 300px;
    }

    .ad-detail__right {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .sidebar-section {
        padding: 15px;
    }

    .ad-specs-grid {
        grid-template-columns: 1fr;
    }

    .spec-item:nth-child(odd) {
        border-right: none;
        padding-right: 0;
    }

    .spec-item:nth-child(even) {
        padding-left: 0;
    }

    .ad-info-card__price {
        font-size: 28px;
    }

    .ad-info-card__title {
        font-size: 22px;
        word-break: break-word;
    }

    .gallery-thumbs {
        scroll-snap-type: x mandatory;
        padding: 8px;
    }

    .gallery-thumb {
        width: calc((100% - 20px) / 3);
        height: auto;
        aspect-ratio: 4 / 3;
        scroll-snap-align: start;
    }
}

@media (max-width: 480px) {
    .gallery-main {
        height: 240px;
    }

    .ad-info-card {
        padding: 15px;
    }

    .ad-detail__section {
        padding: 15px;
    }

    .sidebar-ad-img {
        width: 85px;
        height: 75px;
    }
}