/* =========================================================
Global Styles
========================================================= */
body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bgColor);
    margin: 0;
    padding: 0;
    color: var(--textColor);
}

a {
    color: var(--linkColor);
    text-decoration: none;
}

a:hover {
    text-decoration: none;
    color: var(--linkHoverColor);
}

input {
    font-family: inherit;
}

/* =========================================================
Header Styles
========================================================= */
.top-header {
    background: var(--headerBgColor);
    padding: 1rem 2rem 1rem 5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3rem;
    flex-wrap: wrap;

    /* FIXED HEADER ADDED */
    position: sticky;
    top: 0;

    z-index: 998;
}

.header-container {
    width: 100%;
    display: grid;
    grid-template-columns: 5fr 3fr 15fr 3fr 3fr 1fr;
    gap: 1rem;
    justify-content: center;
    justify-items: stretch;
    align-items: center;
}

.block-1 {
    grid-column: 1 / 2;
    grid-row: 1;
}
.block-2 {
    grid-column: 2 / 3;
    grid-row: 1;
}
.block-3 {
    grid-column: 3 / 4;
    grid-row: 1;
}
.block-4 {
    grid-column: 4 / 5;
    grid-row: 1;
}
.block-5 {
    grid-column: 5 / 6;
    grid-row: 1;
}
.block-6 {
    grid-column: 6 / 7;
    grid-row: 1;
}


.nav-link {
    font-size: 1.2rem;
    text-decoration: none;
}

.nav-link:hover {
    text-decoration: none;
}

.my-shop {
    font-size: 2rem;
    font-weight: bold;
}

.delivery-text,
.postal {
    font-size: 1rem;
}

.search-wrapper {
    position: relative;
    width: 100%;
    max-width: 600px;
}

.search-form {
    display: flex;
    width: 100%;
}

.search-bar {
    flex: 1; /* takes all available space */
    padding: 0.5rem 1rem;
    border: 3px solid #e5e5e5;
    border-right: none; /* remove right border so button merges */
    border-radius: 0.25rem 0 0 0.25rem; /* rounded left corners only */
    font-size: 1rem;
    color: var(--textColor);
    outline: none;
}

.search-bar::placeholder {
    color: #a2a2a2;
    font-weight: 500;
}

.search-btn {
    padding: 0 0.5rem;
    border: 3px solid #e5e5e5;
    border-left: none;
    border-radius: 0 0.25rem 0.25rem 0;
    background: var(--btnBgColor);
    cursor: pointer;
    font-size: 1rem;
    display: flex;             /* important */
    align-items: center;       /* vertically center */
    justify-content: center;   /* horizontally center */
    box-sizing: border-box;    /* prevent overflow */
}

/* Autocomplete container */
#autocomplete-suggestions {
    position: absolute;
    top: calc(100% + 4px);   /* just below search bar */
    left: 0;
    right: 0;
    background: #e9e9e9;
    border-radius: 0 0 6px 6px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
    z-index: 990;
    display: none;
    max-height: 260px;
    width: 100%;
    overflow-y: auto;
}

/* Individual suggestion item */
#autocomplete-suggestions div {
    padding: 10px 14px;
    font-size: 0.95rem;
    cursor: pointer;
    border-bottom: 1px solid #f1f1f1;
}

/* Last item cleanup */
#autocomplete-suggestions div:last-child {
    border-bottom: none;
}

/* Hover effect */
#autocomplete-suggestions div:hover {
    background-color: #f5f7fa;
}

/* Hamburger Button */
.hamburger-btn {
    position: fixed;
    font-size: 2rem;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--linkColor);
    left: 0.5rem;
    top: 0.5rem;
    z-index: 999; /* above header */
}

/* Side Menu */
.side-menu {
    position: fixed;
    top: 0;
    left: -20rem; /* hidden initially */
    width: 20rem;
    height: 100%;
    background-color: var(--headerBgColor);
    color: var(--linkColor);
    box-shadow: 2px 0 5px rgba(0,0,0,0.3);
    transition: left 0.3s ease;
    z-index: 1000;
    padding-top: 3rem;
}

.side-menu ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.side-menu li {
    margin: 1rem 0;
    padding: 0 1.5rem;
}

.side-menu li a {
    text-decoration: none;
    color: var(--linkColor);
    font-size: 1.2rem;
}

.side-menu.open {
    left: 0;
}

.close-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 3rem;
    cursor: pointer;
    color: var(--linkColor);
}

/* =========================================================
Responsive Styles
========================================================= */
@media (max-width: 900px) {
    .search-bar {
        width: 80%;
    }
}

@media (max-width: 700px) {
    .top-header {
        padding: 0.7rem 0.5rem 0.4rem 0.5rem;
    }

    .header-container {
        grid-template-columns: 1fr 3fr 1fr;
        grid-template-rows: auto auto; /* 1fr 1fr ; keep auto*/
    }

    .block-4,
    .block-2, 
    .block-5 {
        display: none;
    }

    .block-1 {
        grid-column: 2 / 3;
        grid-row: 1;
        text-align: center;
    }
    
    .block-6 {
        grid-column: 3 / 4;
        grid-row: 1;
        text-align: right;
    }
    
    .block-3 {
        grid-column: 1 / 4;
        grid-row: 2;
    }

    .my-shop {
        font-size: 1.5rem;
        font-weight: bold;
    }
    
    .hamburger-btn {
        left: 0.2rem;
        top: 0.2rem;
    }

    .side-menu {
        position: fixed;
        top: 0;
        left: -80%; /* hidden initially */
        width: 80%;
    }
}
