/* 
   Modern Ad Detail Design (ikman.lk Style)
   Base Color: #009877 (ikman Green)
   Background: #e7edee (Light Grey)
*/

:root {
    --ikman-green: #009877;
    --ikman-bg: #e7edee;
    --ikman-text-main: #2f3432;
    --ikman-text-sub: #707676;
    --ikman-border: #d4ded9;
    --ikman-yellow: #ffc800;
    --ikman-yellow-text: #673500;
}

body.ad-detail-page {
    background-color: var(--ikman-bg) !important;
    color: var(--ikman-text-main);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    overflow-x: hidden;
}

/* Container */
.ad-detail-page .container {
    max-width: 985px !important;
    margin: 0 auto;
    padding: 0 16px !important;
}

/* Breadcrumb Styling */
.ad-breadcrumb {
    padding: 12px 16px;
    font-size: 13px;
    color: var(--ikman-text-sub);
}
.ad-breadcrumb a { color: var(--ikman-text-sub); text-decoration: none; }
.ad-breadcrumb a:hover { text-decoration: underline; }

/* Unified Main Content Box */
.ad-main-wrapper {
    background: #fff;
    border: 1px solid var(--ikman-border);
    border-radius: 4px;
    padding: 24px;
    margin-bottom: 24px;
}

/* Header Section */
.ad-header-section {
    padding: 0 0 16px 0;
    border-bottom: 1px solid var(--ikman-border);
    margin-bottom: 16px;
}
.ad-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}
.ad-header-row.meta-row {
    margin-top: 8px;
    justify-content: flex-start;
    gap: 16px;
}
.module-title {
    font-size: 22px;
    font-weight: 800;
    color: var(--ikman-text-main);
    margin: 0;
    line-height: 1.3;
}
.ad-header-actions {
    display: flex;
    gap: 12px;
    flex-shrink: 0;
    flex-wrap: nowrap;
}
/* Header Section Buttons & Views */
.btn-action {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border: 1px solid var(--ikman-border);
    border-radius: 4px;
    background: #fff;
    font-size: 13px;
    font-weight: 700;
    color: var(--ikman-text-main);
    cursor: pointer;
    transition: all 0.2s;
}
.btn-action:hover { border-color: var(--ikman-green); color: var(--ikman-green); }
.btn-action i { font-size: 14px; color: var(--ikman-text-sub); }

.views-count { 
    font-size: 12px; 
    font-weight: 700; 
    color: var(--ikman-text-main); 
    display: flex; 
    align-items: center; 
    gap: 6px; 
    padding: 2px 10px;
    border: 1px solid var(--ikman-border);
    border-radius: 4px;
    background: #fdfdfd;
}
.views-count i { color: var(--ikman-green); }

/* Main Grid Layout */
.ad-layout {
    display: grid;
    grid-template-columns: 640px 1fr;
    gap: 16px;
    align-items: start;
    margin-top: 16px;
}

/* LEFT: Main Content */
.ad-main { 
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* Image Gallery */
.module-gallery {
    position: relative;
}
.gallery-main {
    position: relative;
    width: 640px;
    height: 466px;
    background-color: #f3f6f5;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.gallery-nav-arrows {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 16px;
    pointer-events: none;
    z-index: 5;
}
.g-arrow {
    width: 36px;
    height: 52px;
    background: transparent;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    pointer-events: auto;
    color: #424e4e;
    font-size: 24px;
    transition: all 0.2s;
}
.g-arrow:hover { color: var(--ikman-green); scale: 1.1; }

.gallery-expand {
    position: absolute;
    top: 8px;
    right: 8px;
    height: 32px;
    width: 32px;
    border: none;
    border-radius: 2px;
    background: #424e4e;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.gallery-thumbs-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px;
    border-top: 1px solid var(--ikman-border);
}
.gallery-thumbs {
    flex: 1;
    overflow: hidden;
}
.t-arrow {
    width: 32px;
    height: 48px;
    background: transparent;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #afb7ad;
    font-size: 18px;
}
.t-arrow:hover { color: var(--ikman-green); }

.thumb-list {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    scrollbar-width: none;
}
.thumb-list::-webkit-scrollbar { display: none; }
.thumb {
    width: 100px;
    height: 75px;
    flex-shrink: 0;
    cursor: pointer;
    border: 1px solid var(--ikman-border);
    border-radius: 2px;
    opacity: 0.6;
    transition: opacity 0.2s;
    overflow: hidden;
}
.thumb.active { opacity: 1; border-color: var(--ikman-green); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }

/* Ad Info Section */
.ad-info-module {
    padding: 16px;
}
.module-price-section {
    padding-bottom: 12px;
    margin-bottom: 16px;
}
.price-value {
    font-size: 24px;
    font-weight: 800;
    color: var(--ikman-green);
}
.condition-row {
    margin-top: 8px;
    display: flex;
    gap: 8px;
    font-size: 14px;
}
.condition-row .label { color: var(--ikman-text-sub); }
.condition-row .value { font-weight: 800; color: var(--ikman-text-main); }

/* Specs / Key Info */
.module-key-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 24px;
}
.ki-row {
    display: flex;
    align-items: baseline;
}
.ki-label { width: 120px; color: var(--ikman-text-sub); font-size: 14px; }
.ki-value { font-weight: 800; color: var(--ikman-text-main); font-size: 14px; }

/* Description */
.module-description {
    padding-top: 16px;
    border-top: 1px solid var(--ikman-border);
}
.module-description h3 {
    font-size: 16px;
    font-weight: 800;
    margin-bottom: 12px;
}
.desc-content {
    font-size: 14px;
    line-height: 1.6;
    color: var(--ikman-text-main);
    word-break: break-word;
}

/* Action Bar */
.module-actions-bar {
    padding: 16px 0;
    margin-top: 24px;
    border-top: 1px solid var(--ikman-border);
    display: flex;
    align-items: center;
    gap: 24px;
}
.btn-boost-new {
    background-color: var(--ikman-yellow);
    color: var(--ikman-yellow-text);
    font-weight: 800;
    padding: 8px 20px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    font-size: 13px;
    transition: background 0.2s;
}
.btn-boost-new:hover { background-color: #f5c000; }

.btn-report-new {
    background: none;
    border: none;
    color: var(--ikman-text-sub);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0;
    text-decoration: none;
}
.btn-report-new:hover { color: var(--ikman-text-main); }
.btn-report-new i { font-size: 14px; color: #afb7ad; }

/* Sidebar Styling */
.ad-sidebar {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.sidebar-card {
    border: 1px solid var(--ikman-border);
    border-radius: 4px;
}

/* Seller Card */
.seller-card { padding: 0; }
.sc-header {
    padding: 16px;
    display: flex;
    gap: 16px;
    border-bottom: 1px solid var(--ikman-border);
}
.sc-avatar {
    width: 52px;
    height: 39px;
    background: #f3f6f5;
    border: 1px solid var(--ikman-border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ikman-green);
    font-size: 20px;
}
.sc-info h3 { font-size: 15px; font-weight: 800; margin: 0 0 2px 0; }
.sc-visit-shop { font-size: 12px; color: var(--ikman-green); text-decoration: none; font-weight: 700; }
.sc-visit-shop:hover { text-decoration: underline; }
.sc-badges { display: flex; gap: 4px; margin-bottom: 4px; }
.badge-member { background: #ffc800; color: #673500; font-size: 9px; font-weight: 800; padding: 2px 6px; border-radius: 2px; display: inline-flex; align-items: center; gap: 4px; }
.badge-verified { background: #fff; color: #0074ba; border: 1px solid #d5e1e6; font-size: 9px; font-weight: 800; padding: 2px 6px; border-radius: 2px; display: inline-flex; align-items: center; gap: 4px; }
.badge-verified i { color: #0074ba; }

.sc-contact { padding: 12px 16px; }
.call-btn-wrapper {
    background-color: #f1f5f9;
    border-radius: 4px;
    padding: 10px;
    margin-bottom: 8px;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 2px;
    border: 1px solid var(--ikman-border);
}
.call-btn-wrapper .call-text { font-weight: 800; font-size: 15px; color: var(--ikman-text-main); }
.call-btn-wrapper .phone-numbers { color: var(--ikman-text-sub); font-size: 11px; }

.sc-action-row {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 800;
    font-size: 13px;
    color: var(--ikman-text-main);
    padding: 10px;
    border: 1px solid var(--ikman-border);
    border-radius: 4px;
    text-decoration: none;
    margin-bottom: 8px;
    cursor: pointer;
}
.sc-action-row:hover { background: #f8fafc; }
.sc-action-row i { font-size: 16px; color: var(--ikman-green); width: 20px; text-align: center; }
.sc-whatsapp-row i { color: #25d366; }

/* Safety Card */
.sidebar-safety { padding: 16px; }
.sidebar-safety h4 { font-size: 14px; font-weight: 800; margin-bottom: 12px; }
.sidebar-safety ul { padding: 0 0 0 20px; margin: 0; }
.sidebar-safety li { font-size: 13px; color: var(--ikman-text-sub); margin-bottom: 12px; line-height: 1.5; }
.safety-link { font-size: 13px; color: #0074ba; font-weight: 800; text-decoration: none; display: inline-block; margin-top: 8px; }
.safety-link:hover { text-decoration: underline; }

/* More from Seller: 2-Row Carousel Grid */
.more-from-seller-wrapper {
    margin-top: 32px;
    padding-top: 0;
}
.mfs-header { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    margin-bottom: 16px; 
    border-bottom: 1px solid var(--ikman-border);
    padding-bottom: 12px;
}
.mfs-seller-brand { display: flex; align-items: center; gap: 10px; }
.mfs-seller-logo, .mfs-seller-logo-placeholder { 
    width: 32px; 
    height: 32px; 
    border: 1px solid var(--ikman-border); 
    border-radius: 4px; 
    object-fit: contain; 
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: var(--ikman-text-sub);
}
.mfs-header h3 { font-size: 14px; font-weight: 800; color: #707676; margin: 0; }
.mfs-header h3 span { color: var(--ikman-green); }

.mfs-container {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
}
.mfs-grid-wrapper {
    flex: 1;
    overflow: hidden;
}
.mfs-grid {
    display: flex;
    flex-wrap: wrap;
    flex-direction: column;
    height: 320px; /* Fits 2 rows of ~150px cards */
    gap: 12px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
}
.mfs-grid::-webkit-scrollbar { display: none; }

.mfs-card {
    width: calc(50% - 6px);
    flex-shrink: 0;
    scroll-snap-align: start;
    border: 1px solid var(--ikman-border);
    border-radius: 4px;
    transition: all 0.2s;
    background: #fff;
}
.mfs-card:hover { border-color: var(--ikman-green); box-shadow: 0 2px 8px rgba(0,0,0,0.05); }
.mfs-card-link { display: flex; text-decoration: none; color: inherit; padding: 10px; gap: 10px; }
.mfs-card-img { width: 130px; height: 90px; border-radius: 4px; overflow: hidden; background: #f3f6f5; flex-shrink: 0; }
.mfs-card-img img { width: 100%; height: 100%; object-fit: cover; }

.mfs-card-info { flex: 1; display: flex; flex-direction: column; gap: 3px; overflow: hidden; position: relative; }
.mfs-card-info h4 { font-size: 13px; font-weight: 700; color: var(--ikman-text-main); margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mfs-card-meta { display: flex; gap: 6px; align-items: center; }
.mfs-card-meta .badge-member { scale: 0.8; transform-origin: left; margin: 0; }
.mfs-card-meta .badge-verified { scale: 0.8; transform-origin: left; margin: 0; }
.mfs-card-location { font-size: 11px; color: var(--ikman-text-sub); }
.mfs-card-price { font-size: 13px; font-weight: 800; color: var(--ikman-green); margin-top: 4px; }
.mfs-card-time { font-size: 10px; color: var(--ikman-text-sub); align-self: flex-end; margin-top: auto; }

.mfs-arrow {
    width: 32px;
    height: 48px;
    background: transparent;
    border: none;
    cursor: pointer;
    color: #afb7ad;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.mfs-arrow:hover { color: var(--ikman-green); }

.mfs-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 16px;
    padding: 0 10px;
}
.mfs-pagination { display: flex; gap: 6px; justify-content: center; flex: 1; }
.mfs-dot { width: 7px; height: 7px; border-radius: 50%; background: #d4ded9; }
.mfs-dot.active { background: #707676; }

.btn-view-all { 
    font-size: 12px; 
    font-weight: 800; 
    color: #0074ba; 
    text-decoration: none; 
    display: flex; 
    align-items: center; 
    gap: 4px; 
}
.btn-view-all:hover { text-decoration: underline; }

/* Internal Links Section - Full Width Grey with White Box */
.internal-links-section { 
    margin-top: 40px; 
    padding: 40px 0; 
    background-color: #f3f6f5; 
    width: 100%;
    position: relative;
    box-shadow: 0 0 0 50vmax #f3f6f5; /* Full width bg without vw scrollbar issues */
    clip-path: inset(0 -50vmax);
}
.il-container { 
    width: 985px; 
    margin: 0 auto; 
    position: relative; 
    padding: 0 40px; /* Space for arrows */
}
.il-white-box {
    background: #fff;
    border: 1px solid var(--ikman-border);
    border-radius: 4px;
    padding: 24px;
}
.il-grid { 
    display: flex;
    gap: 24px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
}
.il-grid::-webkit-scrollbar { display: none; }

.il-column { min-width: 220px; flex: 1; }
.il-column h4 { font-size: 13px; font-weight: 700; color: var(--ikman-text-main); margin: 0 0 12px 0; }
.il-column ul { list-style: none; padding: 0; margin: 0; }
.il-column li { margin-bottom: 6px; }
.il-column a { font-size: 11px; color: var(--ikman-text-sub); text-decoration: none; }
.il-column a:hover { text-decoration: underline; color: var(--ikman-green); }

.il-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 52px;
    background: transparent;
    border: none;
    cursor: pointer;
    color: #afb7ad;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}
.il-arrow:hover { color: var(--ikman-green); }
.il-arrow.left { left: 0; }
.il-arrow.right { right: 0; }

/* Media Queries */
@media (max-width: 992px) {
    .ad-layout { grid-template-columns: 1fr; }
    .gallery-main { width: 100%; height: auto; aspect-ratio: 4/3; }
    .ad-sidebar { order: 2; }
    .ad-main { order: 1; }
}

@media (max-width: 768px) {
    .ad-header-main { flex-direction: column; gap: 8px; }
    .ad-header-actions { width: 100%; justify-content: space-between; }
    .module-key-info { grid-template-columns: 1fr; }
}
