body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f5f5f5;
}

.store-header {
    position: relative;
    text-align: center;
    overflow: hidden;
    height: 130px; /* Adjust height as needed */
}

.header-image {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
}

.header-content {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 2;
    padding: 4px;
    background: rgba(0, 0, 0, 0.5); /* Semi-transparent overlay */
    color: white;
    height: 100%;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.shop-name {
    margin: 3px 2px;
    text-align: center;
    font-size: 1.8rem;
    font-weight: bold;
    font-family: 'Montserrat', sans-serif;
}

.status-container {
    margin-top: 0px;
    width: 310px;
    align-items: center;
    display: flex;
}

.status-button {
    padding: 3px 8px;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-family: 'Montserrat', sans-serif;
    cursor: pointer;
}

.status-open {
    background-color: #4CAF50;
    color: white;
}

.status-closed {
    background-color: #f44336;
    color: white;
}

.status-temporarily-closed {
    background-color: #ff9800;
    color: white;
}

.status-box {
    font-size: 0.9rem;
    color: white;
    margin-left: 30px;
}

.contact-btn {
    padding: 0.5rem;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: opacity 0.2s;
}

.phone-btn { background-color: blue; color: white; }
.whatsapp-btn { background-color: #25D366; color: white; }
.location-btn { background-color: #f70101; color: white; }

.icon-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 1.30rem;
    color: white;
    text-decoration: none;
}
.header-icons {
    display: flex;
    gap: 25px;
    position: absolute;
    right: 15px;
    top: 70px;
}

.icon {
    color: white;
    text-decoration: none;
    font-size: 24px;
    transition: opacity 0.3s;
}

.icon:hover {
    opacity: 0.8;
}

.form-container {
    max-width: 1200px;
    margin: 20px auto;
    padding: 20px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    /* Added for floating footer */
    padding-bottom: 80px; /* Space for the fixed total/checkout bar */
}

.products-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
    padding: 0 10px;
}

.product-card {
    display: flex;
    flex-direction: row;
    align-items: center;
    border: 1px solid #ddd;
    border-radius: 8px;
    background-color: #e7e7f5;
    overflow: hidden;
    padding: 10px;
    height: 120px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.product-image {
    flex: 0 0 100px;
    height: 100%;
    margin-right: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f9f9f9;
    border-radius: 6px;
}

.product-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: cover;
    border-radius: 4px;
}

.product-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    height: 100%;
    margin-bottom: 0px;
}

.product-title {
    font-family: 'Times New Roman', Times, serif;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: -12px;
    margin-top: 0px;
    color: #333;
}

.product-price {
    font-size: 1rem;
    font-weight: bold;
    color: #95153d;
    margin-bottom: -10px;
}
.product-info {
    display: flex; /* Makes the container a flex container */
    align-items: center; /* Vertically aligns items in the middle */
    gap: 15px; /* Adds space between the price and stock elements */
}
.quantity-controls {
    display: flex;
    align-items: center;
    gap: 0px;
}

.quantity-btn {
    width: 30px;
    height: 30px;
    border: none;
    background: #5355da;
    color: white;
    font-size: 1.2rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.quantity-btn:active {
    transform: scale(0.95);
    background: #45a049;
}

.quantity-input {
    width: 30px;
    height: 20px;
    text-align: center;
    padding: 5px;
    font-size: 1.1rem;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-weight: bold;
    -webkit-appearance: none;
    margin: 0 5px;
}
.available-stock
{
    color: green;
    font-size: small;
}


.out-of-stock {
    color: red;
    font-size: small;
}

.total-section {
    text-align: right;
    margin: 0; /* Changed from 20px 10px to 0 for floating bar */
    font-size: 1.6rem;
    font-weight: bold;
    font-family: 'Segoe UI', sans-serif;
    color: #0b17af;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #666;
    font-weight: bold;
}

.form-group input {
    width: 80%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

/* Original submit button style - will be hidden */
button[type="submit"] {
    background-color: #2E3EFF;
    color: white;
    padding: 5px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    width: 50%;
    font-size: 20px;
    font-weight: bold;
    transition: background-color 0.3s;
    font-family: 'Merriweather', serif;
}

button[type="submit"]:hover {
    background-color: #45a049;
}

.success-message {
    color: #4CAF50;
    text-align: center;
    margin: 20px 0;
    padding: 15px;
    border: 1px solid #4CAF50;
    border-radius: 4px;
}

.shop-message {
    text-align: center;
    padding: 2rem;
    font-size: 1.2rem;
    color: #666;
    border: 2px dashed #ddd;
    border-radius: 8px;
    margin: 20px 0;
}

/* New: Styles for disabled fields */
.disabled-field {
    opacity: 0.7;
    cursor: not-allowed;
}

/* New: Search container styles */
.search-container {
    margin: 15px 10px;
    display: flex;
    gap: 10px;
}

.search-box {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 30px;
    font-size: 16px;
    background-color: #f8f8f8;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
}

.search-button {
    padding: 12px 20px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    font-weight: bold;
}

.search-button:hover {
    background-color: #2980b9;
}

.no-results {
    text-align: center;
    padding: 20px;
    font-size: 18px;
    color: #777;
}

/* --- Floating Total and Checkout Button Styles (New Additions) --- */

.total-section-container { /* New container for total and button */
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: #3b414b; /* Match your modal/header background for consistency */
    padding: 15px 20px;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.2);
    display: flex;
    justify-content: space-between; /* To align total on left and button on right */
    align-items: center;
    z-index: 999; /* Ensure it stays above other content but below modals */
    color: white;
    font-size: 1.2em;
    font-weight: bold;
}

.total-section-container button[type="submit"] {
    /* Style for the checkout button within the new container, overriding the general button[type="submit"] */
    padding: 10px 20px;
    background-color: #28a745; /* A suitable color for a checkout button */
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 1em;
    cursor: pointer;
    transition: background-color 0.3s ease;
    width: auto; /* Override 100% width from general submit button */
}

.total-section-container button[type="submit"]:hover {
    background-color: #218838;
}

/* Ensure the disabled styles are applied to the new button */
.total-section-container button[type="submit"]:disabled,
.total-section-container button[type="submit"].disabled-field {
    opacity: 0.6;
    cursor: not-allowed;
    background-color: #6c757d; /* A grayed-out color for disabled */
}

/* Hide the original submit button to avoid duplicates.
   This targets direct child buttons of the form. */
form > button[type="submit"] {
    display: none;
}
/* --- End Floating Total and Checkout Button Styles --- */


/* Small screen layout (phones ≤ 480px) */
@media (max-width: 480px) {
    .product-card {
        flex-direction: row;
        height: auto;
        padding: 8px;
    }

    .product-image {
        flex: 0 0 120px;
    }

    .product-title {
        font-size: 1.0rem;
    }

    .product-price {
        font-size: 1.0rem;
        margin-bottom: 12px;
    }

    .quantity-btn {
        font-size: 0.85rem;
        padding: 4px 8px;
    }

    .quantity-input {
        width: 20px;
        padding: 4px;
        font-size: 0.85rem;
    }

    header {
        flex-direction: column;
        text-align: center;
        padding: 0.5rem;
    }

    .header-icons {
        position: static;
        justify-content: center;
        margin-top: 8px;
    }

    .shop-name {
        font-size: 1.4rem;
    }

    /* This will apply to the floating button as well due to specificity,
       but the overall floating container manages its size and position */
    .total-section-container button[type="submit"] {
        font-size: 1rem;
        padding: 12px;
    }

    .total-section {
        font-size: 1.3rem;
        /* text-align: center; */ /* Removed as flexbox handles alignment in new container */
    }

    /* Adjust padding for smaller screens if necessary for the fixed footer */
    .form-container {
        padding-bottom: 90px; /* Slightly more padding for smaller screens if needed */
    }
}
