/* ===== Shared Detail Page Styles ===== */
/* Used by both product.html and apps.html */

/* ===== Skeleton System ===== */
.sk {
    background: linear-gradient(110deg,
            rgba(255, 255, 255, 0.03) 8%,
            rgba(255, 255, 255, 0.08) 38%,
            rgba(255, 255, 255, 0.03) 54%);
    background-size: 200% 100%;
    animation: sk-pulse 1.5s cubic-bezier(0.4, 0.0, 0.2, 1) infinite;
    border-radius: 8px;
    color: transparent !important;
    overflow: hidden;
}

@keyframes sk-pulse {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* ===== Main Container ===== */
.product-detail {
    position: relative;
    padding-top: calc(var(--navbar-h) + 40px);
    padding-bottom: 60px;
    max-width: 900px;
    margin: 0 auto;
}

/* ===== Skeleton Fade-Out ===== */
.pd-skeleton-fade-out {
    animation: pdSkeletonFadeOut 0.55s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    position: absolute !important;
    width: calc(100% - 32px);
    z-index: 2;
    pointer-events: none;
}

@keyframes pdSkeletonFadeOut {
    0% {
        opacity: 1;
    }
    100% {
        opacity: 0;
    }
}

/* ===== Staggered Reveal ===== */
.pd-revealing {
    opacity: 1 !important;
}

.pd-revealing > * {
    opacity: 0;
    transform: translateY(20px);
    animation: pdRevealIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.pd-revealing > *:nth-child(1) {
    animation-delay: 0.05s;
}

.pd-revealing > *:nth-child(2) {
    animation-delay: 0.12s;
}

.pd-revealing > *:nth-child(3) {
    animation-delay: 0.19s;
}

.pd-revealing > *:nth-child(4) {
    animation-delay: 0.26s;
}

.pd-revealing > *:nth-child(5) {
    animation-delay: 0.33s;
}

.pd-revealing > *:nth-child(6) {
    animation-delay: 0.40s;
}

.pd-revealing > *:nth-child(7) {
    animation-delay: 0.47s;
}

.pd-revealing > *:nth-child(8) {
    animation-delay: 0.54s;
}

@keyframes pdRevealIn {
    0% {
        opacity: 0;
        transform: translateY(20px) scale(0.98);
    }

    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ===== Hero Section ===== */
.pd-hero {
    display: flex;
    gap: 16px;
    align-items: stretch;
    flex-direction: column;
    width: 100%;
    max-width: 100%;
    padding: 32px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 24px;
    margin-bottom: 32px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 12px 32px -12px rgba(0, 0, 0, 0.45);
}

/* Wide hero layout */
.pd-hero-wide {
    flex-direction: row;
    align-items: center;
    gap: 28px;
}

.pd-hero-left {
    position: relative;
    flex-shrink: 0;
}

.pd-hero-icon-card {
    width: 220px;
    height: 220px;
    border-radius: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 24px -6px rgba(0, 0, 0, 0.4);
    cursor: zoom-in;
}

.pd-title-stack {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 16px;
}

.pd-title-stack .pd-title {
    margin-bottom: 0;
    line-height: 1.2;
}

.pd-status-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.pd-hero-icon-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}



.pd-hero-right {
    flex: 1;
    min-width: 0;
    min-height: 220px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.pd-hero-icon {
    width: 100px;
    height: 100px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    flex-shrink: 0;
}

.pd-hero-info {
    flex: 1;
    min-width: 0;
}

.pd-title {
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -0.025em;
    margin-bottom: 8px;
    line-height: 1.15;
}

.pd-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 14px;
    line-height: 1.65;
}

.pd-meta {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 8px;
}

.pd-category {
    display: inline-flex;
    padding: 5px 14px;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 600;
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.25);
    color: var(--accent-primary);
    text-transform: capitalize;
}

/* Duration section */
.pd-duration-section {
    margin-top: 12px;
}

.pd-duration-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

/* Radio-style duration selector */
.duration-radio {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: max-content;
    min-width: 240px;
    max-width: 100% !important;
}

.duration-radio .duration-btn {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    width: 100%;
    padding: 10px 16px 10px 12px;
    border-radius: 10px !important;
    border: 1px solid transparent !important;
    background: transparent;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, opacity 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
    text-align: left;
    position: relative;
    box-shadow: none;
}

.duration-radio .duration-btn::before {
    content: '';
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.22);
    margin-right: 12px;
    flex-shrink: 0;
    transition: transform 0.2s ease, opacity 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
    box-shadow: inset 0 0 0 3px transparent;
}

.duration-radio .duration-label {
    text-align: left;
    margin-right: 8px;
    flex-shrink: 0;
    min-width: 80px;
}

.duration-note {
    margin-left: 6px;
    margin-right: auto;
    padding: 2px 7px;
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    white-space: nowrap;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
}

body.light-theme .duration-note {
    color: #52525b;
    background: rgba(24, 24, 27, 0.04);
    border-color: rgba(24, 24, 27, 0.08);
}

.duration-price {
    margin-left: auto;
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
}

.duration-radio .duration-btn.active {
    background: rgba(16, 185, 129, 0.08);
    border-color: rgba(16, 185, 129, 0.22) !important;
    transform: none;
    box-shadow: none;
}

.duration-radio .duration-btn.active::before {
    border-color: var(--accent-primary);
    background: var(--accent-primary);
    box-shadow: inset 0 0 0 3px var(--bg-secondary);
}

.duration-radio .duration-btn:hover:not(.active) {
    background: rgba(255, 255, 255, 0.03);
    transform: none;
}

/* Add support for light theme inside duration-btn */
body.light-theme .duration-radio .duration-btn {
    background: transparent;
}
body.light-theme .duration-radio .duration-btn:hover:not(.active) {
    background: rgba(24, 24, 27, 0.03);
}
body.light-theme .duration-radio .duration-btn.active {
    background: rgba(5, 150, 105, 0.08);
    border-color: rgba(5, 150, 105, 0.22) !important;
}
body.light-theme .duration-radio .duration-btn::before {
    border-color: rgba(24, 24, 27, 0.22);
}
body.light-theme .duration-radio .duration-btn.active::before {
    box-shadow: inset 0 0 0 3px #fff;
}

/* Price row inline */
.pd-price-row {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 8px;
}

/* ===== Back Button ===== */
.pd-back-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 11px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-subtle);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
    color: var(--text-secondary);
    text-decoration: none;
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.2s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.2s cubic-bezier(0.16, 1, 0.3, 1), color 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    flex-shrink: 0;
}

.pd-back-btn:hover {
    background: rgba(var(--accent-primary-rgb), 0.12);
    border-color: rgba(var(--accent-primary-rgb), 0.3);
    color: var(--accent-primary);
    transform: translateY(-1px);
}

.pd-back-btn i,
.pd-back-btn svg {
    width: 18px;
    height: 18px;
}

/* ===== Buy/Download Button ===== */
.pd-buy-btn {
    width: 100%;
    min-height: 48px;
    padding: 14px 24px;
    font-size: 0.92rem;
    font-weight: 700;
    border-radius: 9999px;
    background: #fafafa !important;
    border: 1px solid #ffffff;
    color: #09090b !important;
    box-shadow: 0 8px 24px -6px rgba(255, 255, 255, 0.16);
}

body.light-theme .pd-buy-btn {
    background: #18181b !important;
    border-color: #18181b;
    color: #fafafa !important;
    box-shadow: 0 8px 24px -6px rgba(24, 24, 27, 0.25);
}

.pd-buy-btn.out-of-stock,
.pd-buy-btn:disabled {
    background: rgba(239, 68, 68, 0.14) !important;
    border: 1px solid rgba(239, 68, 68, 0.35) !important;
    color: #f87171 !important;
    box-shadow: none !important;
    cursor: not-allowed !important;
    transform: none !important;
}

body.light-theme .pd-buy-btn.out-of-stock,
body.light-theme .pd-buy-btn:disabled {
    background: rgba(220, 38, 38, 0.09) !important;
    border: 1px solid rgba(220, 38, 38, 0.28) !important;
    color: #dc2626 !important;
    box-shadow: none !important;
}

/* ===== Info Grid ===== */
.pd-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
    margin-bottom: 36px;
}

.pd-info-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 18px;
    padding: 24px;
    text-align: center;
    transition: transform 0.3s ease, opacity 0.3s ease, background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
}

.pd-info-card:hover {
    border-color: var(--border-light);
    transform: translateY(-2px);
}

.pd-info-icon {
    font-size: 1.8rem;
    margin-bottom: 10px;
    color: var(--accent-primary);
}

.pd-info-title {
    font-family: var(--font-display);
    font-size: 0.92rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.pd-info-text {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

@media (max-width: 640px) {
    .pd-info-grid {
        grid-template-columns: 1fr;
        gap: 10px;
        margin-bottom: 24px;
    }

    .pd-info-card {
        padding: 12px 16px;
        border-radius: 14px;
        display: flex;
        flex-direction: row;
        align-items: center;
        text-align: left;
        gap: 12px;
    }

    .pd-info-icon {
        font-size: 1.3rem;
        margin-bottom: 0;
        flex-shrink: 0;
        width: 40px;
        height: 40px;
        border-radius: 10px;
        background: rgba(16, 185, 129, 0.1);
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .pd-info-icon svg,
    .pd-info-icon i {
        width: 20px;
        height: 20px;
    }

    .pd-info-title {
        font-size: 0.85rem;
        font-weight: 700;
        margin-bottom: 2px;
        line-height: 1.3;
    }

    .pd-info-text {
        font-size: 0.75rem;
        line-height: 1.35;
        opacity: 0.8;
    }
}

/* ===== Sections ===== */
/* ===== Description Smooth Expand/Collapse ===== */
.pd-desc-content {
    position: relative;
    overflow: hidden;
    max-height: none;
    transition: max-height 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.pd-desc-content.has-overflow {
    max-height: 100px;
}

.pd-read-more-btn {
    background: none;
    border: none;
    color: var(--accent-primary);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    margin-top: 16px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: opacity 0.2s ease;
}

.pd-read-more-btn:hover {
    opacity: 0.85;
}

.pd-read-more-btn i,
.pd-read-more-btn svg,
.pd-read-more-icon {
    width: 18px !important;
    height: 18px !important;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1) !important;
    display: inline-block !important;
    transform-origin: center center;
}

.pd-read-more-btn.is-expanded i,
.pd-read-more-btn.is-expanded svg,
.pd-read-more-btn.is-expanded .pd-read-more-icon {
    transform: rotate(180deg) !important;
}

.pd-section {
    margin-bottom: 36px;
}

.pd-section-title {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 18px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-subtle);
}

/* ===== Screenshots Gallery ===== */
.pd-screenshots-section {
    width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 22px;
    padding: 28px;
}

.pd-screenshots-scroll {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 10px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.pd-screenshots-scroll::-webkit-scrollbar {
    height: 6px;
}

.pd-screenshots-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.pd-screenshots-scroll::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 100px;
}

.pd-screenshot-item {
    flex-shrink: 0;
    height: 350px;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--border-light);
    background: transparent;
    scroll-snap-align: start;
    transition: border-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
    position: relative;
    cursor: zoom-in;
}

.pd-screenshot-item:first-child {
    margin-left: auto;
}

.pd-screenshot-item:last-child {
    margin-right: auto;
}

.pd-screenshot-item:hover {
    border-color: var(--accent-primary);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
}

.pd-screenshot-item img {
    height: 100%;
    width: auto;
    object-fit: contain;
    display: block;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.pd-screenshot-item:hover img {
    transform: scale(1.04);
}

/* ===== Image Lightbox ===== */
.lightbox-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1),
        visibility 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: zoom-out;
    padding: 40px;
}

.lightbox-overlay.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6),
        0 0 0 1px rgba(255, 255, 255, 0.08);
    transform: scale(0.9);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
        opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: default;
    user-select: none;
    -webkit-user-drag: none;
}

.lightbox-overlay.active .lightbox-img {
    transform: scale(1);
    opacity: 1;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 10;
    width: 48px;
    height: 48px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: #fff;
    font-size: 1.6rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.25s ease, opacity 0.25s ease, background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease, box-shadow 0.25s ease;
    line-height: 1;
}

.lightbox-close:hover {
    background: rgba(239, 68, 68, 0.25);
    border-color: rgba(239, 68, 68, 0.5);
    transform: scale(1.08);
}

/* ===== Similar Grid ===== */
.pd-similar-grid {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding-bottom: 16px;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
}

.pd-similar-grid::-webkit-scrollbar {
    height: 6px;
}

.pd-similar-grid::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.pd-similar-grid::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.pd-similar-grid > .product-card {
    scroll-snap-align: start;
    flex-shrink: 0;
}

.similar-nav-btn {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-primary);
    transition: background 0.2s ease, transform 0.2s ease;
}

.similar-nav-btn:hover {
    background: var(--bg-card-hover);
    transform: scale(1.05);
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .pd-hero {
        padding: 18px;
        gap: 16px;
        width: 100%;
        max-width: 100%;
        overflow: hidden;
    }

    .pd-hero-wide {
        display: grid;
        grid-template-columns: 88px minmax(0, 1fr);
        column-gap: 16px;
        row-gap: 16px;
        align-items: center;
    }

    .pd-hero-wide .pd-badges:empty {
        display: none !important;
    }

    .pd-hero-wide .pd-badges:not(:empty) {
        position: static !important;
        grid-column: 1 / -1;
        margin-bottom: -6px;
    }

    .pd-hero-wide .pd-hero-left {
        grid-column: 1;
        width: 88px;
        display: flex;
        justify-content: center;
    }

    .pd-hero-wide .pd-hero-icon-card,
    #pd-skeleton .pd-hero-left .pd-sk-icon {
        width: 88px !important;
        height: 88px !important;
        aspect-ratio: 1 / 1;
        border-radius: 20px !important;
    }

    .pd-hero-wide .pd-hero-right {
        display: contents;
    }

    .pd-hero-wide .pd-title-stack {
        grid-column: 2;
        margin-bottom: 0;
        gap: 8px;
        min-width: 0;
        justify-content: center;
    }

    .pd-hero-wide .pd-title-stack .pd-title {
        font-size: 1.28rem;
        line-height: 1.22;
        word-break: break-word;
    }

    .pd-hero-wide .pd-duration-section {
        margin-top: 0;
    }

    .pd-hero-wide .pd-duration-section,
    .pd-hero-wide #pd-app-details,
    .pd-hero-wide .pd-price-row,
    #pd-skeleton .pd-sk-duration,
    #pd-skeleton .pd-sk-price {
        grid-column: 1 / -1;
        width: 100%;
    }

    .pd-hero-icon {
        width: 64px;
        height: 64px;
        font-size: 2rem;
        border-radius: 16px;
    }

    .pd-hero-info {
        display: flex;
        flex-direction: column;
        gap: 12px;
        width: 100%;
    }

    .pd-meta {
        justify-content: flex-start;
        margin-bottom: 0;
    }

    .pd-price-row {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        width: 100% !important;
    }
    
    .pd-bottom-price {
        align-self: flex-end;
        margin-bottom: 4px;
    }

    .pd-buy-btn {
        width: 100%;
        min-height: 48px;
        padding: 14px 24px;
    }

    .duration-radio {
        width: 100%;
    }

    .product-detail {
        padding-bottom: 60px;
    }

    .pd-title {
        font-size: 1.35rem;
    }

    .pd-desc {
        font-size: 0.85rem;
        margin-bottom: 0;
    }

    .pd-section-title {
        font-size: 1.05rem;
        margin-bottom: 14px;
    }

    .pd-screenshots-section {
        padding: 18px;
        border-radius: 16px;
    }

    .pd-screenshot-item {
        width: auto;
        height: 250px;
    }

    .pd-screenshots-scroll {
        gap: 10px;
    }
}

/* ===== Desktop ===== */
@media (min-width: 768px) {
    .pd-hero {
        flex-direction: row;
        align-items: flex-start;
        gap: 32px;
    }

    .pd-buy-btn {
        width: max-content;
        min-width: 200px;
        margin-left: auto;
    }
}

.pd-bottom-price {
    font-family: var(--font-mono);
    font-size: 1.15rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--text-primary);
}

/* Light theme — detail page shared (comprehensive) */
body.light-theme .pd-hero {
    background: #ffffff !important;
    border-color: rgba(24, 24, 27, 0.08) !important;
    box-shadow: 0 8px 28px rgba(24, 24, 27, 0.05);
}
body.light-theme .pd-hero-icon-card {
    border-color: rgba(24, 24, 27, 0.08);
    box-shadow: 0 6px 18px rgba(24, 24, 27, 0.06);
}
body.light-theme .pd-hero-section {
    background: #ffffff;
    border-color: rgba(24, 24, 27, 0.08);
}
body.light-theme .pd-title { color: #18181b !important; }
body.light-theme .pd-desc { color: #52525b !important; }
body.light-theme .pd-long-desc { color: #52525b; }
body.light-theme .pd-long-desc-text { color: #52525b !important; }
body.light-theme .pd-category {
    color: #059669;
    background: rgba(5, 150, 105, 0.08);
    border-color: rgba(5, 150, 105, 0.22);
}
body.light-theme .pd-stock.in-stock { color: #059669; background: rgba(16, 185, 129, 0.12); }
body.light-theme .pd-stock.out-stock { color: #dc2626; background: rgba(239, 68, 68, 0.1); }

/* Info cards */
body.light-theme .pd-info-card {
    background: #ffffff !important;
    border-color: rgba(24, 24, 27, 0.08) !important;
}
body.light-theme .pd-info-card:hover {
    border-color: rgba(24, 24, 27, 0.16) !important;
}
body.light-theme .pd-info-title { color: #18181b !important; }
body.light-theme .pd-info-text { color: #52525b !important; }
body.light-theme .pd-info-icon { color: #059669; }

/* Section titles */
body.light-theme .pd-section-title { color: #18181b; }

/* Detail rows */
body.light-theme .pd-detail-row {
    background: rgba(24, 24, 27, 0.02);
    border-color: rgba(24, 24, 27, 0.06);
}
body.light-theme .pd-detail-label { color: #52525b; }
body.light-theme .pd-detail-value { color: #18181b; }

/* Price */
body.light-theme .pd-price { color: #18181b; }
body.light-theme .pd-price-amount { color: #18181b; }
body.light-theme .pd-old-price { color: #71717a; }

/* Screenshots */
body.light-theme .pd-screenshot-img {
    border-color: rgba(24, 24, 27, 0.08);
}

/* Back button */
body.light-theme .pd-back-btn {
    color: #18181b;
    background: rgba(24, 24, 27, 0.04);
    border-color: rgba(24, 24, 27, 0.08);
}
body.light-theme .pd-back-btn:hover {
    color: #059669;
    background: rgba(5, 150, 105, 0.08);
}

/* Badges */
body.light-theme .pd-badge {
    background: rgba(24, 24, 27, 0.06);
    color: #18181b;
}

/* Duration selector / meta items */
body.light-theme .pd-meta-item,
body.light-theme .pd-duration-btn {
    background: rgba(24, 24, 27, 0.03);
    border-color: rgba(24, 24, 27, 0.08);
    color: #52525b;
}
body.light-theme .pd-duration-btn.active {
    background: rgba(5, 150, 105, 0.08);
    border-color: rgba(5, 150, 105, 0.25);
    color: #059669;
}
body.light-theme .pd-meta-value { color: #18181b; }

/* ===== Marquee (Similar Products) ===== */
.marquee-container {
    overflow: hidden;
    width: 100%;
    position: relative;
    padding-bottom: 10px;
}

.marquee-track {
    display: flex;
    gap: 16px;
    width: max-content;
    animation: marquee-scroll 90s linear infinite;
}

.marquee-track:hover {
    animation-play-state: paused;
}

@keyframes marquee-scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(calc(-50% - 8px)); }
}

/* ===== Universal Modal Scroll Lock ===== */
body.modal-scroll-lock {
    overflow: hidden !important;
}

.modal-overlay,
#contact-modal-overlay,
.es-assistant-modal,
.search-overlay {
    overscroll-behavior: contain !important;
}

/* ===== Modern Tab Interface ===== */
.pd-tabs-section {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 22px;
    padding: 24px;
    margin-bottom: 32px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 10px 30px rgba(0, 0, 0, 0.25);
}

.pd-tabs-header {
    display: flex;
    position: relative;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-subtle);
    border-radius: 14px;
    padding: 4px;
    margin-bottom: 24px;
}

.pd-tab-indicator {
    position: absolute;
    top: 4px;
    bottom: 4px;
    left: 4px;
    width: calc(50% - 4px);
    background: #fafafa;
    border-radius: 10px;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    z-index: 1;
}

body.light-theme .pd-tab-indicator {
    background: #18181b;
}

.pd-tab-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    position: relative;
    z-index: 2;
    transition: color 0.3s ease;
    border-radius: 10px;
    user-select: none;
}

.pd-tab-btn:hover {
    color: var(--text-primary);
}

.pd-tab-btn.active {
    color: #09090b;
    font-weight: 700;
}

body.light-theme .pd-tab-btn.active {
    color: #fafafa;
}

.pd-tab-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.pd-tabs-content {
    position: relative;
    min-height: 120px;
}

.pd-tab-panel {
    display: none;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.22s cubic-bezier(0.4, 0, 0.2, 1), transform 0.22s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: opacity, transform;
}

.pd-tab-panel.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

/* ===== Collapsible & Expandable Markdown Container ===== */
.pd-tabs-content .markdown-body {
    max-height: 240px;
    overflow: hidden;
    position: relative;
    -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 120px, transparent 235px);
    mask-image: linear-gradient(to bottom, #000 0%, #000 120px, transparent 235px);
    transition: max-height 0.6s cubic-bezier(0.25, 1, 0.5, 1);
}

.pd-tabs-content .markdown-body.expanded {
    overflow: visible;
    -webkit-mask-image: none;
    mask-image: none;
}

.pd-tabs-content .markdown-body.not-collapsible {
    max-height: none;
    overflow: visible;
    -webkit-mask-image: none;
    mask-image: none;
}

.md-expand-wrapper {
    display: flex;
    justify-content: center;
    margin-top: 14px;
}

.md-expand-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 22px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-light);
    border-radius: 9999px;
    color: var(--text-primary);
    font-size: 0.86rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.25s ease, opacity 0.25s ease, background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease, box-shadow 0.25s ease;
    outline: none;
}

.md-expand-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    transform: translateY(-1px);
}

body.light-theme .md-expand-btn {
    background: rgba(24, 24, 27, 0.04);
    border-color: rgba(24, 24, 27, 0.12);
    color: #18181b;
}

body.light-theme .md-expand-btn:hover {
    background: rgba(5, 150, 105, 0.08);
    border-color: rgba(5, 150, 105, 0.3);
    color: #059669;
}

.md-expand-btn i,
.md-expand-btn svg {
    width: 16px;
    height: 16px;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.md-expand-btn.expanded i,
.md-expand-btn.expanded svg {
    transform: rotate(180deg) !important;
}

/* Light Theme Tab Overrides */
body.light-theme .pd-tabs-section {
    background: #ffffff;
    border: 1px solid rgba(24, 24, 27, 0.08);
    box-shadow: 0 8px 28px rgba(24, 24, 27, 0.05);
}

body.light-theme .pd-tabs-header {
    background: #f3f1eb;
    border-color: rgba(24, 24, 27, 0.06);
}

body.light-theme .pd-tab-btn {
    color: #52525b;
}

body.light-theme .pd-tab-btn:hover {
    color: #18181b;
}

/* ===== Rendered Markdown Typography ===== */
.markdown-body {
    color: var(--text-primary);
    font-size: 0.96rem;
    line-height: 1.7;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4 {
    font-family: var(--font-display);
    color: var(--text-primary);
    margin-top: 1.4em;
    margin-bottom: 0.6em;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.3;
}

.markdown-body h1:first-child,
.markdown-body h2:first-child,
.markdown-body h3:first-child {
    margin-top: 0;
}

.markdown-body h1 { font-size: 1.4rem; border-bottom: 1px solid var(--border-subtle); padding-bottom: 8px; }
.markdown-body h2 { font-size: 1.25rem; }
.markdown-body h3 { font-size: 1.1rem; }
.markdown-body h4 { font-size: 1.0rem; }

.markdown-body p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

.markdown-body p:last-child {
    margin-bottom: 0;
}

.markdown-body ul,
.markdown-body ol {
    margin-top: 0.4rem;
    margin-bottom: 1rem;
    padding-left: 1.5rem;
    color: var(--text-secondary);
}

.markdown-body li {
    margin-bottom: 0.35rem;
}

.markdown-body blockquote {
    margin: 1rem 0;
    padding: 12px 18px;
    border-left: 3px solid var(--accent-primary);
    background: rgba(16, 185, 129, 0.06);
    border-radius: 0 12px 12px 0;
    color: var(--text-primary);
}

.markdown-body code {
    font-family: var(--font-mono);
    font-size: 0.86em;
    background: rgba(255, 255, 255, 0.06);
    padding: 3px 6px;
    border-radius: 6px;
    color: var(--accent-primary);
}

.markdown-body pre {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-subtle);
    padding: 14px 18px;
    border-radius: 12px;
    overflow-x: auto;
    margin: 1rem 0;
}

.markdown-body pre code {
    background: transparent;
    padding: 0;
    color: #e4e4e7;
}

.markdown-body a {
    color: var(--accent-primary);
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color 0.2s ease;
}

.markdown-body a:hover {
    opacity: 0.85;
}

.markdown-body .md-img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    margin: 1rem 0;
    border: 1px solid var(--border-subtle);
}

body.light-theme .markdown-body {
    color: #18181b;
}
body.light-theme .markdown-body p,
body.light-theme .markdown-body ul,
body.light-theme .markdown-body ol {
    color: #52525b;
}
body.light-theme .markdown-body h1,
body.light-theme .markdown-body h2,
body.light-theme .markdown-body h3,
body.light-theme .markdown-body h4 {
    color: #18181b;
}
body.light-theme .markdown-body code {
    background: rgba(5, 150, 105, 0.08);
    color: #059669;
}

