/* ============================
   COFFEE LIFE FINAL CSS 2025
   WhatsApp + Payments + Cart
   ============================ */

/* === ROOT VARIABLES === */
:root {
    --shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    --coffee: #4b2e1e;
    --gold: #b47b3a;
    --cream: #f5e6d3;
    --dark: #2c1b0e;
    --whatsapp: #25D366;
    --whatsapp-dark: #1EBE5D;
    --danger: #e74c3c;
    --muted: #666;
}

/* === BODY === */
* {
    box-sizing: border-box
}

body {
    font-family: "Segoe UI", sans-serif;
    margin: 0;
    padding: 0;
    background: #f5f5f5;
    color: var(--dark);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h2,
h3,
h4,
h5 {
    margin: 0
}

p {
    margin: 0.2rem 0
}

small {
    color: var(--muted)
}

/* === TOP PAYMENT + LOCATION (VISIBLE ABOVE MENU) ===
   Ensure this section visually sits above the menu container.
*/
#payment-section-top,
.payment-section {
    background: #fff;
    border-radius: 12px;
    padding: 16px;
    margin: 1rem;
    box-shadow: var(--shadow);
}

/* Payment buttons area (auto-inserted by JS) */
.payment-grid {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

/* Payment button visual style (icons included) */
.payment-btn,
.payment-btn.payment-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    border: none;
    font-weight: 700;
    cursor: pointer;
    transition: transform .18s ease, box-shadow .18s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    min-height: 44px;
}

/* Icon sizing inside payment buttons */
.payment-btn img {
    height: 22px;
    width: auto;
    display: inline-block;
    vertical-align: middle;
}

/* MTN & Airtel variants */
.payment-btn.mtn {
    background: #fcd116;
    color: #111;
}

.payment-btn.airtel {
    background: #e60000;
    color: #fff;
}

/* hover/active states */
.payment-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
}

.payment-temp-note {
    font-size: .85rem;
    color: var(--muted);
    margin-top: 6px
}

/* === DELIVERY SELECTORS === */
.delivery-controls,
.delivery-zone {
    background: #fff;
    border-radius: 10px;
    padding: 12px;
    margin: 1rem;
    box-shadow: var(--shadow);
}

.delivery-controls label,
.delivery-zone label {
    font-weight: 700;
    display: block;
    margin-bottom: 6px
}

.delivery-controls select,
.delivery-zone select {
    width: 100%;
    padding: 8px;
    border-radius: 8px;
    border: 1px solid #ddd;
    font-size: 0.95rem;
}

.delivery-controls select:focus,
.delivery-zone select:focus {
    outline: 2px solid var(--gold)
}

/* === MENU GRID ===
   Grid is below payments/location and forced to uniform rows.
*/
#menu-container {
    display: grid;
    gap: 16px;
    padding: 1rem;
    grid-auto-rows: 1fr;
    /* uniform row heights */
    justify-items: center;
    margin: 0 1rem 1.25rem 1rem;
    /* space for cart/totals below */
}

/* Responsive column breakpoints (1-4 columns) */
@media(min-width:1025px) {
    #menu-container {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media(min-width:769px) and (max-width:1024px) {
    #menu-container {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media(min-width:481px) and (max-width:768px) {
    #menu-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media(max-width:480px) {
    #menu-container {
        grid-template-columns: repeat(1, 1fr);
    }
}

/* === MENU ITEM CARDS ===
   Cards fill their grid cell and keep consistent height.
*/
.menu-item {
    width: 100%;
    height: 100%;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: transform .2s ease, box-shadow .2s ease;
    padding: 12px;
}

/* Make inner content stretch so cards are same height */
.menu-item>.menu-body {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 8px;
    text-align: center;
    height: 100%;
}

/* Optional image area — include only if your item has an image.
   But since you requested minimal images, the layout will work with or without them.
*/
.menu-item .media {
    width: 100%;
    height: 140px;
    overflow: hidden;
    border-radius: 8px;
    background: #f2f2f2;
    display: block;
}

.menu-item .media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .25s ease;
}

.menu-item:hover .media img {
    transform: scale(1.03)
}

/* Text */
.menu-body h4 {
    font-size: 0.98rem;
    font-weight: 700;
    margin-bottom: 4px;
    transition: color .18s, transform .18s
}

.menu-body h4:hover {
    color: var(--gold);
    transform: scale(1.02)
}

.menu-body .desc {
    font-size: 0.82rem;
    color: var(--coffee);
    min-height: 36px;
    line-height: 1.25
}

.menu-body .price {
    font-size: 0.92rem;
    color: var(--gold);
    font-weight: 800
}

/* Buttons area inside card */
.actions {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-top: 8px
}

.actions button {
    flex: 1;
    padding: 8px 10px;
    border-radius: 28px;
    border: none;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform .12s ease;
}

.btn-add {
    background: var(--coffee);
    color: var(--cream)
}

.btn-add:hover {
    background: var(--gold);
    color: var(--dark);
    transform: translateY(-2px)
}

.btn-whatsapp {
    background: var(--whatsapp);
    color: #fff
}

.btn-whatsapp:hover {
    background: var(--whatsapp-dark);
    transform: translateY(-2px)
}

/* === CART PREVIEW === */
.cart-items {
    max-height: 360px;
    overflow-y: auto;
    padding: 0.6rem;
    margin: 0 1rem;
    background: transparent;
}

.cart-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 4px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0. nine rem;
}

.cart-item img {
    width: 44px;
    height: 44px;
    object-fit: cover;
    border-radius: 8px
}

.cart-item-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 3px
}

.cart-controls {
    display: flex;
    align-items: center;
    gap: 6px
}

.qty-btn {
    padding: 4px 8px;
    border-radius: 6px;
    border: none;
    background: var(--gold);
    color: #fff;
    cursor: pointer
}

.qty-btn:hover {
    background: #b28e00
}

.remove {
    cursor: pointer;
    color: var(--danger);
    font-weight: 800
}

/* === CART ROWS / TOTALS / ACTIONS === */
.cart-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin: 8px 1rem;
    align-items: center
}

.cart-row.total {
    font-weight: 900;
    font-size: 1rem
}

.actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin: 0.5rem 1rem 1.25rem 1rem;
    flex-wrap: wrap
}

.btn-order {
    background: var(--whatsapp);
    color: #fff;
    border-radius: 8px;
    padding: 8px 12px;
    cursor: pointer;
    font-weight: 800
}

.btn-order:hover {
    background: var(--whatsapp-dark);
    transform: translateY(-2px)
}

.btn-ghost {
    background: none;
    border: 1px solid var(--coffee);
    color: var(--coffee);
    padding: 8px 12px;
    border-radius: 8px
}

.btn-ghost:hover {
    background: var(--coffee);
    color: var(--cream)
}

/* === FLOATING WHATSAPP BUTTON === */
.whatsapp-float {
    position: fixed;
    bottom: 22px;
    right: 22px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--whatsapp);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
    z-index: 9999;
    cursor: pointer;
    transition: transform .18s;
}

.whatsapp-float i {
    color: #fff;
    font-size: 1.6rem
}

.whatsapp-float:hover {
    transform: scale(1.07)
}

.whatsapp-float.disabled {
    opacity: .6;
    pointer-events: none
}

/* === ANIMATIONS & UTILS === */
@keyframes shake {

    0%,
    100% {
        transform: translateX(0)
    }

    25% {
        transform: translateX(-4px)
    }

    50% {
        transform: translateX(4px)
    }

    75% {
        transform: translateX(-4px)
    }
}

.shake {
    animation: shake .6s
}

.glow {
    box-shadow: 0 0 10px rgba(180, 123, 58, 0.9)
}

/* === SMALL SCREEN TWEAKS === */
@media(max-width:1024px) {
    .menu-item {
        max-width: 100%;
    }

    .menu-item .media {
        height: 120px
    }
}

@media(max-width:768px) {
    .menu-item .media {
        height: 110px
    }

    .payment-grid {
        gap: 8px
    }
}

@media(max-width:480px) {
    .menu-item .media {
        height: 96px
    }

    .menu-item {
        padding: 10px
    }

    .payment-btn img {
        height: 18px
    }

    .payment-btn {
        min-height: 40px;
        font-size: .88rem
    }
}

.payment-option img {
    width: 40px;
    height: auto;
    object-fit: contain;
    margin-right: 10px;
}