/* ============================
   RESET & BASE
============================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    min-height: 100%;
    overflow-x: hidden;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Inter", sans-serif;
    background: #f5f5f5;
    color: #111;
}

img {
    max-width: 100%;
    display: block;
}

a {
    text-decoration: none;
    color: inherit;
}

button {
    font-family: inherit;
}

/* Container for page content */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 12px;
}

.page {
    padding: 10px 0 40px;
}

/* ============================
   HEADER
============================ */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: #ffffff;
    border-bottom: 1px solid #e5e5e5;
    position: sticky;
    top: 0;
    z-index: 1000;
}

/* Hamburger */
.hamburger {
    width: 30px;
    height: 22px;
    background: none;
    border: none;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    cursor: pointer;
    padding: 0;
}
.hamburger span {
    height: 3px;
    background: #000;
    border-radius: 3px;
}

/* Header icons + currency + cart */
.header-icons {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-icons .icon {
    width: 26px;
    height: 26px;
    cursor: pointer;
}

/* Currency dropdown */
.currency-select {
    padding: 6px 8px;
    border-radius: 6px;
    border: 1px solid #ddd;
    font-size: 14px;
    background: #fafafa;
}

/* Cart link */
.cart-link {
    position: relative;
    display: inline-flex;
    align-items: center;
}

/* Cart badge */
.cart-count {
    position: absolute;
    top: -6px;
    right: -10px;
    background: #ff3b30;
    color: #fff;
    padding: 2px 6px;
    border-radius: 999px;
    font-size: 11px;
    line-height: 1;
    min-width: 18px;
    text-align: center;
}

/* ============================
   SIDEBAR MENU
============================ */
.side-menu {
    width: 260px;
    height: 100%;
    position: fixed;
    top: 0;
    left: -260px;
    background: #ffffff;
    padding-top: 15px;
    transition: left 0.3s ease;
    z-index: 1200;
    box-shadow: 2px 0 10px rgba(0,0,0,0.15);
}

.side-menu.open {
    left: 0;
}

.close-btn {
    font-size: 32px;
    background: none;
    border: none;
    margin-left: auto;
    margin-right: 20px;
    cursor: pointer;
    display: block;
}

/* Sidebar Menu */
.menu-links {
    list-style: none;
}

.menu-item {
    padding: 14px 20px;
    font-size: 15px;
    border-bottom: 1px solid #f3f3f3;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

/* Submenu wrapper */
.has-submenu {
    flex-direction: column;
    align-items: flex-start;
}

/* Header row for submenu */
.submenu-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* arrow */
.submenu-arrow {
    transition: transform 0.3s ease;
}

/* rotate arrow when open */
.has-submenu.open .submenu-arrow {
    transform: rotate(180deg);
}

/* actual submenu container */
.submenu {
    width: 100%;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    padding-left: 20px;
}

/* optional, if you also want padding when open via class (JS is setting maxHeight inline) */
.has-submenu.open .submenu {
    padding-top: 6px;
    padding-bottom: 6px;
}

.submenu-item {
    padding: 10px 0;
    font-size: 14px;
    border-bottom: 1px solid #f6f6f6;
}

/* ============================
   HELLO BAR
============================ */
.hellobar_container {
    width: 100%;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #fff7e6;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin: 8px 0 12px;
    animation: fadeSlide .6s ease;
}

/* Animation */
@keyframes fadeSlide {
    0% { opacity: 0; transform: translateY(10px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* ============================
   CATEGORY SECTION
============================ */
.category-section {
    margin-top: 20px;
}

.category-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 12px;
}

/* ============================
   PRODUCT GRID
============================ */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 12px;
    padding-bottom: 36px;
}

/* PRODUCT CARD */
.product-card {
    background: #ffffff;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #ececec;
    display: flex;
    flex-direction: column;
    height: 100%;
    box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}

/* IMAGE */
.prod-img {
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    position: relative;
}

.prod-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Discount Badge */
.discount-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    padding: 4px 8px;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    background: #ff2d55;
    border-radius: 6px;
    z-index: 5;
}

/* PRODUCT BODY */
.prod-body {
    padding: 10px 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex-grow: 1;
}

/* TITLE */
.prod-title {
    font-size: 14px;
    font-weight: 700;
    min-height: 36px;
    line-height: 1.3;
}

/* PRICE */
.price-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.price {
    font-size: 16px;
    font-weight: 800;
}

.old-price {
    font-size: 13px;
    color: #888;
    text-decoration: line-through;
}

/* DESCRIPTION */
.prod-desc {
    font-size: 12px;
    color: #555;
    min-height: 32px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* ACTIONS */
.prod-actions {
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* BUTTONS */
.btn-buy,
.btn-cart {
    width: 100%;
    padding: 9px 0;
    color: #fff;
    background: #000;
    border-radius: 6px;
    text-align: center;
    font-weight: 600;
    font-size: 14px;
    border: none;
    display: inline-block;
}

.btn-cart {
    background: #ff9800;
}

/* ============================
   SEARCH OVERLAY
============================ */
.search-overlay {
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background: #ffffff;
    padding: 16px;
    display: none;
    z-index: 9999;
}

.search-overlay.active {
    display: block;
}

.search-container {
    max-width: 600px;
    margin: 0 auto;
}

.back-btn {
    font-size: 14px;
    margin-bottom: 12px;
    cursor: pointer;
}

#liveSearch {
    width: 100%;
    padding: 12px;
    border: 2px solid #000;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14px;
}

/* SEARCH RESULT ITEM */
.search-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
    cursor: pointer;
}

.search-item img {
    width: 50px;
    height: 50px;
    border-radius: 6px;
    object-fit: cover;
}

.search-item span {
    font-size: 14px;
    font-weight: 600;
}

/* ============================
   MODAL (PRODUCT POPUP)
============================ */
.modal {
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    display: none;
    background: rgba(0,0,0,0.55);
    justify-content: center;
    align-items: center;
    z-index: 99999;
}

.modal-content {
    background: #fff;
    width: 90%;
    max-width: 380px;
    padding: 20px;
    border-radius: 16px;
    animation: popup 0.25s ease;
}

.modal-img {
    width: 100%;
    height: auto;
    border-radius: 10px;
    margin-bottom: 10px;
}

.modal-price {
    margin-top: 6px;
    font-size: 16px;
    font-weight: 700;
}

.close-btn {
    font-size: 22px;
    float: right;
    cursor: pointer;
    border: none;
    background: none;
}

/* popup animation */
@keyframes popup {
    from { transform: scale(.85); opacity: 0; }
    to   { transform: scale(1); opacity: 1; }
}

/* ============================
   MEDIA QUERIES
============================ */

/* Tablets and up */
@media (min-width: 600px) {
    .header {
        padding: 12px 18px;
    }

    .products-grid {
        gap: 16px;
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }

    .product-card {
        border-radius: 12px;
    }

    .prod-body {
        padding: 12px;
    }
}

/* Desktop */
@media (min-width: 992px) {
    .header {
        padding: 14px 32px;
    }

    .container {
        padding: 0 16px;
    }

    .products-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .hellobar_container {
        margin-top: 14px;
        border-radius: 8px;
    }
}
