/* ============================================================
   product-detail.css — Trang chi tiết sản phẩm
   ============================================================ */

.dashcam-product-detail-page {
    --pd-accent: #d62828;
    --pd-accent-dark: #9f1f1f;
    --pd-ink: #0f172a;
    --pd-soft-ink: #475569;
    --pd-border: #e2e8f0;
    --pd-surface: #ffffff;
    --pd-surface-2: #f8fafc;
    background:
        radial-gradient(1100px 440px at 100% 0%, rgba(214, 40, 40, .08), transparent 58%),
        linear-gradient(180deg, #f8fafc 0%, #ffffff 42%);
    padding: 16px;
    border-radius: 16px;
}

/* ── Breadcrumb ─────────────────────────────────────────────── */
.pd-breadcrumb {
    margin-bottom: 20px;
}

.pd-breadcrumb__list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 6px;
    font-size: 13px;
    color: #64748b;
}

.pd-breadcrumb__link {
    color: #334155;
    text-decoration: none;
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .78);
    border: 1px solid #e2e8f0;
}

.pd-breadcrumb__link:hover {
    color: var(--pd-accent);
    border-color: #fecaca;
}

.pd-breadcrumb__sep {
    color: #d1d5db;
    font-size: 14px;
}

.pd-breadcrumb__item--active {
    color: #1e293b;
    font-weight: 500;
}

/* ── Sidebar (reuse listing styles) ─────────────────────────── */
.dashcam-product-detail-page .taxonomy-sidebar {
    position: sticky;
    top: 16px;
}

.dashcam-product-detail-page .sidebar-box {
    border: 1px solid var(--pd-border);
    border-radius: 14px;
    margin-bottom: 16px;
    background: rgba(255, 255, 255, .95);
    box-shadow: 0 10px 28px rgba(15, 23, 42, .06);
    backdrop-filter: blur(3px);
}

.dashcam-product-detail-page .sidebar-title {
    margin: 0;
    padding: 12px 14px;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    border-bottom: 1px solid #f1f5f9;
}

.dashcam-product-detail-page .sidebar-menu {
    list-style: none;
    margin: 0;
    padding: 8px 0;
}

.dashcam-product-detail-page .sidebar-menu li a {
    display: block;
    padding: 7px 14px;
    color: #111827;
    text-decoration: none;
    font-size: 14px;
    transition: background .15s, color .15s;
}

.dashcam-product-detail-page .sidebar-menu li a:hover {
    background: #f9fafb;
    color: #b91c1c;
}

.dashcam-product-detail-page .sidebar-menu li.is-active a {
    color: var(--pd-accent);
    font-weight: 700;
    background: linear-gradient(90deg, #fff1f1 0%, #fff 100%);
}

.dashcam-product-detail-page .sidebar-menu li.is-empty {
    padding: 8px 14px;
    color: #6b7280;
    font-size: 13px;
}

/* ── Product card ──────────────────────────────────────────── */
.pd-card {
    background: var(--pd-surface);
    border: 1px solid var(--pd-border);
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 24px;
    box-shadow: 0 20px 44px rgba(15, 23, 42, .10);
}

/* ── Gallery ───────────────────────────────────────────────── */
.pd-gallery {
    padding: 18px;
    background: linear-gradient(180deg, #fff 0%, #f8fafc 100%);
    height: 100%;
}

.pd-gallery__main {
    position: relative;
    background: #f9fafb;
    border-radius: 12px;
    overflow: hidden;
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pd-gallery__main img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    transition: opacity .25s ease;
}

.pd-discount-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: linear-gradient(135deg, #ef4444, #c81e1e);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 999px;
    z-index: 2;
}

.pd-gallery__no-image {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: #9ca3af;
    font-size: 13px;
}

.pd-gallery__thumbs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.pd-gallery__thumb-btn {
    width: 60px;
    height: 60px;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    overflow: hidden;
    padding: 0;
    background: #f9fafb;
    cursor: pointer;
    transition: border-color .15s, transform .15s;
}

.pd-gallery__thumb-btn img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.pd-gallery__thumb-btn.is-active,
.pd-gallery__thumb-btn:hover {
    border-color: var(--pd-accent);
    transform: translateY(-1px);
}

/* ── Details panel ─────────────────────────────────────────── */
.pd-details {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.pd-details__title {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    line-height: 1.35;
    color: var(--pd-ink);
}

.pd-details__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 20px;
    font-size: 13px;
    color: #6b7280;
}

.pd-details__meta a {
    color: #2563eb;
    text-decoration: none;
}

.pd-details__meta a:hover {
    text-decoration: underline;
}

.pd-meta-item--stock {
    padding: 4px 10px;
    border-radius: 999px;
    font-weight: 700;
}

.pd-meta-item--stock.is-instock {
    background: #ecfdf5;
    color: #047857;
}

.pd-meta-item--stock.is-outstock {
    background: #fef2f2;
    color: #b91c1c;
}

/* ── Price block ───────────────────────────────────────────── */
.pd-price-block {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 8px;
    padding: 14px 18px;
    background: linear-gradient(90deg, #fff2f2 0%, #fff8ef 100%);
    border: 1px solid #ffd6d6;
    border-radius: 12px;
}

.pd-price-original {
    text-decoration: line-through;
    color: #9ca3af;
    font-size: 15px;
}

.pd-price-sale {
    font-size: 28px;
    font-weight: 800;
    color: var(--pd-accent);
}

.pd-price-badge {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
    font-size: 12px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 20px;
}

/* ── Coupon discount feedback line ─────────────────────────── */
.pd-coupon-discount-line {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #065f46;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    border-radius: 6px;
    padding: 6px 12px;
}

.pd-coupon-discount-amount {
    color: #065f46;
    font-weight: 700;
}

/* ── Short description ─────────────────────────────────────── */
.pd-details__short-desc {
    margin: 0;
    font-size: 14px;
    color: #374151;
    line-height: 1.6;
}

.pd-specs-card {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 14px 16px;
    background: #fcfcfd;
}

.pd-section-title {
    margin: 0 0 12px;
    font-size: 15px;
    font-weight: 700;
    color: #111827;
}

.pd-specs-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 18px;
    margin: 0;
}

.pd-spec-item {
    display: grid;
    gap: 2px;
}

.pd-spec-item dt {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #6b7280;
}

.pd-spec-item dd {
    margin: 0;
    font-size: 14px;
    color: #111827;
}

.pd-spec-item dd a {
    color: #2563eb;
    text-decoration: none;
}

.pd-spec-item dd a:hover {
    text-decoration: underline;
}

/* ── Quantity row ──────────────────────────────────────────── */
.pd-qty-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.pd-qty-label {
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    white-space: nowrap;
}

.pd-qty-ctrl {
    display: flex;
    align-items: center;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    overflow: hidden;
}

.pd-qty-btn {
    width: 38px;
    height: 38px;
    border: none;
    background: #f3f4f6;
    font-size: 18px;
    cursor: pointer;
    color: #374151;
    transition: background .15s;
}

.pd-qty-btn:hover {
    background: #e5e7eb;
}

.pd-qty-input {
    width: 54px;
    height: 38px;
    border: none;
    border-left: 1px solid #d1d5db;
    border-right: 1px solid #d1d5db;
    text-align: center;
    font-size: 15px;
    font-weight: 600;
    color: #111827;
    appearance: textfield;
    -moz-appearance: textfield;
    outline: none;
}

.pd-qty-input::-webkit-inner-spin-button,
.pd-qty-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
}

/* ── Coupon row ────────────────────────────────────────────── */
.pd-coupon-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.pd-coupon-label {
    font-size: 14px;
    font-weight: 500;
    color: #374151;
}

.pd-coupon-ctrl {
    display: flex;
    gap: 8px;
}

.pd-coupon-input {
    flex: 1;
    height: 40px;
    padding: 0 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    color: #111827;
    outline: none;
    transition: border-color .15s;
}

.pd-coupon-input:focus {
    border-color: var(--pd-accent);
    box-shadow: 0 0 0 3px rgba(214, 40, 40, .12);
}

.pd-coupon-btn {
    height: 40px;
    padding: 0 18px;
    background: linear-gradient(135deg, #1f2937, #111827);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background .15s;
}

.pd-coupon-btn:hover {
    background: #1f2937;
}

.pd-coupon-message {
    margin: 0;
    font-size: 13px;
    min-height: 18px;
}

.pd-coupon-message.success {
    color: #065f46;
    font-weight: 500;
}

.pd-coupon-message.error {
    color: #b91c1c;
}

/* ── Action buttons ────────────────────────────────────────── */
.pd-action-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 4px;
}

.pd-btn {
    flex: 1;
    min-width: 140px;
    height: 46px;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background .15s, transform .1s, box-shadow .15s;
}

.pd-btn:active {
    transform: scale(.98);
}

.pd-btn:disabled {
    opacity: .6;
    cursor: not-allowed;
}

.pd-btn--cart {
    background: #fff;
    color: var(--pd-accent);
    border: 2px solid #ef9a9a;
}

.pd-btn--cart:hover {
    background: #fff1f1;
    box-shadow: 0 6px 16px rgba(214, 40, 40, .15);
}

.pd-btn--buy {
    background: linear-gradient(135deg, #ef4444, #c81e1e);
    color: #fff;
}

.pd-btn--buy:hover {
    box-shadow: 0 8px 18px rgba(214, 40, 40, .25);
}

/* ── Trust list ────────────────────────────────────────────── */
.pd-trust-list {
    list-style: none;
    margin: 0;
    padding: 12px 16px;
    background: #f9fafb;
    border-radius: 8px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5px 12px;
    font-size: 13px;
    color: #374151;
}

.pd-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.pd-tag {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    background: #f3f4f6;
    color: #374151;
    font-size: 12px;
    font-weight: 600;
}

/* ── Description tabs ──────────────────────────────────────── */
.pd-tabs {
    background: #fff;
    border: 1px solid var(--pd-border);
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 24px;
    box-shadow: 0 10px 28px rgba(15, 23, 42, .06);
}

.pd-tabs__header {
    border-bottom: 1px solid #e5e7eb;
    display: flex;
}

.pd-tabs__tab {
    padding: 12px 24px;
    border: none;
    background: none;
    font-size: 14px;
    font-weight: 600;
    color: #6b7280;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: color .15s;
}

.pd-tabs__tab.is-active {
    color: var(--pd-accent);
    border-bottom-color: var(--pd-accent);
}

.pd-tabs__body {
    padding: 20px 24px;
}

.pd-tab-pane {
    display: none;
}

.pd-tab-pane.is-active {
    display: block;
}

.pd-description {
    font-size: 14px;
    line-height: 1.8;
    color: #374151;
}

.pd-description img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
}

.pd-video-wrap {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
    overflow: hidden;
    border-radius: 12px;
    background: #000;
}

.pd-video-wrap iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* ── Related products ──────────────────────────────────────── */
.pd-related {
    margin-bottom: 24px;
}

.pd-related__title {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 14px;
    color: #111827;
}

.pd-related__grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.pd-related__card {
    border: 1px solid var(--pd-border);
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    transition: box-shadow .2s, transform .2s;
}

.pd-related__card:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 28px rgba(15, 23, 42, .14);
}

.pd-related__img-wrap {
    display: block;
    aspect-ratio: 4 / 3;
    background: #f9fafb;
    overflow: hidden;
}

.pd-related__img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .2s;
}

.pd-related__card:hover .pd-related__img-wrap img {
    transform: scale(1.03);
}

.pd-related__no-img {
    display: grid;
    place-items: center;
    height: 100%;
    color: #9ca3af;
    font-size: 12px;
}

.pd-related__body {
    padding: 10px;
}

.pd-related__body h3 {
    margin: 0 0 6px;
    font-size: 14px;
    line-height: 1.4;
}

.pd-related__body h3 a {
    color: #111827;
    text-decoration: none;
}

.pd-related__body h3 a:hover {
    color: var(--pd-accent);
}

.pd-related__price {
    display: flex;
    align-items: baseline;
    gap: 6px;
    font-size: 13px;
}

.pd-related__price s {
    color: #9ca3af;
}

.pd-related__price strong {
    color: #dc2626;
    font-size: 15px;
}

/* ── Cart toast ────────────────────────────────────────────── */
.cart-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.cart-toast__item {
    padding: 12px 18px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 4px 20px rgba(0, 0, 0, .15);
    opacity: 0;
    transform: translateY(12px);
    transition: opacity .25s, transform .25s;
    pointer-events: auto;
}

.cart-toast__item.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.cart-toast__item--success {
    background: #065f46;
    color: #fff;
}

.cart-toast__item--error {
    background: #b91c1c;
    color: #fff;
}

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 767px) {
    .dashcam-product-detail-page {
        padding: 10px;
        border-radius: 12px;
    }

    .pd-details {
        padding: 16px;
    }

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

    .pd-details__title {
        font-size: 18px;
    }

    .pd-price-sale {
        font-size: 22px;
    }

    .pd-related__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .pd-trust-list {
        grid-template-columns: 1fr;
    }

    .pd-action-row {
        flex-direction: column;
    }

    .pd-coupon-ctrl {
        flex-direction: column;
    }
}

/* ── Focus/hover interaction effects ──────────────────────── */

/* Action buttons focus-visible */
.pd-btn:focus-visible {
    outline: 3px solid var(--pd-accent);
    outline-offset: 2px;
}

.pd-btn--cart:focus-visible {
    outline-color: var(--pd-accent);
    box-shadow: 0 0 0 4px rgba(214, 40, 40, .15);
}

.pd-btn--buy:focus-visible {
    outline-color: #fff;
    box-shadow: 0 0 0 4px rgba(214, 40, 40, .3);
}

/* Coupon button focus */
.pd-coupon-btn:focus-visible {
    outline: 2px solid #374151;
    outline-offset: 2px;
}

/* Quantity button focus/hover */
.pd-qty-btn:focus-visible {
    outline: 2px solid var(--pd-accent);
    outline-offset: -2px;
    background: #d1d5db;
}

/* Tabs focus */
.pd-tabs__tab:hover {
    color: var(--pd-accent);
    background: #fef2f2;
}

.pd-tabs__tab:focus-visible {
    outline: 2px solid var(--pd-accent);
    outline-offset: -2px;
}

/* Sidebar links focus/hover */
.dashcam-product-detail-page .sidebar-menu li a {
    transition: background 150ms ease, color 150ms ease, padding-left 150ms ease;
}

.dashcam-product-detail-page .sidebar-menu li a:hover {
    padding-left: 18px;
}

.dashcam-product-detail-page .sidebar-menu li a:focus-visible {
    outline: 2px solid var(--pd-accent);
    outline-offset: -2px;
    border-radius: 4px;
}

/* Breadcrumb focus */
.pd-breadcrumb__link:focus-visible {
    outline: 2px solid var(--pd-accent);
    outline-offset: 2px;
}

/* Related product cards */
.pd-related__card:focus-within {
    border-color: var(--pd-accent);
    box-shadow: 0 0 0 3px rgba(214, 40, 40, .1);
}

.pd-related__body h3 a:focus-visible {
    outline: 2px solid var(--pd-accent);
    outline-offset: 2px;
    border-radius: 3px;
}

/* Gallery thumb focus */
.pd-gallery__thumb-btn:focus-visible {
    outline: 2px solid var(--pd-accent);
    outline-offset: 2px;
}

/* Tag hover */
.pd-tag {
    transition: background 150ms ease, color 150ms ease;
}

.pd-tag:hover {
    background: #e5e7eb;
    color: #111827;
}

/* Spec links */
.pd-spec-item dd a:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
    border-radius: 3px;
}