@import url('https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,600;1,600&display=swap');

body {
    margin: 0;
    padding: 0;
    background-color: #f4f4f4;
    font-family: Arial, sans-serif;
    overflow-x: hidden;
}

h1 {
    text-align: center;
    margin-top: 20px;
    font-size: 35px;
    font-weight: bold;
    color: #333;
}

/* Category Section */
.category {
    font-weight: bold;
    font-size: 1.5em;
    margin: 20px 0 0;
    text-align: left;
    padding: 10px 35px;
    color: #007bff;
    background-color: #fff;
    box-shadow: 0px 2px 8px #888;
}

/* Product Grid */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
    gap: 20px;
    padding: 25px 35px;
    justify-content: center;
}

/* Product Box */
.product-box {
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    text-align: center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.product-box:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

/* Product Image */
.product-image {
    width: 100%;
    height: 200px;
    object-fit: contain;
    border-bottom: 1px solid #ddd;
}

.product-image img {
    width: 100%;
    height: 100%;
}

/* Product Information */
.product-info {
    box-sizing: border-box;
    height: 130px;
    padding: 5px 20px 10px;
}

.product-name {
    font-size: 1.2em;
    font-weight: bold;
    color: #333;
    margin-top: 10px;
    height: 90px;
}

.product-model {
    font-size: 1em;
    color: #888;
    margin-top: 10px;
}

/* No Products Message */
.no-products {
    text-align: center;
    font-size: 20px;
    color: #555;
    padding: 20px;
}

/* View More Button */
.view-more-btn {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 10px 20px;
    cursor: pointer;
    border-radius: 4px;
    margin: 10px 0;
    font-size: 1em;
    transition: background-color 0.3s ease;
}

.view-more-btn:hover {
    background-color: #0056b3;
}

#viewCatalogBtn, #downloadCatalogBtn, #viewTenderBtn {
    padding: 12px 20px;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    color: #333;
    background-color: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
    z-index: 999;
    overflow-y: auto;
}

.modal-content {
    background-color: #fff;
    padding: 20px;
    position: relative;

    margin: auto;          /* ✅ let flexbox handle centering */
    border-radius: 8px;
    width: 800px;

    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}


/* Modal Body */
.modal-body {
    text-align: center;
    padding: 10px;
    width: 100%;
}

.modal-body h2 {
    font-weight: bolder;
    font-size: 28px;
    color: #444;
    margin-bottom: 10px;
    line-height: 1.4;
}

.modal-body p {
    margin: 8px 0;
    font-size: 16px;
    color: #666;
}

#productDescription {
    text-align: justify;
    margin-top: 10px;
}

.modal-body .span {
    display: block;
    margin: 5px 0;
    font-size: 20px;
    color: #555;
}

hr {
    margin: 10px 0;

}

.model-img {
    width: auto;
    height: 300px;
    margin-top: 20px;
    display: flex;
    /* Flexbox to align the content */
    justify-content: center;
    /* Center the image horizontally */
    align-items: center;
    /* Center the image vertically */
    overflow: hidden;
    /* Ensure no content overflows the container */
    text-align: center;
    background-color: #f9f9f9;
    /* Optional: Background color for contrast */
}

.modal-body img {
    max-width: 100%;
    /* Ensure the image does not exceed the div's width */
    max-height: 100%;
    /* Ensure the image does not exceed the div's height */
    object-fit: contain;
    /* Contain the image within the div */
    margin: auto;
    /* Center the image inside the div */
}

/* Modal Footer */
.modal-footer {
   display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
    text-align: center;
}

.modal-footer:has(.loginMsg) {
    flex-direction: column;
}

.modal-footer .view-more-btn {
    padding: 10px 20px;
    font-size: 14px;
    border: none;
    cursor: pointer;
    background-color: #007BFF;
    color: white;
    border-radius: 5px;
    transition: background-color 0.3s ease;
}

.modal-footer .view-more-btn:hover {
    background-color: #0056b3;
}

.modal-footer .loginMsg {
    font-size: 14px;
    color: #666;
    margin-top: 10px;
}

.modal-footer .loginMsg a {
    color: #007BFF;
    text-decoration: none;
    font-weight: bold;
}

.modal-footer .loginMsg a:hover {
    text-decoration: underline;
}

/* Conditional layout */
.modal-footer {
    flex-wrap: wrap;
}

.modal-footer>*:only-child,
.modal-footer .loginMsg {
    flex: 1 0 100%;
    /* Ensure full width for center alignment */
    text-align: center;
}

/* Close Button in Modal */
.close {
    position: absolute;
    top: 5px;
    right: 5px;
    font-size: 45px;
    margin-right: 10px;
    font-weight: bold;
    cursor: pointer;
    color: #333;
    transition: color 0.3s ease;
}

.close:hover {
    color: red;
}


@media (max-width: 768px) {
    h1 {
        font-size: 25px;
    }

    .category {
        font-weight: bold;
        font-size: 14px;
        margin: 20px 0 0;
        text-align: left;
        padding: 5px 25px;
    }

    .no-products {
        text-align: center;
        font-size: 12px;
        color: #555;
        padding: 20px;
    }

    /* Product Image */
    .product-image {
        height: 150px;
    }

    .product-model {
        margin-top: 0;
    }

    .modal-content {
        width: 90%;
    }

    /* Modal Body */
    .modal-body {
        padding: 0;
    }

    .modal-body h2 {
        font-weight: bolder;
        font-size: 16px !important;
        color: #444;
        margin-bottom: 10px;
    }

    #productModel {
        margin: 8px 0;
        font-size: 12px;
        color: #666;
    }

    #productDescription {
        font-size: 14px;
        text-align: justify;
        margin-top: 10px;
    }

    .model-img {
        height: 150px;
    }

    /* Modal Footer */
    .modal-footer {
        padding: 10px 0;
    }

    .modal-footer .view-more-btn {
        padding: 5px 10px;
        font-size: 12px;
        margin: 0;
    }

    /* Close Button in Modal */
    .close {
        font-size: 30px;
    }
}

/* ===== GLOBAL ===== */
html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    background: #f4f4f4;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow-x: visible;
}

/* ================= DESKTOP ================= */
@media (min-width: 769px) {

    .page-container {
        display: flex;
        width: 100%;
        margin-top: 30px;
        align-items: flex-start;
        overflow: visible;
    }

    .sidebar {
        flex: 0 0 280px;
        background: #fff;
        border-right: 1px solid #ddd;

        position: sticky;
        top: 140px;

        height: fit-content;
        max-height: calc(100vh - 160px);
        overflow-y: auto;
        z-index: 100;
    }
    
    .categories-tbl table {
    width: 100%;
    border-collapse: collapse;
}

.categories-tbl th {
    background: #1f3c88;
    color: white;
    padding: 15px;
    text-align: left;
}

.categories-tbl td {
    border-bottom: 1px solid #eee;
}

.categories-tbl td a {
    display: block;
    padding: 12px 15px;
    text-decoration: none;
    color: #444;
    font-size: 14px;
    transition: background 0.2s;
}

.categories-tbl td a:hover {
    background: #f0f4ff;
    color: #1f3c88;
}

    .main-content {
        flex: 1;
        padding: 0 30px;
    }

    /* ❌ Hide mobile UI on desktop */
    .mobile-fab,
    .mobile-menu-overlay {
        display: none !important;
    }
}

/* ================= MOBILE ================= */
@media (max-width: 768px) {

    /* ❌ Hide sidebar on mobile */
    .sidebar {
        display: none;
    }

    .page-container {
        display: block;
        width: 100%;
    }

    .main-content {
        padding: 10px;
    }

    .category-header {
        background: #1f3c88;
        color: #fff;
        padding: 12px;
        font-size: 14px;
        margin-bottom: 15px;
        scroll-margin-top: 100px;
    }

    .product-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        margin-bottom: 40px;
    }

    .product-box {
        background: #fff;
        padding: 12px 8px;
        border: 1px solid #eee;
        border-radius: 4px;
        text-align: center;
    }

    .product-image {
        height: 120px;
        object-fit: contain;
    }

    .product-name {
        font-size: 11px;
        font-weight: 600;
        min-height: 30px;
    }

    /* ✅ SHOW MOBILE TOGGLE */
    .mobile-fab {
        display: block;
        position: fixed;
        bottom: 25px;
        right: 20px;
        background: #1f3c88;
        color: #fff;
        padding: 14px 22px;
        border-radius: 50px;
        font-weight: bold;
        border: none;
        z-index: 9999;
    }

    /* ✅ MOBILE MENU */
    .mobile-menu-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: #fff;
        z-index: 10000;
    }

    .mobile-menu-overlay.active {
        display: flex;
        flex-direction: column;
    }

    .mobile-menu-header {
        padding: 15px 20px;
        border-bottom: 1px solid #eee;
        display: flex;
        justify-content: space-between;
    }

    .close-btn {
        font-size: 40px;
        cursor: pointer;
    }

    .mobile-menu-body {
        flex: 1;
        overflow-y: auto;
        padding: 10px 20px;
    }

    .mobile-cat-link {
        display: block;
        padding: 18px 0;
        border-bottom: 1px solid #f5f5f5;
        text-decoration: none;
        color: #333;
    }
}

@media (min-width: 769px) {
    .main-content .category-header {
        background-color: #1f3c88 !important;
        color: #fff !important;
    }
}

/* ===== CATEGORY HEADER – MATCH EXAMPLE SIZE (DESKTOP) ===== */
@media (min-width: 769px) {
    .main-content .category-header {
        background-color: #1f3c88 !important;
        color: #fff !important;

        padding: 15px 25px;      /* ✅ same height */
        font-size: 16px;         /* ✅ same text size */
        font-weight: 700;
        text-transform: uppercase;

        border-radius: 4px;
        margin-bottom: 20px;

        scroll-margin-top: 110px;
    }
}

/* ===== SCROLL TO TOP BUTTON ===== */
#scrollTopBtn {
    position: fixed;
    bottom: 90px; /* sits above mobile FAB */
    right: 20px;

    background: #1f3c88;
    color: #fff;
    border: none;
    border-radius: 50%;

    width: 48px;
    height: 48px;
    font-size: 18px;
    font-weight: bold;

    cursor: pointer;
    display: none;
    z-index: 10001;

    box-shadow: 0 4px 10px rgba(0,0,0,0.25);
}

/* Desktop positioning */
@media (min-width: 769px) {
    #scrollTopBtn {
        bottom: 30px;
        right: 30px;
    }
}
