/* General Layout */

body {

    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;

    margin: 0;

    background-color: #f9f9f9;

    color: #333;

}



/* Links */

a {

    color: inherit;

    text-decoration: none;

}



/* =========================

   NAVBAR

========================= */

.navbar {

    background: #27ae60;

    color: white;

    padding: 1rem 10%;

    display: flex;

    justify-content: space-between;

    align-items: center;

    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);

}



.navbar h1 a {

    color: white;

}



.navbar div a {

    margin-left: 20px;

    font-weight: bold;

    color: white;

}



.navbar div a:hover {

    text-decoration: underline;

}



/* =========================

   FLASH MESSAGES

========================= */

.flash-container {

    position: fixed;

    top: 15px;

    width: 100%;

    display: flex;

    justify-content: center;

    z-index: 1000;

    pointer-events: none;

}



.flash-message {

    pointer-events: auto;

    padding: 12px 25px;

    border-radius: 5px;

    color: white;

    font-weight: bold;

    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);

    animation: fadeout 3s forwards;

}



.success {
    background-color: #27ae60;
}

.info {
    background-color: #2980b9;
}

.warning {
    background-color: #e67e22;
}

.error {
    background-color: #e74c3c;
}



@keyframes fadeout {

    0% {
        opacity: 1;
    }

    70% {
        opacity: 1;
    }

    100% {
        opacity: 0;
        visibility: hidden;
    }

}



/* =========================

   SEARCH BAR

========================= */

.search-form {

    padding: 30px 10%;

    display: flex;

    gap: 10px;

}



.search-form input {

    flex: 1;

    padding: 10px;

    border-radius: 6px;

    border: 1px solid #ccc;

}



.search-form button {

    background: #27ae60;

    color: white;

    border: none;

    padding: 10px 20px;

    border-radius: 6px;

    cursor: pointer;

}



.search-form button:hover {

    background: #219150;

}

/* Clearance Toggle */
.filter-actions {
    margin-top: 10px;
    padding: 0 10%;

}

.filter-btn {
    display: inline-block;
    padding: 8px 16px;
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 20px;
    color: #555;
    font-size: 0.85rem;
    font-weight: bold;
}

.filter-btn.active {
    background: #ffc107;
    border-color: #ffb300;
    color: #000;
}

/* =========================

   PRODUCT GRID

========================= */

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 25px;
    padding: 40px 10%;
}

.product-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s;
    position: relative; 
    display: flex;
    flex-direction: column;
    justify-content: space-between; 
}

.product-card:hover {
    transform: translateY(-5px);
}

.product-card h3 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 1.1rem;
}

/* The Description Clamp */
.description {
    font-size: 0.85rem;
    color: #666;
    margin: 10px 0;
    line-height: 1.4;
    height: 2.8em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2; 
    -webkit-box-orient: vertical;
}

/* Discount Badge */
.discount-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #e74c3c;
    color: white;
    padding: 4px 8px;
    border-radius: 5px;
    font-size: 0.7rem;
    font-weight: bold;
    z-index: 5;
}

/* Price Styling */
.price-container {
    margin: 10px 0;
}

.current-price {
    font-weight: bold;
    color: #27ae60;
    font-size: 1.2rem;
}

.old-price {
    text-decoration: line-through;
    color: #999;
    font-size: 0.85rem;
    margin-left: 5px;
}

/* Expiry Date Styling */
.expiry-info {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 15px;
}

.expiry-date.urgent {
    color: #d9534f;
    font-weight: bold;
}

/* Standard Paragraph Spacing */
.product-card p {
    margin: 5px 0;
}

/* Add to Cart Button */
.product-card button {
    background: #27ae60;
    color: white;
    border: none;
    width: 100%;
    padding: 10px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    margin-top: auto; 
}

.product-card button:hover {
    background: #219150;
}

.disabled-btn {
    background: #ccc !important;
    cursor: not-allowed;
}

/* =========================

   TABLE (CHECKOUT)

========================= */

table {

    width: 100%;

    border-collapse: collapse;

    margin-top: 20px;

    background: white;

    border-radius: 8px;

    overflow: hidden;

}



th,
td {

    padding: 12px;

    text-align: center;

}



th {

    background: #f1f1f1;

}



tr:not(:last-child) {

    border-bottom: 1px solid #eee;

}



/* Quantity Buttons */

table button {

    background: #27ae60;

    border: none;

    color: white;

    padding: 5px 10px;

    border-radius: 4px;

    cursor: pointer;

    font-weight: bold;

}



table button:hover {

    opacity: 0.85;

}



/* =========================

   FORMS (LOGIN)

========================= */

form {

    margin-top: 20px;

}



form input {

    display: block;

    width: 100%;

    max-width: 400px;

    padding: 10px;

    margin-bottom: 15px;

    border-radius: 6px;

    border: 1px solid #ccc;

}



form button {

    background: #27ae60;

    color: white;

    border: none;

    padding: 10px 25px;

    border-radius: 6px;

    cursor: pointer;

    font-weight: bold;

}



form button:hover {

    background: #219150;

}



/* =========================

   PAGE CONTENT SPACING

========================= */

h2 {

    padding: 30px 10% 0;

}



p {

    padding: 0 10%;

}

.auth-form {

    padding: 0 10%;

    max-width: 400px;

}



.password-box {

    display: flex;

    align-items: center;

    gap: 10px;

}



.password-box button {

    background: #ddd;

    border: none;

    padding: 8px;

    border-radius: 4px;

    cursor: pointer;

}





.nav-btn {

    background: #27ae60;

    color: white;

    text-decoration: none;

    padding: 8px 15px;

    border-radius: 5px;

    font-weight: bold;

    transition: 0.3s;

}



.nav-btn:hover {

    background: #219150;

    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);

}





.day-form select {

    border: 1px solid #ddd;

    border-radius: 3px;

    background: white;

}

.bulk-add-btn {

    display: block;

    background: #f39c12;
    

    color: white;

    text-align: center;

    text-decoration: none;

    font-size: 0.65rem;

    padding: 3px;

    border-radius: 3px;

    margin-bottom: 5px;

    font-weight: bold;

}



.bulk-add-btn:hover {

    background: #e67e22;

}



.day-form select {

    flex: 1;

    font-size: 0.7rem;

    padding: 2px;

    border: 1px solid #ddd;

}



/* Checkout Layout */

.checkout-wrapper {

    display: flex;

    gap: 30px;

    flex-wrap: wrap;

    margin-top: 20px;

}



.item-list {

    flex: 2;

    min-width: 300px;

}



.summary-card {

    flex: 1;

    min-width: 300px;

    background: #fff;

    padding: 25px;

    border-radius: 12px;

    border: 1px solid #ddd;

    height: fit-content;

    position: sticky;

    top: 20px;

}



/* Item Row Styling */

.item-card {

    display: flex;

    justify-content: space-between;

    background: white;

    padding: 15px;

    margin-bottom: 10px;

    border-radius: 8px;

    border: 1px solid #eee;

}



/* Toggle Switch Styling */

.method-toggle {

    display: flex;

    gap: 10px;

    margin-top: 10px;

}



.toggle-btn {

    flex: 1;

    text-align: center;

    padding: 10px;

    text-decoration: none;

    border-radius: 5px;

    border: 2px solid #2e7d32;

    color: #2e7d32;

    font-weight: bold;

    transition: 0.2s;

}



.toggle-btn.active {

    background: #2e7d32;

    color: white;

}



.price-row {

    display: flex;

    justify-content: space-between;

    margin-bottom: 10px;

}



.total-row {

    display: flex;

    justify-content: space-between;

    font-weight: bold;

    font-size: 1.4rem;

    margin-top: 15px;

    padding-top: 15px;

    border-top: 2px solid #eee;

}



.qty-controls {

    display: flex;

    align-items: center;

    gap: 10px;

    margin-top: 5px;

}



.qty-btn {

    text-decoration: none;

    background: #eee;

    color: #333;

    padding: 2px 10px;

    border-radius: 4px;

    font-weight: bold;

    font-size: 0.9rem;

}



.qty-btn:hover {

    background: #ddd;

}



/* --- Navbar Base --- */

.navbar {

    background-color: #2e7d32;

    padding: 10px 5%;

    display: flex;

    justify-content: space-between;

    align-items: center;

    color: white;

}



.nav-group-left {

    display: flex;

    align-items: center;

    gap: 20px;

}



/* --- The Dropdown Container --- */

.nav-menu {

    position: relative;
    

    display: inline-block;

}



.menu-btn {

    background: #ffffff;

    color: #2e7d32;

    padding: 8px 15px;

    border: none;

    border-radius: 5px;

    font-weight: bold;

    cursor: pointer;

}



/* --- The actual Dropdown Box --- */

.menu-content {

    display: none;

    position: absolute;

    top: 100%;

    left: 0;

    background-color: white;

    min-width: 220px;

    box-shadow: 0px 8px 16px rgba(0, 0, 0, 0.2);

    z-index: 1000;

    border-radius: 8px;

    padding: 10px 0;

}



/* Show the menu when hovering over the container */

.nav-menu:hover .menu-content {

    display: block;

}





.menu-content a {

    color: #333333 !important;

    padding: 12px 20px;

    text-decoration: none;

    display: block;

    font-size: 0.95rem;

}



.menu-content a:hover {

    background-color: #f1f1f1;

    color: #2e7d32 !important;

}



.menu-content hr {

    border: 0;

    border-top: 1px solid #eee;

    margin: 8px 0;

}

/* =========================

   AI CHATBOT PAGE

========================= */

.chat-container {

    max-width: 800px;

    margin: 20px auto;

    background: white;

    border-radius: 12px;

    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);

    display: flex;

    flex-direction: column;

    height: 70vh;

}



.chat-box {

    flex: 1;

    overflow-y: auto;

    padding: 20px;

    display: flex;

    flex-direction: column;

    gap: 15px;

    border-bottom: 1px solid #eee;

}



/* Chat Bubbles */

.message {

    max-width: 75%;

    padding: 12px 16px;

    border-radius: 15px;

    font-size: 0.95rem;

    line-height: 1.4;

}



.ai-message {

    align-self: flex-start;

    background-color: #f1f1f1;

    color: #333;

    border-bottom-left-radius: 2px;

}



.user-message {

    align-self: flex-end;

    background-color: #27ae60;

    color: white;

    border-bottom-right-radius: 2px;

}



/* Chat Input Area */

.chat-input-area {

    padding: 15px;

    display: flex;

    gap: 10px;

    background: #fff;

    border-bottom-left-radius: 12px;

    border-bottom-right-radius: 12px;

}



.chat-input-area input {

    flex: 1;

    padding: 12px;

    border: 1px solid #ddd;

    border-radius: 6px;

    outline: none;

}



.chat-input-area button {

    background: #27ae60;

    color: white;

    border: none;

    padding: 0 20px;

    border-radius: 6px;

    cursor: pointer;

    font-weight: bold;

}

/* =========================

   SETTINGS & PROFILE PAGE

========================= */

.settings-container {

    max-width: 600px;

    margin: 50px auto;

    padding: 0 20px;

}



.profile-card {

    background: white;

    border-radius: 15px;

    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);

    overflow: hidden;

    border: 1px solid #eee;

}



.profile-header {

    background: #2e7d32;

    padding: 40px 20px;

    text-align: center;

    color: white;

}



.profile-avatar {

    width: 80px;

    height: 80px;

    background: rgba(255, 255, 255, 0.2);

    border-radius: 50%;

    margin: 0 auto 15px;

    display: flex;

    align-items: center;

    justify-content: center;

    font-size: 2rem;

    font-weight: bold;

}



.member-id {

    opacity: 0.8;

    font-size: 0.85rem;

}



.profile-body {

    padding: 30px;

}



.form-group {

    margin-bottom: 20px;

}



.form-group label {

    display: block;

    color: #666;

    font-size: 0.8rem;

    text-transform: uppercase;

    font-weight: bold;

    margin-bottom: 8px;

}



.stats-box {

    background: #f9f9f9;

    padding: 15px;

    border-radius: 8px;

    margin-bottom: 30px;

    border: 1px solid #eee;

}



.btn-group {

    display: flex;

    gap: 10px;

}



.save-btn {

    flex: 2;

    background: #2e7d32;

    color: white;

    border: none;

    padding: 12px;

    border-radius: 8px;

    font-weight: bold;

    cursor: pointer;

}



.cancel-btn {

    flex: 1;

    text-align: center;

    background: #eee;

    color: #333;

    padding: 12px;

    border-radius: 8px;

    font-size: 0.9rem;

}



.warning-btn {

    background: #e67e22;

    color: white;

    border: none;

    width: 100%;

    padding: 12px;

    border-radius: 8px;

    font-weight: bold;

    cursor: pointer;

}



.section-title {

    color: #333;

    margin-top: 0;

    border-bottom: 1px solid #eee;

    padding-bottom: 10px;

    font-size: 1.2rem;

}



.divider {

    border: 0;

    border-top: 1px solid #eee;

    margin: 30px 0;

}



.logout-link {

    display: block;

    text-align: center;

    color: #e74c3c;

    font-weight: bold;

}

/* The switch - the box around the slider */

.switch {

    position: relative;

    display: inline-block;

    width: 50px;

    height: 24px;

}



/* Hide default HTML checkbox */

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}



/* The slider */

.slider {

    position: absolute;

    cursor: pointer;

    top: 0;
    left: 0;
    right: 0;
    bottom: 0;

    background-color: #ccc;

    transition: .4s;

    border-radius: 24px;

}



.slider:before {

    position: absolute;

    content: "";

    height: 18px;
    width: 18px;

    left: 3px;
    bottom: 3px;

    background-color: white;

    transition: .4s;

    border-radius: 50%;

}



input:checked+.slider {
    background-color: #2e7d32;
}

input:checked+.slider:before {
    transform: translateX(26px);
}



/* =========================

   2FA VERIFICATION PAGE

========================= */

.verify-container {

    max-width: 400px;

    margin: 80px auto;

    padding: 0 20px;

}



.verify-card {

    background: white;

    border-radius: 15px;

    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);

    overflow: hidden;

    border: 1px solid #eee;

    padding: 30px;

    text-align: center;

}



.verify-icon {

    color: #2e7d32;

    font-size: 3rem;

    margin-bottom: 20px;

}



/* Specific styling for the 6-digit input */

.otp-input {

    text-align: center;

    letter-spacing: 8px;

    font-size: 1.8rem;

    font-weight: bold;

    padding: 15px;

    border: 2px solid #2e7d32;

    border-radius: 8px;

    width: 100%;

    box-sizing: border-box;

    margin-bottom: 20px;

    color: #333;

}



.otp-input:focus {

    outline: none;

    box-shadow: 0 0 8px rgba(46, 125, 50, 0.3);

}



.verify-btn {

    background: #2e7d32;

    color: white;

    border: none;

    width: 100%;

    padding: 15px;

    border-radius: 8px;

    font-weight: bold;

    font-size: 1rem;

    cursor: pointer;

    transition: background 0.3s;

}



.verify-btn:hover {

    background: #219150;

}



.resend-text {

    margin-top: 20px;

    font-size: 0.85rem;

    color: #666;

}



.resend-link {

    color: #2e7d32;

    font-weight: bold;

    text-decoration: none;

}



.tfa-flex-container {

    display: flex;

    justify-content: space-between;

    align-items: center;

}



/* Receipt Page Styling */

.receipt-container {

    max-width: 600px;

    margin: 40px auto;

    padding: 20px;

    background: white;

    border-radius: 8px;

    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);

    text-align: center;

}



.receipt-header {

    border-bottom: 2px solid #f1f1f1;

    padding-bottom: 15px;

    margin-bottom: 20px;

}



.receipt-details {

    text-align: left;

    margin-bottom: 20px;

    line-height: 1.6;

}



.qr-section {

    background: #f9f9f9;

    padding: 20px;

    border: 1px dashed #ccc;

    border-radius: 10px;

    margin: 20px 0;

}



.qr-code-img {

    max-width: 200px;

    height: auto;

    margin-top: 10px;

}



.btn-group {

    display: flex;

    gap: 10px;

    justify-content: center;

    margin-top: 20px;

}

.product-card.out-of-stock {
    opacity: 0.6;
    filter: grayscale(0.5);
    pointer-events: none; /* Prevents clicking anything inside the card */
}

.sold-out-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-15deg);
    background: rgba(231, 76, 60, 0.9);
    color: white;
    padding: 10px 20px;
    font-weight: bold;
    border: 3px solid white;
    z-index: 10;
}

.btn-disabled {
    background-color: #bdc3c7 !important;
    cursor: not-allowed;
}

.status-tag.out { color: #e74c3c; font-weight: bold; }
.status-tag.in { color: #27ae60; }

.price-container {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 10px;
}

.old-price {
    text-decoration: line-through;
    color: #95a5a6;
    font-size: 0.85rem;
}

.current-price {
    font-size: 1.25rem;
    font-weight: bold;
}

.low-stock {
    color: #d35400;
    font-weight: bold;
}

/* Container for the Title and the View All link */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.view-all-link {
    color: #e67e22;
    text-decoration: none;
    font-weight: bold;
    font-size: 0.9rem;
}

.view-all-link:hover {
    text-decoration: underline;
}

/* Force the clearance row to NOT wrap and hide overflow if necessary */
.clearance-row {
    grid-template-columns: repeat(4, 1fr) !important; /* Forces 4 columns */
    overflow: hidden; /* Ensures nothing spills to a second row */
}

/* --- ORDER HISTORY STYLES --- */

.order-card {
    margin-bottom: 30px;
    border: 1px solid #ddd;
    border-radius: 10px;
    overflow: hidden;
    background: white;
}

.order-header {
    padding: 15px;
    background: #f1f8e9;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #eee;
}

.order-meta {
    font-size: 0.8rem;
    color: #666;
}

.qr-btn {
    background: #3498db;
    color: white;
    padding: 8px 15px;
    text-decoration: none;
    border-radius: 5px;
    font-size: 0.9rem;
    font-weight: bold;
}

/* TRACKER */
.tracker-wrapper {
    padding: 25px 20px;
    background: #fff;
}

.tracker-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    max-width: 600px;
    margin: 0 auto;
}

.step {
    z-index: 2;
    text-align: center;
    flex: 0 0 80px;
}

.circle {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #ddd; /* Default Pending Gray */
    color: white;
    line-height: 30px;
    margin: 0 auto 5px;
    font-weight: bold;
}

.step-label {
    font-size: 0.75rem;
    font-weight: bold;
    display: block;
    color: #555;
}

.line {
    flex: 1;
    height: 4px;
    background: #ddd; /* Default Pending Gray */
    margin-top: -20px;
}

/* These classes are applied via Jinja logic */
.active-step {
    background: #27ae60 !important; /* Completed Green */
}

.active-line {
    background: #27ae60 !important; /* Completed Green */
}

/* DETAILS & FOOTER */
.order-details {
    padding: 0 20px 20px;
}

.items-title {
    margin-bottom: 10px;
    border-bottom: 1px solid #eee;
    padding-bottom: 5px;
}

.history-item-list {
    list-style: none;
    padding: 0;
    margin-bottom: 15px;
}

.history-item {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
}

.order-note-box {
    margin-bottom: 15px;
    padding: 10px;
    background: #fffde7;
    border-left: 4px solid #fdd835;
    font-size: 0.85rem;
}

.order-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #eee;
    padding-top: 15px;
}

.order-total {
    font-size: 1.2rem;
    font-weight: bold;
    margin: 0;
}

.reorder-btn {
    background: #27ae60;
    color: white;
    padding: 10px 20px;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
}

.empty-history {
    text-align: center;
    padding: 50px;
    color: #666;
}