/*
 * Template Name: FreshMarket - Grocery & Supermarket eCommerce HTML5 Template
 * Author: Your Brand / Name
 * Version: 1.0.0
 * Created for: CodeCanyon / Envato Market
 */
 
/* --- Custom Brand System --- */
/* --- Brand Variables --- */
:root {
    --primary: #059669;         /* Main brand green */
    --primary-hover: #047857;   /* Darker green for hover states */
    --primary-light: #16a34a;    /* A lighter, vibrant green used for actions */
    --accent: #f59e0b;          /* Orange/Yellow for badges & deals */
    --dark: #0f172a;            /* Dark slate for text & footer */
    --light-bg: #f8fafc;        /* Background color */
    --border: #e2e8f0;          /* Subtle border gray */
    --card-bg: #ffffff;
    --green-button: #5BC28E;
    --green-button-hover: #5BC2C2;

    /* Extended Palette */
    --text-primary: #333333;    /* Main body text color */
    --text-secondary: #64748b;  /* Lighter text for descriptions */
    --text-muted: #94a3b8;      /* Muted text for tertiary info */
    --dark-alt: #1e293b;        /* Alternative dark for top-bar, headings */
    --light-alt-bg: #f1f5f9;    /* Light gray for element backgrounds */
    --primary-bg-light: #dcfce7;/* Very light green for cart button */
    --danger: #ef4444;          /* Red for sale tags, notifications */
    
    --radius-sm: 8px;
    --radius-md: 14px;
}
/* --- Global Styles --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

body {
    background-color: var(--light-bg);
    color: var(--text-primary);
}

body.sidebar-open {
    overflow: hidden; /* Prevent background scroll when sidebar is open */
}



.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* --- Top Bar --- */
.top-bar {
    background: var(--dark-alt);
    color: var(--text-muted);
    font-size: 0.85rem;
    padding: 8px 0;
}

.top-bar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.top-bar-links a {
    color: var(--text-muted);
    text-decoration: none;
    margin-left: 15px;
}

/* --- Main Header --- */
.main-header {
    background: var(--card-bg);
    padding: 15px 0;
    border-bottom: 1px solid var(--border);
}

.header-grid {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.logo {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary); /* Uses #059669 */
    text-decoration: none;
}

.logo span {
    color: var(--dark);
}

.search-box {
    display: flex;
    flex: 1;
    max-width: 550px;
    border: 2px solid var(--primary-light);
    border-radius: 8px;
    overflow: hidden;
}

.category-select {
    border: none;
    background: var(--light-alt-bg);
    padding: 0 12px;
    font-size: 0.85rem;
    outline: none;
    border-right: 1px solid var(--border);
}

.search-box input {
    width: 100%;
    padding: 10px 15px;
    border: none;
    outline: none;
}

.search-box button {
    background: var(--primary-light);
    color: white;
    border: none;
    padding: 0 20px;
    cursor: pointer;
    transition: background 0.2s;
}

.search-box button:hover {
    background: var(--primary-hover);
}

.header-actions {
    display: flex;
    gap: 15px;
}

.action-btn {
    text-decoration: none;
    color: var(--dark-alt);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 6px;
    background: var(--light-bg);
    cursor: pointer;
}

.cart-btn {
    position: relative;
    background: var(--primary-bg-light);
    color: var(--primary-hover);
}

.cart-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--danger);
    color: white;
    font-size: 0.75rem;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

/* Dropdown Menu Styles */
.dropdown {
    position: relative;
}

.dropdown-caret {
    font-size: 0.8em;
    margin-left: 4px;
    transition: transform 0.2s ease-in-out;
}

.dropdown.open .dropdown-caret {
    transform: rotate(180deg);
}

.dropdown-menu {
    display: none; /* Hidden by default */
    position: absolute;
    top: 100%;
    right: 0;
    background-color: var(--card-bg);
    min-width: 160px;
    box-shadow: 0 8px 16px 0 rgba(0,0,0,0.1);
    z-index: 10;
    border-radius: var(--radius-sm);
    padding: 5px 0;
    margin-top: 8px;
}

.dropdown-menu a {
    color: var(--text-secondary);
    padding: 10px 15px;
    text-decoration: none;
    display: block;
    font-size: 0.9rem;
}

.dropdown-menu a:hover { background-color: var(--light-alt-bg); }

/* --- Navigation --- */
.navbar {
    background: var(--primary-light);
}

.nav-links {
    display: flex;
    gap: 20px;
}

.nav-links a {
    color: white;
    text-decoration: none;
    padding: 12px 15px;
    font-weight: 500;
    font-size: 0.95rem;
    display: block;
    transition: background 0.2s;
}

.nav-links a:hover, .nav-links a.active {
    background: var(--primary-hover);
}

.deals-link {
    background: var(--accent);
}

.mobile-menu-btn, .close-btn {
    display: none; /* Hidden by default */
    cursor: pointer;
}

/* --- Hero Section --- */
.hero-section {
    background: linear-gradient(rgba(0,0,0,0.3), rgba(0,0,0,0.3)), url('https://images.unsplash.com/photo-1542838132-92c53300491e?w=1200&auto=format&fit=crop') center/cover;
    padding: 80px 0;
    color: white;
    border-radius: 0 0 16px 16px;
}

.hero-card {
    max-width: 500px;
}

.hero-card .badge {
    background: var(--primary-light);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

.hero-card h1 {
    font-size: 2.5rem;
    margin: 15px 0;
    line-height: 1.2;
}

.btn-primary {
    display: inline-block;
    background: var(--primary-light);
    color: white;
    padding: 12px 25px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    margin-top: 15px;
    transition: background 0.2s;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

/* --- Products Section --- */
.products-section {
    padding: 10px 0;
}

.section-title {
    margin-bottom: 30px;
}

.section-title h2 {
    font-size: 1.8rem;
    color: var(--dark);
}

.section-title p {
    color: var(--text-secondary);
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 25px;
}

.product-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    transition: transform 0.2s, box-shadow 0.2s;
    max-width: 350px;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.05);
}

.product-card .tag {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 3px 8px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 4px;
    color: white;
    z-index: 2;
}

.tag.sale { background: var(--danger); }
.tag.organic { background: var(--primary-light); }

.product-img {
    height: 180px;
    overflow: hidden;
    background: var(--light-bg);
}

.product-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-info {
    padding: 15px;
}

.product-info .category {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 600;
}

.product-info h3 {
    font-size: 1rem;
    margin: 5px 0;
    color: var(--dark-alt);
}

.rating {
    font-size: 0.85rem;
    color: var(--accent);
    margin-bottom: 10px;
}

.rating span {
    color: var(--text-muted);
}

.price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
}

.price {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-light);
}

.old-price {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-decoration: line-through;
    font-weight: normal;
}

.add-cart-btn {
    background: var(--light-alt-bg);
    border: none;
    color: var(--dark);
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}

.add-cart-btn:hover {
    background: var(--primary-light);
    color: white;
}
.rem-cart-btn {
    background: var(--green-button);
    border: none;
    color: var(--dark);
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}

.rem-cart-btn:hover {
    background: var(--green-button-hover);
    color: white;
}

/* --- Footer --- */
.main-footer {
    background: var(--dark);
    color: var(--text-muted);
    padding-top: 50px;
    margin-top: 40px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    padding-bottom: 40px;
}

.footer-grid h3 span { color: var(--primary-light); }
.footer-grid h4 { color: white; margin-bottom: 15px; }

.footer-grid ul { list-style: none; }
.footer-grid ul li { margin-bottom: 8px; }
.footer-grid ul li a { color: var(--text-muted); text-decoration: none; }
.footer-grid ul li a:hover { color: white; }

.footer-bottom {
    border-top: 1px solid var(--dark-alt);
    text-align: center;
    padding: 20px 0;
    font-size: 0.85rem;
}
/* ==========================================
   RESPONSIVE MEDIA QUERIES (CodeCanyon Ready)
   ========================================== */

/* --- Medium Screens & Tablets (max-width: 992px) --- */
@media (max-width: 992px) {
    .header-grid {
        flex-wrap: wrap;
    }

    .search-box {
        order: 3;
        flex: 1 1 100%; /* Force search bar to its own full row on tablets */
        margin-top: 10px;
    }

    .hero-card h1 {
        font-size: 2rem;
    }

    .product-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 15px;
    }
}

/* --- Mobile Devices & Phones (max-width: 768px) --- */
@media (max-width: 830px) {
    .top-bar-content {
        flex-direction: column;
        gap: 6px;
        text-align: center;
    }

    .mobile-menu-btn {
        display: flex; /* Show hamburger on tablets and smaller */
        background: var(--light-alt-bg);
        border: none;
    }

    .nav-links {
        overflow-x: auto; /* Horizontal scrollable nav tabs on mobile */
        white-space: nowrap;
        padding-bottom: 5px;
        -webkit-overflow-scrolling: touch;
    }

    .nav-links::-webkit-scrollbar {
        display: none; /* Hide scrollbar for clean app-like look */
    }

    /* Sidebar Styles */
    .navbar {
        position: fixed;
        top: 0;
        left: -100%; /* Hidden off-screen */
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.5); /* Semi-transparent overlay */
        z-index: 1000;
        transition: left 0.3s ease-in-out;
        visibility: hidden;
    }

    body.sidebar-open .navbar {
        left: 0;
        visibility: visible;
    }

    .navbar .nav-links {
        position: absolute;
        top: 0;
        left: -280px; /* Hidden off-screen */
        width: 280px;
        height: 100%;
        background: var(--card-bg);
        flex-direction: column;
        align-items: flex-start;
        gap: 0;
        padding: 20px;
        padding-top: 60px;
        transition: left 0.3s ease-in-out;
        white-space: normal;
        overflow-y: auto;
    }

    body.sidebar-open .navbar .nav-links {
        left: 0;
    }

    .navbar .nav-links a {
        color: var(--dark);
        width: 100%;
        border-radius: 6px;
    }

    .hero-section {
        padding: 50px 0;
    }

    .hero-card h1 {
        font-size: 1.6rem;
    }

    .footer-grid {
        grid-template-columns: 1fr; /* Stack footer sections vertically */
        text-align: center;
    }

    .close-btn {
        display: block;
        position: absolute;
        top: 15px;
        right: 20px;
        font-size: 2rem;
        color: var(--text-muted);
        background: none;
        border: none;
    }
}

/* --- Small Smartphones (max-width: 480px) --- */
@media (max-width: 480px) {
    .category-select {
        display: none; /* Hide category select inside search bar on small screens to save space */
    }

    .logo {
        font-size: 1.5rem;
    }

    .action-btn span:not(.cart-count) {
        display: none; /* Hide "Account" text label, leave only icon */
    }

    .product-grid {
        grid-template-columns: repeat(2, 1fr); /* Clean 2-column grid on mobile phones */
        gap: 10px;
    }

    .product-info {
        padding: 10px;
    }

    .product-info h3 {
        font-size: 0.85rem;
    }

    .price {
        font-size: 0.95rem;
    }

    .add-cart-btn {
        padding: 4px 8px;
        font-size: 0.8rem;
    }
}


        /* --- Horizontal Category Chips Slider (YouTube Style) --- */
        .category-slider-wrapper {
            background: #ffffff;
            border-bottom: 1px solid var(--border);
            padding: 12px 0;
            box-shadow: 0 2px 4px rgba(0,0,0,0.02);
        }

        .category-chips-slider {
            display: flex;
            gap: 10px;
            overflow-x: auto;
            white-space: nowrap;
            scroll-behavior: smooth;
            -webkit-overflow-scrolling: touch; /* iOS Momentum Scrolling */
            padding: 2px 5px;
            cursor: grab;
        }

        .category-chips-slider.dragging {
            cursor: grabbing;
            scroll-behavior: auto;
        }

        /* Hide Scrollbar */
        .category-chips-slider::-webkit-scrollbar {
            display: none;
        }
        .category-chips-slider {
            -ms-overflow-style: none;
            scrollbar-width: none;
        }

        /* Chip Buttons */
        .chip {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            background: #f1f5f9;
            color: var(--text);
            border: 1px solid var(--border);
            padding: 8px 18px;
            border-radius: 20px;
            font-size: 0.9rem;
            font-weight: 500;
            cursor: pointer;
            white-space: nowrap;
            user-select: none;
            transition: all 0.2s ease;
        }

        .chip i {
            font-size: 0.9rem;
            color: var(--text-light);
        }

        .chip:hover {
            background: #e2e8f0;
        }

        .chip.active {
            background: var(--dark);
            color: #ffffff;
            border-color: var(--dark);
        }

        .chip.active i {
            color: var(--primary);
        }

        .chip-deal {
            background: #fef3c7;
            border-color: #fde68a;
            color: #b45309;
        }

        .chip-deal i { color: #d97706; }

        /* --- Demo Content --- */
        .content-demo {
            padding: 40px 0;
            text-align: center;
        }

/* Add this to your main CSS file! to hide button that is clicked*/
.d-none { display: none !important; }
.pe-none { pointer-events: none !important; }

/*action buttons*/
/* Container for the buttons */
.cart-actions {
    display: flex;
    justify-content: flex-end; /* <--- This is the magic property! */
    gap: 15px; 
    width: 100%;
}

/* Make both wrappers take up exactly 50% of the space */
.btn-order {
    /*flex: 1;*/
    width: 125px;
}

/* Base button styling */
.btn-order button {
    width: 100%; /* Fill the 50% wrapper */
    padding: 12px 15px;
    font-size: 16px;
    font-weight: bold;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

/* Red Remove Button */
.remove-btn {
    background-color: #dc3545; 
}

.remove-btn:hover {
    background-color: #c82333;
}

/* Green Order Button */
.order-btn {
    background-color: #28a745;
}

.order-btn:hover {
    background-color: #218838;
}
.text-success{
  color: #02aabd !important;
}
.me-4{
    margin-left: 4px;
}
.me-3{
    margin-left: 3px;
}
.me-2{
    margin-left: 2px;
}
.me-1{
    margin-left: 1px;
}

.mr-4{
    margin-right: 4px;
}
.mr-3{
    margin-right: 3px;
}
.mr-2{
    margin-right: 2px;
}
.mr-1{
    margin-right: 1px;
}
.m-15{
    margin: 15px;
}
.m-10{
    margin: 10px;
}
.m-4{
    margin: 4px;
}
.m-3{
    margin: 3px;
}
.m-2{
    margin: 2px;
}
.m-1{
    margin: 1px;
}
.p-4{
    padding: 4px;
}
.p-3{
    padding: 3px;
}
.p-2{
    padding: 2px;
}
.p-1{
    padding: 1px;
}
/* --- Scroll to Top Button --- */
.scroll-top-btn {
    position: fixed;
    bottom: 25px;
    right: 25px;
    width: 44px;
    height: 44px;
    background-color: var(--primary);
    color: #ffffff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease-in-out;
    z-index: 999;
}

.scroll-top-btn:hover {
    background-color: var(--primary-hover);
    transform: translateY(-3px);
}

/* Class added via JS when scrolled down */
.scroll-top-btn.show {
    opacity: 1;
    visibility: visible;
}
/* end scroll up button */

/*start style for the checkbox*/
/* Container for the custom checkbox */
.custom-checkbox {
    display: flex;
    align-items: center;
    position: relative;
    cursor: pointer;
    font-size: 16px;
    user-select: none;
}

/* Hide the default browser checkbox */
.custom-checkbox input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

/* Create a custom box */
.checkmark {
    height: 20px;
    width: 20px;
    background-color: #fff;
    border: 2px solid #ccc;
    border-radius: 4px;
    margin-right: 10px;
    transition: all 0.2s ease-in-out;
    position: relative;
}

/* On hover, slightly darken border */
.custom-checkbox:hover input ~ .checkmark {
    border-color: #999;
}

/* When checked, change background to your success green */
.custom-checkbox input:checked ~ .checkmark {
    background-color: #198754;
    border-color: #198754;
}

/* Create the checkmark indicator (hidden by default) */
.checkmark:after {
    content: "";
    position: absolute;
    display: none;
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* Show the checkmark when checked */
.custom-checkbox input:checked ~ .checkmark:after {
    display: block;
}
/*end for the style of checkbox*/

/*makes the form input clickable in the whole input */
.search-box form {
  width: 100%;
  display: flex; /* If you need the input and a button side-by-side */
}
.search-box input {
  width: 100%;
}
/*end form input click*/