.listing-detail { background: #f3f4f6; color: #253442; }
.cd-page, .cd-page *, .cd-mobile-contact, .cd-mobile-contact * { box-sizing: border-box; letter-spacing: 0; }
.cd-page { font-size: 16px; line-height: 1.65; padding-bottom: 0; }
.cd-container { width: min(100% - 64px, 1440px); margin-inline: auto; }
.cd-page h1, .cd-page h2, .cd-page h3 { color: #172f47; text-transform: none; letter-spacing: 0; }
.cd-page h2 { font-size: 22px; line-height: 1.35; font-weight: 700; margin: 0 0 18px; }
.cd-page a, .cd-mobile-contact a { text-decoration: none; }
.cd-page a:focus-visible, .cd-page button:focus-visible, .cd-page summary:focus-visible,
.cd-mobile-contact a:focus-visible { outline: 3px solid #145a9d; outline-offset: 4px; }
.cd-breadcrumb { display: flex; align-items: center; gap: 14px; padding: 18px 0; font-size: 14px; color: #596f83; }
.cd-breadcrumb a { display: inline-flex; align-items: center; gap: 10px; color: #1767af; font-weight: 600; }
.cd-breadcrumb a:hover { color: #124e83; text-decoration: underline; }
.cd-layout { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 24px; align-items: start; }
.cd-content { min-width: 0; }
.cd-overview { background: #fff; padding: 26px 28px 28px; }
.cd-sidebar { position: sticky; top: 98px; min-width: 0; padding: 18px; border: 1px solid #dce1e6; border-radius: 6px; background: #fff; scroll-margin-top: 115px; }
.cd-heading { min-width: 0; padding: 0 0 18px; }
.cd-heading h1 { font-size: 26px; line-height: 1.4; font-weight: 700; overflow-wrap: anywhere; margin: 0 0 12px; }
.cd-heading-bottom { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px 24px; }
.cd-offer-summary { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 18px; }
.cd-status-line { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; color: #546a7f; font-size: 13px; }
.cd-status-line .cd-status { display: inline-flex; align-items: center; gap: 7px; color: #147b47; background: #e1f3e8; border: 1px solid #b7ddc6; border-radius: 4px; padding: 4px 10px; font-weight: 700; }
.cd-is-sold .cd-status-line .cd-status { color: #b52c39; background: #fce9ec; border-color: #efc5cb; }
.cd-ad-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; color: #64717e; font-size: 13px; }
.cd-product-core { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); align-items: start; gap: 28px; padding: 24px 0 0; }
.cd-product-core-gallery-only { grid-template-columns: minmax(0, 1fr); }
.cd-gallery { min-width: 0; }
.cd-gallery-with-thumbnails { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 12px; align-items: start; }
.cd-gallery-with-thumbnails .cd-gallery-stage { grid-column: 2; grid-row: 1; }
.cd-specifications { min-width: 0; scroll-margin-top: 115px; }
.cd-specifications h2 { font-size: 20px; margin-bottom: 14px; }
.cd-gallery-stage { position: relative; overflow: hidden; border: 1px solid #e3e6e9; border-radius: 4px; background: #f6f7f8; }
.cd-photo-count { position: absolute; left: 18px; top: 18px; display: inline-flex; align-items: center; gap: 7px; background: rgba(20, 39, 56, .85); color: #fff; padding: 5px 10px; border-radius: 4px; font-size: 13px; z-index: 2; pointer-events: none; }
.listing-detail #racunarGalerija { width: 100%; }
.listing-detail #racunarGalerija .carousel-inner { height: 400px; }
.listing-detail #racunarGalerija .carousel-item { height: 100%; }
.listing-detail #racunarGalerija .carousel-inner,
.listing-detail #modalCarousel .carousel-inner { touch-action: pan-y; user-select: none; }
.listing-detail #racunarGalerija .cd-zoom { display: block; position: relative; border: 0; padding: 0; width: 100%; height: 100%; background: transparent; cursor: zoom-in; }
.listing-detail #racunarGalerija .cd-zoom img { width: 100%; height: 100%; max-height: none; object-fit: contain; }
.cd-zoom-icon { display: flex; align-items: center; justify-content: center; position: absolute; right: 16px; bottom: 16px; width: 38px; height: 38px; border-radius: 4px; background: rgba(255,255,255,.94); color: #24435e; font-size: 17px; }
.listing-detail #racunarGalerija .carousel-control-prev,
.listing-detail #racunarGalerija .carousel-control-next { top: 50%; bottom: auto; transform: translateY(-50%); width: 42px; height: 48px; border-radius: 5px; opacity: 1; color: #24435e; background: rgba(255,255,255,.94); font-size: 30px; box-shadow: 0 2px 8px #1e34451a; }
.listing-detail #racunarGalerija .carousel-control-prev { left: 14px; }
.listing-detail #racunarGalerija .carousel-control-next { right: 14px; }
.listing-detail #racunarGalerija .carousel-control-prev:hover,
.listing-detail #racunarGalerija .carousel-control-next:hover { background: #1a76d1; color: #fff; }
.cd-thumbnails { position: relative; grid-column: 1; grid-row: 1; display: flex; flex-direction: column; gap: 8px; max-height: 402px; padding: 2px 4px 2px 0; overflow-y: auto; overflow-x: hidden; scrollbar-width: thin; scrollbar-color: #aebdcb transparent; }
.cd-thumbnails .racunar-thumbnail { display: block; flex: 0 0 58px; width: 58px; height: 58px; padding: 2px; border: 2px solid #dce2e7; border-radius: 4px; background: #f4f5f6; cursor: pointer; opacity: 1; margin: 0; }
.cd-thumbnails .racunar-thumbnail.active { border-color: #1a76d1; background: #fff; opacity: 1; }
.cd-thumbnails .racunar-thumbnail:hover { opacity: 1; border-color: #77aee0; }
.cd-thumbnails .racunar-thumbnail img { width: 100%; height: 100%; object-fit: cover; border-radius: 2px; }
.cd-no-photo { height: 400px; border: 1px solid #e3e6e9; border-radius: 4px; background: #f6f7f8; display: flex; gap: 18px; flex-direction: column; align-items: center; justify-content: center; color: #61778b; }
.cd-no-photo i { font-size: 40px; }
.cd-price-panel { min-width: 0; }
.cd-price-line { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 22px; }
.cd-price { color: #166dc0; font-size: 30px; line-height: 1.2; font-weight: 700; white-space: nowrap; }
.cd-price > span { font-size: 23px; }
.cd-price-change { display: flex; align-items: center; gap: 10px; font-size: 15px; }
.cd-price-change s { color: #667b8f; }
.cd-price-change > span { font-size: 13px; font-weight: 700; background: #fbe8e8; color: #b52c39; padding: 3px 6px; border-radius: 3px; }
.cd-sold-message { color: #b52c39; font-size: 20px; font-weight: 700; margin: 0 0 4px; line-height: 1.35; }
.cd-price-panel .cd-browse-available { color: #1767af; font-weight: 600; font-size: 15px; }
.cd-price-panel .cd-browse-available:hover { text-decoration: underline; }
.cd-sidebar-offer { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 10px; min-width: 0; margin-top: 18px; padding: 16px 14px; border-radius: 6px; background: linear-gradient(135deg, #111827, #1f4f82); color: #fff; }
.cd-sidebar-price-label { font-size: 12px; font-weight: 800; text-transform: uppercase; }
.cd-sidebar-price, .cd-sidebar-status { min-width: 0; max-width: 100%; color: #fff; font-size: 30px; line-height: 1.2; font-weight: 800; overflow-wrap: anywhere; }
.cd-sidebar-price > span { font-size: 24px; }
.cd-sidebar-discount { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; width: 100%; font-size: 13px; }
.cd-sidebar-discount s { color: #dce6f0; overflow-wrap: anywhere; }
.cd-sidebar-discount > span { font-weight: 700; }
.cd-is-sold .cd-sidebar-offer { background: #a62e3b; }
.cd-seller .cd-sidebar-offer + .cd-contact-actions { margin-top: 12px; }
.cd-contact-actions { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
.cd-contact-actions a { min-width: 0; min-height: 44px; padding: 9px; border-radius: 5px; display: flex; align-items: center; justify-content: center; gap: 7px; font-weight: 600; font-size: 13px; line-height: 1.4; transition: background .15s ease; }
.cd-contact-actions .cd-contact-call { grid-column: 1 / -1; background: #1a76d1; color: #fff; justify-content: center; padding: 9px 12px; gap: 12px; }
.cd-contact-call > i { font-size: 20px; }
.cd-contact-call > span { display: flex; flex-direction: column; gap: 2px; }
.cd-contact-number { font-size: 13px; font-weight: 400; }
.cd-contact-actions .cd-contact-call:hover { background: #1266b8; color: #fff; }
.cd-contact-actions .cd-contact-whatsapp { background: #e3f3e9; color: #177747; border: 1px solid #b5dac4; }
.cd-contact-actions .cd-contact-whatsapp:hover { background: #d1ebdc; color: #115b36; }
.cd-contact-actions .cd-contact-viber { background: #ece9fb; color: #5e43a5; border: 1px solid #d6cdef; }
.cd-contact-actions .cd-contact-viber:hover { background: #e0d9f6; color: #4b3388; }
.cd-contact-whatsapp > i, .cd-contact-viber > i { font-size: 19px; }
.cd-badges { display: flex; flex-wrap: wrap; gap: 6px 14px; padding: 0; margin: 14px 0 6px; list-style: none; }
.listing-detail #specifikacije-racunara .cd-badges li { display: inline-flex; gap: 6px; align-items: center; font-size: 13px; color: #305e47; margin: 0; }
.cd-badges i { color: #208453; font-size: 12px; }
.cd-badge-note { color: #60758a; font-size: 12px; line-height: 1.65; margin: 0; }
.cd-seller .cd-contact-actions { margin-top: 18px; padding-bottom: 16px; border-bottom: 1px solid #e4e8ec; }
.cd-seller-heading { display: flex; gap: 12px; align-items: center; }
.cd-seller-avatar { display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; flex-shrink: 0; border: 1px solid #c6dced; background: #e0edfa; color: #146ab7; font-size: 14px; font-weight: 700; border-radius: 50%; }
.cd-seller-identity { min-width: 0; }
.cd-seller-label { display: block; color: #60758a; font-size: 12px; margin-bottom: 1px; }
.cd-seller-identity strong, .cd-seller-identity a { display: block; font-size: 14px; font-weight: 700; color: #203e5b; line-height: 1.45; overflow-wrap: anywhere; }
.cd-seller-identity a:hover { color: #1a76d1; text-decoration: underline; }
.cd-member-since { color: #61778b; font-size: 12px; }
.cd-disclaimer { color: #52697e; font-size: 13px; line-height: 1.75; margin: 14px 0 10px; }
.cd-seller .cd-report { display: inline-flex; align-items: center; gap: 7px; color: #61758a; font-size: 13px; padding: 4px 0; }
.cd-seller .cd-report:hover { color: #a52c39; }
.cd-verification { margin-top: 12px; font-size: 13px; }
.cd-verification summary { display: inline-flex; align-items: center; gap: 7px; color: #17734a; cursor: pointer; font-weight: 600; min-height: 30px; }
.cd-verification summary::-webkit-details-marker { display: none; }
.cd-verification p { border-left: 2px solid #83ba9d; padding-left: 12px; color: #51697c; margin: 8px 0 0; }
.cd-section-nav { display: flex; gap: 24px; flex-wrap: wrap; border-top: 1px solid #e3e8ed; border-bottom: 1px solid #e3e8ed; padding: 0; }
.cd-section-nav a { display: flex; align-items: center; gap: 7px; font-size: 14px; font-weight: 600; color: #245275; padding: 10px 0 12px; }
.cd-section-nav a:hover { color: #166dc0; text-decoration: underline; }
.cd-section-nav .cd-contact-jump { display: none; }
.cd-description-column { min-width: 0; margin-top: 24px; padding: 30px 28px 34px; background: #fff; }
.cd-description-column section { scroll-margin-top: 115px; }
.cd-page .section-kicker { margin: 0 0 6px; color: #1a76d1; font-weight: 600; font-size: 13px; text-transform: none; }
.cd-spec-table { margin: 0; border-top: 1px solid #e1e6eb; }
.cd-spec-row { display: grid; grid-template-columns: minmax(0, 40%) minmax(0, 60%); border-bottom: 1px solid #e1e6eb; }
.cd-spec-row:nth-child(odd) { background: #f5f7f9; }
.cd-spec-row dt, .cd-spec-row dd { padding: 10px 12px; margin: 0; font-size: 15px; line-height: 1.6; overflow-wrap: anywhere; min-width: 0; }
.cd-spec-row dt { font-weight: 600; color: #263b4e; }
.cd-spec-row dd { color: #344a5c; }
.cd-purposes { margin-top: 28px; }
.cd-purposes h3 { font-size: 16px; font-weight: 600; margin-bottom: 12px; }
.cd-purposes > div { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.cd-purposes a { display: inline-flex; align-items: center; gap: 6px; color: #1767af; font-size: 14px; padding: 3px 0; }
.cd-purposes a:hover { text-decoration: underline; }
.cd-page .cd-description-text { color: #344352; font-size: 16px; line-height: 1.85; overflow-wrap: anywhere; max-width: 85ch; }
.cd-page .cd-description-text p { color: inherit; font-size: inherit; line-height: inherit; margin: 0 0 18px; }
.cd-description-text ul, .cd-description-text ol { padding-left: 22px; margin-bottom: 18px; }
.cd-description-text ul { list-style: disc; }
.cd-description-text ol { list-style: decimal; }
.cd-description-text img, .cd-description-text video, .cd-description-text iframe { max-width: 100%; height: auto; }
.cd-description-text table { width: 100%; table-layout: fixed; }
.cd-description-text pre { white-space: pre-wrap; }
.cd-description-text a { color: #1767af; text-decoration: underline; }
.cd-video { margin-top: 30px; padding-top: 24px; border-top: 1px solid #e1e6eb; }
.cd-video .embed-responsive { border-radius: 6px; overflow: hidden; background: #172f47; }
.cd-related-band { background: #fff; margin-top: 32px; padding: 0 0 20px; border-top: 1px solid #e3e7eb; }
.cd-page .hc-related-catalog { margin: 0; padding: 32px 0 20px; border: 0; }
.cd-page .hc-related-catalog .hc-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cd-page .cd-back-link { display: inline-flex; align-items: center; gap: 10px; color: #1767af; font-size: 15px; font-weight: 600; padding: 14px 0; }
.cd-mobile-contact { display: none; }

/* Keep the shared Bootstrap lightbox separate from the legacy detail styles. */
.listing-detail #imageModal { padding: 0 !important; }
.listing-detail #imageModal .modal-dialog { display: block; }
.listing-detail #imageModal .modal-content { height: 100%; border-radius: 0; background: #0c1421eb !important; }
.listing-detail #imageModal .modal-body { height: 100%; flex: 1; padding: 55px 64px !important; }
.listing-detail #modalCarousel .carousel-inner { display: block !important; }
.listing-detail #modalCarousel .carousel-item { height: 100%; }
.listing-detail #modalCarousel .modal-img { max-width: 100%; width: 100%; height: 100%; max-height: none; object-fit: contain; }
.listing-detail #imageModal .modal-close-btn { position: fixed; right: 18px; top: 16px; z-index: 5; width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; border-radius: 5px; font-size: 36px; opacity: 1; color: #fff; background: #ffffff24; text-shadow: none; }
.listing-detail #imageModal .modal-close-btn:hover { background: #1a76d1; }
.listing-detail #modalCarousel .carousel-control-prev,
.listing-detail #modalCarousel .carousel-control-next { width: 48px; opacity: 1; }
.listing-detail #modalCarousel .carousel-control-prev { left: -52px; }
.listing-detail #modalCarousel .carousel-control-next { right: -52px; }
.listing-detail #modalCarousel .carousel-control-prev-icon,
.listing-detail #modalCarousel .carousel-control-next-icon { width: 40px; height: 48px; background-color: #ffffff26; border-radius: 5px; background-size: 18px; }
.listing-detail.modal-open .cd-mobile-contact { visibility: hidden; }

@media (min-width: 769px) and (max-width: 1240px) {
    .cd-sidebar { top: 156px; }
    .cd-sidebar, .cd-specifications, .cd-description-column section { scroll-margin-top: 156px; }
}
@media (max-width: 1199px) {
    .cd-container { width: calc(100% - 40px); }
    .cd-layout { grid-template-columns: minmax(0, 1fr) 250px; gap: 24px; }
    .cd-sidebar { padding: 16px; }
    .cd-overview, .cd-description-column { padding: 22px; }
    .cd-product-core { gap: 18px; }
    .cd-gallery-with-thumbnails { display: block; }
    .cd-thumbnails { flex-direction: row; max-height: none; padding: 10px 2px 6px; overflow-x: auto; overflow-y: hidden; }
    .listing-detail #racunarGalerija .carousel-inner { height: auto; aspect-ratio: 1; }
    .cd-no-photo { height: auto; aspect-ratio: 1; }
    .listing-detail .cd-product-core-gallery-only #racunarGalerija .carousel-inner,
    .cd-product-core-gallery-only .cd-no-photo { height: 400px; aspect-ratio: auto; }
    .cd-heading h1 { font-size: 24px; }
    .cd-spec-row dt, .cd-spec-row dd { padding: 9px; font-size: 14px; }
}
@media (max-width: 991px) {
    .cd-layout { grid-template-columns: minmax(0, 1fr); gap: 0; }
    .cd-sidebar { position: static; margin-top: 24px; padding: 24px; }
    .cd-seller { max-width: 540px; }
    .cd-section-nav .cd-contact-jump { display: flex; }
    .cd-page .hc-related-catalog .hc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .cd-page .hc-related-catalog .hc-card:last-child:nth-child(odd) { grid-column: 1 / -1; max-width: calc(50% - 10px); }
}
@media (max-width: 640px) {
    .listing-detail { padding-bottom: calc(114px + env(safe-area-inset-bottom)); }
    .cd-container { width: 100%; }
    .cd-breadcrumb { padding: 16px; font-size: 13px; }
    .cd-overview { padding: 20px 16px 24px; }
    .cd-description-column { padding: 24px 16px; margin-top: 16px; }
    .cd-sidebar { padding: 20px 16px; margin: 16px 0 0; border-radius: 0; border-left: 0; border-right: 0; }
    .cd-related-band { margin-top: 24px; padding-inline: 16px; }
    .cd-heading { padding-bottom: 10px; }
    .cd-heading h1 { font-size: 22px; line-height: 1.4; margin: 0 0 10px; }
    .cd-status-line { font-size: 13px; }
    .cd-ad-meta { font-size: 12px; }
    .cd-product-core { grid-template-columns: minmax(0, 1fr); gap: 28px; padding: 20px 0 0; }
    .listing-detail #racunarGalerija .carousel-inner { aspect-ratio: 4 / 3; }
    .listing-detail .cd-product-core-gallery-only #racunarGalerija .carousel-inner,
    .cd-product-core-gallery-only .cd-no-photo { height: auto; aspect-ratio: 4 / 3; }
    .cd-photo-count { top: 12px; left: 12px; }
    .cd-thumbnails { gap: 8px; padding-top: 10px; }
    .cd-thumbnails .racunar-thumbnail { width: 62px; height: 62px; flex-basis: 62px; }
    .cd-price { font-size: 28px; }
    .cd-contact-actions a { min-height: 48px; }
    .cd-disclaimer { font-size: 13px; }
    .cd-section-nav { gap: 0 18px; }
    .cd-section-nav a { font-size: 13px; padding: 8px 0 12px; gap: 6px; }
    .cd-sidebar, .cd-specifications, .cd-description-column section { scroll-margin-top: 168px; }
    .cd-page h2 { font-size: 21px; margin-bottom: 16px; }
    .cd-spec-row dt, .cd-spec-row dd { padding: 10px; font-size: 15px; }
    .cd-page .cd-description-text { font-size: 16px; }
    .cd-page .hc-related-catalog { padding-top: 28px; }
    .cd-page .hc-related-catalog .hc-grid { grid-template-columns: minmax(0, 1fr); }
    .cd-page .hc-related-catalog .hc-card:last-child:nth-child(odd) { max-width: none; }
    .cd-mobile-contact { display: block; position: fixed; bottom: 0; left: 0; right: 0; z-index: 1001; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: #fff; border-top: 1px solid #c7dcec; box-shadow: 0 -4px 18px #14385014; }
    .cd-mobile-price { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; line-height: 1.4; }
    .cd-mobile-price strong { color: #166dc0; font-size: 20px; }
    .cd-mobile-is-sold .cd-mobile-price strong { color: #b52c39; }
    .cd-mobile-price > span { color: #177747; font-size: 12px; font-weight: 600; }
    .cd-mobile-price > .cd-mobile-sold { color: #b52c39; }
    .cd-contact-compact { grid-template-columns: 1.1fr 1fr .85fr; gap: 8px; }
    .cd-contact-compact .cd-contact-call { grid-column: auto; padding: 10px; justify-content: center; gap: 7px; }
    .cd-contact-compact a { font-size: 13px; padding: 10px 6px; gap: 6px; min-height: 44px; }
    .cd-contact-compact a > i { font-size: 16px; }
    .cd-contact-compact .cd-contact-call > span { width: auto; }
    .cd-contact-compact .cd-contact-number { display: none; }
    .listing-detail #imageModal .modal-body { padding: 64px 8px !important; }
    .listing-detail #modalCarousel .carousel-control-prev { left: 0; }
    .listing-detail #modalCarousel .carousel-control-next { right: 0; }
}
@media (prefers-reduced-motion: reduce) {
    .listing-detail .carousel-item, .cd-contact-actions a { transition: none; }
}
