:root {
    --primary-color: #2c3e50;
    --secondary-color: #e74c3c;
    --accent-color: #f39c12;
    --light-color: #ecf0f1;
    --dark-color: #34495e;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
    color: #333;
    padding-bottom: 70px; /* Space for bottom navbar */
}

/* Header Styles */
.header {
    background-color: white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-top {
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

.logo {
    height: 40px;
}

.search-container {
    position: relative;
    max-width: 600px;
    margin: 0 auto;
}

.search-input {
    width: 100%;
    padding: 8px 40px 8px 15px;
    border: 1px solid #ddd;
    border-radius: 25px;
    font-size: 14px;
}

.search-button {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--primary-color);
}

.user-info {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 15px;
    font-size: 14px;
}

.cart-icon {
    position: relative;
}

.cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--secondary-color);
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
}

/* Slider */
.slider-section {
    padding: 20px 0;
    background-color: white;
}

.slider-container {
    max-width: 900px;
    margin: 0 auto;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.carousel-item img {
    width: 100%;
    height: 250px;
    object-fit: cover;
}

/* Category Slide - No Box Style */
.category-section {
    padding: 15px 0;
    background-color: white;
    border-bottom: 1px solid #eee;
}

.section-title {
    font-size: 18px;
    font-weight: bold;
    color: var(--dark-color);
    margin-bottom: 10px;
    text-align: left;
    padding-left: 15px;
}

.category-container {
    position: relative;
    overflow: hidden;
}

.category-slider {
    display: flex;
    overflow-x: auto;
    scroll-behavior: smooth;
    scrollbar-width: none; /* Hide scrollbar for Firefox */
    -ms-overflow-style: none; /* Hide scrollbar for IE and Edge */
    padding: 5px 0;
    white-space: nowrap;
}

.category-slider::-webkit-scrollbar {
    display: none; /* Hide scrollbar for Chrome, Safari, and Opera */
}

.category-btn {
    display: inline-flex;
    align-items: center;
    padding: 8px 15px;
    background: transparent;
    border: none;
    border-radius: 20px;
    text-decoration: none;
    color: var(--dark-color);
    font-size: 14px;
    margin-right: 10px;
    transition: all 0.3s;
    white-space: nowrap;
    cursor: pointer;
}

.category-btn:hover {
    background-color: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

.category-btn.active {
    background-color: var(--secondary-color);
    color: white;
}

.category-btn i {
    margin-right: 6px;
    font-size: 14px;
}

/* Product Section */
.product-section {
    padding: 30px 0;
    background-color: #f8f9fa;
}

.section-title.product-title {
    font-size: 24px;
    margin-bottom: 20px;
    text-align: center;
    position: relative;
    padding-bottom: 15px;
}

.section-title.product-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background: var(--secondary-color);
}

.product-container {
    max-width: 1200px;
    margin: 0 auto;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 25px;
    justify-content: center;
}

.product-card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0,0,0,0.08);
    transition: all 0.3s;
    border: 1px solid #eee;
    max-width: 280px;
    margin: 0 auto;
    opacity: 1;
    transform: scale(1);
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
}

.product-card.hidden {
    display: none;
}

.product-image {
    height: 200px;
    overflow: hidden;
    position: relative;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.product-card:hover .product-image img {
    transform: scale(1.05);
}

.discount-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--secondary-color);
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
}

.product-info {
    padding: 18px;
}

.product-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 10px;
    height: 48px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.product-title a {
    color: var(--dark-color);
    text-decoration: none;
}

.product-title a:hover {
    color: var(--secondary-color);
}

.product-price {
    color: var(--secondary-color);
    font-weight: bold;
    font-size: 18px;
    margin-bottom: 8px;
}

.original-price {
    color: #999;
    font-size: 14px;
    text-decoration: line-through;
    margin-left: 5px;
}

.stock-status {
    font-size: 14px;
    margin-bottom: 8px;
}

.in-stock {
    color: #27ae60;
}

.out-of-stock {
    color: #e74c3c;
}

.product-location {
    font-size: 12px;
    color: #777;
}

/* Loading indicator */
.loading {
    text-align: center;
    padding: 20px;
    display: none;
}

.loading.active {
    display: block;
}

/* Footer */
footer {
    background-color: var(--dark-color);
    color: white;
    padding: 40px 0 20px;
    margin-top: 50px;
}

.footer-container {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 25px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.footer-links a {
    color: white;
    text-decoration: none;
    font-size: 16px;
    transition: color 0.3s;
}

.footer-links a:hover {
    color: var(--accent-color);
}

.footer-copyright {
    font-size: 14px;
    opacity: 0.8;
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 20px;
}

/* Bottom Mobile Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: white;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    z-index: 1000;
    display: none;
    height: 60px;
}

.bottom-nav ul {
    display: flex;
    justify-content: space-around;
    align-items: center;
    height: 100%;
    margin: 0;
    padding: 0;
    list-style: none;
}

.bottom-nav li {
    flex: 1;
    text-align: center;
}

.bottom-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--dark-color);
    text-decoration: none;
    font-size: 11px;
    padding: 5px 0;
    transition: all 0.3s;
    position: relative;
}

.bottom-nav a:hover {
    color: var(--primary-color);
}

.bottom-nav a.active {
    color: var(--secondary-color);
}

.bottom-nav a.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 3px;
    background-color: var(--secondary-color);
    border-radius: 0 0 3px 3px;
}

.bottom-nav i {
    font-size: 20px;
    margin-bottom: 3px;
}

.cart-badge {
    position: absolute;
    top: 5px;
    right: 25%;
    background: var(--secondary-color);
    color: white;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    font-weight: bold;
}

.product-image {
    position: relative;
    overflow: hidden;
}

.product-image-carousel {
    position: relative;
    width: 100%;
    height: 250px;
    overflow: hidden;
}

.product-image-carousel .carousel-item img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.product-image:hover .carousel-item img {
    transform: scale(1.05);
}

.product-image .carousel-control-prev,
.product-image .carousel-control-next {
    width: 30px;
    height: 30px;
    background-color: rgba(0, 0, 0, 0.3);
    border-radius: 50%;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.product-image:hover .carousel-control-prev,
.product-image:hover .carousel-control-next {
    opacity: 1;
}

.product-image .carousel-control-prev {
    left: 10px;
}

.product-image .carousel-control-next {
    right: 10px;
}

.product-image .carousel-control-prev-icon,
.product-image .carousel-control-next-icon {
    width: 15px;
    height: 15px;
}

.product-image .carousel-indicators {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: 0;
}

.product-image .carousel-indicators [data-bs-target] {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin: 0 3px;
}

.discount-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: #dc3545;
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-weight: bold;
    z-index: 10;
}

.product-card {
    transition: transform 0.3s ease,
    box-shadow 0.3s ease;
    opacity: 0;
    transform: scale(0.9);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.product-info {
    padding: 15px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.product-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 10px;
    line-height: 1.3;
    height: 42px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.product-price {
    font-size: 18px;
    font-weight: bold;
    color: #dc3545;
    margin-bottom: 5px;
}

.original-price {
    text-decoration: line-through;
    color: #6c757d;
    font-size: 14px;
    margin-left: 5px;
}

.stock-status {
    font-size: 12px;
    margin-bottom: 5px;
}

.in-stock {
    color: #198754;
}

.out-of-stock {
    color: #dc3545;
}

.product-location {
    font-size: 12px;
    color: #6c757d;
    margin-top: auto;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}

.loading {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.7);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}

.loading.active {
    display: flex;
}

/* Image Zoom Modal */
.image-modal .modal-dialog {
    max-width: 90%;
}

.image-modal .modal-body {
    padding: 0;
}

.image-modal .carousel-item img {
    width: 100%;
    max-height: 80vh;
    object-fit: contain;
}

.image-modal .carousel-control-prev,
.image-modal .carousel-control-next {
    width: 50px;
    height: 50px;
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    top: 50%;
    transform: translateY(-50%);
}

.image-modal .carousel-control-prev {
    left: 20px;
}

.image-modal .carousel-control-next {
    right: 20px;
}

.image-modal .carousel-indicators {
    margin-bottom: 20px;
}

.image-modal .carousel-indicators [data-bs-target] {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin: 0 5px;
}

.load-more-container {
    text-align: center;
    margin: 30px 0;
}

.load-more-btn {
    background-color: #FF6B35;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 50px;
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.load-more-btn:hover {
    background-color: #e55a2b;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

.load-more-btn:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
    transform: none;
}

.no-more-products {
    color: #6c757d;
    font-style: italic;
    margin-top: 20px;
    text-align: center;
}

/* Tablet View - 3 columns */
@media (min-width: 768px) and (max-width: 991.98px) {
    .product-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 15px;
    }

    .product-image-carousel {
        height: 200px;
    }

    .product-image-carousel .carousel-item img {
        height: 200px;
    }

    .product-title {
        font-size: 15px;
        height: 40px;
    }

    .product-price {
        font-size: 17px;
    }

    .product-info {
        padding: 12px;
    }
}


/* Small Mobile View - 1 column */
@media (max-width: 479.98px) {
    .product-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px;
    }

    .product-image {
        height: 120px;
    }

    .section-title {
        font-size: 14px;
    }

    .section-title.product-title {
        font-size: 18px;
    }

    .bottom-nav a {
        font-size: 10px;
    }

    .bottom-nav i {
        font-size: 18px;
    }
}


/* Responsive Styles */
@media (max-width: 768px) {

    .product-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px !important;
    }

    .product-image-carousel {
        height: 180px !important;
    }

    .product-image-carousel .carousel-item img {
        height: 180px !important;
    }

    .product-title {
        font-size: 14px !important;
        height: 38px !important;
    }

    .product-price {
        font-size: 16px !important;
    }

    .product-info {
        padding: 10px !important;
    }

    .discount-badge {
        padding: 3px 6px !important;
        font-size: 12px !important;
    }

    .header-top {
        padding: 8px 0;
    }

    .logo {
        height: 30px;
    }

    /* Hide the third row (user info) on mobile */
    .user-info-row {
        display: none;
    }

    .carousel-item img {
        height: 180px;
    }

    /* Category section adjustments for mobile */
    .section-title {
        font-size: 16px;
        margin-bottom: 8px;
        padding-left: 10px;
    }

    .category-btn {
        padding: 6px 12px;
        font-size: 12px;
        margin-right: 8px;
    }

    .category-btn i {
        font-size: 12px;
        margin-right: 4px;
    }

    .product-section {
        padding: 20px 0;
    }

    .section-title.product-title {
        font-size: 20px;
        margin-bottom: 15px;
    }

    .product-grid {
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
        gap: 15px;
    }

    .product-card {
        max-width: 100%;
    }

    .product-image {
        height: 150px;
    }

    .product-title {
        font-size: 14px;
        height: 40px;
    }

    .product-price {
        font-size: 16px;
    }

    .discount-badge {
        font-size: 11px;
        padding: 3px 6px;
    }

    .stock-status, .product-location {
        font-size: 12px;
    }

    .footer-links {
        flex-direction: column;
        align-items: center;
        gap: 12px;
    }

    /* Show bottom navigation on mobile */
    .bottom-nav {
        display: block;
    }
}
