:root {
    --brand: #0d6e45;
    --ink: #1e293b;
    --muted: #64748b;
    --line: #e2e8f0;
}
body {
    font-family: 'Be Vietnam Pro', system-ui, -apple-system, 'Segoe UI', sans-serif;
    background: #f4f7f5;
    color: var(--ink);
}
.detail-header {
    background: #fff;
    border-bottom: 1px solid var(--line);
    box-shadow: 0 1px 8px rgba(0,0,0,.05);
}
.brand-logo {
    width: 38px; height: 38px;
    border-radius: 12px;
    background: var(--brand);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}
.brand-name { font-size: 17px; color: var(--ink); }
.brand-sub { font-size: 11px; color: var(--muted); }
.detail-header .navbar-brand { min-width: 0; flex-shrink: 1; }
.detail-header .navbar-brand .brand-name {
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.detail-header .btn-success { flex-shrink: 0; }
.detail-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 22px;
    box-shadow: 0 2px 10px rgba(0,0,0,.04);
}
.detail-title { font-size: 22px; font-weight: 800; margin-bottom: 10px; line-height: 1.35; }
.detail-h2 {
    font-size: 16px; font-weight: 800; margin: 26px 0 12px;
    padding-bottom: 8px; border-bottom: 2px solid var(--brand); display: inline-block;
}
.detail-desc { color: #475569; line-height: 1.7; white-space: normal; }

/* ================= Gallery ================= */
.detail-gallery { user-select: none; -webkit-user-select: none; }
.dg-main {
    position: relative;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid var(--line);
    background: #0f172a;
    height: clamp(240px, 46vw, 460px);
    cursor: zoom-in;
}
.dg-img {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
    transition: opacity .28s ease, transform .5s ease;
}
.dg-img.dg-fading { opacity: 0; }
.dg-main:hover .dg-img { transform: scale(1.045); }
.dg-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 38px; height: 38px;
    border: none;
    border-radius: 50%;
    background: rgba(15, 23, 42, .45);
    color: #fff;
    font-size: 18px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: background .2s, opacity .25s;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 3;
}
.dg-main:hover .dg-nav { opacity: 1; }
.dg-nav:hover { background: rgba(15, 23, 42, .75); }
.dg-prev { left: 12px; }
.dg-next { right: 12px; }
.dg-counter {
    position: absolute;
    top: 12px; left: 12px;
    background: rgba(15, 23, 42, .55);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 999px;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 3;
}
.dg-zoom-btn {
    position: absolute;
    top: 12px; right: 12px;
    width: 34px; height: 34px;
    border: none;
    border-radius: 9px;
    background: rgba(15, 23, 42, .55);
    color: #fff;
    font-size: 15px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: background .2s;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 3;
}
.dg-zoom-btn:hover { background: rgba(15, 23, 42, .8); }
.dg-thumbs {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    overflow-x: auto;
    padding-bottom: 4px;
    scroll-snap-type: x proximity;
    scrollbar-width: thin;
}
.dg-thumbs::-webkit-scrollbar { height: 6px; }
.dg-thumbs::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 999px; }
.dg-thumb {
    flex: 1 0 auto;
    width: calc((100% - (var(--n, 2) - 1) * 8px) / var(--n, 2));
    min-width: 64px;
    aspect-ratio: 4 / 3;
    height: auto;
    padding: 0;
    border: 2px solid transparent;
    border-radius: 10px;
    overflow: hidden;
    background: none;
    cursor: pointer;
    scroll-snap-align: start;
    opacity: .7;
    transition: opacity .2s, border-color .2s, transform .15s;
}
.dg-thumb:hover { opacity: 1; transform: translateY(-1px); }
.dg-thumb.active { border-color: var(--brand); opacity: 1; }
.dg-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Lightbox */
.dg-lightbox {
    position: fixed;
    inset: 0;
    z-index: 1080;
    background: rgba(2, 6, 23, .93);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity .25s ease, visibility .25s ease;
}
.dg-lightbox.open { opacity: 1; visibility: visible; }
.dg-lightbox img {
    max-width: 94vw;
    max-height: 90vh;
    border-radius: 8px;
    box-shadow: 0 12px 48px rgba(0, 0, 0, .55);
}
.dg-lightbox .dg-nav { opacity: 1; width: 44px; height: 44px; font-size: 22px; }
.dg-lb-close {
    position: absolute;
    top: 16px; right: 16px;
    width: 42px; height: 42px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, .08);
    color: #fff;
    font-size: 19px;
    cursor: pointer;
    transition: background .2s;
}
.dg-lb-close:hover { background: rgba(255, 255, 255, .22); }
.dg-lb-counter {
    position: absolute;
    bottom: 20px; left: 50%;
    transform: translateX(-50%);
    color: #cbd5e1;
    font-size: 13px;
    letter-spacing: .5px;
}

/* ================= Related products slider ================= */
.related-section { padding: 30px 0 6px; }
.rp-heading {
    font-size: 19px;
    font-weight: 800;
    margin: 0;
    color: var(--ink);
}
.rp-arrow {
    width: 38px; height: 38px;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: #fff;
    color: var(--ink);
    font-size: 15px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 8px;
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .06);
    transition: background .2s, color .2s, border-color .2s, transform .15s;
}
.rp-arrow:hover {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
    transform: translateY(-1px);
}
.rp-track {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding: 6px 2px 16px;
    scrollbar-width: none;
}
.rp-track::-webkit-scrollbar { display: none; }
.rp-card {
    flex: 0 0 clamp(240px, 28vw, 300px);
    scroll-snap-align: start;
    display: block;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 16px;
    overflow: hidden;
    text-decoration: none;
    color: var(--ink);
    transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}
.rp-card:hover {
    transform: translateY(-5px);
    border-color: transparent;
    box-shadow: 0 16px 36px rgba(13, 110, 69, .16);
    color: inherit;
}
.rp-media {
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: #eef2f7;
}
.rp-media img {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .45s ease;
}
.rp-card:hover .rp-media img { transform: scale(1.07); }
.rp-ph {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #b6c2d0;
    font-size: 30px;
    background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
}
.rp-badge {
    position: absolute;
    top: 10px; left: 10px;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 999px;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
.rp-chip {
    position: absolute;
    bottom: 10px; left: 10px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .3px;
    color: #fff;
    background: rgba(15, 23, 42, .55);
    padding: 4px 10px;
    border-radius: 999px;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}
.rp-body { padding: 13px 14px 15px; }
.rp-price {
    font-size: 17px;
    font-weight: 800;
    color: #dc2626;
    line-height: 1.25;
}
.rp-name {
    font-size: 13.5px;
    font-weight: 600;
    line-height: 1.45;
    margin: 5px 0 7px;
    min-height: 39px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.rp-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 5px 12px;
    align-items: center;
    font-size: 12px;
    color: var(--muted);
}

.detail-map-wrap { border-radius: 12px; overflow: hidden; border: 1px solid var(--line); }
.detail-map { width: 100%; height: 320px; border: 0; display: block; }
.detail-price-card { position: sticky; top: 16px; }
.detail-price { font-size: 26px; font-weight: 800; color: #dc2626; }
.detail-facts li {
    display: flex; justify-content: space-between; align-items: center;
    padding: 9px 0; border-bottom: 1px dashed var(--line);
    font-size: 14px;
}
.detail-facts li span { color: var(--muted); }
.detail-footer { border-top: 1px solid var(--line); background: #fff; margin-top: 30px; }
.footer-keywords { border-bottom: 1px solid var(--line); padding-bottom: 20px; }
a.footer-kw {
    font-size: 12px;
    color: #64748b;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    padding: 3px 9px;
    white-space: nowrap;
    text-decoration: none !important;
    transition: color .15s, border-color .15s, background .15s;
}
a.footer-kw:hover {
    color: var(--brand);
    border-color: var(--brand);
    background: #f0fdf4;
}
@media (max-width: 991.98px) {
    .detail-price-card { position: static; }
}
@media (max-width: 767.98px) {
    .detail-card { padding: 16px; }
    .detail-title { font-size: 18px; }
    .detail-map { height: 240px; }
    .detail-price { font-size: 22px; }
    .detail-header .brand-logo { width: 32px; height: 32px; font-size: 16px; }
    .detail-header .brand-name { font-size: 14px; }
    .detail-header .brand-sub { display: none; }
    .detail-header .btn-success { padding: .35rem .6rem; font-size: 13px; }
}
.detail-callbar {
    display: none;
    position: fixed;
    left: 0; right: 0; bottom: 0;
    background: #fff;
    border-top: 1px solid var(--line);
    box-shadow: 0 -4px 16px rgba(15,23,42,.08);
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
    z-index: 1040;
}
.detail-callbar .btn { width: 100%; border-radius: 10px; padding: .65rem; font-weight: 700; }
@media (max-width: 575.98px) {
    body { padding-bottom: 66px; }
    .detail-callbar { display: block; }
}