:root {
    --primary: #ff6b2b;
    --secondary: #1f2937;
    --text: #374151;
    --light-bg: #f9fafb;
    --border: #e5e7eb;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    line-height: 1.6;
    color: var(--text);
    margin: 0;
    padding: 0;
    background-color: #f3f4f6;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
}

.print-container {
    max-width: 210mm;
    /* A4 width */
    margin: 40px auto;
    padding: 40px;
    background: white;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Header */
.doc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid var(--primary);
    padding-bottom: 20px;
    margin-bottom: 40px;
}

.print-logo {
    height: 40px;
}

.doc-meta {
    text-align: right;
    font-size: 0.85rem;
    color: #6b7280;
}

.doc-meta p {
    margin: 0;
}

/* Markdown Content Styling */
.markdown-body h1 {
    color: var(--secondary);
    font-size: 2.25rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
}

.markdown-body h2 {
    color: var(--primary);
    font-size: 1.5rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.markdown-body h3 {
    color: var(--secondary);
    font-size: 1.25rem;
    margin-top: 1.5rem;
}

.markdown-body p {
    margin-bottom: 1rem;
}

.markdown-body ul,
.markdown-body ol {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

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

/* Tables */
.markdown-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
    font-size: 0.9rem;
}

.markdown-body th,
.markdown-body td {
    border: 1px solid var(--border);
    padding: 12px;
    text-align: left;
}

.markdown-body th {
    background-color: var(--secondary);
    color: white;
    font-weight: 600;
}

.markdown-body tr:nth-child(even) {
    background-color: var(--light-bg);
}

/* Document Images */
.markdown-body img.doc-image {
    max-width: 100% !important;
    height: auto !important;
    margin: 1rem 0;
}

.markdown-body img.product-image {
    float: right !important;
    max-width: 180px !important;
    width: 180px !important;
    height: auto !important;
    margin: 0 0 1rem 1.5rem !important;
    clear: right;
}

.markdown-body img.badge-image {
    float: right !important;
    width: 90px !important;
    max-width: 90px !important;
    height: auto !important;
    margin: 0 0 1rem 1.5rem !important;
    clear: right;
}

.markdown-body img.dimensions-image {
    display: inline-block !important;
    max-width: 48% !important;
    height: auto !important;
    max-height: 250px !important;
    margin: 0.5rem;
    padding: 0.5rem;
    background: var(--light-bg);
    border-radius: 8px;
    vertical-align: top;
    object-fit: contain;
}

.markdown-body img.gallery-image {
    display: inline-block !important;
    max-width: 45% !important;
    height: auto !important;
    max-height: 200px !important;
    margin: 0.5rem;
    object-fit: contain;
    vertical-align: top;
}

/* Footer */
.doc-footer {
    margin-top: 60px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    text-align: center;
    font-size: 0.8rem;
    color: #9ca3af;
}

/* Print Specific Overrides */
@media print {
    body {
        background: white;
    }

    .print-container {
        margin: 0;
        padding: 0;
        box-shadow: none;
        max-width: none;
    }

    .doc-header {
        margin-bottom: 30px;
    }

    /* Ensure link URLs are shown only if useful, or hide them for cleanness */
    a {
        text-decoration: none;
        color: var(--secondary);
    }

    /* Avoid breaking inside important elements */
    table,
    h2,
    h3 {
        break-inside: avoid;
    }

    .doc-footer {
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        background: white;
    }
}