/* ============================================
   GLOBAL STYLES - MOBILE RESPONSIVE
   Shared across all pages
   ============================================ */

* {
    overflow-wrap: anywhere;
}

html, body{
    max-width: 100vw;
}

h2, p, label, input {
    font-family: "Montserrat", sans-serif;
    font-optical-sizing: auto;
    font-weight: 450;
    font-style: normal;
}

h1, h2, p, label {
    color: #0B3B4B;
}

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    background-color: #EEEE;
    flex: 1;
    max-width: 100vw;
}

/* ============================================
   HEADER & FOOTER BASE STYLES
   ============================================ */
   
header{
    position: relative;
    width: 100%;
    max-width: 100vw;
    height: auto;
    min-height: 75px;
    background-color: white;
    overflow-x: visible;
    box-sizing: border-box;
}

footer{ 
    width: 100%;
    max-width: 100vw;
    height: 75px;
    background-color: white;
    overflow-x: visible;
    box-sizing: border-box;
}


.blue-bar {
    background-color: #0b3b4b;
    height: 10px;
    width: 100%;
    max-width: 100vw;
    padding: 0;
    margin: 0;
}

.large-yellow-bar {
    background-color: #fed06f;
    height: 10px;
    width: 100%;
    max-width: 100vw;
    padding: 0;
    margin: 0;
    flex-shrink: 0;
}

header > div {
    position: relative;
    height: auto;
    display: flex;
    flex-direction: column;
}

footer > div {
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 0;
}

/* ============================================
   HEADER CONTENT
   ============================================ */

#header-content {
    display: flex;
    justify-content: space-between;
    min-height: 65px;
    /* position: relative;     */
    align-items: center;
    padding-inline: 12px;
    box-sizing: border-box;
    flex: 1;
    width: 100%;
    max-width: 100%;
}

#menu {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    margin-right: 0px;
    gap: 30px;

}

#menu > * {
    margin: 0; /* ✅ ADD THIS - no individual margins */
}

header p {
    cursor: pointer;
    font-size: 24px;
    text-decoration-line: underline;
}

header p:hover {
    text-shadow: 1px 0 0 currentColor;
}

header img {
    object-fit: contain;
    flex-shrink: 0;
    width: 50px;
    height: 50px;
    cursor: pointer;
    vertical-align: middle;
}

header #menu .shopping-cart:hover {
    cursor: pointer;
}

.home-button {
    width: 160px;
    height: 50px;
    margin-left: 0px;
    margin-right: 0;
    vertical-align: middle;

}

/* ============================================
   FOOTER CONTENT
   ============================================ */

#footer-content {
    display: grid;
    grid-template-columns: auto max-content max-content max-content;
    grid-template-rows: auto;
    flex: 1;
    align-items: center;
    background-color: white;
}

footer a, footer .home-button {
    margin: 0 25px;
}

footer p {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    margin: 0;
    text-align: center;
    font-size: 16px;
}

footer img {
    object-fit: cover;
    width: 40px;
    height: 40px;
    cursor: pointer;
    vertical-align: middle;
}

footer a {
    text-decoration: none;
    border: none;
}

/* ============================================
   DROPDOWN MENU (Mobile Navigation)
   ============================================ */

#menu-toggle {
    display: none;
}

#menu .shopping-cart {
    flex: 0 0 50px;
    display: flex;
    justify-content: center;
}

#dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    width: 100vw;
    max-width: 100vw;
    background-color: white;
    z-index: 100;
    padding: 10px 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    flex-direction: column;
    align-items: center;
}

#dropdown-menu .login 
#dropdown-menu .profile{
    display: none !important;
}

#dropdown-menu * {
    padding: 15px 20px;  /* ✅ Vertical centering */
    margin: 0;
    text-align: center;
    cursor: pointer;
    font-size: 24px;
    text-decoration-line: underline;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60px;
}

#dropdown-menu *:hover {
    background-color: #f5f5f5;  /* ✅ Hover effect */
}

#dropdown-menu.open{
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* ============================================
   RESPONSIVE DESIGN - MOBILE OPTIMIZED
   ============================================ */

/* Tablets & Small Desktops (max-width: 980px) */
/* Force iPad + Tablets to use mobile dropdown */
@media (max-width: 1024px) {

    /* Show mobile toggle */
    #menu-toggle {
        display: flex;
        align-items: center;
        height: 50px;
    }

    /* Hide desktop nav items */
    #menu .product-page,
    #menu .about-us,
    #menu .shopping-cart,
    #menu .profile,
    #menu .login {
        display: none !important;
    }

    /* Header layout stays clean */
    #header-content {
        display: flex;
        align-items: center;
        justify-content: space-between;
    }

    #menu {
        display: flex;
        align-items: center;
        gap: 20px;
    }

    /* Dropdown menu positioning */
    #dropdown-menu {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        width: 100vw;
        max-width: 100vw;
    }
}

/* Small Tablets & Large Phones (max-width: 768px) */
@media (max-width: 768px) {
    /* Smaller logo */
    .home-button {
        width: 140px;
        height: 45px;
        margin-left: 15px;
    }

    /* Smaller header images */
    header img {
        width: 45px;
        height: 45px;
    }

    /* Smaller text */
    header p {
        font-size: 20px;
    }

    #header-content{
        display: flex;
        align-items: center;
         
    }

    /* Adjust menu spacing */
    #menu {
        display: flex;
        align-items: center;
        margin-right: 15px;
        gap: 15px;
    }

    /* Dropdown adjustments */
    #dropdown-menu * {
        font-size: 20px;
        padding: 12px 16px;
        min-height: 54px;
    }

    /* Footer adjustments */
    footer {
        height: auto;
        min-height: 120px;
        padding: 0;
    }

    #footer-content {
        display: flex;
        flex-direction: column;
        justify-content: center;
        gap: 10px;
    }

    footer p {
        position: static;
        transform: none;
        margin: 10px 0;
    }

    footer a, footer .home-button {
        margin: 5px 12px;
    }

    footer .home-button {
        width: 120px;
        height: 40px;
    }

    footer img {
        width: 35px;
        height: 35px;
    }
}

/* Mobile Phones (max-width: 710px) */
@media (max-width: 710px) {

    #header-content{
        display: flex;
        align-items: center;
    }

    #menu{
        display: flex;
        align-items: center;
    }


    footer {
        height: 165px;
    }
    
    #footer-content {
        display: flex;
        flex-direction: column;
        justify-content: space-evenly;
    }

    footer p {
        position: static;
        text-align: center;
        transform: translateX(0%);
        margin: 10px 0;
    }
}

/* Small Mobile Phones (max-width: 600px) */
@media (max-width: 600px) {
    #header-content{
        padding-inline: 10px;
        display: flex;
        align-items: center;
    }

    
    /* Smaller logo */
    .home-button {
        width: 100px;
        height: 38px;
        margin-left: 15px; /* Slightly bigger than 6px */
    }

    /* Smaller header images */
    header img {
        width: 38px;
        height: 38px;
    }

    /* Smaller text */
    header p {
        font-size: 17px;
    }

    /* Adjust menu spacing */
    #menu {
        display: flex;
        align-items: center;
        margin-right: 15px; /* Slightly bigger than 6px */
        gap: 10px;
    }

    /* Dropdown adjustments */
    #dropdown-menu * {
        font-size: 18px;
        padding: 12px 16px;
        min-height: 52px;
    }

    /* Footer adjustments */
    footer {
        overflow-x: hidden;
        max-width: 100vw;
    }

    footer p {
        font-size: 13px;
    }

    footer img {
        width: 30px;
        height: 30px;
    }
}

/* Extra Small Phones (max-width: 480px) */
@media (max-width: 480px) {
    /* Smaller logo */
    .home-button {
        width: 85px;
        height: 32px;
        margin-left: 12px; /* Slightly bigger than 5px */
        border: #fed06f;
        border-radius: 12px;
    }


    /* Smaller header images */
    header img {
        width: 32px;
        height: 32px;
    }

    /* Smaller text */
    header p {
        font-size: 15px;
    }

    /* Adjust menu spacing */
    #menu {
        margin-right: 12px; /* Slightly bigger than 5px */
        gap: 8px;
    }

    /* Remove hover effect on small screens */
    header #menu .shopping-cart:hover {
        width: 32px;
        height: 32px;
    }


    #dropdown-menu * {
        font-size: 17px;
        padding: 10px 14px;
        min-height: 48px;
    }

    /* Footer adjustments */
    footer {
        height: auto;
        min-height: 140px;
        padding: 0;
        max-width: 100vw;
        overflow-x: hidden;
    }

    footer p {
        font-size: 11px;
        margin: 8px 0;
    }

    footer .home-button {
        width: 85px;
        height: 32px;
    }

    footer img {
        width: 26px;
        height: 26px;
    }

    footer a, footer .home-button {
        margin: 4px 5px;
    }
}

/* Extra Extra Small Phones (max-width: 375px) - iPhone SE */
@media (max-width: 375px) {
    /* Smaller logo */
    .home-button {
        width: 70px;
        height: 26px;
        margin-left: 10px; /* Keep slightly bigger */
    }

    /* Smaller header images */
    header img {
        width: 28px;
        height: 28px;
    }

    /* Smaller text */
    header p {
        font-size: 13px;
    }

    /* Adjust menu spacing */
    #menu {
        margin-right: 10px; /* Keep slightly bigger */
        gap: 8px;
    }

    #menu-toggle {
        font-size: 13px;
    }

    /* Dropdown adjustments */
    #dropdown-menu {
        width: 100vw;
        max-width: 100vw;
        left: 0;
        right: 0;
    }

    #dropdown-menu * {
        font-size: 15px;
        padding: 10px 12px;
        min-height: 44px;
    }

    /* Footer adjustments */
    footer {
        max-width: 100vw;
        overflow-x: hidden;
    }

    footer p {
        font-size: 10px;
    }

    footer img {
        width: 22px;
        height: 22px;
    }

    footer a, footer .home-button {
        margin: 3px 3px;
    }

    footer .home-button {
        width: 70px;
        height: 26px;
    }
}

/* Touch-friendly improvements */
@media (hover: none) and (pointer: coarse) {
    header p, #dropdown-menu p {
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    header p:hover {
        text-shadow: none;
    }

    header #menu .shopping-cart:hover {
        width: 50px;
        height: 50px;
        transform: none;
    }
    
    #dropdown-menu * {
        min-height: 48px;
        padding: 12px 16px;
    }
}

/* Landscape orientation on phones */
@media (max-height: 500px) and (orientation: landscape) {
    header, footer {
        height: 60px;
    }

    #dropdown-menu {
        top: 60px;
        max-height: calc(100vh - 60px);
        overflow-y: auto;
    }

    footer {
        min-height: 60px;
        height: auto;
    }
}
