/* Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* CSS Variables */
:root {
    --primary-color: #00ACED;
    --secondary-color: #FB6806;
    --dark-blue: #002936;
    --light-text: #fff;
    --dark-text: #595959;
    --body-bg: #fff;
    --link-color: #00ACED;
    --product-info-color: #006989;
    --container-max-width: 1200px;
    --container-padding: 0 20px;
    --font-family-default: 'Open Sans', sans-serif; /* Added sans-serif fallback */
}

body {
    font-family: var(--font-family-default);
    line-height: 1.6;
    background-color: var(--body-bg);
    color: var(--dark-text); /* Default text color */
}

/* Reusable Container */
.container {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: var(--container-padding);
}

/* Open Sans Fonts (keeping original structure for now) */
@font-face {
    font-family: 'Open Sans';
    src: url('fonts/open-sans-latin-300-normal.woff2') format('woff2'),
         url('fonts/open-sans-latin-300-normal.woff') format('woff');
    font-weight: normal; /* Corresponds to 300 */
    font-style: normal;
}

@font-face {
    font-family: 'Open Sans';
    src: url('fonts/open-sans-latin-500-normal.woff2') format('woff2'),
         url('fonts/open-sans-latin-500-normal.woff') format('woff');
    font-weight: 500;
    font-style: normal;
}

@font-face {
    font-family: 'Open Sans';
    src: url('fonts/open-sans-latin-700-normal.woff2') format('woff2'),
         url('fonts/open-sans-latin-700-normal.woff') format('woff');
    font-weight: bold; /* Corresponds to 700 */
    font-style: normal;
}

/* Header */
header {
    background-color: var(--primary-color);
    color: var(--light-text);
    padding: 10px 0;
}

.navcontainer-wrapper { /* New wrapper for header background */
    background-color: var(--primary-color);
}

.navcontainer {
    /* max-width: 1200px; margin: 0 auto; padding: 0 20px; -> Moved to .container */
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: var(--container-padding);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    width: 65%; /* This might need adjustment if .container padding affects it */
}

.logo img {
    width: 150px; /* Adjust as needed */
    display: block; /* Prevents bottom space */
}

/* Navigation */
#mainNav ul {
    list-style: none;
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

#mainNav ul li a {
    color: var(--light-text);
    text-decoration: none;
    font-size: 1rem;
}

/* Hamburger Menu */
.hamburger-toggle {
    display: none; /* Hidden checkbox */
}

.hamburger-menu {
    display: none;
    font-size: 25px;
    color: var(--light-text);
    cursor: pointer;
}

.hamburger-menu i {
    transition: opacity 0.3s ease; /* Smooth transition for icon changes */
}

.hamburger-menu .fa-bars {
    opacity: 1;
}

.hamburger-menu .fa-times {
    opacity: 0;
}

.hamburger-toggle:checked + .hamburger-menu .fa-bars {
    opacity: 0;
}

.hamburger-toggle:checked + .hamburger-menu .fa-times {
    opacity: 1;
    margin-left: -18px; /* Kept for now, review if problematic */
}

#mainNav ul li hr, .mobile-nav-hr {
    border: none;
    height: 1px;
    background-color: #cecece; /* Consider making this a variable if used elsewhere */
    margin: 5px 0;
    display: none; /* Hide by default, shown in media query */
}

.login-link {
    display: none;
}

/* Hide login in main nav on desktop */
.user-actions .login-action {
    display: block; /* Show in user actions */
}

#mainNav ul li a[href="login.php"] {
    display: none; /* Hide in main nav */
}

/* User Actions */
.user-actions {
    display: flex;
    gap: 20px;
    align-items: center;
}

.user-actions a {
    color: var(--light-text);
    text-decoration: none;
    display: flex;
    align-items: center;
}

.user-actions i {
    margin-right: 5px;
}

.user-actions > .item-count {
    background-color: #0696cb; /* Consider var(--primary-darker) or similar */
    border-radius: 20px;
    padding: 6px 20px;
    font-size: 0.9rem;
    margin-left: 15px;
}

/* Search */
.search-form {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: -60px; /* Review this for robustness */
    margin-bottom: 30px;
}

.search-form input {
    padding: 10px 10px;
    border-radius: 20px;
    width: 220px;
    border: 1px solid #ccc; /* Added border for better visibility */
}

.search-form button {
    background-color: var(--dark-blue);
    color: var(--light-text);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

/* Main Navigation (Product Categories) */
.main-nav {
    background-color: var(--dark-blue);
    margin: 20px auto 50px auto;
    border-radius: 100px 0 0 100px;
    color: var(--light-text);
    padding: 10px 0; /* Padding inside the dark background */
}

.main-nav ul {
    list-style: none;
    display: flex;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    padding: 0 20px; /* Inner padding for links */
}

.main-nav ul li {
    flex: 1 1 auto;
    text-align: center;
}

.main-nav ul li a {
    color: var(--light-text);
    text-decoration: none;
    padding: 10px 15px;
    display: block;
    border-radius: 5px;
    transition: background-color 0.3s ease;
}

.main-nav ul li a.active,
.main-nav ul li a:target {
    background-color: var(--primary-color);
    border-radius: 30px 0 0 30px;
}

.main-nav ul li a:hover {
    background-color: #52c7f1; /* Lighter shade of primary, consider a variable */
    border-radius: 30px 0 0 30px;
}

/* Slideshow */
.slideshow {
    margin-top: 20px;
}

/* .slideshow .container -> uses global .container */

.slideshow img {
    width: 100%;
    height: auto;
    display: block; /* Prevents bottom space */
}

/* Overlay (if used, currently not in HTML) */
.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.overlay h2 {
    color: var(--light-text);
    margin-bottom: 20px;
}

.overlay button {
    background-color: var(--primary-color);
    color: var(--light-text);
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
}

/* Featured Products */
.featured-products {
    margin-top: 20px;
}

/* .featured-products .container -> uses global .container */

.featured-products h3 {
    font-weight: 300; /* Was normal, then 300. Let's stick to 300 */
    background-color: var(--secondary-color);
    border-radius: 30px 0 0 30px;
    color: var(--light-text);
    padding: 2px 20px;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.product {
    border: 1px solid #ddd;
    padding: 10px;
    text-align: center;
}

.product img {
    width: 100%;
    height: auto;
    display: block; /* Prevents bottom space */
    margin-bottom: 10px; /* Add some space below image */
}

.product p {
    margin: 10px 0;
}

.normal-price {
    font-size: 24px;
    color: var(--dark-text);
    font-weight: 500;
}

.current-price {
    font-size: 1.4em;
    color: var(--secondary-color);
    font-weight: 500;
}

.was-text {
    font-size: 0.7em;
    color: var(--dark-text);
    text-transform: uppercase;
    font-weight: 500;
}

.old-price {
    font-size: 1em;
    color: var(--dark-text);
    font-weight: 500;
}

.info {
    padding-left: 20px;
    padding-right: 20px;
    color: var(--product-info-color);
    font-weight: 500;
}

/* Brands and Partnerships */
.brands-partnerships {
    margin-top: 20px;
    text-align: left;
}

/* .brands-partnerships .container -> uses global .container */

.brands-partnerships h3 {
    font-weight: 300; /* Was normal, consistent with featured-products h3 */
    background-color: var(--secondary-color);
    border-radius: 30px 0 0 30px;
    color: var(--light-text);
    padding: 2px 20px;
    margin-bottom: 25px;
}

.brands-partnerships .content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    flex-wrap: wrap;
}

.brands-partnerships .text {
    max-width: 40%;
}

.brands-partnerships .text p a {
    color: var(--link-color);
    text-decoration: none;
}

.brands-partnerships .text p a:hover {
    text-decoration: underline;
}

.brand-logos {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    background-color: var(--dark-blue);
    border-radius: 70px 0 0 70px;
    padding: 10px;
    margin-left: auto;
    margin-top: -5px;
    margin-bottom: 15px;
    width: fit-content;
}

.brand-logos img {
    height: auto;
    min-width: 50px;
    max-width: 100px;
    display: block; /* Prevents bottom space */
}

/* Footer */
footer { /* New wrapper for background color */
    background-color: var(--primary-color);
    color: var(--light-text);
}

/* .footer-container -> uses global .container */
.footer-container {
    max-width: 1200px; /* Standardized width */
    margin: 0 auto;
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.footer-section {
    flex: 1;
    padding: 20px; 
}

.footer-section.product-categories {
    background-color: var(--secondary-color);
}

.footer-section h2 {
    margin-bottom: 10px;
    font-weight: 300; /* Was normal */
    font-size: 1.5em; /* Adjust size as needed */
}

.footer-section ul {
    list-style: none;
    padding-left: 20px;
}

.footer-section ul li {
    margin-bottom: 5px;
    position: relative;
}

.footer-section ul li::before {
    content: "";
    display: inline-block;
    width: 8px;
    height: 8px;
    background-color: var(--dark-text); /* Changed from #595959 */
    border-radius: 2px;
    margin-right: 10px;
    position: absolute;
    left: -20px;
    top: 50%;
    transform: translateY(-50%);
}

.footer-section ul li a {
    color: var(--light-text);
    text-decoration: none;
    font-size: 1rem;
    line-height: 1.6;
}

.footer-section ul li a:hover {
    text-decoration: underline;
}

.social-icons a {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--light-text);
}

.social-icons i {
    font-size: 24px;
    margin-top: 30px;
    margin-bottom: 30px;
    border: 1px solid var(--light-text);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: var(--primary-color);
    color: var(--light-text);
    transition: color 0.3s ease, background-color 0.3s ease;
    transform: scale(2.0); /* Kept for now, review visual impact */
}

.social-icons i:hover {
    background-color: var(--light-text);
    color: var(--primary-color);
}

.social-icons {
    display: flex;
    gap: 50px;
}

/* Copyright Section */
.copyright {
    text-align: center;
    padding: 20px 75px;
    background-color: var(--body-bg);
    color: var(--dark-text);
    font-size: 0.9rem;
    line-height: 2.0;
}

@media (max-width: 460px) {
    .product-grid {
        grid-template-columns: repeat(2, 1fr); /* Display 2 columns per row */
        gap: 10px; /* Adjust spacing between items */
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .search-form {
        flex-direction: row;
        order: 2;
        width: 100%;
        margin-top: 20px; /* Adjusted from -45px, needs testing */
        margin-bottom: 20px;
        justify-content: center;
    }

    .logo {
        order: 1;
        width: 100%;
        margin-top: 0; /* Adjusted */
        margin-bottom: 10px; /* Adjusted */
        text-align: center;
    }
    
    .navcontainer {
        /* flex-direction: column; */ /* Original behavior */
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        position: relative;
        padding: 0 10px; /* Added padding for spacing from edges */
    }

    #mainNav ul li hr, .mobile-nav-hr {
        display: block;
        width: 100%; /* Make it full width of the li or nav */
    }

    .login-link {
        display: block;
    }

    .user-actions .login-action {
        display: none; /* Hide in user actions */
    }
    
    #mainNav ul li a[href="login.php"] {
        display: flex; /* Show in mobile menu */
    }

    #mainNav {
        display: none;
        flex-direction: column;
        background-color: var(--primary-color);
        position: absolute;
        top: 60px; /* Adjust based on actual header height */
        left: 0;
        width: 100%;
        padding: 10px 20px;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
        z-index: 1000; /* Ensure it's on top */
    }

    .hamburger-menu {
        display: block;
        /* position: absolute; Removed */
        /* top: 20px; Removed */
        /* right: 20px; Removed */
        z-index: 1001; /* Ensures it's clickable above other elements if needed */
        /* Now positioned by flex layout of .navcontainer */
    }
    
    .hamburger-toggle:checked ~ #mainNav {
        display: flex;
    }

    #mainNav ul {
        flex-direction: column;
        gap: 10px;
        width: 100%;
    }

    #mainNav ul li a::before {
    font-family: "Font Awesome 5 Free";
    content: "\f023"; /* Default to login icon */
    margin-right: 10px;
    font-weight: 900;
}

/* Specific icons for each position - now shifted by 1 */
#mainNav ul li:nth-child(1) a::before { content: "\f023"; } /* Login (lock icon) */
#mainNav ul li:nth-child(2) a::before { content: "\f015"; } /* Home */
#mainNav ul li:nth-child(3) a::before { content: "\f05a"; } /* About */
#mainNav ul li:nth-child(4) a::before { content: "\f0e0"; } /* Contact */
#mainNav ul li:nth-child(5) a::before { content: "\f07a"; } /* Products */

/* Keep this for any login links with class */
#mainNav ul li.login-link a::before { content: "\f023"; }

.main-nav-wrapper {
    border-radius: 0;
    margin-top: 20px;
    margin-bottom: 30px;
}

    .main-nav ul {
        justify-content: center;
    }

    .main-nav ul li a.active,
    .main-nav ul li a:target,
    .main-nav ul li a:hover {
        border-radius: 0; /* Full width hover/active on mobile */
        border-radius: 30px 0 0 30px;
    }

    .brands-partnerships .text {
        max-width: 100%;
        text-align: center;
    }

    .brand-logos {
        border-radius: 0; /* Full width on mobile */
        justify-content: space-around;
        width: 100%;
        margin-left: 0;
    }

    .footer-section {
        flex-basis: 100%;
        
    }

    .product-categories {
        display: inline;
        /* display: none; not showing this section */
    }

    .footer-section ul {
        padding-left: 20px;
        display: inline-block; /* Allow centering of block */
        text-align: left; /* Align text left within the centered block */
    }
    .footer-section ul li::before {
        left: -20px; /* Keep icon position relative to text */
    }

    .footer-container {
        padding: 0 20px;
        gap: 10px;
    }

    .social-icons {
        justify-content: center;
    }
}

@media (max-width: 992px) {
    .footer-section {
       /*  flex-basis: calc(50% - 10px); Adjust for gap */
        gap: 20px;
    }
    .brands-partnerships .text {
        max-width: 100%; /* Allow text to take full width before stacking */
        margin-bottom: 20px;
    }
    .brand-logos {
        border-radius: 70px 0 0 70px;
        width: 100%;
        margin-left: 0;
        justify-content: space-around;
    }
}

/* Database */

.main-content {
    background-color:  #0ab3ec38;
    padding: 20px;
    max-width: 1200px;
    margin: 20px auto;
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    padding: 10px;
    flex-direction: column;
    align-items: center;
}

.site-header {
    padding: 10px 10px 20px;
    border-bottom: 1px solid #4fd0ffe3;
}
.service-list dt {
    margin: 2em 0 0.5em;
    border-bottom: 1px solid #ccc;
    font-weight: bold;
}

.service-list dd {
    margin-left: 1em;
}

.section-bar h3 {
    font-weight: 300;
    background-color: var(--secondary-color);
    border-radius: 30px 0 0 30px;
    color: var(--light-text);
    padding: 2px 20px;
}

form fieldset {
    border: 1px solid #999;
    border-radius: 5px;
    padding: 1em;
}

.form-row {
    margin: 0.5em 0;
}

input, button, select, textarea {
    font-size: 1em;
}

button {
    display: inline-block;
    padding: 0.4em 0.8em;
    border: none;
    border-radius: 5px;
    background-color: #00aced;
    color: white;
}
.contact-form {
    color: #030303;
    width: 320px;
    margin: 0 auto;
  }
  
  .contact-form input, textarea {
    width: 96%;
    padding: 8px 2%;
    border-radius: 4px;
    border: none;
    background-color: #afe4f7;
    margin-top: 4px;
  }
  
  .contact-form textarea {
    min-height: 120px;
  }
  
  .contact-form button {
    font-size: 16px;
    color: #fff;
    background-color: #00ACED;
    padding: 10px 16px;
    border-radius: 4px;
    border: none;
    display: block;
    margin: 0 auto;
    cursor: pointer;
    box-shadow: 0px 3px #0476a0;
  }
  
  .contact-form button:hover {
    background-color: #67c6e9;
  }


/* Message styling */

.error-summary {
    margin: 1em 0;
    padding: 0.5em;
    border: 1px solid #8f080874;
    border-radius: 5px;
    color: #8f0808;
    background-color: #8f080827;
    font-style: italic;
}

.error-message {
    color: #8f0808;
    font-style: italic;
}

.success-message {
    color: #088f08;
    font-style: italic;
}


/* Product list */

.product-list {
    list-style-type: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    flex-direction: row;
    gap: 20px 10px;
}

.product-list > * {
    flex-basis: 200px;
}


/* Product cards */


.product {
    display: flex;
    flex-direction: column;
    justify-content: stretch;
    border: 1px solid #ccc;
    border-radius: 5px;
}

.product__link {
    flex-grow: 1;
    padding: 0.5em;
    text-decoration: none;
    color: inherit;
}

.product__link:hover {
    text-decoration: none;
    background-color: #00aced22;
    color: inherit;
}

/* Product details */
.product-table h3 {
    font-weight: 300; /* Was normal, consistent with featured-products h3 */
    background-color: var(--secondary-color);
    border-radius: 30px 0 0 30px;
    color: var(--light-text);
    padding: 2px 20px;
    margin-bottom: 25px;

}
.product-table {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 20px 20px 0 20px;
    font-size: 1em;
    border-radius: 5px;
}
table.product-details :is(th, td) {
  padding: 0.3em 0.6em;
}
td > img {
    max-width: 300px;
    max-height: 300px;
    margin: 0 auto;
    display: block;
}

table.product-details th {
  text-align: left;
  font-weight: normal;
  background-color: #ff690c;
  color: white;
}

.product >a {
   max-width: 300px;
    max-height: 400px;
    margin: 0 auto;
    display: block;
}

.container h3 {
    font-weight: 300; 
    background-color: var(--secondary-color);
    border-radius: 30px 0 0 30px;
    color: var(--light-text);
    padding: 2px 20px;
    margin-bottom: 25px;
    margin-top: 20px;
}
.about-list dt {
    margin: 2em 0 0.5em;
    border-bottom: 1px solid #ccc;
    font-weight: bold;
}

.about-list dd {
     margin-left: 1em;
}

.contact-summary {
    margin: 1em 1em;
    padding: 0.5em;
}

.edit {
    padding: 10px 30px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    background-color: #f9f9f9;
    position: relative;
    z-index: 1;
    background-color: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border-radius: 5px;
    margin: 10px auto 10px;

}

