:root {
    --primary-red: #CC0000;
    --light-red: #ff6659;
    --dark-red: #9a0007;
    --light-gray: #f5f5f5;
    --medium-gray: #e0e0e0;
    --dark-gray: #424242;
    --text-gray: #616161;
    --border-radius: 8px;
}

.section-title {
    position: relative;
    padding-bottom: 15px;
    font-weight: 700;
    color: var(--dark-gray);
}

.section-title:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background-color: var(--primary-red);
}

.catalog-card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
    padding: 25px;
    height: 100%;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--medium-gray);
}

.catalog-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.12);
}

.catalog-icon {
    font-size: 2.5rem;
    color: var(--primary-red);
    margin-bottom: 15px;
}

.catalog-card h4 {
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--dark-gray);
}

.catalog-image-container {
    position: relative;
    margin: 15px 0;
    border-radius: var(--border-radius);
    overflow: hidden;
    cursor: pointer;
    background: var(--light-gray);
}

.catalog-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: all 0.3s ease;
}

.quick-view-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: all 0.3s ease;
}

.catalog-image-container:hover .quick-view-overlay {
    opacity: 1;
}

.catalog-image-container:hover .catalog-image {
    transform: scale(1.05);
}

.quick-view-btn {
    background: var(--light-gray);
    color: var(--dark-gray);
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center; /* This ensures vertical centering */
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    width: auto;
    min-width: 140px;
    line-height: 1; /* Added to ensure consistent text height */
}

.quick-view-btn:hover {
    background: white;
    color: var(--primary-red);
    transform: translateY(-2px);
}

.quick-view-icon-white {
    color: white;
    font-size: 1.1rem;
    display: flex; /* Ensure icon is properly aligned */
    align-items: center;
}

.quick-view-btn:hover .quick-view-icon-white {
    color: var(--primary-red);
}

.quick-view-btn:hover .quick-view-icon-white {
    color: var(--primary-red);
}

.catalog-card p {
    flex-grow: 1;
    margin-bottom: 20px;
    color: var(--text-gray);
    line-height: 1.6;
}

.catalog-card i {
    font-size: 1.5rem!important;
    color: #CC0000;
    margin-bottom: 0!important;
}

.btn-download {
    background-color: #CC0000; /* Red background */
    border-color: #CC0000; /* Red border */
    color: white; /* White text */
    padding: 12px 25px;
    font-weight: 500;
    border-radius: 6px;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    border: 2px solid #CC0000; /* Ensure border matches */
}

.btn-download:hover {
    background-color: white; /* White background on hover */
    border-color: #CC0000; /* Keep red border */
    color: #CC0000; /* Red text on hover */
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(211, 47, 47, 0.3);
}

/* Change icon color on hover */
.btn-download:hover .text-white {
    color: #CC0000 !important;
}

.btn-outline-secondary {
    border-color: var(--medium-gray);
    color: var(--dark-gray);
    padding: 12px 30px;
    font-weight: 500;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.btn-outline-secondary:hover {
    background-color: var(--medium-gray);
    color: var(--dark-gray);
    transform: translateY(-2px);
}

/* Modern Modal2 Styles - Updated from .modal to .modal2 */
.modal2 {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1060; /* Higher than Bootstrap modals */
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal2.active {
    opacity: 1;
    visibility: visible;
}

.modal2-content {
    background: white;
    border-radius: 12px;
    width: 95%;
    max-width: 1200px;
    max-height: 90vh;
    overflow: hidden;
    position: relative;
    transform: translateY(20px);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.modal2.active .modal2-content {
    transform: translateY(0);
}

.modal2-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    border-bottom: 1px solid var(--medium-gray);
    background: white;
}

.modal2-header h3 {
    margin: 0;
    font-weight: 600;
    color: var(--dark-gray);
    font-size: 1.5rem;
}

.modal2-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-gray);
    cursor: pointer;
    padding: 5px;
    transition: all 0.3s ease;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal2-close:hover {
    background: var(--light-gray);
    color: var(--dark-gray);
}

.modal2-body {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Document Viewer Section */
.document-viewer-section {
    flex: 0 0 70%;
    background: var(--light-gray);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.pdf-viewer {
    width: 100%;
    height: 100%;
    min-height: 500px;
    border-radius: var(--border-radius);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    background: white;
}

/* Document Info Section */
.document-info-section {
    flex: 0 0 30%;
    padding: 30px;
    display: flex;
    flex-direction: column;
    background: white;
    border-left: 1px solid var(--medium-gray);
}

.doc-info-header {
    display: flex;
    align-items: flex-start;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--medium-gray);
}

.doc-info-header .catalog-icon {
    font-size: 2rem;
    color: var(--primary-red);
    margin-right: 15px;
    margin-bottom: 0;
}

.doc-title-section {
    flex: 1;
}

.doc-title {
    font-weight: 600;
    margin: 0 0 5px 0;
    color: var(--dark-gray);
    font-size: 1.3rem;
    line-height: 1.3;
}

.doc-type {
    color: var(--text-gray);
    font-size: 0.9rem;
}

.doc-description {
    margin-bottom: 25px;
    color: var(--text-gray);
    line-height: 1.6;
    flex-grow: 1;
}

/* Document Actions Grid (Similar to Product Detail) */
.doc-actions-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: auto;
}

.doc-action-btn {
    padding: 14px 20px;
    border-radius: var(--border-radius);
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: 1px solid var(--medium-gray);
    text-decoration: none;
    text-align: center;
    font-size: 0.95rem;
    cursor: pointer;
    background: white;
    color: var(--dark-gray);
}

.doc-action-btn i {
    font-size: 1.1rem;
}

.doc-action-btn.print-btn:hover {
    background: var(--light-gray);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.doc-action-btn.expand-btn:hover {
    background: var(--light-gray);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.doc-action-btn.download-btn {
    background-color: var(--primary-red);
    color: white;
    border-color: var(--primary-red);
}

.doc-action-btn.download-btn:hover {
    background-color: var(--dark-red);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(211, 47, 47, 0.3);
}

@media (max-width: 992px) {
    .modal2-body {
        flex-direction: column;
    }
    
    .document-viewer-section, .document-info-section {
        flex: 0 0 100%;
    }
    
    .document-viewer-section {
        min-height: 400px;
    }
    
    .pdf-viewer {
        min-height: 400px;
    }
    
    .document-info-section {
        border-left: none;
        border-top: 1px solid var(--medium-gray);
    }
    
    .doc-actions-grid {
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    .doc-action-btn {
        flex: 1;
        min-width: 140px;
    }
}

@media (max-width: 576px) {
    .modal2-content {
        width: 98%;
        border-radius: 10px;
    }
    
    .modal2-header {
        padding: 15px 20px;
    }
    
    .document-viewer-section, .document-info-section {
        padding: 20px;
    }
    
    .doc-actions-grid {
        flex-direction: column;
    }
    
    .doc-action-btn {
        width: 100%;
    }
    
    .catalog-card {
        padding: 20px;
    }
}
