@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap');

:root {
    --accent-color: #A19AD3;
    /* Accent color */
    --base-color: white;
    /* base background color */
    --text-color: #2E2B41;
    /* text color */
    --input-color: #F3F0FF;
    /* input background color */
}

header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background-color: var(--text-color);
}

body {
    font-family: Poppins, Arial, sans-serif;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    background-color: #f5f5f5;
    color: var(--text-color);
}

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


#logoutBtn {
    background: var(--accent-color);
    color: var(--base-color);
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    margin-right: 1.5rem;
}

#logoutBtn:hover {
    opacity: 0.8;
}

#userDisplay {
    color: white;
    margin-right: 50px;
    text-align: center;
    font-family: 'Franklin Gothic Medium', 'Arial Narrow', Arial, sans-serif;
    font-weight: bold;
    font-size: 20px;
}

/* Hamburger Styles */
.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    z-index: 10;
}

.hamburger .bar {
    width: 25px;
    height: 4px;
    background-color: var(--base-color);
    margin: 4px;
    border-radius: 50px;
}

.ad-section {
    background-color: #eee;
    padding: 2rem;
    text-align: center;
    margin-bottom: 2rem;
}

.directory {
    padding: 2rem 2rem 1.5rem;
    background-color: #f5f5f5;
}

.direct-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 1rem;
}

.direct-item {
    background-color: white;
    border-radius: 16px;
    padding: 1.5rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
    min-height: 100px;
    aspect-ratio: 1.6/1;
    position: relative;
}

.direct-item i {
    font-size: 1.75rem;
    margin-bottom: 0.75rem;
    color: var(--text-color);
    transition: all 0.2s ease;
}

.direct-item::before {
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--text-color);
    transition: all 0.3s ease;
}

.direct-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(161, 154, 211, 0.15);
    background-color: var(--accent-color);
}

.direct-item p {
    margin: 0;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-color);
    transition: all 0.2s ease;
}

/* add subtle effect when clicing */
.direct-item:hover i,
.direct-item:hover p {
    color: white;
}


.direct-item:active {
    transform: scale(0.98);
}


.categories {
    padding: 1rem;
    margin-bottom: 2rem;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 1rem;
}

.category-item {
    background-color: grey;
    padding: 1rem;
    text-align: center;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.category-item:hover {
    background-color: #e8e8e8;
}

.recommended {
    padding: 1rem;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.25rem;
    padding: 1rem;
    max-width: 1400px;
    margin: 0 auto;
}

.product-card {
    position: relative;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px var(--shadow-color);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
    cursor: pointer;
}


.product-price {
    color: #333;
    margin-bottom: 0.5rem;
}

.add-to-cart {
    width: 100%;
    padding: 0.75rem;
    background-color: var(--accent-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
    margin-top: 1rem;
}

.add-to-cart:hover {
    background-color: #8B84C0;
}

.section-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-color);
    margin: 2rem 0 1.5rem 1rem;
    position: relative;
    display: inline-block;
}

.filters {
    display: flex;
    align-items: center;
    gap: 2rem;
    padding: 1rem 2rem;
}

.section-title-filter {
    font-size: 1.5rem;
    color: var(--text-color);
    font-weight: 600;
    font-family: Poppins, Arial, sans-serif;
    margin: 0;
    position: relative;
    padding-bottom: 7px;
}

.filters-options {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

/* Add a subtle accent line under the title */
.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 3px;
    background-color: var(--accent-color);
    border-radius: 2px;
}

.section-title-filter::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 3px;
    background-color: var(--accent-color);
    border-radius: 2px;
}

.discounts {
    padding: 1rem;
}

.sale-badge {
    background-color: #ff4444;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    display: inline-block;
    margin-bottom: 0.5rem;
}


/* Footer Styles */
footer {
    background-color: var(--text-color);
    color: var(--base-color);
    padding: 40px 20px;
    margin-top: 50px;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}

.footer-links {
    margin: 20px 0;
}

.footer-links a {
    color: var(--base-color);
    margin: 0 15px;
    transition: color 0.3s;
}

.footer-links a:hover {
    color: var(--accent-color);
}

.social-media {
    margin-top: 20px;
}

.social-media a {
    color: var(--base-color);
    margin: 0 15px;
    font-size: 18px;
    transition: color 0.3s;
}

.social-media a:hover {
    color: var(--accent-color);
}

/* Language Selector */
#language-selector {
    margin-bottom: 20px;
}

#language-dropdown {
    padding: 8px;
    border-radius: 4px;
    border: 1px solid #ddd;
    background-color: var(--base-color);
}


/* Responsive Styles */
@media screen and (max-width: 1024px) {
    .direct-grid {
        max-width: 800px;
        gap: 0.875rem;
    }

    .direct-item {
        padding: 1.25rem 1rem;
        min-height: 90px;
    }
}

@media screen and (max-width: 768px) {
    .navbar .menu {
        display: none;
        flex-direction: column;
        width: 100%;
        position: absolute;
        top: 60px;
        left: 0;
        background-color: var(--text-color);
        padding: 10px 0;
    }

    .navbar .menu.active {
        display: flex;
    }

    .navbar .menu li {
        margin: 10px 0;
        text-align: center;
    }

    #userDisplay {
        margin: 0.5rem 0;
    }

    #logoutBtn {
        margin: 0.5rem auto;
        width: 80%;
    }

    .hamburger {
        display: flex;
    }

    .directory {
        padding: 1rem;
    }

    .direct-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
        padding: 0 0.5rem;
    }

    .direct-item {
        min-height: 80px;
        padding: 1rem;
    }

    .direct-item i {
        font-size: 1.5rem;
        margin-bottom: 0.5rem;
    }

    .direct-item p {
        font-size: 0.9rem;
    }

    .filters {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        padding: 1rem;
    }

    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 1rem;
        padding: 0.75rem;
    }

    .product-title {
        font-size: 0.9rem;
    }

    .current-price {
        font-size: 1.1rem;
    }

    .product-details {
        padding: 0.75rem;
    }

    .section-title-filter {
        font-size: 1.25rem;
        padding-bottom: 10px;
    }

    .section-title-filter::after {
        width: 32px;
        height: 2px;
    }

    .footer-links {
        flex-direction: column;
    }

    .footer-links a {
        display: block;
        margin: 0.1px 0;
    }

    .search-bar input {
        width: 100%;
        padding: 0.5rem;
        border: 1px solid #ddd;
        border-radius: 4px;
    }
}

@media screen and (max-width: 480px) {
    .directory {
        padding: 0.75rem;
    }

    .section-title {
        font-size: 1.1rem;
        margin-bottom: 1rem;
    }

    .direct-grid {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
}


/* update product grid to center-align boxes while keeping text left-aligned */
.recommended,
.discounts {
    padding: 2rem;
    background-color: #f5f5f5;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
    width: 100%;
    justify-content: center;
    max-width: 1200px;
    margin: 0 auto;
}

.product-card {
    display: flex;
    flex-direction: column;
    background-color: white;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    text-align: left;
    /* Ensure text is left-aligned */
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

.product-image {
    position: relative;
    width: 100%;
    height: 10px;
    padding-top: 100%;
    /* 1:1 Aspect Ratio */
    overflow: hidden;
}

.product-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}


.product-details {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
}

.product-details h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem;
    color: #333;
}


.product-price-container {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.original-price {
    font-size: 0.9rem;
    color: #95A5A6;
    text-decoration: line-through;
}

.current-price {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--price-color);
}

.discount-badge {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background-color: var(--discount-color);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 600;
    z-index: 1;
}


.seller-info {
    font-size: 0.875rem;
    color: #7F8C8D;
    margin-top: auto;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.seller-info i {
    font-size: 0.875rem;
}

.add-to-cart-btn {
    margin-top: auto;
    width: 100%;
    background-color: var(--accent-color);
    color: white;
    border: none;
    padding: 0.75rem;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
}