/* ===================================================================
   Model Detail Page — Premium UI
   All classes prefixed with mdp- to avoid conflicts with main site
   =================================================================== */

/* ---- Container ---- */
.mdp-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    box-sizing: border-box;
}

/* ---- Breadcrumbs ---- */
.mdp-breadcrumbs {
    padding: 6.5rem 0 0.75rem;
}

.mdp-breadcrumb-list {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 0.8rem;
    color: var(--text-subtle);
    flex-wrap: wrap;
}

.mdp-breadcrumb-list li:not(:last-child)::after {
    content: "›";
    margin-left: 0.4rem;
    opacity: 0.5;
}

.mdp-breadcrumb-list a {
    color: var(--text-muted);
    transition: color 0.2s;
}

.mdp-breadcrumb-list a:hover {
    color: var(--primary);
}

.mdp-breadcrumb-list .current {
    color: var(--text-main);
    font-weight: 500;
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}


/* ===== HERO GALLERY ===== */
.mdp-hero {
    padding: 1rem 0 0;
}

.mdp-gallery {
    position: relative;
}

.mdp-gallery-main {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    aspect-ratio: 16 / 10;
    cursor: zoom-in;
}

.mdp-main-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.35s ease;
    display: block;
}

.mdp-free-tag {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: var(--free-accent);
    color: #000;
    padding: 0.4rem 1rem;
    border-radius: 50px;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.5);
    z-index: 3;
    font-family: var(--font-heading);
}

/* Gallery arrows */
.mdp-gallery-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #fff;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 4;
    opacity: 0;
    transition: all 0.25s ease;
}

.mdp-gallery-main:hover .mdp-gallery-arrow {
    opacity: 1;
}

.mdp-gallery-arrow:hover {
    background: rgba(0, 243, 255, 0.25);
    border-color: var(--primary);
    box-shadow: 0 0 16px rgba(0, 243, 255, 0.25);
}

.mdp-arrow-prev {
    left: 0.75rem;
}

.mdp-arrow-next {
    right: 0.75rem;
}

/* Image counter badge */
.mdp-img-counter {
    position: absolute;
    bottom: 0.75rem;
    right: 0.75rem;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.3rem 0.75rem;
    border-radius: 50px;
    z-index: 3;
    letter-spacing: 0.05em;
    font-family: var(--font-heading);
}

/* Thumbnail strip */
.mdp-thumbs {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.mdp-thumbs::-webkit-scrollbar {
    display: none;
}

.mdp-thumb {
    width: 72px;
    height: 72px;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s ease;
    flex-shrink: 0;
    background: var(--bg-card);
    opacity: 0.55;
}

.mdp-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.mdp-thumb:hover {
    opacity: 0.85;
    border-color: rgba(255, 255, 255, 0.15);
}

.mdp-thumb.active {
    opacity: 1;
    border-color: var(--primary);
    box-shadow: 0 0 12px rgba(0, 243, 255, 0.25);
}


/* ===== INFO SECTION ===== */
.mdp-info {
    padding: 2.5rem 0 2rem;
}

.mdp-info-grid {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 3rem;
    align-items: start;
}

/* ---- LEFT: Details ---- */
.mdp-details {
    min-width: 0;
    /* prevent grid blowout */
}

.mdp-badges {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.mdp-badge {
    padding: 0.3rem 0.85rem;
    border-radius: 50px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-family: var(--font-heading);
    border: 1px solid transparent;
    white-space: nowrap;
}

.mdp-badge-category {
    background: rgba(123, 45, 255, 0.12);
    color: var(--accent);
    border-color: rgba(123, 45, 255, 0.25);
}

.mdp-badge-engine {
    background: rgba(0, 243, 255, 0.08);
    color: var(--primary);
    border-color: rgba(0, 243, 255, 0.2);
}

.mdp-badge-compat {
    background: rgba(255, 0, 255, 0.08);
    color: var(--secondary);
    border-color: rgba(255, 0, 255, 0.15);
}

.mdp-title {
    font-family: var(--font-heading);
    font-size: clamp(1.5rem, 1.2rem + 1.5vw, 2.25rem);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.03em;
    margin-bottom: 1.25rem;
    color: var(--text-main);
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.mdp-stats-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--glass-border);
}

.mdp-stat {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.mdp-stat svg {
    opacity: 0.6;
    flex-shrink: 0;
}

.mdp-stat strong {
    color: var(--text-main);
    font-weight: 600;
}

.mdp-description {
    font-size: 0.95rem;
    line-height: 1.85;
    color: var(--text-muted);
    margin-bottom: 2rem;
    max-width: 65ch;
}

/* SEO Tags */
.mdp-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.mdp-tag {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.07);
    color: var(--text-subtle);
    padding: 0.25rem 0.65rem;
    border-radius: 50px;
    font-size: 0.7rem;
    font-weight: 500;
    transition: all 0.2s ease;
    cursor: default;
}

.mdp-tag:hover {
    border-color: rgba(0, 243, 255, 0.3);
    color: var(--primary);
    background: rgba(0, 243, 255, 0.04);
}


/* ---- RIGHT: Action Panel ---- */
.mdp-action-panel {
    position: sticky;
    top: 5.5rem;
}

.mdp-action-card {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 2rem;
    box-shadow:
        0 4px 30px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.mdp-price-section {
    text-align: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--glass-border);
}

.mdp-price {
    display: block;
    font-family: var(--font-heading);
    font-size: 2.75rem;
    font-weight: 800;
    color: var(--free-accent);
    text-shadow: 0 0 30px rgba(16, 185, 129, 0.35);
    line-height: 1;
    margin-bottom: 0.3rem;
}

.mdp-price-sub {
    display: block;
    font-size: 0.8rem;
    color: var(--text-subtle);
    font-weight: 400;
}

/* Download button */
.mdp-download-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    padding: 1.1rem 2rem;
    background: linear-gradient(135deg, var(--free-accent), #059669);
    color: #fff;
    border: none;
    border-radius: 14px;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    box-shadow: 0 4px 20px rgba(16, 185, 129, 0.3);
    margin-bottom: 1.75rem;
    -webkit-tap-highlight-color: transparent;
    position: relative;
    overflow: hidden;
}

.mdp-download-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.12), transparent);
    transition: left 0.5s ease;
}

.mdp-download-btn:hover::before {
    left: 100%;
}

.mdp-download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(16, 185, 129, 0.45);
}

.mdp-download-btn:active {
    transform: translateY(0);
}

.mdp-download-btn svg {
    flex-shrink: 0;
    transition: transform 0.3s;
}

.mdp-download-btn:hover svg {
    transform: translateY(2px);
}

/* Compatibility list */
.mdp-compat-list h4 {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-subtle);
    margin-bottom: 0.75rem;
    font-weight: 600;
    font-family: var(--font-heading);
}

.mdp-compat-list ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.mdp-compat-list li {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.mdp-compat-list li svg {
    color: var(--free-accent);
    flex-shrink: 0;
}


/* ===== RELATED MODELS ===== */
.mdp-related {
    padding: 3rem 0 4rem;
    border-top: 1px solid var(--glass-border);
    margin-top: 2rem;
}

.mdp-section-heading {
    font-family: var(--font-heading);
    font-size: clamp(1.3rem, 1rem + 1vw, 1.75rem);
    font-weight: 700;
    margin-bottom: 1.5rem;
    letter-spacing: -0.02em;
}

.mdp-related-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
}

.mdp-rel-card {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    overflow: hidden;
    transition: all 0.3s ease;
    text-decoration: none;
    color: inherit;
    display: block;
}

.mdp-rel-card:hover {
    transform: translateY(-6px);
    border-color: rgba(0, 243, 255, 0.3);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(0, 243, 255, 0.1);
}

.mdp-rel-img {
    aspect-ratio: 4/5;
    overflow: hidden;
}

.mdp-rel-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
    display: block;
}

.mdp-rel-card:hover .mdp-rel-img img {
    transform: scale(1.06);
}

.mdp-rel-body {
    padding: 0.85rem 1rem;
}

.mdp-rel-body h3 {
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 0.3rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.mdp-rel-body span {
    color: var(--free-accent);
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}


/* ===== LIGHTBOX ===== */
.mdp-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.96);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mdp-lightbox.active {
    display: flex;
    opacity: 1;
}

.mdp-lb-img {
    max-width: 92vw;
    max-height: 88vh;
    object-fit: contain;
    border-radius: 6px;
    user-select: none;
    -webkit-user-drag: none;
}

.mdp-lb-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 1.75rem;
    cursor: pointer;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 10001;
    line-height: 1;
}

.mdp-lb-close:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--primary);
    color: var(--primary);
}

.mdp-lb-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    z-index: 10000;
}

.mdp-lb-prev {
    left: 1rem;
}

.mdp-lb-next {
    right: 1rem;
}

.mdp-lb-arrow:hover {
    background: rgba(0, 243, 255, 0.15);
    border-color: var(--primary);
}

.mdp-lb-counter {
    position: absolute;
    bottom: 1.25rem;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.8rem;
    font-weight: 600;
    background: rgba(0, 0, 0, 0.5);
    padding: 0.35rem 0.85rem;
    border-radius: 50px;
    font-family: var(--font-heading);
    letter-spacing: 0.05em;
}

/* Logo */
.logo-link {
    text-decoration: none;
}

/* 404 */
.mdp-not-found {
    text-align: center;
    padding: 10rem 2rem;
    min-height: 60vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.mdp-not-found h1 {
    font-family: var(--font-heading);
    font-size: clamp(1.5rem, 1rem + 2vw, 2.5rem);
    margin-bottom: 1rem;
}

.mdp-not-found p {
    color: var(--text-muted);
    margin-bottom: 2rem;
    max-width: 40ch;
}

.mdp-not-found a {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.85rem 1.75rem;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff;
    border-radius: 12px;
    font-weight: 700;
    font-family: var(--font-heading);
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    transition: all 0.3s;
}

.mdp-not-found a:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(0, 243, 255, 0.3);
}


/* =============================================================
   RESPONSIVE — Tablet (≤ 900px)
   ============================================================= */
@media (max-width: 900px) {
    .mdp-info-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .mdp-action-panel {
        position: static;
    }

    .mdp-action-card {
        border-radius: 16px;
        padding: 1.5rem;
    }

    .mdp-gallery-main {
        aspect-ratio: 4 / 3;
        border-radius: 16px;
    }

    .mdp-gallery-arrow {
        opacity: 1;
    }

    .mdp-related-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .mdp-thumb {
        width: 64px;
        height: 64px;
    }
}


/* =============================================================
   RESPONSIVE — Mobile (≤ 600px)
   ============================================================= */
@media (max-width: 600px) {
    .mdp-container {
        padding: 0 1rem;
    }

    /* Breadcrumbs */
    .mdp-breadcrumbs {
        padding: 5rem 0 0.5rem;
    }

    .mdp-breadcrumb-list {
        font-size: 0.7rem;
        gap: 0.25rem;
    }

    .mdp-breadcrumb-list .current {
        max-width: 140px;
    }

    /* Gallery */
    .mdp-hero {
        padding: 0.5rem 0 0;
    }

    .mdp-gallery-main {
        border-radius: 14px;
        aspect-ratio: 3 / 4;
    }

    .mdp-gallery-arrow {
        width: 36px;
        height: 36px;
        opacity: 1;
    }

    .mdp-gallery-arrow svg {
        width: 16px;
        height: 16px;
    }

    .mdp-arrow-prev {
        left: 0.5rem;
    }

    .mdp-arrow-next {
        right: 0.5rem;
    }

    .mdp-img-counter {
        font-size: 0.6rem;
        padding: 0.2rem 0.6rem;
        bottom: 0.5rem;
        right: 0.5rem;
    }

    .mdp-thumbs {
        gap: 0.35rem;
        margin-top: 0.5rem;
    }

    .mdp-thumb {
        width: 48px;
        height: 48px;
        border-radius: 8px;
    }

    /* Info */
    .mdp-info {
        padding: 1.5rem 0 1rem;
    }

    .mdp-badges {
        margin-bottom: 0.75rem;
        gap: 0.35rem;
    }

    .mdp-badge {
        font-size: 0.6rem;
        padding: 0.2rem 0.6rem;
    }

    .mdp-title {
        font-size: 1.25rem;
        margin-bottom: 1rem;
    }

    .mdp-stats-row {
        gap: 0.75rem;
        margin-bottom: 1.15rem;
        padding-bottom: 1.15rem;
    }

    .mdp-stat {
        font-size: 0.78rem;
    }

    .mdp-stat svg {
        width: 14px;
        height: 14px;
    }

    .mdp-description {
        font-size: 0.88rem;
        line-height: 1.75;
        margin-bottom: 1.25rem;
    }

    .mdp-tags {
        gap: 0.3rem;
    }

    .mdp-tag {
        font-size: 0.62rem;
        padding: 0.2rem 0.5rem;
    }

    /* Action card */
    .mdp-action-card {
        padding: 1.25rem;
        border-radius: 14px;
    }

    .mdp-price {
        font-size: 2.25rem;
    }

    .mdp-download-btn {
        padding: 1rem 1.5rem;
        font-size: 0.9rem;
        border-radius: 12px;
        margin-bottom: 1.25rem;
    }

    .mdp-download-btn svg {
        width: 18px;
        height: 18px;
    }

    .mdp-compat-list li {
        font-size: 0.8rem;
    }

    /* Related */
    .mdp-related {
        padding: 2rem 0 3rem;
        margin-top: 1rem;
    }

    .mdp-related-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .mdp-rel-card {
        border-radius: 12px;
    }

    .mdp-rel-body {
        padding: 0.65rem 0.75rem;
    }

    .mdp-rel-body h3 {
        font-size: 0.75rem;
    }

    .mdp-rel-body span {
        font-size: 0.65rem;
    }

    /* Lightbox */
    .mdp-lb-img {
        max-width: 96vw;
        max-height: 80vh;
    }

    .mdp-lb-close {
        top: 0.75rem;
        right: 0.75rem;
        width: 38px;
        height: 38px;
        font-size: 1.4rem;
    }

    .mdp-lb-arrow {
        width: 36px;
        height: 36px;
    }

    .mdp-lb-prev {
        left: 0.5rem;
    }

    .mdp-lb-next {
        right: 0.5rem;
    }

    .mdp-lb-arrow svg {
        width: 18px;
        height: 18px;
    }

    .mdp-lb-counter {
        bottom: 0.75rem;
        font-size: 0.7rem;
        padding: 0.25rem 0.65rem;
    }

    /* 404 */
    .mdp-not-found {
        padding: 5rem 1.5rem;
    }
}


/* =============================================================
   RESPONSIVE — Small phones (≤ 380px)
   ============================================================= */
@media (max-width: 380px) {
    .mdp-container {
        padding: 0 0.75rem;
    }

    .mdp-title {
        font-size: 1.1rem;
    }

    .mdp-thumb {
        width: 42px;
        height: 42px;
    }

    .mdp-price {
        font-size: 1.85rem;
    }

    .mdp-download-btn {
        font-size: 0.82rem;
        padding: 0.85rem 1rem;
    }

    .mdp-related-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
    }

    .mdp-rel-body h3 {
        font-size: 0.7rem;
        -webkit-line-clamp: 1;
    }
}