/* ================================================
   plan-detail.css
   Styles for plan-detail.php — inherits all
   variables from style.css (loaded first).
   ================================================ */

/* Override main bg to match white content — always white regardless of theme */
main,
.pd-page,
.pd-hero,
.pd-hero-info,
.pd-grid {
    background-color: #fff !important;
}

/* ── Page wrapper ── */
.pd-page {
    padding: 40px 36px 80px;
    max-width: 960px;
    margin: 0 auto;
    box-sizing: border-box;
    min-height: 100vh;
}

/* ── Back link ── */
.pd-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--secondary);
    text-decoration: none;
    margin-bottom: 28px;
    transition: opacity .2s;
}

.pd-back:hover { opacity: .7; }

/* ── Hero section ── */
.pd-hero {
    display: flex;
    gap: 32px;
    align-items: flex-start;
    margin-bottom: 40px;
    padding-bottom: 32px;
    border-bottom: 1px solid #e0e0e0;
}

.pd-hero-img {
    flex-shrink: 0;
    width: 300px;
    height: 300px;
    border-radius: 16px;
    overflow: hidden;
    background: #1a1a1a;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pd-hero-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pd-hero-info {
    flex: 1;
    min-width: 0;
}

.pd-cat {
    display: inline-block;
    background: var(--secondary);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    padding: 4px 12px;
    border-radius: 50px;
    margin-bottom: 12px;
}

.pd-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 32px;
    font-weight: 800;
    color: #222;
    margin: 0 0 16px;
    line-height: 1.2;
}

.pd-price {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 20px;
    font-weight: 700;
    color: var(--secondary);
}

/* ── Content grid ── */
.pd-grid {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

/* ── Cards ── */
.pd-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 16px;
    overflow: hidden;
}

.pd-card-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    font-weight: 700;
    font-family: 'Playfair Display', Georgia, serif;
    color: var(--secondary);
    padding: 18px 24px;
    margin: 0;
    background: #fff;
    border-bottom: 1px solid #e0e0e0;
}

.pd-card-body {
    padding: 20px 24px;
    font-size: 14px;
    line-height: 1.8;
    color: #333;
    background: #fff;
}

.pd-card-body--viewer {
    padding: 12px;
}

/* ── PDF.js Viewer ── */
.pdf-viewer {
    width: 100%;
    background: #f4f4f4;
    border-radius: 8px;
    padding: 8px;
    box-sizing: border-box;
}

.pdf-canvas:last-child {
    margin-bottom: 0;
}

.pdf-loading,
.pdf-error {
    text-align: center;
    padding: 28px 16px;
    color: #888;
    font-size: 13px;
}

.pd-desc,
.pd-woofers {
    color: #444;
}

/* ── PDF list ── */
.pd-pdf-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.pd-pdf-list li a {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    font-weight: 500;
    color: var(--secondary);
    text-decoration: none;
    padding: 10px 16px;
    border-radius: 10px;
    border: 1px solid var(--form-border);
    transition: background .2s, border-color .2s;
    word-break: break-all;
}

.pd-pdf-list li a:hover {
    background: rgba(255,123,0,.06);
    border-color: var(--secondary);
}

.pd-pdf-list li a i {
    color: #e05252;
    font-size: 16px;
    flex-shrink: 0;
}

/* ── Specs table ── */
.pd-specs-table {
    width: 100%;
    border-collapse: collapse;
}

.pd-specs-table tr {
    border-bottom: 1px solid #e0e0e0;
}

.pd-specs-table tr:last-child {
    border-bottom: none;
}

.pd-specs-table th,
.pd-specs-table td {
    padding: 10px 0;
    font-size: 14px;
    text-align: left;
}

.pd-specs-table th {
    font-weight: 600;
    color: #555;
    width: 140px;
}

.pd-specs-table td {
    color: #222;
    font-weight: 500;
}

/* ── AdSense slots ── */
.pd-card--adsense {
    border: 1px dashed #ccc;
    background: #fafafa;
    min-height: 100px;
}

.pd-adsense-slot {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 90px;
    padding: 16px;
    background: #fafafa !important;
}

/* ── Comments section ── */
.pd-comments {
    color: #444;
}

/* ── PDF download button ── */
.pd-pdf-download {
    padding: 12px 24px 16px;
    border-top: 1px solid #e0e0e0;
    text-align: center;
    background: #fff;
}

.pd-download-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    background: var(--secondary);
    text-decoration: none;
    padding: 10px 24px;
    border-radius: 8px;
    transition: opacity .2s;
}

.pd-download-btn:hover {
    opacity: .85;
}

.pd-download-btn i {
    font-size: 14px;
}

.pd-download-btn--locked {
    background: #999;
    cursor: default;
}

.pd-download-btn--locked:hover {
    opacity: 1;
    background: #888;
}

/* CNC Section */
.pd-cnc-section {
    grid-column: 1 / -1;
    border: 2px dashed var(--secondary);
    background: var(--card-bg);
}

.pd-cnc-body {
    padding: 24px 28px;
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.pd-cnc-info {
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.pd-cnc-info i {
    color: var(--secondary);
    margin-right: 6px;
}

.pd-cnc-locked-text {
    font-size: 14px;
    color: #666;
    flex: 1;
}

.pd-cnc-unavailable {
    font-size: 14px;
    color: #999;
    font-style: italic;
}

.pd-cnc-unavailable i {
    margin-right: 6px;
    color: #bbb;
}

/* CNC Request */
.pd-cnc-requested-text {
    font-size: 14px;
    color: #666;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.pd-cnc-requested-text i {
    color: var(--secondary);
}

.pd-cnc-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.pd-cnc-badge--pending {
    background: #fff3e0;
    color: #ff7b00;
}

.pd-cnc-badge--completed {
    background: #e8f5e9;
    color: #27ae60;
}

.pd-cnc-badge--rejected {
    background: #fce4ec;
    color: #c0392b;
}

.pd-cnc-count {
    font-size: 12px;
    color: #999;
    width: 100%;
}

.pd-request-cnc-btn {
    cursor: pointer;
    border: none;
    font-family: inherit;
}

.pd-request-cnc-btn:disabled {
    opacity: .7;
    cursor: not-allowed;
}

.pd-request-cnc-btn--done {
    background: #27ae60 !important;
    pointer-events: none;
}

/* Prevent saving canvas as image */
.pdf-canvas {
    display: block;
    width: 100%;
    height: auto;
    margin-bottom: 6px;
    border-radius: 4px;
    box-shadow: 0 1px 4px rgba(0,0,0,.12);
    -webkit-user-select: none;
    user-select: none;
    pointer-events: none;
}

.pdf-viewer {
    -webkit-user-select: none;
    user-select: none;
}
@media (max-width: 640px) {
    .pd-page {
        padding: 24px 20px 60px;
    }

    .pd-hero {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 20px;
    }

    .pd-hero-img {
        width: 200px;
        height: 200px;
    }

    .pd-title {
        font-size: 24px;
    }

    .pd-card-body {
        padding: 16px 18px;
    }
}
