/* ---------- Reset ---------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

ul {
    list-style: none;
}

a {
    text-decoration: none;
    color: inherit;
}

/* ---------- Base layout ---------- */
html, body {
    height: 100%;
    margin: 0;
    font-family: sans-serif;
    font-size: 0.9rem;
    background-color: #BCE5FF;
}

.container {
    display: flex;
    flex-direction: column;
    height: 100%;
}

header, footer {
    width: 100%;
    align-items: center;
    padding: 0.5rem;
    background-color: #BCE5FF;
}

header {
    display: flex;
    position: fixed;
    z-index: 20;
    justify-content: space-between;
    padding-top: 0;
    padding-bottom: 0;
}

main {
    z-index: 10;
    background-color: #FFF;
    flex: 1;
    overflow-y: auto;
}

footer {
    position: fixed;
    bottom: 0;
    z-index: 20;
    text-align: center;
}

/* ---------- Header contents ---------- */
.site-logo {
    height: 3rem;
    width: auto;
    max-width: 100%;
    flex-shrink: 0;
    display: block;
}

/* ---------- Main navigation ---------- */
.main-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#menu-toggle {
    display: none; /* Hidden on desktop */
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #000;
}

.menu-bar {
    display: flex;
}

.menu-bar li {
    position: relative;
}

.menu-bar > li > a, .dropdown-btn {
    display: block;
    padding: 5px;
    background-color: #BCE5FF;
    border: none;
    border-right: 1px solid rgba(156, 208, 234, 1);
    cursor: pointer;
    width: 100%;
    text-align: left;
    font-family: inherit;
    font-size: 0.9rem;
    line-height: normal;
    color: #000;
}

.menu-bar a:hover, .menu-bar button:hover, .menu-bar a:focus, .menu-bar button:focus {
    background-color: #9CD0EA;
}

/* Submenu */
.submenu {
    display: none; /* Hidden by default */
    position: absolute;
    top: 100%;
    left: 0;
    background-color: #BCE5FF;
    min-width: 140px;
    z-index: 100;
}

.submenu .submenu {
    top: 0;
    left: 100%;
}

/* Show submenu on hover for mouse users (desktop) */
.has-submenu:hover > .submenu,
.has-submenu:focus-within > .submenu {
    display: block;
}

.submenu li a {
    width: 100%;
    height: 100%;
    display: block;
    padding: 5px;
}

.submenu li:hover {
    background-color: #9CD0EA;
}

/* JS-toggled menus always display, regardless of hover state */
.submenu.is-open {
    display: block !important;
}

/* ---------- Home page: brand/hero slideshow ---------- */
.slideshow {
    margin-top: 3rem;
    width: 100%;
    overflow: hidden;
    position: relative;
}

.gif {
    position: absolute;
    bottom: 15%;
    right: 1%;
    height: 7rem;
    width: auto;
    z-index: 10;
}

.slide-wrapper {
    display: flex;
    width: 1500%;
    height: 100%;
    animation: slide 60s infinite; /* Total duration for all slides */
}

.slide {
    width: 6.666%; /* 100% / number of images */
    height: 100%;
}

.slide img {
    width: 100%;
    object-fit: contain; /* Fill the space without distortion */
}

/*
  Animation logic for 15 slides:
  each slide holds position for ~5.666% of the timeline, then transitions.
*/
@keyframes slide {
    0%, 5.666% { transform: translateX(0); }
    6.666%, 12.332% { transform: translateX(-6.666%); }
    13.332%, 18.998% { transform: translateX(-13.332%); }
    19.998%, 25.664% { transform: translateX(-19.998%); }
    26.664%, 32.33% { transform: translateX(-26.664%); }
    33.33%, 38.996% { transform: translateX(-33.33%); }
    39.996%, 45.662% { transform: translateX(-39.996%); }
    46.662%, 52.328% { transform: translateX(-46.662%); }
    53.328%, 58.994% { transform: translateX(-53.328%); }
    59.994%, 65.66% { transform: translateX(-59.994%); }
    66.66%, 72.326% { transform: translateX(-66.66%); }
    73.326%, 78.992% { transform: translateX(-73.326%); }
    79.992%, 85.658% { transform: translateX(-79.992%); }
    86.658%, 92.324% { transform: translateX(-86.658%); }
    93.324%, 98.99% { transform: translateX(-93.324%); }
    100% { transform: translateX(0); }
}

/* ---------- Home page: brand grid ---------- */
.page-heading {
    font-size: 3rem;
    text-align: center;
    padding: 2rem;
}

.brand-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
    gap: 1rem;
    padding: 0 1rem 5rem;
    place-items: center;
}

.brand-logo {
    height: 5rem;
    width: 10rem;
    object-fit: contain;
}

/* ---------- Catalogue page ---------- */
.catalogue-page {
    padding: 7rem 1rem 5rem;
}

.catalogue-heading {
    font-size: 2rem;
    text-align: center;
    padding-bottom: 2rem;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(25rem, 1fr));
    gap: 1rem;
    place-items: center;
}

.catalogue-card {
    display: block;
    border: 1px solid #000;
    border-radius: 15px;
}

.catalogue-image {
    height: 25rem;
    width: 25rem;
    object-fit: contain;
    padding: 1rem;
}

.catalogue-item-title-wrap {
    display: flex;
    justify-content: center;
    padding: 1rem;
}

.catalogue-item-title {
    font-size: 1rem;
    text-align: center;
}

/* ---------- Contact Us page ---------- */
.contact-page {
    padding: 7rem 1rem 5rem;
}

.branch-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr));
    gap: 1.5rem;
    max-width: 60rem;
    margin: 0 auto;
}

.branch-card {
    border: 1px solid #9CD0EA;
    border-radius: 15px;
    padding: 1.5rem;
    background-color: #F5FBFF;
}

.branch-name {
    font-size: 1.3rem;
    padding-bottom: 1rem;
}

.branch-detail-row {
    padding-bottom: 0.5rem;
    line-height: 1.5;
}

.branch-detail-row a {
    color: #007bff;
}

.branch-detail-row a:hover {
    text-decoration: underline;
}

.branch-map-link {
    display: inline-block;
    margin-top: 0.5rem;
    padding: 0.5rem 1rem;
    background-color: #007bff;
    color: #fff;
    border-radius: 5px;
    font-size: 0.9rem;
}

.branch-map-link:hover {
    background-color: #0062cc;
}

/* ---------- Product detail page ---------- */
.product-detail {
    padding: 7rem 1rem 5rem;
}

.product-title-wrap {
    display: flex;
    justify-content: center;
    padding-bottom: 2rem;
}

.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(25rem, 1fr));
    gap: 1rem;
    place-items: center;
}

.product-image {
    height: 25rem;
    width: 25rem;
    object-fit: contain;
    padding: 1rem;
}

.variants-row {
    display: flex;
    justify-content: center;
    align-items: center;
    padding-bottom: 2rem;
}

.variants-label {
    padding-right: 1rem;
}

.scroll-container {
    overflow-x: auto; /* Adds horizontal scrollbar when needed */
    overflow-y: hidden;
    white-space: nowrap;
}

.content-item {
    cursor: pointer;
    padding: 5px;
    margin: 5px;
    font-size: 1rem;
    background-color: #BCE5FF;
    color: #000;
    border: 1px solid #9CD0EA;
    border-radius: 5px;
    text-align: center;
}

.content-item:hover {
    background-color: #9CD0EA;
}

/* ---------- Floating contact widget ---------- */
.contact-bubble {
    position: fixed;
    top: 55px;
    right: 60px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    padding: 0.5rem;
    color: white;
    background-color: rgba(100, 100, 100, 0.7);
    backdrop-filter: blur(5px);
    border-radius: 15px;
}

.fab-wrapper {
    position: fixed;
    top: 50px;
    right: 10px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

#fab-checkbox {
    display: none;
}

.fab-main-btn {
    width: 40px;
    height: 40px;
    background-color: #007bff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    font-size: 24px;
    transition: transform 0.3s;
}

#fab-checkbox:checked ~ .fab-main-btn {
    transform: rotate(135deg);
    background-color: #ff4444;
}

.fab-icon {
    height: 30px;
    width: auto;
}

.fab-icon--action {
    height: 40px;
    width: auto;
    padding-left: 5px;
}

.fab-menu {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 20px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-20px);
    transition: all 0.3s ease;
}

#fab-checkbox:checked ~ .fab-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* ---------- Responsive / mobile ---------- */
@media (max-width: 768px) {
    #menu-toggle {
        display: block; /* Show hamburger on mobile */
    }

    .menu-bar {
        display: none; /* Hidden by default on mobile */
        flex-direction: column;
        width: 100%;
        position: absolute;
        top: 43px; /* Header height */
        left: 0;
        background-color: #BCE5FF;
        max-height: calc(100vh - 125px); /* Fill the rest of the screen */
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .menu-bar.is-open {
        display: flex; /* Shown when toggled open */
    }

    .menu-bar li {
        border-bottom: 1px solid rgba(156, 208, 234, 1);
        width: 100%;
    }

    /* Prevent hover effects from triggering on mobile */
    .has-submenu:hover > .submenu,
    .has-submenu:focus-within > .submenu {
        display: none;
    }

    .submenu, .submenu .submenu {
        position: relative; /* Stack submenus vertically on mobile */
        top: auto;
        left: auto;
        background-color: #BCE5FF;
        box-shadow: none;
        padding-left: 20px;
    }

    .gif {
        height: 0;
    }

    footer {
        font-size: 0.7rem;
    }
}
