:root {
    --primary-color: #2E7D32;
    /* Green 800 */
    --accent-color: #4CAF50;
    /* Green 500 */
    --bg-color: #f5f5f5;
    --text-color: #333;
    --card-bg: #fff;
    --danger-color: #d32f2f;
    --warning-color: #ffa000;
}

body {
    font-family: 'Poppins', sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--bg-color);
    color: var(--text-color);
    padding-bottom: 80px;
    /* Space for nav or floaters */
}

/* Banner */
.cycle-banner {
    background-color: var(--warning-color);
    color: #000;
    padding: 10px;
    /* position: sticky; removed to make it scroll away */
    /* top: 0; */
    /* z-index: 1000; */
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);

    /* Force single line and adjust size */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cycle-info strong {
    font-size: clamp(0.75rem, 2.5vw, 1rem);
    /* Scales between 12px and 16px depending on viewport */
}

.cycle-banner.open {
    background-color: #d4edda;
    color: #155724;
}

.cycle-banner.closed {
    background-color: #f8d7da;
    color: #721c24;
}

/* Navbar */
.navbar {
    background-color: var(--primary-color);
    color: white;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    /* Make navbar sticky */
    top: 0;
    z-index: 1000;
}

.logo {
    font-size: 1.2rem;
    font-weight: bold;
}

.nav-icons button {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    margin-left: 10px;
}

/* Views */
.view {
    padding: 15px;
    display: block;
}

.view.hidden {
    display: none;
}

/* Category Buttons */
.cat-btn {
    padding: 8px 16px;
    border: 1px solid var(--primary-color);
    background: white;
    color: var(--primary-color);
    border-radius: 20px;
    cursor: pointer;
    white-space: nowrap;
    font-size: 0.9rem;
    transition: all 0.3s;
}

.cat-btn.active,
.cat-btn:hover {
    background: var(--primary-color);
    color: white;
}

/* Product Grid */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
}

.product-card {
    background: var(--card-bg);
    border-radius: 8px;
    padding: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.product-card img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 4px;
}

.unit-selector {
    margin: 10px 0;
    padding: 5px;
    width: 100%;
}

.add-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 8px;
    width: 100%;
    border-radius: 4px;
    cursor: pointer;
}

/* Map */
.map-container {
    height: 250px;
    width: 100%;
    border-radius: 8px;
    margin-bottom: 10px;
    border: 1px solid #ddd;
}

/* Login */
.login-container {
    max-width: 400px;
    margin: 40px auto;
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.tabs {
    display: flex;
    margin-bottom: 20px;
}

.tabs button {
    flex: 1;
    padding: 10px;
    background: none;
    border: none;
    border-bottom: 2px solid #ddd;
    cursor: pointer;
}

.tabs button.active {
    border-bottom-color: var(--primary-color);
    font-weight: bold;
}

form input {
    width: 90%;
    padding: 10px;
    margin-bottom: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

form button {
    width: 100%;
    padding: 12px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

/* WhatsApp Float */
.whatsapp-float {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background-color: #25d366;
    color: white;
    border-radius: 50%;
    text-align: center;
    font-size: 30px;
    box-shadow: 2px 2px 3px #999;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
}

.whatsapp-float img {
    width: 35px;
    height: 35px;
}

/* Utilities */
.hidden {
    display: none !important;
}

/* Cart Styles */
.cart-item {
    display: flex;
    align-items: center;
    background: var(--card-bg);
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 10px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    gap: 10px;
}

.cart-item img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
}

.cart-item-details {
    flex: 1;
}

.cart-item-details h4 {
    margin: 0;
    font-size: 1rem;
    color: var(--text-color);
}

.cart-item-details p {
    margin: 2px 0 5px;
    font-size: 0.85rem;
    color: #666;
}

.cart-qty-control {
    display: flex;
    align-items: center;
    gap: 8px;
}

.cart-qty-control button {
    background: #e0e0e0;
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-qty-control span {
    font-weight: 600;
    min-width: 20px;
    text-align: center;
}

.cart-item-right {
    text-align: right;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-end;
}

.item-subtotal {
    font-weight: bold;
    color: var(--primary-color);
    display: block;
    margin-bottom: 5px;
}

.remove-btn {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0;
}

.remove-btn:hover {
    color: var(--danger-color);
}

.cart-summary {
    background: #fff;
    padding: 15px;
    border-top: 1px solid #eee;
    margin-top: 20px;
    /* meaningful only if inside a scrollable area, 
       but good to have visual separation */
}

.cart-empty {
    text-align: center;
    padding: 40px 20px;
    color: #888;
}

.cart-empty-icon {
    font-size: 4rem;
    margin-bottom: 10px;
    display: block;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
    width: 90%;
    max-width: 400px;
}

.toast {
    background-color: #333;
    color: white;
    padding: 12px 24px;
    border-radius: 25px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
    font-size: 0.9rem;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast.success {
    background-color: var(--primary-color);
}

.toast.error {
    background-color: var(--danger-color);
}

/* Checkout Redesign */
.checkout-container {
    max-width: 600px;
    margin: 0 auto;
}

.checkout-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    border: 1px solid #eee;
}

.checkout-card h4 {
    margin-top: 0;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
    color: var(--primary-color);
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.input-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.form-control {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
    background: #fafafa;
}

.form-control:focus {
    border-color: var(--primary-color);
    background: white;
    outline: none;
}

.radio-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.radio-option {
    display: flex;
    align-items: center;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.radio-option:hover {
    background: #f9f9f9;
}

.radio-option input[type="radio"] {
    margin-right: 12px;
    width: 20px;
    height: 20px;
    accent-color: var(--primary-color);
}

.confirm-btn-sticky {
    position: sticky;
    bottom: 20px;
    background: var(--primary-color);
    color: white;
    padding: 16px;
    width: 100%;
    border: none;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: bold;
    box-shadow: 0 5px 20px rgba(46, 125, 50, 0.4);
    cursor: pointer;
    transition: transform 0.2s;
    z-index: 900;
}

.confirm-btn-sticky:active {
    transform: scale(0.98);
}