html,
/* Update the existing body rule */
body {
    font-family: Arial, sans-serif;
    background-color: #f8f9fa;
    overflow-x: hidden;

    /* FIX: Add padding to push content down below the fixed navbar */
    padding-top: 27px;
}

/* --- NEW FEATURED PRODUCTS SCROLLING STYLES --- */
.featured-products-container {
    position: relative;
    padding: 0; /* REMOVED SIDE PADDING */
    margin: 0; /* REMOVED SIDE MARGIN */
    width: 100%;
}

.scrolling-product-row {
    display: flex;
    overflow-x: scroll; /* Allows manual horizontal swiping/scrolling */
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch; /* Improves mobile scroll performance */
    padding: 0;
    margin: 0;
    scroll-snap-type: x mandatory; /* Ensures cards snap into place cleanly */
    scroll-padding: 0;
}

.scrolling-product-row::-webkit-scrollbar {
    display: none; /* Hide scrollbar for a cleaner mobile look */
}

.scrolling-product-row .product-item-wrapper {
    /* Mobile: Show 2 items simultaneously, so each item is 50% width. */
    flex: 0 0 50%;
    max-width: 50%;
    padding: 0.5rem; /* Spacing between cards */
    box-sizing: border-box;
    scroll-snap-align: start;
}

@media (min-width: 768px) {
    .scrolling-product-row .product-item-wrapper {
        /* Desktop: Show 4 items simultaneously, so each item is 25% width. */
        flex: 0 0 25%;
        max-width: 25%;
    }
}

/* --- Indicator Dot Styling --- */
.indicator-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    background-color: #ccc;
    border-radius: 50%;
    margin: 0 4px;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.3s;
}

.indicator-dot.active {
    background-color: #4CAF50;
    transform: scale(1.2);
}

/* --- Navigation Arrow Styling (Desktop Only) --- */
.scroll-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: #4CAF50;
    color: white;
    border: none;
    cursor: pointer;
    z-index: 10;
    width: 40px;
    height: 40px;
    line-height: 40px;
    text-align: center;
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    transition: background 0.3s;
    display: none; /* Hidden by default (i.e., hidden on mobile) */
}

.scroll-arrow:hover {
    background: #4CAF50;
}

.scroll-arrow.left {
    left: 10px; /* Adjusted position */
}

.scroll-arrow.right {
    right: 10px; /* Adjusted position */
}

@media (min-width: 992px) { /* Show arrows only on desktop */
    .scroll-arrow {
        display: block;
    }
}
/* --- END NEW FEATURED PRODUCTS SCROLLING STYLES --- */


/* Add an explicit height to the top-bar so padding works correctly */
.top-bar {
    height: 34px; /* Approximate height of top bar + padding */
    background-color: #4CAF50;
    color: white;
    padding: 8px 0;
    overflow: hidden;
    white-space: nowrap;
    width: 100%;
}

/* Marquee Animation Styles */
.marquee-content {
    display: inline-block;
    animation: marquee-slide 25s linear infinite;
    padding-left: 100%;
}

@keyframes marquee-slide {
    0% { transform: translateX(0%); }
    100% { transform: translateX(-100%); }
}

.navbar {
    background-color: #f7f9fc;
    border-bottom: 1px solid #e0e0e0;

    /* FIX: Changed back to fixed for reliability */
    position: fixed;

    top: 0;
    z-index: 1020;
    width: 100vw;
}

.navbar-brand img {
    height: 40px;
}

.navbar-nav .nav-link {
    color: #333;
    font-weight: 500;
    margin-right: 15px;
}

.navbar-nav .nav-link:hover {
    color: #4CAF50;
}

.navbar-nav .nav-link,
.navbar-icons .nav-item .nav-link {
    font-weight: bold;
    color: black;
}

.navbar-icons .nav-item .nav-link {
    font-size: 20px;
    margin-left: 20px;
}

.cart-icon-container {
    position: relative;
    display: inline-block;
}

.cart-icon-badge {
    position: absolute;
    top: 0;
    right: 0;
    transform: translate(50%, -50%);
    padding: 2px 6px;
    border-radius: 50%;
    background-color: #4CAF50;
    color: white;
    font-size: 10px;
    font-weight: bold;
}

 .dropdown:hover>.dropdown-menu {
            display: block;
        }

        .user-dropdown .dropdown-menu {
            border: none;
            box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
            border-radius: 8px;
            padding: 10px;
        }

        .user-dropdown .dropdown-menu a {
            font-weight: normal;
        }

        /* Submenu styling */
        .dropdown-submenu {
            position: relative;
        }

        .dropdown-submenu>.dropdown-menu {
            top: 0;
            left: 100%;
            margin-top: -1px;
        }


.modal-content {
    border-radius: 12px;
    border: none;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.modal-header {
    border-bottom: none;
}

.modal-body {
    padding-top: 0;
    padding-bottom: 2rem;
}

#searchModal .modal-body {
    text-align: center;
}

#searchModal input {
    border-radius: 50px;
    padding: 10px 20px;
    border-color: #ddd;
    width: 100%;
    outline: none;
    box-shadow: none;
}

.list-group-item {
    border-color: #eee;
}

@media (max-width: 991.98px) {
    .navbar-collapse {
        text-align: left;
    }

    .navbar-brand {
        flex-grow: 1;
    }

    .dropdown-menu {
        position: static !important;
        float: none !important;
        width: 100% !important;
    }
}

@media (min-width: 992px) {
    .desktop-nav-links {
        margin-right: 2rem;
    }

    .navbar-nav {
        margin-left: 1.5rem;
    }

    .dropdown-menu {
        position: absolute !important;
    }
}

.search-item {
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
    text-align: left;
}

.search-item img {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    object-fit: cover;
    margin-right: 1rem;
}

.search-item .details {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.search-item .product-name {
    font-weight: bold;
    color: #333;
    margin-bottom: 0.25rem;
}

.search-item .product-price {
    font-weight: bold;
    color: #4CAF50;
    font-size: 1.1rem;
}

.offcanvas-header {
    background-color: black;
    color: white;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.offcanvas-header .btn-close {
    background-color: white;
}

.offcanvas-body .nav-link {
    font-weight: normal;
    color: black;
    padding: 1rem 0;
}

.offcanvas-body .sign-in-button {
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 50px;
    padding: 0.75rem 2rem;
    text-align: center;
    font-weight: bold;
    text-decoration: none;
    display: inline-block;
    margin-bottom: 1rem;
}

.offcanvas-body .divider {
    border-top: 1px solid rgba(0, 0, 0, 0.4);
    margin: 0.2rem 0;
}

/* Reusable Title Styling with Bottom Line */
.section-title-line {
    font-weight: bold;
    color: #333;
    position: relative;
    display: inline-block;
    width: 100%;
    text-align: center;
    margin-bottom: 2.5rem;
}

.section-title-line::after {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: -8px;
    width: 100px;
    height: 3px;
    background-color: #4CAF50;
}

/* Category Section Styling */
.category-item {
    position: relative;
    text-align: center;
    color: white;
}

.category-item img {
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
    width: 100%;
    height: auto;
}

.category-item:hover img {
    transform: translateY(-5px);
}

.category-name {
    position: absolute;
    top: 1rem;
    left: 1rem;
    font-weight: bold;
    font-size: 1.25rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

/* Styling for the new "Featured Products" section */

.product-filter-dropdown .dropdown-menu {
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);

    /* FIX 1: Tighter spacing (Set margin to a very low value to reduce gap) */
    margin-top: 2px !important;

    /* FIX 2: Guarantees full opacity and stacking order over products */
    background-color: white;
    z-index: 1050;
}

/* FIX 4: Ensures individual list items are fully opaque white */
.dropdown-item {
    background-color: white;
}

.product-filter-dropdown .dropdown-item.active,
.product-filter-dropdown .dropdown-item:active {
    background-color: #4CAF50;
    color: white;
}

.product-card {
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    text-align: center;
    transition: box-shadow 0.3s ease;
    position: relative;
}

.product-card:hover {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.product-card img {
    width: 100%;
    height: auto;
}

.product-card .card-body {
    padding: 1rem;
}

.product-card .product-name {
    font-weight: bold;
    color: #333;
    margin-bottom: 0.5rem;
    min-height: 72px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    text-overflow: ellipsis;
    white-space: normal;
    text-align: left;
}

.product-card .product-price {
    font-weight: bold;
    color: #4CAF50;
    font-size: 1.25rem;
    margin-bottom: 1rem;
    text-align: left;
}

.product-buttons {
    display: flex;
    margin-top: 1rem;
    position: relative;

}

.product-buttons .btn-sm {
    font-size: 0.8rem;
    padding: 0.5rem 1rem;
}

.btn-success {
    /* Sets the default background color to the Oraimo Green */
    background-color: black !important;
    border-color: black !important;
    color: white !important; /* Ensure text remains white */
}

.btn-success:hover,
.btn-success:focus {
    /* Sets the color when the user hovers or focuses on the button */
    background-color: #4CAF50 !important; /* A slightly darker shade of green */
    border-color: #4CAF50 !important;
    color: white !important;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); /* Optional: add a slight shadow */
}

.product-buttons .btn {
    border-radius: 50px;
    font-weight: bold;
}

/* --- VIEW MORE BUTTON (based on .btn-outline-success) --- */

.btn-outline-success {
    /* Default state: Green border, Green text */
    color: #4CAF50 !important;
    border-color: #4CAF50 !important;
}

.btn-outline-success:hover,
.btn-outline-success:focus {
    /* HOVER STATE: Fills with Green background, White text */
    background-color: #4CAF50 !important;
    border-color: #4CAF50 !important;
    color: white !important;
}

.view-more-btn {
    /* Override: Ensure default is green outline/text */
    background-color: transparent;
    color: #4CAF50;
    border: 1px solid #4CAF50;
    font-weight: bold;
    padding: 10px 30px;
    border-radius: 50px;
    transition: all 0.3s ease;
}

.view-more-btn:hover {
    /* HOVER STATE: Solid Black background, White text */
    background-color: black;
    color: white;
    border-color: black;
}

/* Styles for the success message and animations */
.success-message {
    font-size: 0.9rem;
    color: #4CAF50;
    font-weight: bold;
    text-align: center;
    opacity: 0;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.5s ease-out;
    pointer-events: none;
    white-space: nowrap;
    background-color: black;
    padding: 10px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.success-message.visible {
    opacity: 1;
}

/* Update the existing stylesheet with the new rule */
.d-grid .btn-light {
    /* FIX: Force text onto a single line */
    white-space: nowrap;
    overflow: hidden;
}

.product-buttons.animate-particles::before,
.product-buttons.animate-particles::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    background-color: #4CAF50;
    border-radius: 50%;
    opacity: 0;
    pointer-events: none;
    z-index: 10;
    transform: translate(-50%, -50%);
}

.product-buttons.animate-particles::before {
    animation: particles-1 0.8s ease-out forwards;
}

@keyframes particles-1 {
    0% {
        transform: translate(-50%, -50%) scale(0.5);
        opacity: 1;
    }

    100% {
        transform: translate(-100px, -100px) scale(0);
        opacity: 0;
    }
}

@keyframes particles-2 {
    0% {
        transform: translate(-50%, -50%) scale(0.5);
        opacity: 1;
    }

    100% {
        transform: translate(100px, 100px) scale(0);
        opacity: 0;
    }
}

@media (max-width: 767.98px) {
    .product-buttons {
        flex-direction: column;
    }

    .product-buttons .btn {
        margin-bottom: 0.5rem;
    }
}

/* --- PRODUCT PAGE SPECIFIC STYLES --- */
.product-image-container {
    position: sticky;
    top: 20px;
}

.product-main-image {
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.product-thumbnails img {
    border: 2px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.product-thumbnails img:hover,
.product-thumbnails img.active {
    border-color: #4CAF50;
}

.product-details {
    background-color: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.product-title {
    font-weight: bold;
    color: #333;
}

.product-price {
    font-size: 2rem;
    font-weight: bold;
    color: #4CAF50;
}

.quantity-selector {
    border: 1px solid #ddd;
    border-radius: 50px;
    overflow: hidden;
}

.quantity-selector button {
    background-color: transparent;
    border: none;
    padding: 0.5rem 1rem;
    font-size: 1.25rem;
    color: #333;
    transition: background-color 0.2s;
    border-radius: 50px;
}

.quantity-selector button:hover {
    background-color: #f0f0f0;
}

.quantity-selector input {
    border: none;
    width: 50px;
    text-align: center;
    font-weight: bold;
    color: #333;
    box-shadow: none;
}

.action-buttons .btn {
    border-radius: 50px;
    font-weight: bold;
    padding: 10px 30px;
}

/* Example CSS for your external file */
.pagination-style-black .pagination .page-item.active .page-link {
    background-color: #4CAF50 !important;
    border-color: #4CAF50 !important;
    color: white !important;
}
