.detail-container { max-width: 1240px; }
.detail-section { padding: 3rem 0 0; }

/* Top: gallery + info */
.detail-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: clamp(2rem, 5vw, 4.5rem); align-items: start; }
.gallery { display: grid; grid-template-columns: minmax(0, 1fr); gap: .8rem; align-content: start; }
.gallery-thumbs { order: 2; display: grid; grid-template-columns: repeat(auto-fill, minmax(58px, 66px)); gap: .5rem; }
.gallery-thumbs button { padding: 0; aspect-ratio: 1; overflow: hidden; background: #f2f4f5; border: 2px solid transparent; transition: border-color .2s ease, opacity .2s ease; opacity: .65; }
.gallery-thumbs button:hover { opacity: 1; }
.gallery-thumbs button.active { border-color: var(--brand-red); opacity: 1; }
.gallery-thumbs img { width: 100%; height: 100%; object-fit: cover; }
.gallery-main { position: relative; aspect-ratio: 1; overflow: hidden; background: #f2f4f5; }
.gallery-main img { width: 100%; height: 100%; object-fit: cover; transition: transform .25s ease; will-change: transform; }
@media (hover: hover) {
  .gallery-main { cursor: zoom-in; }
  .gallery-main.is-zoomed img { transform: scale(2.2); transition: transform .15s ease-out; }
  .gallery-main.is-zoomed .gallery-count { opacity: 0; pointer-events: none; }
}
.gallery-count { transition: opacity .2s ease; }
.gallery-count { position: absolute; right: .85rem; bottom: .85rem; padding: .2rem .6rem; color: #fff; background: rgba(16,37,54,.8); font-size: .75rem; font-weight: 600; }

.detail-info { padding-top: .25rem; }
.detail-brand { display: inline-block; color: var(--brand-red); font-size: .78rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.detail-name { margin: .5rem 0 .75rem; font-size: clamp(1.8rem, 3vw, 2.5rem); font-weight: 600; letter-spacing: -.03em; line-height: 1.1; color: var(--ink); }
.detail-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; margin-bottom: 1.25rem; color: #8a949a; font-size: .88rem; }
.detail-stock { display: inline-flex; align-items: center; gap: .4rem; padding: .2rem .65rem; color: #1b6e4b; background: #e8f5ee; font-size: .78rem; font-weight: 700; }
.detail-stock::before { content: ""; width: 6px; height: 6px; background: #22a06b; border-radius: 50%; }
.detail-stock.request { color: #8a5a0b; background: #fbf1de; }
.detail-stock.request::before { background: #e6a23c; }
.detail-desc { margin-bottom: 1.25rem; color: #4a5358; font-size: 1.05rem; line-height: 1.7; }
.detail-points { margin: 0 0 1.75rem; padding: 1.25rem 0; list-style: none; border-top: 1px solid #e6eaed; border-bottom: 1px solid #e6eaed; }
.detail-points li { position: relative; padding-left: 1.6rem; color: var(--ink); font-size: .95rem; line-height: 2; }
.detail-points li::before { content: "\F26E"; position: absolute; left: 0; color: var(--brand-red); font-family: "bootstrap-icons"; }
.detail-colors { margin: -.25rem 0 1.75rem; }
.detail-colors-label { margin-bottom: .65rem; color: #6b757b; font-size: .78rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.detail-colors-label strong { color: var(--ink); }
.color-swatches { display: flex; flex-wrap: wrap; gap: .6rem; }
.color-swatch { position: relative; width: 22px; height: 22px; padding: 0; background: var(--swatch); border: 1px solid rgba(23,32,32,.18); border-radius: 50%; transition: transform .2s ease; }
.color-swatch::after { content: ""; position: absolute; inset: -4px; border: 1.5px solid transparent; border-radius: 50%; transition: border-color .2s ease; }
.color-swatch:hover { transform: scale(1.12); }
.color-swatch.active::after { border-color: var(--ink); }
.color-swatch:focus-visible { outline: 2px solid var(--petrol); outline-offset: 5px; }
.detail-actions { display: flex; flex-wrap: wrap; gap: .75rem; }
.btn-outline-dark-sq { display: inline-flex; align-items: center; gap: .5rem; padding: .85rem 1.5rem; color: var(--ink); font-weight: 700; text-decoration: none; background: #fff; border: 1.5px solid var(--ink); transition: background .2s ease, color .2s ease; }
.btn-outline-dark-sq:hover { color: #fff; background: var(--ink); }
.btn-datasheet { display: flex; align-items: center; gap: .9rem; max-width: 420px; margin-top: .85rem; padding: .85rem 1.1rem; color: var(--ink); text-decoration: none; background: #f6f7f8; border: 1px solid #e1e5e8; border-left: 3px solid var(--brand-red); transition: background .2s ease, border-color .2s ease; }
.btn-datasheet > i:first-child { color: var(--brand-red); font-size: 1.6rem; }
.btn-datasheet span { display: flex; flex: 1; flex-direction: column; font-size: .95rem; font-weight: 700; line-height: 1.25; }
.btn-datasheet small { margin-top: .15rem; color: #7b858b; font-size: .75rem; font-weight: 500; }
.btn-datasheet > i:last-child { color: #8a949a; font-size: .9rem; transition: transform .2s ease, color .2s ease; }
.btn-datasheet:hover { color: var(--ink); background: #fff; border-color: #cfd6db; border-left-color: var(--brand-red); }
.btn-datasheet:hover > i:last-child { color: var(--brand-red); transform: translate(2px, -2px); }
.detail-note { display: flex; gap: .5rem; margin: 1.25rem 0 0; color: #7b858b; font-size: .85rem; line-height: 1.5; }
.detail-note i { color: var(--brand-red); }
.detail-notfound { padding: 4rem 0; text-align: center; }
.detail-notfound i { color: var(--brand-red); font-size: 3rem; }
.detail-notfound h2 { margin: 1rem 0 .4rem; font-size: 1.8rem; }
.detail-notfound p { margin-bottom: 1.5rem; color: #6b757b; }

/* Tabs */
.detail-tabs-wrap { margin-top: 4rem; padding: 3rem 0 4rem; background: #f6f7f8; }
.detail-tabs { display: flex; gap: 2rem; margin: 0 0 1.75rem; padding: 0; list-style: none; border-bottom: 1px solid #dfe4e7; overflow-x: auto; }
.detail-tabs button { position: relative; padding: .9rem 0; color: #7b858b; white-space: nowrap; background: none; border: 0; font-size: .98rem; font-weight: 600; transition: color .2s ease; }
.detail-tabs button:hover { color: var(--ink); }
.detail-tabs button.active { color: var(--ink); }
.detail-tabs button.active::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 3px; background: var(--brand-red); }
.detail-panel { max-width: 860px; }
.desc-body { padding: 1.75rem 2rem; background: #fff; }
.desc-body p { margin: 0 0 1.5rem; color: #4a5358; font-size: 1rem; line-height: 1.75; }
.desc-body h3 { margin: 0 0 .5rem; color: var(--ink); font-size: 1.05rem; font-weight: 700; }
.desc-body .feature-list { padding: 0; }
.spec-table { width: 100%; border-collapse: collapse; background: #fff; }
.spec-table th, .spec-table td { padding: 1rem 1.25rem; border-bottom: 1px solid #edf0f2; font-size: .95rem; text-align: left; }
.spec-table th { width: 38%; color: var(--ink); font-weight: 600; }
.spec-table td { color: #4a5358; }
.spec-table tr:last-child th, .spec-table tr:last-child td { border-bottom: 0; }
.feature-list { margin: 0; padding: 1.5rem 1.75rem; list-style: none; background: #fff; }
.feature-list li { position: relative; padding: .55rem 0 .55rem 1.75rem; color: var(--ink); font-size: .98rem; border-bottom: 1px solid #edf0f2; }
.feature-list li:last-child { border-bottom: 0; }
.feature-list li::before { content: "\F26E"; position: absolute; left: 0; color: var(--brand-red); font-family: "bootstrap-icons"; }
.order-steps { margin: 0; padding: 0; list-style: none; counter-reset: step; background: #fff; }
.order-steps li { position: relative; display: flex; flex-direction: column; gap: .2rem; padding: 1.25rem 1.5rem 1.25rem 4.25rem; border-bottom: 1px solid #edf0f2; counter-increment: step; }
.order-steps li:last-child { border-bottom: 0; }
.order-steps li::before { content: counter(step); position: absolute; left: 1.25rem; top: 1.2rem; display: grid; place-items: center; width: 34px; height: 34px; color: #fff; background: var(--brand-red); border-radius: 50%; font-weight: 700; }
.order-steps strong { color: var(--ink); }
.order-steps span { color: #5b656b; font-size: .92rem; }

/* Related */
.related { padding-top: 4rem; padding-bottom: 5rem; }
.related-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 1.75rem; }
.related-head h2 { margin: 0; font-size: clamp(1.5rem, 2.5vw, 2rem); font-weight: 600; letter-spacing: -.02em; color: var(--ink); }
.related-all { color: var(--brand-red); font-size: .9rem; font-weight: 600; text-decoration: none; }
.related-all:hover { color: var(--ink); }

@media (max-width: 991.98px) {
  .detail-grid { grid-template-columns: 1fr; }
  .detail-section { padding-top: 2rem; }
}
@media (max-width: 575.98px) {
  .gallery-thumbs { grid-template-columns: repeat(auto-fill, minmax(46px, 54px)); gap: .4rem; }
  .detail-tabs { gap: 1.25rem; }
  .spec-table th, .spec-table td { padding: .85rem .9rem; font-size: .88rem; }
  .detail-actions .btn, .btn-outline-dark-sq { flex: 1 1 100%; justify-content: center; }
}
