/* Materials Page Layout */
.materials-layout-container {
    display: flex;
    max-width: 1600px;
    margin: 40px auto;
    padding: 0 30px;
    gap: 40px;
    align-items: flex-start;
}

/* Sidebar Styles */
.materials-sidebar {
    flex: 0 0 350px;
    background-color: #f8f9fa;
    padding: 25px;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    height: fit-content;
    position: sticky;
    top: 20px;
}
.materials-sidebar h3 {
    font-size: 22px;
    color: #1a237e;
    margin-top: 0;
    padding-bottom: 15px;
    border-bottom: 2px solid #e0e0e0;
}
.materials-sidebar ul { 
    list-style: none; 
    padding: 0; 
    margin: 20px 0 0 0; 
}
.material-select-btn {
    display: block;
    width: 100%;
    padding: 15px;
    margin-bottom: 8px;
    text-align: left;
    font-size: 16px;
    font-weight: bold;
    color: #333;
    background-color: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s ease;
}
.material-select-btn.active {
    background-color: #3f51b5;
    color: white;
    border-color: #3f51b5;
    transform: translateX(5px);
}
.material-select-btn:not(.active):hover {
    background-color: #e8eaf6;
    color: #1a237e;
    border-color: #3f51b5;
    transform: translateX(5px);
}

/* Content Area Styles */
.materials-content {
    flex: 1;
    min-width: 0;
}
.material-detail { 
    display: none;
    background-color: #ffffff;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    margin-bottom: 30px;
}
.material-detail.active {
    display: block;
    animation: contentFadeIn 0.5s ease;
}
.detail-header {
    padding: 25px 30px;
    border-bottom: 1px solid #e9ecef;
    background-color: #f8f9fa;
    border-radius: 8px 8px 0 0;
}
.detail-header h2 { 
    font-size: 28px; 
    color: #1a237e; 
    margin: 0; 
}
.detail-body { 
    padding: 30px; 
}
.detail-description p { 
    font-size: 16px; 
    line-height: 1.7; 
    color: #333; 
    margin-bottom: 15px;
}
.detail-grid {
    display: grid;
    grid-template-columns: 1fr; 
    gap: 30px;
    margin-top: 30px;
    align-items: flex-start;
}
.detail-specs h4 {
    font-size: 20px;
    color: #0d47a1;
    margin-top: 25px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    border-bottom: 2px solid #e8eaf6;
    padding-bottom: 10px;
}
.detail-specs h4:first-of-type { 
    margin-top: 0; 
}
.detail-specs h4 i { 
    margin-right: 10px; 
    color: #3f51b5; 
}
.detail-specs p {
    font-size: 15px;
    line-height: 1.6;
    color: #555;
    border-left: 3px solid #e8eaf6;
    padding-left: 15px;
    margin: 0 0 15px 5px;
}
.spec-list { 
    list-style: none; 
    padding: 0; 
    margin: 0;
}
.spec-list li {
    display: flex;
    align-items: flex-start;
    padding: 10px 0;
    font-size: 15px;
    border-bottom: 1px solid #f0f0f0;
}
.spec-list li:last-child { 
    border-bottom: none; 
}
.spec-list li i {
    color: #0d47a1;
    margin-right: 15px;
    margin-top: 4px;
    width: 20px;
    text-align: center;
}
.detail-image-group {
    display: flex;       /* This is the key change to align items horizontally */
    gap: 20px;           /* This adds space between the two images */
    margin-top: 20px;
    width: 100%;
}
.detail-image {
    flex: 1;             /* This makes each image container share the space equally */
    min-width: 0;        /* This prevents images from overflowing their container */
    margin-bottom: 15px;
}
.detail-image img {
    width: 100%;
    max-width: 600px;
    display: block;
    margin: 0 auto;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}


.detail-content-layout {
    display: grid;
    grid-template-columns: 3fr 1.1fr;
    gap: 40px;
    align-items: flex-start;
}

.main-product-info {
    min-width: 0;
}

/* NEW: Pricing sidebar */
.pricing-sidebar {
    position: sticky;
    top: 20px;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    background-color: #f8f9fa;
}

.pricing-sidebar h3 {
    margin-top: 0;
    font-size: 22px;
    color: #1a237e;
    margin-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 10px;
}

/* Pricing Table */
.price-table {
    width: 100%;
    margin-top: 0;
    border-collapse: collapse;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    overflow: hidden;
    font-size: 16px;
}

.price-table th, .price-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #dee2e6;
}

.price-table th {
    background-color: #e9ecef;
    color: #333;
    font-weight: bold;
}

.price-table tbody tr:last-child td {
    border-bottom: none;
}

.price-table tbody tr:hover {
    background-color: #f1f3f5;
}

/* Bulk Order Button */
.bulk-order-btn {
    display: inline-block;
    background-color: #0d47a1;
    color: #fff;
    border: none;
    border-radius: 5px;
    padding: 12px 25px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    margin-top: 20px;
    width: 100%;
    box-sizing: border-box;
    text-align: center;
    transition: background-color 0.3s ease;
}
/* Add this to make disabled buttons look inactive */
.bulk-order-btn:disabled,
.bulk-order-btn:disabled:hover {
    background-color: #cccccc;
    cursor: not-allowed;
    opacity: 0.7;
}
.bulk-order-btn:hover {
    background-color: #1a237e;
}

/* Modal for Bulk Order Form */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 1001;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background-color: #fff;
    padding: 30px;
    border-radius: 10px;
    width: 90%;
    max-width: 550px;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.modal-header h3 {
    margin: 0;
    font-size: 24px;
    color: #1a237e;
}

.modal-close-btn {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #555;
}

.modal-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.modal-form input, .modal-form textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 16px;
}

.modal-form textarea {
    resize: vertical;
    min-height: 100px;
}

.modal-form input#modal-product-name {
    background-color: #f1f3f5;
    font-weight: bold;
}

.modal-form button {
    padding: 12px;
    background-color: #0d47a1;
    color: #fff;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s;
}

.modal-form button:hover {
    background-color: #0b3c8a;
}


/* Responsive Materials Styles */
@media (max-width: 992px) {
    .materials-layout-container {
        flex-direction: column;
    }
    .materials-sidebar {
        flex-basis: auto;
        width: 100%;
        position: static;
    }
    .detail-content-layout {
        grid-template-columns: 1fr;
    }
    .pricing-sidebar {
        position: static;
        margin-top: 30px;
    }
}