/* General Styles */
body {
    background-color: #1a1f2b;color: #c6d4df;
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
/* Header */
.header {
    display: flex;
    justify-content: space-between; /* Moves items to left and right */
    align-items: center;
    padding: 10px 20px;
    background-color: #1a1f2b;
    position: sticky;   /* Make it stick to the top */
    top: 0;
    z-index: 1001;
}

/* Ensures the logo stays on the left */
.logo {
    font-size: 36px;
    font-weight: bold;
    color: #66c0f4;
}
/* Desktop Navigation Bar */
.navbar-desktop {
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #1a1f2b;
    padding: 10px 0;
    position: sticky;
    top: 60px;
    z-index: 1000;
}

.navbar-desktop .nav-links {
    display: flex;
    justify-content: center;
    align-items: center;
}

.navbar-desktop a {
    color: #c6d4df;
    padding: 15px 20px;
    text-decoration: none;
    text-transform: uppercase;
    font-weight: bolder;
}

.navbar-desktop a:hover {
    color: #66c0f4;
    text-decoration: underline;
}

/* Dropdown Styles */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: #1a1f2b;
    min-width: 200px;
    box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2);
    z-index: 1;
    border-radius: 8px;
}

.dropdown-content a {
    color: #c6d4df;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
}

.dropdown-content a:hover {
    background-color: #3c4450;
}

.dropdown:hover .dropdown-content {
    display: block;
}

/* Dropdown Headings */
.dropdown-content div span {
    font-size: 18px;
    font-weight: bold;
    color: #66c0f4;
    display: block;
    margin-bottom: 10px;
}

/* Mobile Navigation Bar */
.navbar-mobile {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: #171a21;
    padding: 8px 0;
    z-index: 1000;
    box-shadow: 0px -2px 10px rgba(0, 0, 0, 0.5);
}

.navbar-mobile .nav-links {
    display: flex;
    justify-content: center; /* Center the links */
    align-items: center;
    gap: 10px; /* Add some space between the links */
    padding: 0 10px; /* Add padding to the sides */
}

.navbar-mobile a {
    color: #c6d4df;
    padding: 6px;
    text-decoration: none;
    text-transform: uppercase;
    font-size: 9px; /* Base font size for mobile */
    white-space: nowrap;
    flex: 1; /* Ensure equal spacing */
    text-align: center; /* Center text within each link */
    transition: color 0.3s ease;
}

.navbar-mobile a:hover {
    color: #66c0f4;
    text-decoration: underline;
}

/* Dropdown Styles for Mobile */
.navbar-mobile .dropdown {
    position: relative;
}

.navbar-mobile .dropdown-content {
    display: none;
    position: absolute;
    bottom: 100%;
    left: 50%; 
    transform: translateX(-50%); 
    background-color: #171a21;
    min-width: 160px; 
    box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2);
    z-index: 1001; /* Ensure it appears above the navbar */
    border-radius: 8px;
    padding: 8px; 
    max-width: 90vw; /* Ensure dropdown doesn't exceed viewport width */
    white-space: nowrap; 
}

.navbar-mobile .dropdown-content a {
    color: #c6d4df;
    padding: 8px 10px;
    text-decoration: none;
    display: block;
    font-size: 9px; /* Match the font size of the navbar links */
    white-space: nowrap;
}

.navbar-mobile .dropdown-content a:hover {
    background-color: #3c4450;
}

.navbar-mobile .dropdown:focus-within .dropdown-content {
    display: block; /* Show dropdown when focused */
}

.navbar-mobile .dropdown-divider {
    border-bottom: 1px solid #3c4450;
    margin: 5px 0;
}
/* Cart Message */
.cart-message {
    color: #ff4c4c;
    font-weight: bolder;
    margin-left: 10px;
    display: none;
}

/* Cart Button */
.cart-btn {
    background-color: #66c0f4;
    color: #171a21;
    border: none;
    padding: 10px 20px;
    cursor: pointer;
    font-size: 16px;
    text-decoration: none;
    font-weight: bolder;
    border-radius: 5px;
}

.cart-btn:hover {
    background-color: #4fa8d3;
}
/* Popup styles */
.popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    justify-content: center;
    align-items: center;
}

.popup-content {
    background: #1b2838;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    width: 300px;
    color: #c6d4df;
}

.popup-content h3 {
    margin-top: 0;
}

.popup-content input {
    width: 100%;
    padding: 5px;
    margin: 10px 0;
    text-align: center;
}

.popup-buttons {
    display: flex;
    justify-content: space-between;
}

.popup-buttons button {
    background-color: #66c0f4;
    color: #171a21;
    border: none;
    padding: 10px 20px;
    cursor: pointer;
    border-radius: 5px;
}

.popup-buttons button:hover {
    background-color: #4fa8d3;
}
/* Blur effect when popup is active */
body.popup-active .grid,
body.popup-active #producttopic {
    filter: blur(5px);
    pointer-events: none; 
    opacity: 0.4;
}

/* Ensure the popup itself is not blurred */
.popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}
#quantityWarning{
    color: red;
    font-size: 14px;
    display: none;
}

/* Close button */
.close-btn {
    color: #fff;
    background-color: #1b2838;
    font-size: 20px;
    cursor: pointer;
    float: right;
}

/* Product Grid */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 15px;
    margin-bottom: 40px;
}
#producttopic1, #producttopic2, #producttopic3, #producttopic4, #producttopic5 {
    color: #66c0f4;
    font-size: 28px;
    text-align: left;
    padding: 10px 20px;
}
/* Product Card */
.productcard {
    background-color: #1b2838;
    border: 1px solid #3c4450;
    border-radius: 8px;
    overflow: hidden;
    text-align: center;
    padding: 15px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.productcard:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.productcard img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 8px;
}

.productcard h3 {
    margin: 10px 0;
    font-size: 18px;
    color: #c6d4df;
}

.productcard p {
    font-size: 16px;
    margin-bottom: 10px;
    color: #ffffff;
}
.productBtns {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

/*"View Product" */
.viewproduct {
    display: inline-block;
    width: 80px;
    text-align: center;
    padding: 10px;
    background-color: #66c0f4;
    color: #171a21;
    border-radius: 5px;
    font-weight: bold;
    text-decoration: none;
    transition: background-color 0.3s ease;
}

.viewproduct:hover {
    background-color: black;
    color: #66c0f4;
}
/* Add to Cart button styling */
.addtocart {
    background-color: #66c0f4;
    color: black;
    padding: 10px;
    border-radius: 5px;
    font-weight: bold;
    border: none;
    cursor: pointer;
    margin-right: 8px;
    transition: background-color 0.3s ease;
}

.addtocart:hover {
    background-color: black;
    color: #66c0f4;
}


#backtotop {
    display: block;
    margin: 30px auto; /* Top & bottom spacing and horizontal centering */
    padding: 10px 20px;
    background-color: #66c0f4;
    color: #171a21;
    font-weight: bold;
    text-decoration: none;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s ease;
    width: 95px;
}

#backtotop:hover {
    background-color: black;
    color: #66c0f4;    
}

/* Footer */
.footer {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    background-color: #1b2838;
    padding: 20px;
    margin-top: 20px;
    flex-wrap: wrap;
    text-align: center;
}
.footer-logo-text {
    font-size: 28px;
    font-weight: bold;
    color: #66c0f4;
}
.footer-contact p {
    margin: 5px 0;
    color: #c6d4df;
    font-size: 14px;
}
.footer-links {
    text-align: left;
    margin: 10px 0;
}
.footer-links h3 {
    margin-bottom: 10px;
    color: #c6d4df;
    font-size: 16px;
}
.footer-links a {
    display: block;
    color: #ffffff;
    margin: 5px 0;
    text-decoration: none;
    font-size: 14px;
}
.footer-links a:hover {
    text-decoration: underline;
    color: #66c0f4;
}
.footer-social {
    text-align: center;
    margin-top: 10px;
}
.footer-social a {
    display: inline-block;
    margin-left: 10px;
}
.footer-social img {
    width: 30px;
    height: 30px;
}
/* Specific Responsive Support for Modern Devices */
@media screen and (max-width: 1024px) {
    .navbar-mobile {
        display: flex;
    }

    .navbar-desktop {
        display: none;
    }
}

/* Extra optimization for foldables and tablets in portrait */
@media screen and (max-width: 912px), screen and (max-height: 912px) {
    .grid {
        grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    }
}

@media screen and (max-width: 768px) {
    .grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }
}

@media screen and (max-width: 600px) {
    .grid {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    }
}

@media screen and (max-width: 480px) {
    .grid {
        grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    }
}

@media screen and (max-width: 414px) {
    .grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    }
}

@media screen and (max-width: 390px) {
    .grid {
        grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    }
}

@media screen and (max-width: 375px) {
    .grid {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    }
}

@media screen and (max-width: 360px) {
    .grid {
        grid-template-columns: repeat(auto-fit, minmax(95px, 1fr));
    }
}