/* height and width are based on A4 Paper size which is 784px width and 1123px height  */

/* 
A4 Page size
210mm = 794px
297mm = 1123px
 */
*{
    --a4-page-height:100%;
    --specsheet-preview-header-height:80px;
    --specsheet-preview-footer-height:80px;
    --specsheet-preview-content-height:calc(var(--a4-page-height) - (var(--specsheet-preview-header-height) + var(--specsheet-preview-footer-height)));
}

.a4-page {
    width: 794px;
    /* A4 width at 96dpi */
    /* height: 1123px; */
    height: var(--a4-page-height);
    /* A4 height at 96dpi */
    background: white !important;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    /* header top, footer bottom */
    margin: 0px auto;
    /* spacing between pages */
    box-sizing: border-box;
    padding: 0px 0px 10px 0px;
    /* box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1); */
    overflow: hidden !important;
}


.a4-page:last-child {
    padding-bottom: 0px !important;
}

.plt.specsheet-preview-header,
.plt.specsheet-preview-footer,
.plt.specsheet-preview-content {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

.a4-page p,
.a4-page h1,
.a4-page h2,
.a4-page h3,
.a4-page h4,
.a4-page h5,
.a4-page h6 {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

.plt.specsheet-preview-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    height: var(--specsheet-preview-header-height) !important;
    overflow: hidden !important;
    padding: 0px 60px !important;
    background-color: #EFF2F6 !important;
    /* margin-bottom: 10px !important; */
    text-align: end !important;
}

.plt.specsheet-preview-header div span:first-child {
    color: var(--plt-primary);
    font-size: var(--plt-fs-18);
    font-weight: 700;
}

.plt.specsheet-preview-header div span:last-child {
    color: var(--plt-txt-muted);
    font-size: var(--plt-fs-16);
    font-weight: 400;
}

.plt .specsheet-preview-wrapper {}

.plt.specsheet-preview-content {
    /*
    height: 1123px !important;
    min-height: 1123px !important;
    max-height: 1123px !important; */
    padding: 15px 60px !important;
    flex: 1;
    height: var(--specsheet-preview-content-height) !important;
    /* fill remaining space between header and footer */
    overflow: hidden !important;
    /* content that overflows the page will need separate page */
    background-color: white;
}

.plt.specsheet-preview-footer {
    height: var(--specsheet-preview-footer-height) !important;
    overflow: hidden !important;
    padding: 0px 60px !important;
    background-color: #1B2D5B !important;
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0px !important;
    overflow: hidden !important;
}

.plt.specsheet-preview-footer p {
    font-family: 'Urbanist';
    font-weight: 700;
    font-style: bold;
    size: var(--plt-fs-18);
    color: white;
    padding: 0px !important;
    margin: 0px;
}

.plt .MuiDialogContent-root,
.plt .MuiDialogContent-root>.MuiBox-root {
    padding: 0px !important;
}

.plt.specsheet-preview-footer:last-child {
    margin-bottom: 0px !important;
}

.plt.specsheet-preview-content table,
.plt.specsheet-preview-content table thead {
    border-radius: var(--plt-border-radius) !important;
}

.plt.specsheet-preview-content .MuiTableRow-root.MuiTableRow-head,
.plt.specsheet-preview-content table thead th {
    background-color: var(--plt-primary-bg) !important;
}

/* #region Ordering Guide Table Overrides */

.plt.specsheet-preview-content table.ordering-guide-table thead:nth-child(1) tr td {
  border: none !important;
}
.plt.specsheet-preview-content table.ordering-guide-table thead td span.ordering-guide-indicator {
    display: block;
    border: 1px solid #A0A5B1;
    border-radius: 8px !important;
    width: 100% !important;
    height: 25px !important;
}
.plt.specsheet-preview-content table.ordering-guide-table thead td span.ordering-guide-indicator.active {
    background-color: var(--plt-primary);
}



.plt.specsheet-preview-content table.ordering-guide-table thead:nth-child(2) tr th {
  background: #EFF2F6 !important;
  color:black;
  font-weight: bold;
  border: none !important;
}

.plt.specsheet-preview-content table.ordering-guide-table tbody tr td {
  background: #ffffff !important;
  border: none !important;
  color:black;
  font-weight: bold;
}

.plt.specsheet-preview-content table.ordering-guide-table thead:nth-child(2) th:first-child {
  border-radius: var(--plt-border-radius) 0 0 var(--plt-border-radius) !important;
}

.plt.specsheet-preview-content table.ordering-guide-table thead:nth-child(2) th:last-child {
  border-radius: 0 var(--plt-border-radius) var(--plt-border-radius) 0 !important;
  border-right: none;
}

/* #endregion Ordering Guide Table Overrides */


.plt.specsheet-preview-content tr th {
    color: white;
    font-weight: 600;
    font-size: var(--plt-fs-16);
    border-right: 2px solid white;
}

.plt.specsheet-preview-content tr:first-child th:first-child {
    border-radius: var(--plt-border-radius) 0 0 0 !important;
}

.plt.specsheet-preview-content tr:first-child th:last-child {
    border-radius: 0 var(--plt-border-radius) 0 0 !important;
    border-right: none;
}

.plt.specsheet-preview-content tbody tr td {
    background-color: #EFF2F6;
}

.plt.specsheet-preview-content tbody tr td {
    font-size: var(--plt-fs-14);
    padding: 4px 10px;
    border-bottom: none;
    border-right: 2px solid white;
    border-bottom: 2px solid white;
}

.plt.specsheet-preview-content .MuiTableBody-root tr:last-child td:first-child {
    border-radius: 0 0 0 var(--plt-border-radius) !important;
}

.plt.specsheet-preview-content .MuiTableBody-root tr:last-child td:last-child {
    border-radius: 0 0 var(--plt-border-radius) 0 !important;
    border-right: none;

}

.success-btn {
    color: #2E8B8B !important;
    background: none;
    border: none;
    font-weight: 600;
    padding: 4px 8px;
    text-decoration: none !important;
    border-bottom: 2px solid #2E8B8B !important;
    border-radius: 0 !important;
    font-size: 13px;
}

.preview-nav-btn {
    font-family: 'Urbanist';
    font-weight: 600;
    font-size: 16px;
    font-style: SemiBold;
    padding: 6px 12px;
    border-radius: 0 !important;
    transition: all 0.2s ease;
    font-size: 16px;
    text-decoration: none !important;
}

.preview-nav-btn.undeline {
    border-bottom: 1px solid #2E8B8B;
    background: none;
    border-left: none;
    border-right: none;
    border-top: none;
}

.preview-nav-btn.success {
    color: #2E8B8B !important;
    border-bottom: 2px solid #2E8B8B !important;
}

.preview-nav-success-btn {
    border-bottom: 1px solid #2E8B8B;
    color: #2E8B8B !important;
    background: none;
    border-left: none;
    border-right: none;
    border-top: none;
    font-weight: 900;
    font-family: sans-serif;
    padding: 6px 12px;
    border-radius: 0 !important;
    transition: all 0.2s ease;
    font-size: 14px;
    text-decoration: none !important;
    border-bottom: 2px solid #2E8B8B !important;
}

/* Ensure wrapper sections are visible for PDF */
.plt {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    height: auto !important;
    margin-bottom: 40px !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
}

/* PDF-specific styles */
@media print {
    .plt {
        page-break-after: always !important;
        break-after: page !important;
    }

    .plt:last-child {
        page-break-after: auto !important;
        break-after: auto !important;
    }

    .a4-page {
        box-shadow: none !important;
    }

    .specsheet-preview-header,
    .specsheet-preview-content,
    .specsheet-preview-footer {
        display: block !important;
        visibility: visible !important;
    }

    /* Hide interactive elements in print */
    button,
    input,
    select,
    textarea,
    .preview-nav-btn,
    .MuiIconButton-root {
        display: none !important;
    }
}
.ordering-guide-indicator.active {
    position: relative;
    cursor: help;
}

.ordering-guide-indicator.active:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #1B2D5B;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 10px;
    white-space: nowrap;
    z-index: 10;
}