@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    background-color: #f9f6f1;
    margin: 0;
    overflow: hidden;
    -webkit-user-select: none;
    user-select: none;
}

input,
textarea {
    -webkit-user-select: auto;
    user-select: auto;
}

.header {
    display: flex;
    justify-content: center;
    font-size: larger;
    margin-bottom: 25px;
    margin-top: 90px;
    background-color: rgb(229, 211, 184);
    padding: 20px;
}

.header h2 {
    font-size: 35px;
    font-weight: bold;
    color: #4b2e2e;

}

.container {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    /* 5 أعمدة */
    gap: 20px;
    padding: 20px;
    justify-items: center;
}

.product {
    width: 100%;
    max-width: 220px;
    height: 100%;
    background-color: white;
    border: 1px solid #ffffff;
    box-shadow: 0 4px 12px rgba(46, 24, 24, 0.1);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px;
    margin-bottom: 20px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.product:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(46, 24, 24, 0.15);
}

.product img {
    width: 100%;
    height: 180px;
    object-fit: contain;
    border-radius: 10px;
    margin-bottom: 12px;
}

.product h3 {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 5px;
    margin-top: 0;
    text-align: center;
    color: #ff8799;
}

.product h5 {
    font-weight: bold;
    margin-bottom: 3px;
    margin-top: 0px;
}

.product del {
    font-size: larger;
    font-weight: lighter;
}

.product h4 {
    font-size: 15px;
    font-weight: bold;
    margin-top: auto;
    /* Pushes price and buttons to bottom naturally */
    margin-bottom: 10px;
    color: #4b2e2e;
}

.product input {
    width: 50px;
    padding: 3px 5px;
    margin-bottom: 12px;
    text-align: center;
    border: 1px solid #ccc;
    border-radius: 5px;
    outline: none;
}

.product a {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    background-color: #ff91a3;
    padding: 8px 10px;
    border: none;
    border-radius: 5px;
    transition: 0.3s;
    text-decoration: none;
    font-size: 13px;
    font-weight: bold;
    color: rgb(245, 235, 218);
    margin-bottom: 8px;
    text-align: center;
}

.product a:last-child {
    margin-bottom: 0;
}

.product a:hover {
    background-color: #ff647b;
    color: white;
}

@media (max-width: 768px) {

    body,
    html,
    a {
        cursor: auto !important;
    }

    .container {
        grid-template-columns: repeat(2, 1fr);
        /* 2 منتجات في الصف */
        gap: 15px;
        padding: 15px;
    }

    .header {
        margin-top: 120px;
    }
}

::-webkit-scrollbar {
    width: 7px;
    background-color: #ffffffb1;
}

::-webkit-scrollbar-thumb {
    width: 7px;
    background-color: #f0d5d5;
    border-radius: 2px;
}

/* Root Variables for Navbar */
:root {
    --bg-color-nav: #f6f5f0;
    --text-color-nav: #1a1a1a;
    --accent-color-nav: #ff5e3a;
    --nav-height: 80px;
}

/* Navbar */
.navbar {
    font-family: 'Plus Jakarta Sans', sans-serif !important;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--nav-height);
    display: flex;
    align-items: center;
    z-index: 1000;
    transition: background-color 0.3s ease, padding 0.3s ease;
    background-color: transparent;
    /* or matching the styles.css */
}

.navbar.scrolled {
    background-color: rgba(246, 245, 240, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.nav-container {
    width: 100%;
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-left: 100px;

}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--text-color-nav);
    text-decoration: none;
}

.nav-links {
    display: flex;
    gap: 2rem;
    background-color: rgba(126, 126, 126, 0.922);
    padding: 20px 24px;
    border-radius: 50px;
    align-items: center;
    list-style: none;
    margin: 0;
}

.nav-links a {
    font-weight: 500;
    font-size: 1rem;
    position: relative;
    overflow: hidden;
    color: var(--text-color-nav);
    text-decoration: none;

}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background-color: var(--text-color-nav);
    transform: translateX(-100%);
    transition: transform 0.3s ease;
}

.nav-links a:hover::after {
    transform: translateX(0);
}

.mobile-menu-btn {
    display: none;
    flex-direction: column;
    gap: 6px;
    cursor: pointer;
}

.mobile-menu-btn span {
    width: 30px;
    height: 2px;
    background-color: var(--text-color-nav);
    transition: transform 0.3s ease, opacity 0.3s ease;
}

/* Base states for desktop */
.sidebar-wrapper {
    display: contents;
    /* Behaves like it's not there for flexbox */
}

.close-sidebar {
    display: none;
}

.sidebar-overlay {
    display: none;
}

/* Search and Icons Styles */
.icons {
    display: flex;
    gap: 20px;
    font-size: 16px;
    color: var(--text-color-nav);
    align-items: center;
}

.search-popup {
    position: absolute;
    top: 35px;
    right: 0;
    background-color: white;
    border: 1px solid #ccc;
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    width: 200px;
    z-index: 100;
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
    transition: all 0.3s ease;
}

.search-popup.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.search-popup input {
    width: 100%;
    padding: 5px;
    margin-bottom: 5px;
    border-radius: 5px;
    border: 1px solid #ccc;
    outline: none;
}

.search-popup button {
    width: 100%;
    padding: 5px;
    background-color: #333;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

@media (max-width: 768px) {

    /* Hamburger to X animation */
    .mobile-menu-btn.active span:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }

    .mobile-menu-btn.active span:nth-child(2) {
        opacity: 0;
    }

    .mobile-menu-btn.active span:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

    /* Mobile Sidebar Wrapper */
    .sidebar-wrapper {
        display: flex;
        flex-direction: column;
        position: fixed;
        top: 0;
        right: -100%;
        width: 320px;
        max-width: 80vw;
        height: 100vh;
        background-color: var(--bg-color-nav);
        z-index: 2000;
        padding: 40px 30px;
        transition: right 0.4s cubic-bezier(0.16, 1, 0.3, 1);
        box-shadow: -5px 0 25px rgba(0, 0, 0, 0.1);
        overflow-y: auto;
    }

    .sidebar-wrapper.active {
        right: 0;
    }

    /* Sidebar Overlay Backdrop */
    .sidebar-overlay {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background: rgba(0, 0, 0, 0.4);
        /* Less dark, no blur */
        z-index: 990;
        /* Must be lower than navbar's 1000 z-index */
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.4s ease;
    }

    .sidebar-overlay.active {
        opacity: 1;
        pointer-events: auto;
    }

    .close-sidebar {
        display: block;
        align-self: flex-end;
        font-size: 1.8rem;
        cursor: pointer;
        margin-bottom: 2rem;
        color: var(--text-color-nav);
        transition: transform 0.3s ease;
    }

    .close-sidebar:hover {
        transform: rotate(90deg) scale(1.1);
    }

    .nav-links {
        display: flex;
        flex-direction: column;
        background-color: transparent;
        padding: 0;
        align-items: flex-start;
        width: 100%;
        gap: 1.5rem;
    }

    .nav-links a {
        font-size: 1.5rem;
        font-weight: 600;
        width: 100%;
        border-bottom: 1px solid rgba(0, 0, 0, 0.05);
        padding-bottom: 15px;
    }

    .nav-links a::after {
        display: none;
        /* remove desktop underline effect */
    }

    .icons {
        display: flex;
        justify-content: space-around;
        width: 100%;
        font-size: 1.6rem;
        margin-top: 2rem;
        padding-top: 2rem;
        border-top: 1px solid rgba(0, 0, 0, 0.1);
        gap: 0;
    }

    .search-popup {
        top: auto;
        bottom: 60px;
        right: 50%;
        transform: translateX(50%) translateY(10px);
        width: 250px;
    }

    .search-popup.show {
        transform: translateX(50%) translateY(0);
    }

    .mobile-menu-btn {
        display: flex;
    }

    .nav-container {
        padding-left: 5%;
        padding-right: 5%;
    }

    .icons {
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .container {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        padding: 10px;
    }

    .product {
        padding: 10px;
    }

    .product img {
        height: 130px;
        margin-bottom: 8px;
    }

    .product h3 {
        font-size: 14px;
        margin-bottom: 3px;
    }

    .product h4 {
        font-size: 13px;
    }

    .product a {
        font-size: 12px;
        padding: 6px 8px;
    }

    .header h2 {
        font-size: 24px;
    }
}

body,
html {
    height: auto;
    overflow: auto;
}