/* Import Google Font - Roboto */
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap');

/* Define CSS variables for colors */
:root {
    --primary-color: #009057;
    --primary-hover-color: #007a4a;
    --promotion-bg-color: #fff8e1;
    --promotion-border-color: #ffc107;
    --price-promo-color: #dc3545;
    --bs-primary: var(--primary-color);
    --bs-primary-rgb: 0, 144, 87;
    --bg-light-green: rgba(0, 144, 87, 0.1);
}


/* Global Styles */
body {
    font-family: 'Roboto', sans-serif;
    color: #333;
    margin-bottom: 60px;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--primary-color);
}


html {
    font-size: 14px;
    position: relative;
    min-height: 100%;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}


.bg-light-green {
    background-color: var(--bg-light-green) !important;
}


td.text-end .input-group {
    justify-content: center;
}



.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}


/* Alerts */
.alert-info {
    --bs-info-bg-subtle: var(--bg-light-green);
    --bs-info-text-emphasis: #0c5460;
    --bs-info-border-subtle: #bee5eb;
}


/* Buttons */
.btn-primary {
    --bs-btn-bg: var(--primary-color);
    --bs-btn-border-color: var(--primary-color);
    --bs-btn-hover-bg: var(--primary-hover-color);
    --bs-btn-hover-border-color: var(--primary-hover-color);
    --bs-btn-active-bg: var(--primary-hover-color);
    --bs-btn-active-border-color: var(--primary-hover-color);
    --bs-btn-focus-shadow-rgb: var(--bs-primary-rgb);
}

.btn-outline-primary {
    --bs-btn-color: var(--primary-color);
    --bs-btn-border-color: var(--primary-color);
    --bs-btn-hover-bg: var(--primary-color);
    --bs-btn-hover-border-color: var(--primary-color);
    --bs-btn-hover-color: #fff;
    --bs-btn-active-bg: var(--primary-hover-color);
    --bs-btn-active-border-color: var(--primary-hover-color);
    --bs-btn-focus-shadow-rgb: var(--bs-primary-rgb);
}


.btn:disabled {
    background-color: var(--bg-light-green) !important;
    border-color: var(--bg-light-green) !important;
    color: var(--primary-color)
}



/* Links */
a, .page-link {
    color: var(--primary-color);
}

    a:hover, .page-link:hover {
        color: var(--primary-hover-color);
    }

.page-item.active .page-link {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* Navigation */
.nav-link.active {
    font-weight: bold;
    text-decoration: underline;
    text-underline-offset: 4px;
}

/* Nav link base styles and hover highlight */
.navbar .nav-link {
    color: var(--primary-color); /* UPDATED: Changed from a muted color */
    font-weight: 500;
    padding: 0.45rem 0.6rem;
    border-radius: 0.375rem;
    transition: background-color 0.15s ease, color 0.15s ease, transform 0.08s ease;
    display: inline-flex;
    align-items: center;
}

/* Subtle highlight on hover/focus */
.navbar .nav-link:hover,
.navbar .nav-link:focus {
    color: var(--primary-hover-color);
    background-color: rgba(var(--bs-primary-rgb), 0.07); /* subtle green background */
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0,0,0,0.03);
}

/* Keep active link visually distinct */
.navbar .nav-link.active {
    background-color: rgba(var(--bs-primary-rgb), 0.12);
    color: var(--primary-color);
}

/* Ensure dropdown items follow primary color rules */
.dropdown-item.active, .dropdown-item:active {
    background-color: var(--primary-color);
}

/* Badges */
.badge.bg-primary {
    --bs-bg-opacity: 1;
    background-color: var(--primary-color) !important;
}

/* Card Styles for Products */

.product-card {
    border: 1px solid var(--primary-color);
    transition: box-shadow 0.2s ease-in-out;
    position: relative;
    display: flex;
    flex-direction: column;
}

    .product-card:hover {
        box-shadow: 0 4px 10px rgba(0, 144, 87, 0.2);
    }

.card {
    border: 1px solid var(--primary-color);
    transition: box-shadow 0.3s ease-in-out, transform 0.2s ease-in-out;
}

.card-body {
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.card:hover {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transform: translateY(-5px);
}

.card-title {
    font-size: 0.8rem;
    font-weight: 500;
    color: #333; /* Overriding the general h5 color for readability */
    flex-grow: 1; /* Allows title to take up space, pushing PIP to bottom */
    margin-bottom: 0.5rem;
    line-height: 1.2;
    min-height: 38.4px; /* Approx 3 lines of text */
}

.card-img-top {
    max-height: 100px;
    object-fit: contain;
    padding: 0.5rem;
}

.product-meta, .product-pip {
    font-size: 0.65rem;
    color: #6c757d;
}

.product-meta {
    display: flex;
    justify-content: space-between;
    margin-top: auto; /* Pushes meta to the bottom of card-body */
}


.product-meta-highlight {
    font-size: 0.8rem; 
    font-weight: bold; 
}


/* Promotion Card Specific Styles */
.promotion-card {
    /*background-color: var(--promotion-bg-color);*/
    border: 1px solid var(--promotion-border-color);
}



.product-list-price {
    white-space: nowrap;
    text-align:right;
}

.product-list-quantity {
    text-align: center;
    width: 100px;
}


    /* make the input group shrink to content so text-align can center it */
    .product-list-quantity .input-group {
        display: inline-flex !important; /* instead of flex (block) */
        width: auto; /* don’t stretch to 100% */
    }

/*td.qty-present .input-group {
    width: auto !important;
}*/
/* if needed */

/* Per-product update overlay */


.product-updating-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0.72);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20;
    border-radius: .25rem;
}

    .product-updating-overlay .spinner-border {
        width: 2rem;
        height: 2rem;
    }



.card-footer {
    background-color: #f8f9fa;
    border-top: 1px solid #e0e0e0;
    padding: 0.75rem;
}

/* Promotion label */
.on-promotion {
    color: var(--price-promo-color);
    font-weight: 700;
    text-align: center;
    margin: 0.25rem 0;
    font-size: 0.9rem;
}


.filters-sidebar {
    position: sticky;
    top: 0;
    max-height: 100vh;
    overflow-y: auto;
    align-self: flex-start;
}


/* Accordion */
.accordion-button {
    color: #333;
}

    .accordion-button:not(.collapsed) {
        background-color: rgba(0, 144, 87, 0.1);
        color: var(--primary-color);
    }

    .accordion-button:focus {
        box-shadow: 0 0 0 0.25rem rgba(0, 144, 87, 0.25);
    }

thead {
    background-color: var(--bg-light-green) !important; /* Replace with your desired color, e.g., blue */
    --bs-table-bg: var(--bg-light-green);
}

th {
    background-color: var(--bg-light-green) !important;     /* Replace with your desired color, e.g., blue */
}

/* Last Ordered Text Style */

.last-ordered {
    font-size: 0.65rem;
    color: var(--primary-color);
    font-style: italic;
    text-align: center;
    margin-top: 0.5rem;
    margin-bottom: 0;
    line-height: 1;
    min-height: 13px; /* Reserve space to prevent layout shift */
}

.price-section .price-original {
    text-decoration: line-through;
    color: #6c757d;
    font-size: 0.8rem;
    margin-right: 0.5rem;
}

.price-section .price-promo {
    color: var(--price-promo-color);
    font-weight: bold;
    font-size: 1rem;
}

.price-section .price-list {
    white-space: nowrap;
}

/* Favourite Icon */
.favourite-icon {
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 1.2rem;
    color: #ccc;
    cursor: pointer;
    transition: color 0.2s ease-in-out, transform 0.2s ease-in-out;
    z-index: 10;
}

    .favourite-icon:hover {
        transform: scale(1.2);
    }

    .favourite-icon.active {
        color: var(--price-promo-color);
    }


/* Quantity input styling */
.quantity-input {
    border-left: 0;
    border-right: 0;
    border-radius: 0;
}

    .quantity-input:focus {
        box-shadow: none;
        border-color: #ced4da;
    }


/* Form Checkbox Styling */
.form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.form-check-input:focus {
    border-color: #80bdab;
    box-shadow: 0 0 0 0.25rem rgba(0, 144, 87, 0.25);
}

/*** FOOTER ***/

#footer {
    position: relative;
    max-width: 980px;
    margin: 20px auto;
}

    #footer p {
        line-height: 26px;
        padding-top: 5px;
    }

#footer-logo {
    float: left;
    vertical-align: middle;
    margin-right: 15px;
}

.footer_social {
    float: right;
    display: block;
}

.footer_social_mobile {
    display: none;
}

.category-list {
    padding: 0;
    margin: 0;
    list-style: none;
}

    .category-list .list-group-item {
        border: none;
        border-bottom: 1px solid #ddd;
        cursor: pointer;
        text-align: left;
        font-size: 1rem;
        padding: 0.5rem 1rem;
    }

        .category-list .list-group-item:hover {
            background-color: #f8f9fa;
        }

    .category-list .active-category {
        font-weight: bold;
        text-decoration: underline;
        background-color: azure
    }

/* Change footer background when product quantity > 0 */
.qty-present {
    background-color: var(--bg-light-green) !important;
    box-shadow: none !important;
}


td.qty-present .input-group {
    width: auto !important;
    margin-left: auto;
    margin-right: auto;
}


/* Modal styles for product detail popup */
.product-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 1rem;
}

.product-modal {
    background: #fff;
    border-radius: 8px;
    max-width: 900px;
    width: 100%;
    padding: 1.25rem;
    padding-top: 3.5rem; /* ensures nothing touches the button */
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    position: relative;
    max-height: 92vh;
    overflow-y: auto;
}

.product-modal .modal-image {
    max-height: 60vh;
    object-fit: contain;
    border: 1px solid #e9ecef;
    padding: 0.75rem;
    background: #fff;
}

.modal-close {
    position: absolute;
    top: 10px;
    right: 10px;
    /*background: transparent;*/
    border: medium;
    font-size: 1.2rem;
    color: #333;
}

/* Ensure product images show pointer */
.clickable-product-image {
    cursor: pointer;
}

/* Keep price styling consistent with card */
.product-modal .price-original {
    text-decoration: line-through;
    color: #6c757d;
    font-size: 0.95rem;
    margin-right: 0.5rem;
}

.product-modal .price-promo {
    color: var(--price-promo-color);
    font-weight: 700;
    font-size: 1.05rem;
}

/* Responsive tweaks */
@media (max-width: 576px) {
    .product-modal {
        padding: 0.75rem;
    }
    .product-modal .modal-image {
        max-height: 40vh;
    }
}

/* Basket styles */


#basket-app {
    max-width:80%; 
}



/* Image column fixed width for consistent thumbnail size */
.basket-image-col {
    width: 120px;
    flex: 0 0 120px;
}

/* Fixed size thumbnail with aspect ratio preserved via object-fit */
.basket-item-img {
    max-height: 100px;
    object-fit: contain;
    padding: 0.5rem;
    display: block;
}

/* per-item container visual */
.basket-line {
    border: 1px solid #ececec;
    background: #ffffff;
    padding: 0.5rem;
}

/* small spacing for right-hand anchored controls */
.table .line-bottom {
    gap: 1rem;
}

/* keep qty row compact and inline */
.qty-price-row {
    gap: 1rem;
}

/*Basket wdth*/
.list-group {
    width:70%; /* or any value you want */
}


.filters-page .list-group {
    width: 100%;
}

/* Basket styles */

.basket-line-attention {
    border: 2px solid #dc3545; /* Bootstrap danger */
}

.price-increase {
    color: var(--price-promo-color);
}
.price-decrease {
    color: var(--primary-color);
}


/* Confirm modal text*/

#confirmOrderModal .form-check-label {
    font-size: 0.83rem;
}


/* MOQ warning – shown when minimum order quantity > 1 */
.moq-warning {
    color: var(--price-promo-color);
    font-weight: 700;
}

/* Quantity input – transient invalid state while value is not a multiple of MOQ */
.quantity-input.qty-invalid {
    border-color: var(--price-promo-color) !important;
    color: var(--price-promo-color);
}