/* ── ROOT VARIABLES (Fresh / Organic Theme) ── */
:root {
    --fresh-green: #2e7d32;
    --fresh-green-light: #4caf50;
    --fresh-green-bg: #e8f5e9;
    --fresh-orange: #e65100;
    --fresh-orange-light: #ff9800;
    --fresh-warm: #fff8e1;
    --fresh-brown: #5d4037;
    --fresh-teal: #00897b;
    --shadow-sm: 0 2px 12px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.08);
    --radius-lg: 20px;
    --radius-md: 14px;
    --radius-sm: 10px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    background: #f8faf8;
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    color: #1e2b1e;
    -webkit-tap-highlight-color: transparent;
    /* 🔥 KEY FIX: Allow the body to scroll naturally */
    overflow-y: auto;
    overflow-x: hidden;
    scroll-behavior: smooth;
}

/* ── APP SHELL ── */
.app-shell {
    max-width: 480px;
    margin: 0 auto;
    background: #ffffff;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.06);
    position: relative;
}

/* ── HEADER ── */
.app-header {
    position: sticky;
    top: 0;
    z-index: 50;
    padding: 10px 16px 8px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(46, 125, 50, 0.10);
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 56px;
}

.app-header .brand {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.app-header .brand .logo-icon {
    width: 34px;
    height: 34px;
    background: linear-gradient(135deg, var(--fresh-green), var(--fresh-green-light));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.2rem;
}

.app-header .brand h1 {
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0;
    letter-spacing: -0.3px;
    color: var(--fresh-green);
    background: linear-gradient(135deg, var(--fresh-green), var(--fresh-green-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.header-actions .btn-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: var(--fresh-green-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: var(--fresh-green);
    transition: all 0.2s;
    padding: 0;
    position: relative;
    flex-shrink: 0;
}

.header-actions .btn-icon:active {
    transform: scale(0.92);
    background: #c8e6c9;
}

.header-actions .cart-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: #dc3545;
    color: #fff;
    font-size: 0.55rem;
    font-weight: 700;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
}

/* ── SEARCH OVERLAY ── */
.search-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #ffffff;
    display: flex;
    align-items: center;
    padding: 0 16px;
    gap: 10px;
    z-index: 20;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-4px);
    transition: all 0.25s ease;
    border-radius: 0;
}

.search-overlay.open {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.search-overlay .search-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 1rem;
    padding: 12px 0;
    background: transparent;
    color: #1e2b1e;
    font-weight: 500;
}

.search-overlay .search-input::placeholder {
    color: #a0a0a0;
    font-weight: 400;
}

.search-overlay .search-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: #f1f3f1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: #555;
    transition: background 0.2s;
    flex-shrink: 0;
}

.search-overlay .search-close:active {
    background: #dee2de;
}

/* ── BOTTOM NAV ── */
.app-bottom-nav {
    /* left: 49%;
    transform: translateX(-48%); */
    flex-shrink: 0;
    width: 100%;
    max-width: 480px;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 4px;
    z-index: 1050;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.04);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px 8px;
    border: none;
    background: transparent;
    color: #8a9a8a;
    font-size: 0.8rem;
    font-weight: 500;
    transition: color 0.2s;
    text-decoration: none;
    min-width: 52px;
    position: relative;
    border-radius: 8px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.nav-item i {
    padding: 0;
    font-size: 1.8rem;
    line-height: 1.0;
    margin-bottom: 0px;
    transition: transform 0.2s;
}

.nav-item span {
    line-height: 1.0;
}

.nav-item.active {
    color: var(--fresh-green);
}

.nav-item.active i {
    transform: scale(1.05);
}

.nav-item:active {
    opacity: 0.6;
}

.nav-item .nav-badge {
    position: relative;
    /* top: 18px;
    right: 18px; */
    margin-top: -18px;
    margin-bottom: 8px;
    color: var(--fresh-green-bg);
    font-size: 0.8rem;
    font-weight: 500;
    line-height: 1;
    min-width: 16px;
    text-align: center;
}

/* ─── PAGE SECTIONS ─── */
.page-section { display: none; animation: fadeUp 0.3s ease-out; }
.page-section.active { display: block; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

/* ── RESPONSIVE ── */
@media (min-width: 481px) {
    .app-shell {
        border-radius: 24px;
        margin-top: 0;
        margin-bottom: 0;
    }
    .app-bottom-nav {
        left: 49%;
        transform: translateX(-48%);
    }
}

@media (max-width: 380px) {
    .app-header .brand h1 {
        font-size: 0.95rem;
    }

    .nav-item {
        min-width: 44px;
        font-size: 0.7rem;
    }

    .nav-item i {
        font-size: 1.5rem;
    }

    .nav-item .nav-badge {
        margin-top: -16px;
        margin-bottom: 6px;
    }
}

/* ── SKELETON LOADING ── */
.skeleton-wrapper {
    padding: 12px 16px 20px;
}

.skeleton-card {
    background: #fff;
    border-radius: 20px;
    padding: 14px 16px;
    margin-bottom: 14px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
    display: flex;
    gap: 14px;
    align-items: stretch;
    border: 1px solid rgba(0, 0, 0, 0.03);
}

.skeleton-card .sk-img {
    width: 80px;
    height: 80px;
    border-radius: 14px;
    background: #e9ece9;
    flex-shrink: 0;
    animation: shimmer 1.2s infinite;
}

.skeleton-card .sk-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    justify-content: center;
}

.skeleton-card .sk-line {
    height: 14px;
    border-radius: 6px;
    background: #e9ece9;
    animation: shimmer 1.2s infinite;
}

.skeleton-card .sk-line.short {
    width: 60%;
}

.skeleton-card .sk-line.med {
    width: 40%;
}

.skeleton-card .sk-line.price {
    width: 30%;
    height: 18px;
}

.skeleton-card .sk-action {
    width: 60px;
    height: 60px;
    border-radius: 30px;
    background: #e9ece9;
    flex-shrink: 0;
    animation: shimmer 1.2s infinite;
}

@keyframes shimmer {
    0% {
        opacity: 0.5;
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0.5;
    }
}

/* ─── MAIN CONTENT (grows to fill space) ─── */
.app-main {
    flex: 1;
    padding: 0 0 76px 0; /* space for sticky footer */
    background: #f8faf8;
}

input,textarea,button,select:focus {
    box-shadow: none !important;
}
.dataTable thead {
    display: none;
}
.sorting_1 {
    background-color: #f8faf8 !important;
    padding-bottom: 0 !important;
    border-bottom: none !important;
}

/* ── PRODUCT CARDS (DataTables override) ── */
.product-card {
    position: relative;
    background: #ffffff;
    border-radius: 20px;
    padding: 8px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.03);
    display: flex;
    gap: 14px;
    align-items: stretch;
    transition: all 0.2s;
}

.product-card .card-img-wrap {
    flex-shrink: 0;
    width: 100px;
    height: 100px;
    border-radius: 14px;
    overflow: hidden;
    background: var(--fresh-green-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.product-card .card-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-card .card-img-wrap .img-placeholder {
    font-size: 2.2rem;
    opacity: 0.5;
}

.product-card .card-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    /* justify-content: space-around; */
    padding: 0;
}

.product-card .card-body .product-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1e2b1e;
    margin: 0 0 1px 0;
    line-height: 1.5;
}

.product-card .card-body .product-meta {
    font-size: 0.7rem;
    color: #6a7a6a;
    margin: 0 0 2px 0;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.product-card .card-body .product-price {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--fresh-green);
    margin: 2px 0 0 0;
}

.product-card .card-body .product-price .price-per {
    font-size: 0.7rem;
    font-weight: 400;
    color: #8a9a8a;
    margin-left: 4px;
}

.product-card .card-actions {
    position: absolute;
    bottom: 8px;                    /* distance from bottom edge */
    right: 8px;                     /* distance from right edge */
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0px;
    flex-shrink: 0;
}

.product-card .card-actions .qty-control {
    display: flex;
    align-items: center;
    gap: 4px;
    background: var(--fresh-green-bg);
    border-radius: 20px;
    padding: 2px 4px;
}

.product-card .card-actions .qty-control .qty-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    background: transparent;
    color: var(--fresh-green);
    transition: all 0.15s;
    padding: 0;
    font-weight: 700;
}

.product-card .card-actions .qty-control .qty-btn:active {
    background: rgba(46, 125, 50, 0.15);
    transform: scale(0.9);
}

.product-card .card-actions .qty-control .qty-display {
    min-width: 24px;
    text-align: center;
    font-weight: 700;
    font-size: 0.9rem;
    color: #1e2b1e;
}

.product-card .card-actions .product-amount-display {
    /* min-width: 48px; */
    margin-top: 0px;
    margin-bottom: -8px;
    border: 2px solid #fff;
    border-radius: 20px;
    padding: 2px 8px;
    text-align: center;
    font-weight: 700;
    font-size: 0.6rem;
    line-height: 1;
    background-color: var(--fresh-green);
    color: var(--fresh-green-bg);
    z-index: 1;
}

.product-card .card-actions .cart-btn {
    border: none;
    background: linear-gradient(135deg, var(--fresh-green), var(--fresh-green-light));
    color: #fff;
    border-radius: 20px;
    padding: 5px 14px;
    font-size: 0.7rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(46, 125, 50, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    width: 100%;
    justify-content: center;
}

.product-card .card-actions .cart-btn:active {
    transform: scale(0.94);
}

.product-card .card-actions .cart-btn .cart-badge-sm {
    background: rgba(255, 255, 255, 0.25);
    border-radius: 10px;
    padding: 0 6px;
    font-size: 0.6rem;
    font-weight: 700;
}
/* ── RESPONSIVE ── */
@media (max-width: 380px) {
    .product-card .card-img-wrap {
        width: 80px;
        height: 80px;
    }

    .product-card .card-body .product-name {
        font-size: 0.8rem;
    }

    .product-card .card-body .product-price {
        font-size: 1.0rem;
    }

    .skeleton-card .sk-img {
        width: 64px;
        height: 64px;
    }
}

/* USER PAGE */
.page-title { font-weight: 500; font-size:1.0rem; color:#1e2b1e; }
.page-title i {font-weight: 700; color:#2e7d32; margin-right:6px; }
#cartCheckout tbody td,th{
    font-weight: 500; font-size:0.8rem; color:#758a75;
}

/* Order card */
.order-card { background: #fff; border-radius: 16px; padding: 14px 16px; margin: 0 0px 12px; box-shadow: 0 2px 12px rgba(0,0,0,0.04); border:1px solid rgba(0,0,0,0.03); }
.order-card .order-head { display: flex; justify-content: space-between; align-items: center; margin-bottom:6px; }
.order-card .order-id { font-weight:700; font-size:0.85rem; }
.order-card .order-status { font-size:0.65rem; font-weight:600; padding:2px 12px; border-radius:20px; background:#e8f5e9; color:#2e7d32; }
.order-card .order-status.delivered { background:#e3f2fd; color:#0d47a1; }
.order-card .order-status.cancelled { background:#fce4ec; color:#c62828; }
.order-card .order-date { font-size:0.7rem; color:#8a9a8a; margin-bottom:6px; }
.order-card .order-items { font-size:0.8rem; color:#3d4d3d; margin-bottom:4px; }
.order-card .order-total { font-weight:700; font-size:0.9rem; color:#2e7d32; }
.order-card .order-total span { font-weight:400; color:#8a9a8a; font-size:0.7rem; }