/* frontend_style.css - Main Stylesheet for the Public Frontend */

/* --- General Body and Typography --- */
:root {
    --primary-color: #007BFF; /* A vibrant blue for main actions */
    --secondary-color: #6C757D; /* Muted grey for secondary text */
    --accent-color: #28A745; /* Green for success/add to cart */
    --background-color: #F8F9FA; /* Light grey background */
    --card-background: #FFFFFF; /* White for cards/boxes */
    --border-color: #E0E0E0;
    --text-color: #343A40;
    --light-text: #ADB5BD;
    --red: #DC3545; /* For errors or specific states */
    --blue: #007BFF; /* For links or info */
    --box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08); /* Soft shadow */
    --border-radius: 8px;
    --transition: all 0.3s ease;
}

* {
    font-family: 'Poppins', sans-serif;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    outline: none;
    border: none;
    text-decoration: none;
}

html {
    font-size: 62.5%; /* 1rem = 10px */
    overflow-x: hidden;
    scroll-behavior: smooth;
}

body {
    background-color: var(--background-color);
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* --- Utility Classes --- */
.heading {
    text-align: center;
    margin-bottom: 3rem;
    font-size: 4rem;
    color: var(--text-color);
    text-transform: uppercase;
    letter-spacing: 2px;
    position: relative;
    padding-bottom: 1rem;
}

.heading::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background-color: var(--primary-color);
    border-radius: 2px;
}

section {
    padding: 3rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.btn, .option-btn, .delete-btn {
    display: inline-block;
    padding: 1rem 2.5rem;
    font-size: 1.6rem;
    border-radius: 5px;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
    white-space: nowrap;
}

.btn {
    background-color: var(--primary-color);
    color: var(--card-background);
}

.btn:hover {
    background-color: #0056b3; /* Darker blue */
}

.option-btn {
    background-color: var(--secondary-color);
    color: var(--card-background);
}

.option-btn:hover {
    background-color: #5A6268;
}

.delete-btn {
    background-color: var(--red);
    color: var(--card-background);
}

.delete-btn:hover {
    background-color: #C82333;
}

.flex-btn {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* --- Header Styles --- */
.header {
    background-color: var(--card-background);
    box-shadow: var(--box-shadow);
    padding: 1.5rem 2rem;
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.header .flex {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1200px;
    margin: 0 auto;
}

.header .logo {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header .logo img {
    height: 4rem; /* Adjust logo size */
    width: auto;
    border-radius: 5px;
    object-fit: contain;
}

.header .navbar a {
    margin: 0 1rem;
    font-size: 1.8rem;
    color: var(--text-color);
    transition: var(--transition);
}

.header .navbar a:hover {
    color: var(--primary-color);
}

.header .icons div,
.header .icons a {
    font-size: 2.5rem;
    color: var(--text-color);
    cursor: pointer;
    margin-left: 1.5rem;
    transition: var(--transition);
}

.header .icons div:hover,
.header .icons a:hover {
    color: var(--primary-color);
}

.header .icons a span {
    font-size: 1.6rem;
    margin-left: 0.5rem;
}

#menu-btn {
    display: none; /* Hidden on desktop */
}

.header .profile {
    position: absolute;
    top: 100%;
    right: 2rem;
    background-color: var(--card-background);
    box-shadow: var(--box-shadow);
    border-radius: var(--border-radius);
    padding: 2rem;
    text-align: center;
    width: 30rem;
    display: none; /* Hidden by default */
    animation: fadeIn 0.2s ease-out;
}

.header .profile.active {
    display: block; /* Show when active */
}

.header .profile p {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    color: var(--text-color);
}

.header .profile p span {
    color: var(--primary-color);
    font-weight: 600;
}

.header .profile .flex-btn {
    margin-top: 1.5rem;
}

/* --- Hero Section --- */
.hero {
    min-height: calc(100vh - 7rem); /* Adjust based on header height */
    display: flex;
    align-items: center;
    justify-content: center;
    background: url('https://placehold.co/1200x600/f0f0f0/333333?text=Hero+Banner') no-repeat center center/cover;
    color: white;
    text-align: center;
    position: relative;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5); /* Dark overlay */
}

.hero-content {
    position: relative;
    z-index: 1;
    padding: 2rem;
}

.hero-content h1 {
    font-size: 5rem;
    margin-bottom: 1.5rem;
    color: var(--card-background);
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.hero-content p {
    font-size: 2rem;
    margin-bottom: 3rem;
    color: rgba(255, 255, 255, 0.9);
}

/* --- Categories Section --- */
.categories .box-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
    gap: 2rem;
    justify-content: center;
}

.categories .box-container .box {
    background-color: var(--card-background);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 2.5rem;
    text-align: center;
    transition: var(--transition);
}

.categories .box-container .box:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.categories .box-container .box i {
    font-size: 5rem;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
}

.categories .box-container .box h3 {
    font-size: 2rem;
    color: var(--text-color);
}

/* --- Featured Products Section --- */
.featured-products .box-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(28rem, 1fr));
    gap: 2.5rem;
    justify-content: center;
}

.featured-products .box-container .box {
    background-color: var(--card-background);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 2rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: var(--transition);
}

.featured-products .box-container .box:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.featured-products .box-container .box .product-image {
    width: 100%;
    max-width: 250px;
    height: auto;
    object-fit: contain;
    margin-bottom: 1.5rem;
    border-radius: 5px;
}

.featured-products .box-container .box .name {
    font-size: 2rem;
    color: var(--text-color);
    margin-bottom: 1rem;
    font-weight: 600;
}

.featured-products .box-container .box .price {
    font-size: 2.2rem;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    font-weight: 700;
}

.featured-products .box-container .box .price span {
    font-size: 1.8rem;
    color: var(--secondary-color);
}

.featured-products .box-container .box .qty {
    width: 8rem;
    padding: 0.8rem;
    font-size: 1.6rem;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    text-align: center;
    margin-bottom: 1.5rem;
}

.featured-products .box-container .box .btn {
    width: 100%;
    margin-top: 1rem;
}

.featured-products .box-container .box .option-btn {
    width: 100%;
    margin-top: 1rem;
    background-color: var(--accent-color);
}

.featured-products .box-container .box .option-btn:hover {
    background-color: #218838;
}


/* --- Footer Styles --- */
.footer {
    background-color: #343A40;
    color: white;
    padding: 3rem 2rem;
    margin-top: auto; /* Pushes footer to the bottom */
}

.footer .box-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(25rem, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto 2rem;
}

.footer .box-container .box h3 {
    font-size: 2rem;
    color: var(--card-background);
    margin-bottom: 1.5rem;
    text-transform: uppercase;
}

.footer .box-container .box p,
.footer .box-container .box a {
    display: block;
    font-size: 1.6rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 1rem;
    transition: var(--transition);
}

.footer .box-container .box a:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

.footer .box-container .box a i {
    margin-right: 1rem;
    color: var(--primary-color);
}

.footer .credit {
    text-align: center;
    font-size: 1.6rem;
    color: rgba(255, 255, 255, 0.5);
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    max-width: 1200px;
    margin: 0 auto;
}

.footer .credit span {
    color: var(--primary-color);
}


/* --- Message Box Styles (for frontend, similar to admin) --- */
.message {
    background-color: var(--blue); /* Or a suitable color for info/success */
    color: var(--card-background);
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.8rem;
    position: sticky;
    top: 70px; /* Adjust based on header height */
    z-index: 999;
    margin: 2rem auto;
    max-width: 1200px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.message span {
    max-width: calc(100% - 30px); /* Leave space for the close icon */
    word-wrap: break-word;
}

.message i {
    cursor: pointer;
    font-size: 2rem;
    color: var(--card-background);
    transition: transform 0.2s ease;
}

.message i:hover {
    transform: rotate(90deg);
}


/* --- Responsive Adjustments --- */
@media (max-width: 991px) {
    html {
        font-size: 55%;
    }
    .header .flex {
        padding: 1.5rem 2rem;
    }
    section {
        padding: 2rem;
    }
}

@media (max-width: 768px) {
    .header .navbar {
        position: absolute;
        top: 99%;
        left: 0;
        right: 0;
        background-color: var(--card-background);
        border-top: 1px solid var(--border-color);
        clip-path: polygon(0 0, 100% 0, 100% 0, 0 0);
        transition: clip-path 0.3s ease-out;
    }

    .header .navbar.active {
        clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
    }

    .header .navbar a {
        display: block;
        margin: 2rem;
        text-align: center;
        font-size: 2.5rem;
    }

    #menu-btn {
        display: inline-block;
    }

    .header .profile {
        right: 0;
        left: 0;
        width: auto;
        border-radius: 0;
    }

    .hero-content h1 {
        font-size: 4rem;
    }

    .hero-content p {
        font-size: 1.8rem;
    }

    .categories .box-container {
        grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
    }

    .featured-products .box-container {
        grid-template-columns: repeat(auto-fit, minmax(25rem, 1fr));
    }

    .footer .box-container {
        grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr));
    }
}

@media (max-width: 450px) {
    html {
        font-size: 50%;
    }
    .heading {
        font-size: 3rem;
    }
    .hero-content h1 {
        font-size: 3rem;
    }
    .hero-content p {
        font-size: 1.6rem;
    }
    .featured-products .box-container {
        grid-template-columns: 1fr;
    }
    .footer .box-container {
        grid-template-columns: 1fr;
    }
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}
