/* Custom styles for nutrition breakfast project */
html, body {
    overflow: visible !important;
    margin: 0;
    padding: 0;
    height: auto;
}
body {
    font-family: 'Arial', sans-serif;
}

/* Ensure main content clears fixed header on desktop */
@media (min-width: 992px) {
    body {
        padding-top: 140px !important; /* header height (32px logo + padding) + extra distance; adjust if header grows */
    }
}

.card-img-wrapper {
    position: relative;
    overflow: hidden;
    width: 100%;
}

.card {
    border: none;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    border-radius: 15px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
    height: auto;
    display: block;
    background-color: #f8f9fa;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
}

.card-img-top {
    height: 200px !important;
    object-fit: cover;
    background: white;
    transition: transform 0.3s ease;
}

.card-img-top:hover {
    transform: scale(1.05);
}

.special-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: linear-gradient(45deg, #ff6b6b, #ff5252);
    color: white;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: bold;
    z-index: 1;
    text-transform: uppercase;
}

.new-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: linear-gradient(45deg, #4CAF50, #45a049);
    color: white;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: bold;
    z-index: 1;
    text-transform: uppercase;
}

.add-to-cart {
    width: 100%;
}

.card-text {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
    min-height: 4.2rem; /* 3 lines * 1.4 line-height */
    max-height: 4.2rem; /* Ensure consistent height */
}

footer {
    margin-top: auto;
}

/* Chat floating button */
.chat-float {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
}

.chat-float a {
    display: inline-block;
    background: #007bff;
    color: white;
    padding: 15px;
    border-radius: 50px;
    text-decoration: none;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    transition: background 0.3s ease;
}

.chat-float a:hover {
    background: #0056b3;
    color: white;
    text-decoration: none;
}

/* Bottom navigation */
.bottom-nav {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    background: white !important;
    border-top: 1px solid #ddd !important;
    z-index: 1010 !important;
    display: block !important;
}

.bottom-nav i {
    margin-bottom: 4px;
}

/* Responsive Menu */
.desktop-menu {
    display: block;
}

.mobile-menu {
    display: none;
}

.filter-hidden {
    display: none !important;
}

/* Product detail page styles */
.product-image-container {
    position: relative;
    overflow: hidden;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.product-details {
    padding: 2rem;
    background: white;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.product-info h4 {
    border-bottom: 2px solid #f8f9fa;
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
}

.product-info .fas {
    margin-right: 0.5rem;
    color: #6c757d;
}

.price-section {
    background: linear-gradient(135deg, #fff5f5 0%, #fef2f2 100%);
    padding: 1.5rem;
    border-radius: 10px;
    border-left: 4px solid #dc3545;
    margin-bottom: 2rem;
}

.action-section .btn {
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

.action-section .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4);
}

@media (max-width: 991px) {
    /* 移动端展开菜单的背景色 */
    .navbar-collapse {
        background-color: rgba(0, 0, 0, 0.95);
        padding: 10px;
        border-radius: 8px;
        margin-top: 10px;
    }
    .bottom-nav {
        display: block;
    }
    body {
        font-size: 14px;
        padding-bottom: 60px;
        padding-top: 80px;
    }
    .card-img-top {
        height: 180px !important;
    }
    .special-badge {
        font-size: 10px;
        padding: 3px 5px;
    }
    footer {
        display: none;
    }
    /* .navbar-expand-lg {
        display: none;
    } */
    .card {
        border-radius: 10px;
        margin-bottom: 15px !important;
        height: auto;
        display: block;
    }
    /* Two-column layout with free stacking */
    .left-column, .right-column {
        padding: 0 8px;
    }
    .left-column .card,
    .right-column .card {
        margin-bottom: 15px !important;
    }
    .mobile-menu .col-6 {
        padding-left: 12px;
        padding-right: 12px;
    }
    .price-cent {
        font-size: 12px;
    }
    .desktop-menu {
        display: none;
    }
    .mobile-menu {
        display: block;
    }

    .product-details {
        padding: 1rem;
        margin-top: 1rem;
    }

    .product-image-container img {
        width: 100% !important;
        height: auto !important;
    }
}
