/* Global Styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
}

/* CSS Custom Properties for responsive spacing */
:root {
    --navbar-height: 56px;
    --order-summary-height: 80px;
    --desktop-top-spacing: 80px;
    --mobile-top-spacing: 70px;
    --mobile-small-top-spacing: 80px;
}

@media (max-width: 991.98px) {
    :root {
        --mobile-top-spacing: 80px;
        --mobile-small-top-spacing: 90px;
    }
}

@media (max-width: 576px) {
    :root {
        --mobile-top-spacing: 90px;
        --mobile-small-top-spacing: 100px;
    }
}

/* Desktop and larger screen adjustments */
@media (min-width: 992px) {
    :root {
        --desktop-top-spacing: 90px; /* Slightly more spacing for larger screens */
    }
}

@media (min-width: 1200px) {
    :root {
        --desktop-top-spacing: 100px; /* Even more spacing for extra large screens */
    }
}

/* Prevent horizontal scrolling globally on mobile */
@media (max-width: 991.98px) {
    html, body {
        overflow-x: hidden !important;
        max-width: 100vw !important;
        width: 100% !important;
    }
    
    .container {
        overflow-x: hidden !important;
        max-width: 100vw !important;
        width: 100% !important;
    }
}

/* Responsive Table Styles - Table on Desktop, Horizontal Cards on Mobile */
@media (max-width: 991.98px) {
    /* Completely prevent horizontal scrolling on mobile */
    .table {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
        table-layout: fixed !important;
    }
    
    /* Force table container to not scroll */
    .table-container {
        overflow-x: hidden !important;
        max-width: 100vw !important;
        width: 100% !important;
    }
    
    /* Hide table headers on mobile */
    .d-lg-table-header {
        display: none !important;
    }
    
    /* Make table rows look like horizontal cards on mobile */
    .product-row {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        margin-bottom: 1rem;
        border: 1px solid #dee2e6;
        border-radius: 0.5rem;
        /* background: #ffeb3b !important;  */
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
        padding: 1rem;
        gap: 1rem;
        position: relative;
        width: 100% !important;
        max-width: 100% !important;
        overflow: hidden !important;
        flex-wrap: wrap !important;
    }
    
    .product-row td {
        display: block !important;
        border: none !important;
        padding: 0;
        text-align: left;
        flex-shrink: 0;
    }
    
    /* Product image styling on mobile - left side */
    .product-image {
        flex: 0 0 auto;
        width: 80px;
        text-align: center;
    }
    
    .product-image img {
        width: 80px !important;
        height: 80px !important;
        border-radius: 0.5rem;
        object-fit: cover;
        border: 2px solid #ffffff;
        background: #ffffff;
        cursor: pointer;
    }
    
    /* Product name styling on mobile - center */
    .product-name {
        flex: 1;
        text-align: left;
        padding: 0;
        border: none;
        margin-bottom: 0.5rem;
    }
    
    .product-name strong {
        font-size: 1rem;
        color: #212529;
        display: block;
        margin-bottom: 0.25rem;
        font-weight: 600;
    }
    
    .product-name small {
        font-size: 0.8rem;
        color: #666;
    }
    
    /* Product price styling on mobile - right side */
    .product-price {
        flex: 0 0 auto;
        text-align: right;
        padding: 0;
        background: none;
        margin: 0;
        min-width: 100px;
    }
    
    .product-price .h6 {
        font-size: 1rem;
        margin-bottom: 0.25rem;
        color: #212529;
        font-weight: 600;
    }
    
    .product-price .badge {
        font-size: 0.7rem;
        background: #dc3545;
        color: white;
    }
    
    /* Product quantity and total styling on mobile - bottom row */
    .product-quantity,
    .product-total {
        display: flex !important;
        justify-content: space-between;
        align-items: center;
        padding: 0.5rem 0;
        border: none;
        margin-top: 0.5rem;
    }
    
    .product-quantity {
        flex: 1;
        margin-right: 1rem;
    }
    
    .product-quantity input {
        width: 80px !important;
        font-size: 0.9rem;
        border: 2px solid #dee2e6;
        border-radius: 0.25rem;
        background: #ffffff;
        color: #212529;
        text-align: center;
        font-weight: 600;
    }
    
    .product-quantity small {
        font-size: 0.75rem;
        display: block;
        margin-top: 0.25rem;
        /* color: #666; */
    }
    
    .product-total {
        flex: 0 0 auto;
        /* background: #8b4513 !important;  */
        color: white !important;
        border-radius: 0.375rem;
        padding: 0.5rem 0.75rem;
        margin: 0;
        min-width: 80px;
        text-align: center;
        font-weight: 600;
    }
    
    /* Hide description and original price on mobile */
    .d-lg-table-cell {
        display: none !important;
    }
    
    /* Responsive adjustments for very small screens */
    @media (max-width: 576px) {
        .product-row {
            padding: 0.75rem;
            gap: 0.75rem;
        }
        
        .product-image img {
            width: 70px !important;
            height: 70px !important;
        }
        
        .product-name strong {
            font-size: 0.9rem;
        }
        
        .product-price {
            min-width: 90px;
        }
        
        .product-quantity input {
            width: 70px !important;
        }
    }
    
    /* Remove background color on mobile for product rows */
    @media (max-width: 991.98px) {
        .product-row {
            background: transparent !important;
        }
        
        .product-row:hover {
            background: transparent !important;
        }
        
        .table-hover tbody tr.product-row:hover {
            background: transparent !important;
        }
    }
}

/* Desktop table styles */
@media (min-width: 992px) {
    .product-row td {
        vertical-align: middle;
    }
    
    .product-image img {
        transition: transform 0.2s ease;
    }
    
    .product-image img:hover {
        transform: scale(1.05);
    }
}

/* Fireworks Animation Background */
.fireworks-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    overflow: hidden;
}

.firework {
    position: absolute;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    animation: firework 3s infinite;
}

.firework:nth-child(1) {
    top: 20%;
    left: 10%;
    background: #ff6b6b;
    animation-delay: 0s;
}

.firework:nth-child(2) {
    top: 30%;
    left: 80%;
    background: #4ecdc4;
    animation-delay: 0.5s;
}

.firework:nth-child(3) {
    top: 60%;
    left: 20%;
    background: #45b7d1;
    animation-delay: 1s;
}

.firework:nth-child(4) {
    top: 70%;
    left: 70%;
    background: #96ceb4;
    animation-delay: 1.5s;
}

.firework:nth-child(5) {
    top: 40%;
    left: 50%;
    background: #feca57;
    animation-delay: 2s;
}

.firework:nth-child(6) {
    top: 80%;
    left: 40%;
    background: #ff9ff3;
    animation-delay: 2.5s;
}

@keyframes firework {
    0% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
    50% {
        transform: translateY(-100px) scale(1.5);
        opacity: 0.8;
    }
    100% {
        transform: translateY(-200px) scale(0);
        opacity: 0;
    }
}

/* Hero Section */
.hero-section {
    position: relative;
    overflow: hidden;
    min-height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Hero Animations */
.animate-fade-in {
    animation: fadeInUp 1s ease-out;
}

.animate-fade-in-delay {
    animation: fadeInUp 1s ease-out 0.3s both;
}

.animate-fade-in-delay-2 {
    animation: fadeInUp 1s ease-out 0.6s both;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Image Carousel */
.carousel-item {
    padding: 20px 0;
}

.carousel-item img {
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.carousel-control-prev,
.carousel-control-next {
    width: 50px;
    height: 50px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    top: 50%;
    transform: translateY(-50%);
}

.carousel-indicators button {
    background-color: #ffc107;
    border: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.carousel-indicators button.active {
    background-color: #ff8c00;
}

/* About Section */
.about-stat {
    padding: 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 15px;
    border: 2px solid #ffc107;
}

.about-stat h3 {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 10px;
}

/* Feature Cards */
.feature-card {
    background: white;
    padding: 30px 20px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    height: 100%;
    border: 2px solid transparent;
}

.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    border-color: #ffc107;
}

.feature-icon {
    transition: transform 0.3s ease;
}

.feature-card:hover .feature-icon {
    transform: scale(1.1);
}

/* Product Cards */
.product-card {
    transition: all 0.3s ease;
    border: none;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
}

.product-card .image-container {
    position: relative;
    overflow: hidden;
}

.product-card .card-img-top {
    height: 250px;
    object-fit: contain;
    transition: transform 0.3s ease;
    background: #f8f9fa;
    cursor: pointer;
    padding: 10px;
}

.product-card:hover .card-img-top {
    transform: scale(1.02);
}

.product-card .image-overlay {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.product-card:hover .image-overlay {
    opacity: 1;
}

/* Price Display */
.price-section {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.original-price {
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 2px;
}

.current-price {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

.current-price .text-warning {
    color: #b8860b !important; /* Dark gold for better contrast on light backgrounds */
}

.discount-badge {
    background: linear-gradient(45deg, #dc3545, #c82333);
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Testimonials */
.testimonial-card {
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    height: 100%;
}

.testimonial-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
}

.testimonial-avatar {
    transition: transform 0.3s ease;
}

.testimonial-card:hover .testimonial-avatar {
    transform: scale(1.1);
}

/* Buttons */
.btn-warning {
    background: linear-gradient(45deg, #ffc107, #ff8c00);
    border: none;
    color: #000;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-warning:hover {
    background: linear-gradient(45deg, #ff8c00, #ffc107);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 193, 7, 0.4);
}

.btn-outline-warning {
    border-color: #ffc107;
    color: #ffc107;
    transition: all 0.3s ease;
}

.btn-outline-warning:hover {
    background: #ffc107;
    color: #000;
    transform: translateY(-2px);
}

/* Navigation */
.navbar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 10000 !important;
    width: 100% !important;
}

.navbar-brand {
    font-weight: bold;
    font-size: 1.5rem;
}

.navbar-nav .nav-link {
    font-weight: 500;
    transition: color 0.3s ease;
}

.navbar-nav .nav-link:hover {
    color: #ffc107 !important;
}

/* Section Headers */
section h2 {
    position: relative;
    margin-bottom: 3rem;
}

section h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background: linear-gradient(45deg, #ffc107, #ff8c00);
    border-radius: 2px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-section h1 {
        font-size: 2rem;
    }
    
    .hero-section .lead {
        font-size: 1rem;
    }
    
    .product-card .card-img-top {
        height: 200px;
    }
    
    .navbar-brand {
        font-size: 1.2rem;
    }
    
    .price-section {
        align-items: flex-start;
    }
    
    .discount-badge {
        font-size: 0.7rem;
        padding: 1px 6px;
    }
    
    .carousel-item .row {
        flex-direction: column;
    }
    
    .carousel-item .col-md-6:first-child {
        margin-bottom: 20px;
    }
    
    .feature-card {
        margin-bottom: 20px;
    }
    
    .about-stat {
        margin-bottom: 20px;
    }
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 193, 7, 0.3);
    border-radius: 50%;
    border-top-color: #ffc107;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Hover Effects */
.card {
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #ffc107;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #ff8c00;
}

/* Toast Notifications */
.toast {
    border: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.toast-header {
    background: linear-gradient(45deg, #ffc107, #ff8c00);
    color: #000;
    font-weight: 600;
}

/* Image Modal */
.image-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(5px);
}

.image-modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 90%;
    max-height: 90%;
    text-align: center;
}

.image-modal img {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 10px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.image-modal-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10000;
    transition: all 0.3s ease;
}

.image-modal-close:hover {
    color: #ffc107;
    transform: scale(1.1);
}

.image-modal-title {
    color: #fff;
    font-size: 1.2rem;
    margin-top: 20px;
    text-align: center;
}

/* Mobile responsive for image modal */
@media (max-width: 768px) {
    .image-modal-content {
        max-width: 95%;
        max-height: 95%;
    }
    
    .image-modal img {
        max-height: 70vh;
    }
    
    .image-modal-close {
        top: 10px;
        right: 20px;
        font-size: 30px;
    }
}

/* Map Container Styling */
.map-container {
    position: relative;
    overflow: hidden;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.map-container:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

.map-container iframe {
    transition: all 0.3s ease;
}

/* Business Hours Styling */
.business-hours {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
}

.business-hours h5 {
    color: #495057;
    margin-bottom: 15px;
}

.business-hours p {
    margin-bottom: 8px;
    font-weight: 500;
}

.business-hours .text-success {
    font-weight: 600;
}

/* Form Elements */
.form-control:focus {
    border-color: #ffc107;
    box-shadow: 0 0 0 0.2rem rgba(255, 193, 7, 0.25);
}

.form-select:focus {
    border-color: #ffc107;
    box-shadow: 0 0 0 0.2rem rgba(255, 193, 7, 0.25);
}

/* Cards */
.card {
    border: none;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

/* Cart page product image styling */
.cart-item img {
    max-width: 80px !important;
    max-height: 80px !important;
    width: auto !important;
    height: auto !important;
    object-fit: cover !important;
}

.card:hover {
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.card-header {
    background: linear-gradient(45deg, #f8f9fa, #e9ecef);
    border-bottom: 1px solid #dee2e6;
    font-weight: 600;
}

/* Order Success Card Header - Force Green Background */
.card.border-success .card-header {
    background: #198754 !important;
    color: white !important;
    border-bottom: 1px solid #198754 !important;
}

/* Tables */
.table th {
    background: linear-gradient(45deg, #f8f9fa, #e9ecef);
    border-top: none;
    font-weight: 600;
    color: #000000 !important;
}

.table-hover tbody tr:hover {
    background-color: rgba(255, 193, 7, 0.1);
}

/* Alerts */
.alert {
    border: none;
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.alert-success {
    background: linear-gradient(45deg, #d4edda, #c3e6cb);
    color: #155724;
}

.alert-danger {
    background: linear-gradient(45deg, #f8d7da, #f5c6cb);
    color: #721c24;
}

/* Footer */
footer {
    background: linear-gradient(135deg, #343a40, #495057);
}

/* Footer Styling */
footer {
    margin-top: 3rem;
    border-top: 3px solid #ffc107;
    box-shadow: 0 -5px 15px rgba(0, 0, 0, 0.1);
}

.footer-divider {
    border-color: #ffc107;
    opacity: 0.3;
    margin: 1rem auto;
    width: 80px;
}

footer a {
    transition: all 0.3s ease;
}

footer a:hover {
    color: #ff8c00 !important;
    text-shadow: 0 0 8px rgba(255, 193, 7, 0.5);
}

footer p {
    margin-bottom: 0.5rem;
}

footer .text-muted {
    color: #adb5bd !important;
}

/* Ensure footer is visible at bottom */
body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding-top: 56px !important; /* Add top padding for fixed navbar */
}

main, .main-content {
    flex: 1;
}

/* Footer responsive adjustments */
@media (max-width: 768px) {
    footer {
        margin-top: 2rem;
        padding: 2rem 0;
    }
    
    .footer-divider {
        width: 60px;
        margin: 0.8rem auto;
    }
}

/* Responsive Design */
@media (max-width: 576px) {
    .container {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    .hero-section {
        padding: 1rem 0;
        min-height: 10vh;
    }
    
    .hero-section h1 {
        font-size: 1.75rem;
    }
}

/* Print Styles */
@media print {
    .navbar,
    .btn,
    .toast-container,
    footer {
        display: none !important;
    }
    
    .container {
        max-width: 100% !important;
        padding: 0 !important;
    }
    
    .card {
        border: 1px solid #000 !important;
        box-shadow: none !important;
    }
}

/* Accessibility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus styles for keyboard navigation */
.btn:focus,
.form-control:focus,
.form-select:focus {
    outline: 2px solid #ffc107;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .btn-warning {
        background: #000;
        color: #fff;
        border: 2px solid #000;
    }
    
    .card {
        border: 2px solid #000;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Improved Yellow/Gold Text for Visibility */
.text-warning {
    color: #b8860b !important; /* Dark gold for better contrast on light backgrounds */
}

.text-gold {
    color: #ff9800 !important; /* Orange-gold for even more contrast */
}

/* Use .text-gold in sections with light backgrounds for headings, icons, etc. */

/* Order Summary Bar Styling */
.order-summary-bar {
    background: rgba(139, 69, 19) !important;
    color: white;
    padding: 12px 20px;
    border-radius: 50px;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.2);
    margin: 0 auto 20px auto;
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    width: 80%;
    max-width: 600px;
    height: auto;
    min-height: auto;
    max-height: 80px;
    overflow: hidden;
    transition: all 0.3s ease;
}

/* Ensure navbar doesn't overlap order summary bar */
.navbar {
    z-index: 1001 !important;
}

/* Enhanced sticky styling */
.order-summary-bar.sticky {
    border-radius: 0 0 15px 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    background: rgba(139, 69, 19, 0.95) !important;
}

.summary-item {
    text-align: center;
}

.summary-label {
    display: block;
    font-size: 0.65rem;
    opacity: 0.9;
    margin-bottom: 1px;
}

.summary-value {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
}

/* Quantity Input Styling */
.quantity-section {
    padding: 15px 0;
}

.quantity-input {
    text-align: center;
    font-weight: 600;
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
}

.quantity-input:focus {
    border-color: #ffc107;
    box-shadow: 0 0 0 0.2rem rgba(255, 193, 7, 0.25);
}

.quantity-input::-webkit-inner-spin-button,
.quantity-input::-webkit-outer-spin-button {
    opacity: 1;
    height: 20px;
}

/* Quantity input focus and active states */
.quantity-input:focus {
    border-color: #ffc107;
    box-shadow: 0 0 0 0.2rem rgba(255, 193, 7, 0.25);
    transform: scale(1.02);
}

.quantity-input:invalid {
    border-color: #dc3545;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

/* Product total animation */
.total-amount {
    transition: all 0.3s ease;
}

.total-amount.updated {
    animation: pulse 0.6s ease-in-out;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.product-total {
    text-align: center;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.total-label {
    display: block;
    margin-bottom: 5px;
}

.total-amount {
    display: block;
    font-size: 1.1rem;
    font-weight: 600;
    color: #28a745;
}

/* Responsive adjustments for quantity section */
@media (max-width: 768px) {
    .order-summary-bar .row > div {
        margin-bottom: 15px;
    }
    
    .order-summary-bar .row > div:last-child {
        margin-bottom: 0;
    }
    
    .quantity-section .row > div {
        margin-bottom: 10px;
    }
    
    .quantity-section .row > div:last-child {
        margin-bottom: 0;
    }
    
    /* Mobile fixed positioning - bottom layout like image */
    .order-summary-bar {
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        z-index: 9999 !important;
        width: 100% !important;
        padding: 12px 20px !important;
        margin: 0 !important;
        border-radius: 0 !important;
        /* background: #8B4513 !important; */
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.2) !important;
    }
    
    /* Show the bar only when it has content */
    .order-summary-bar:not([style*="display: none"]) {
        display: block !important;
    }
    
    .order-summary-bar .row {
        align-items: center !important;
        margin: 0 !important;
    }
    
    .order-summary-bar .row > div {
        margin-bottom: 0 !important;
        padding: 0 5px !important;
    }
    
    .order-summary-bar .summary-item {
        text-align: center !important;
        margin-bottom: 0 !important;
    }
    
    .order-summary-bar .summary-label {
        font-size: 0.7rem !important;
        margin-bottom: 2px !important;
    }
    
    .order-summary-bar .summary-value {
        font-size: 0.9rem !important;
        font-weight: 600 !important;
    }
    
    .order-summary-bar .btn {
        font-size: 0.7rem !important;
        padding: 4px 8px !important;
    }
    
    .order-summary-bar .badge {
        font-size: 0.6rem !important;
    }
    
    .order-summary-bar.sticky {
        padding: 8px 15px !important;
    }
    
    /* Add top margin to products section to prevent overlap */
    #products {
        margin-top: calc(var(--mobile-top-spacing) + 90px) !important; /* Dynamic spacing */
    }
}

/* Ensure fixed bar works properly on all devices */
@media (max-width: 576px) {
    .order-summary-bar {
        display: none !important;
    }
    
    /* Show the bar only when it has content */
    .order-summary-bar:not([style*="display: none"]) {
        display: block !important;
    }
    
    .order-summary-bar .summary-label {
        font-size: 0.6rem !important;
        margin-bottom: 1px !important;
    }
    
    .order-summary-bar .summary-value {
        font-size: 0.8rem !important;
    }
    
    .order-summary-bar .btn {
        font-size: 0.6rem !important;
        padding: 3px 6px !important;
    }
    
    .order-summary-bar .badge {
        font-size: 0.5rem !important;
    }
    
    /* Body padding will be handled dynamically by JavaScript */
    
    /* Remove top margin since bar is now at bottom */
    #products {
        margin-top: 20px !important;
    }
}

/* Mobile Product Card Styles */
.product-card-mobile {
    border: 1px solid #dee2e6;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    background: #bbe1ff;
}

/* Mobile Order Summary Bar - Fixed at Bottom */
.mobile-order-summary-bar {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 9999 !important;
    width: 100% !important;
    height: auto !important;
    min-height: auto !important;
    max-height: 80px !important;
    padding: 12px 20px !important;
    margin: 0 !important;
    border-radius: 0 !important;
    background: rgba(139, 69, 19, 0.9) !important;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.2) !important;
    overflow: hidden !important;
}

/* Hide desktop summary elements on mobile */
@media (max-width: 991px) {
    .order-summary-bar {
        display: none !important;
        background: transparent !important;
        position: static !important;
    }
    
    .order-summary-bar .summary-item {
        display: none !important;
    }
    
    .order-summary-bar .btn {
        display: none !important;
    }
    
    .order-summary-bar .row {
        display: none !important;
    }
}

.product-card-mobile:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.product-card-mobile .card-body {
    padding: 12px;
}

.product-card-mobile .product-info h6 {
    font-size: 0.8rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 2px;
    line-height: 1.1;
    word-wrap: break-word;
    hyphens: auto;
}

.product-card-mobile .product-info small {
    font-size: 0.65rem;
    line-height: 1.1;
    word-wrap: break-word;
    hyphens: auto;
}

.product-card-mobile .original-price {
    font-size: 0.75rem;
    color: #6c757d;
    text-decoration: line-through;
}

.product-card-mobile .current-price {
    display: flex;
    align-items: center;
    gap: 4px;
}

.product-card-mobile .current-price .h6 {
    font-size: 0.9rem;
    font-weight: 600;
    color: #198754;
    margin: 0;
}

.product-card-mobile .current-price .badge {
    font-size: 0.6rem;
    padding: 2px 6px;
}

.product-card-mobile .quantity-input {
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 0.8rem;
    text-align: center;
}

.product-card-mobile .quantity-input:focus {
    border-color: #ffc107;
    box-shadow: 0 0 0 0.2rem rgba(255, 193, 7, 0.25);
}

.product-card-mobile .total-amount {
    font-size: 0.9rem;
    font-weight: 600;
    color: #ffc107;
}

.product-card-mobile .total-section {
    text-align: right;
}

/* Animation for total amount updates */
.product-card-mobile .total-amount.updated {
    animation: pulse 0.6s ease-in-out;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* Responsive adjustments for mobile cards */
@media (max-width: 576px) {
    .product-card-mobile .card-body {
        padding: 10px;
    }
    
    .product-card-mobile .product-info h6 {
        font-size: 0.85rem;
    }
    
    .product-card-mobile .product-info small {
        font-size: 0.7rem;
    }
    
    .product-card-mobile .current-price .h6 {
        font-size: 0.85rem;
    }
    
    .product-card-mobile .quantity-input {
        font-size: 0.75rem;
        width: 60px !important;
    }
    
    .product-card-mobile .total-amount {
        font-size: 0.85rem;
    }
}

/* Floating Contact Icons */
.floating-contact-icons {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.floating-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: white;
    font-size: 24px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    animation: float 3s ease-in-out infinite;
}

.floating-icon:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
    color: white;
    text-decoration: none;
}

.whatsapp-icon {
    background: linear-gradient(45deg, #25D366, #128C7E);
    animation-delay: 0s;
}

.call-icon {
    background: linear-gradient(45deg, #007bff, #0056b3);
    animation-delay: 1.5s;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* Responsive adjustments for floating icons */
@media (max-width: 768px) {
    .floating-contact-icons {
        bottom: 15px;
        right: 15px;
        gap: 12px;
    }
    
    .floating-icon {
        width: 55px;
        height: 55px;
        font-size: 22px;
    }
}

@media (max-width: 576px) {
    .floating-contact-icons {
        bottom: 10px;
        right: 10px;
        gap: 10px;
    }
    
    .floating-icon {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
}

/* Floating Special Offer Image */
.floating-special-offer {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 1000;
}

.special-offer-link {
    display: block;
    text-decoration: none;
    transition: all 0.3s ease;
    animation: bounce 2s ease-in-out infinite;
}

.special-offer-link:hover {
    transform: scale(1.1);
    text-decoration: none;
}

.special-offer-image {
    width: 120px;
    height: auto;
    /* border-radius: 10px; */
    /* box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3); */
    transition: all 0.3s ease;
}

.special-offer-link:hover .special-offer-image {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

/* Responsive adjustments for special offer image */
@media (max-width: 768px) {
    .floating-special-offer {
        bottom: 15px;
        left: 15px;
    }
    
    .special-offer-image {
        width: 100px;
    }
}

@media (max-width: 576px) {
    .floating-special-offer {
        bottom: 10px;
        left: 10px;
    }
    
    .special-offer-image {
        width: 80px;
    }
}

/* Search Functionality Styles */
#productSearch {
    transition: all 0.3s ease;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 16px;
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#productSearch:focus {
    border-color: #ffc107;
    box-shadow: 0 0 0 0.2rem rgba(255, 193, 7, 0.25);
    outline: none;
}

#productSearch.is-valid {
    border-color: #28a745;
    background-color: #f8fff9;
}

#productSearch.is-valid:focus {
    border-color: #28a745;
    box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25);
}

#productSearch.is-invalid {
    border-color: #dc3545;
    background-color: #fff8f8;
}

#productSearch.is-invalid:focus {
    border-color: #dc3545;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

/* Search button styling */
.btn-outline-warning {
    border-color: #ffc107;
    color: #ffc107;
    transition: all 0.3s ease;
    border-radius: 8px;
    padding: 12px 20px;
    font-weight: 600;
}

.btn-outline-warning:hover {
    background-color: #ffc107;
    border-color: #ffc107;
    color: #000;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(255, 193, 7, 0.3);
}

/* Search form container */
.search-form-container {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.1), rgba(255, 193, 7, 0.05));
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 30px;
    border: 1px solid rgba(255, 193, 7, 0.2);
}

/* Search results styling */
.no-products-message {
    animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Product filtering animation */
.product-row, .product-card-mobile {
    transition: all 0.3s ease;
}

.product-row.hidden, .product-card-mobile.hidden {
    opacity: 0;
    transform: scale(0.95);
    pointer-events: none;
}

/* Category header animation */
.category-header {
    transition: all 0.3s ease;
}

.category-header.hidden {
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
}

/* Search input with icon */
.search-input-container {
    position: relative;
    z-index: 999999 !important;
    transition: all 0.3s ease;
    min-height: 60px;
    padding: 10px 0;
}

/* Container height adjustment when suggestions are visible */
.search-input-container.has-suggestions {
    margin-bottom: 50px;
    padding-bottom: 20px;
    transition: margin-bottom 0.3s ease, padding-bottom 0.3s ease;
}

.search-input-container.has-suggestions .form-control {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    transition: border-radius 0.3s ease;
}

    .search-input-container .form-control {
        padding-left: 55px;
        padding-right: 50px;
    }

.search-input-container .search-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
    z-index: 10;
    font-size: 16px;
}

.clear-search-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    padding: 8px;
    border: none;
    background: transparent;
    color: #6c757d;
    z-index: 10;
    transition: all 0.2s ease;
    border-radius: 50%;
}

.clear-search-btn:hover {
    color: #dc3545;
    background-color: rgba(220, 53, 69, 0.1);
    border-radius: 50%;
}

/* Search Suggestions Dropdown */
.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #dee2e6;
    border-top: none;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 9999999 !important;
    max-height: 1200px;
    overflow-y: auto;
    display: none;
}

/* Global override to ensure suggestions appear above everything */
.search-suggestions,
.search-suggestions * {
    z-index: 9999999 !important;
    position: relative;
}

.search-input-container,
.search-input-container * {
    z-index: 999999 !important;
}

.suggestion-item {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid #f8f9fa;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.suggestion-item:hover,
.suggestion-item.active {
    background-color: #f8f9fa;
    color: #495057;
    transform: translateX(5px);
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-item i {
    font-size: 12px;
    opacity: 0.6;
}

.suggestion-item strong {
    color: #ffc107;
    font-weight: 600;
}

.suggestion-item .fa-arrow-down {
    opacity: 0.4;
    transition: all 0.2s ease;
}

.suggestion-item:hover .fa-arrow-down {
    opacity: 0.8;
    transform: translateY(2px);
}

/* Product highlight animation */
.product-highlight {
    animation: highlightPulse 3s ease-in-out;
}

@keyframes highlightPulse {
    0% {
        background-color: #fff3cd;
        border-color: #ffc107;
        transform: scale(1);
    }
    50% {
        background-color: #ffeaa7;
        border-color: #fdcb6e;
        transform: scale(1.02);
    }
    100% {
        background-color: #fff3cd;
        border-color: #ffc107;
        transform: scale(1);
    }
}

/* Hide table headers during search */
.search-active thead {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

.search-active .table-container {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

.search-active .category-header {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Additional hiding for empty categories during search */
.category-header.hidden {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    opacity: 0 !important;
    transform: scale(0) !important;
}

.table-container.hidden {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    opacity: 0 !important;
    transform: scale(0) !important;
}

/* Force hide empty categories with inline styles */
.category-header[style*="display: none"] {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    opacity: 0 !important;
}

.table-container[style*="display: none"] {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    opacity: 0 !important;
}

/* Responsive search styling */
@media (max-width: 768px) {
    #productSearch {
        font-size: 16px; /* Prevent zoom on iOS */
        padding: 14px 16px;
    }
    
    .search-form-container {
        padding: 15px;
        margin-bottom: 20px;
    }
    
    .btn-outline-warning {
        padding: 14px 16px;
        font-size: 14px;
    }
}

@media (max-width: 576px) {
    /* Mobile form container adjustments */
    .container.my-4 {
        padding: 25px 15px;
        margin-bottom: 50px;
        min-height: 300px;
    }
    
    .row {
        margin-bottom: 30px;
    }
    
    .col-md-12, .col-md-4 {
        margin-bottom: 15px;
    }
    
    .search-form-container {
        padding: 25px;
        margin-bottom: 40px;
        min-height: 200px;
    }
    
    #productSearch {
        padding: 20px 22px;
        font-size: 16px;
        min-height: 70px;
        line-height: 1.4;
    }
    
    .btn-outline-warning {
        padding: 12px 14px;
        font-size: 13px;
    }
    
    /* Mobile category dropdown styling */
    .form-select {
        padding: 16px 18px;
        font-size: 16px;
        min-height: 55px;
        border-radius: 8px;
        margin-bottom: 15px;
    }
    
    .form-label {
        font-size: 16px;
        font-weight: 600;
        margin-bottom: 8px;
        color: #333;
    }
    
    .search-input-container {
        position: relative;
        z-index: 999999;
        min-height: 90px;
        padding: 20px 0;
    }
    
    /* Mobile container height adjustment when suggestions are visible */
    .search-input-container.has-suggestions {
        margin-bottom: 120px;
        padding-bottom: 50px;
        transition: margin-bottom 0.3s ease, padding-bottom 0.3s ease;
    }
    
    .search-input-container.has-suggestions .form-control {
        border-bottom-left-radius: 0;
        border-bottom-right-radius: 0;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
        transition: border-radius 0.3s ease, box-shadow 0.3s ease;
    }
    
    .search-suggestions {
        max-height: 400px;
        z-index: 9999999 !important;
        box-shadow: 0 4px 12px rgba(0,0,0,0.15);
        border: 1px solid #dee2e6;
        border-radius: 8px;
        position: absolute !important;
        top: 100% !important;
        left: 0 !important;
        right: 0 !important;
        background: white !important;
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    .suggestion-item {
        padding: 14px 16px;
        font-size: 15px;
        min-height: 48px;
        display: flex;
        align-items: center;
    }
    
    .suggestion-item .fa-arrow-down {
        font-size: 12px;
    }
    
    /* Mobile search icon and clear button adjustments */
    .search-input-container .search-icon {
        font-size: 18px;
        left: 20px;
        top: 50%;
        transform: translateY(-50%);
    }
    
    .clear-search-btn {
        font-size: 16px;
        width: 36px;
        height: 36px;
        display: flex;
        align-items: center;
        justify-content: center;
        right: 15px;
    }
    
    /* Mobile search input padding adjustments */
    .search-input-container .form-control {
        padding-left: 60px !important;
        padding-right: 55px !important;
    }
    
    /* Force mobile dropdown visibility */
    .search-suggestions[style*="display: block"] {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        position: absolute !important;
        z-index: 9999999 !important;
    }
    
    /* Override any conflicting z-index from other elements */
    .search-suggestions {
        z-index: 9999999 !important;
    }
    
    .search-input-container {
        z-index: 999999 !important;
    }
}

/* Download Price List Button - Red with Animations */
.download-price-btn {
    background: linear-gradient(45deg, #dc3545, #c82333) !important;
    border: 2px solid #dc3545 !important;
    color: white !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    border-radius: 25px !important;
    padding: 8px 16px !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    position: relative !important;
    overflow: hidden !important;
    box-shadow: 0 4px 15px rgba(220, 53, 69, 0.3) !important;
    animation: pulse-glow 2s infinite !important;
}

.download-price-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.download-price-btn:hover {
    background: linear-gradient(45deg, #c82333, #dc3545) !important;
    border-color: #c82333 !important;
    transform: translateY(-2px) scale(1.05) !important;
    box-shadow: 0 8px 25px rgba(220, 53, 69, 0.5) !important;
    animation: none !important;
}

.download-price-btn:hover::before {
    left: 100%;
}

.download-price-btn:active {
    transform: translateY(0) scale(0.98) !important;
    box-shadow: 0 2px 10px rgba(220, 53, 69, 0.4) !important;
}

.download-price-btn:disabled {
    opacity: 0.7 !important;
    cursor: not-allowed !important;
    transform: none !important;
    animation: none !important;
}

.download-price-btn i {
    margin-right: 6px;
    transition: transform 0.3s ease;
}

.download-price-btn:hover i {
    transform: translateY(-1px) rotate(5deg);
}

/* Pulse glow animation */
@keyframes pulse-glow {
    0% {
        box-shadow: 0 4px 15px rgba(220, 53, 69, 0.3);
    }
    50% {
        box-shadow: 0 4px 20px rgba(220, 53, 69, 0.6);
    }
    100% {
        box-shadow: 0 4px 15px rgba(220, 53, 69, 0.3);
    }
}

/* Mobile responsive for download button */
@media (max-width: 768px) {
    .download-price-btn {
        font-size: 12px !important;
        padding: 6px 12px !important;
        border-radius: 20px !important;
    }
}