/* ============================================================
   Pinab Express — Global Design System
   Premium UI with Inter + Poppins, smooth animations,
   glassmorphism, and fully mobile-responsive layout.
   ============================================================ */

/* ── 1. ROOT TOKENS ──────────────────────────────────────── */
:root {
    /* Brand Palette */
    --color-red:      #D32F2F; /* Red */
    --color-orange:   #FF9F43;
    --color-golden:   #D4AF37; /* Gold */
    --color-black:    #111827; /* Black */
    --color-white:    #FFFFFF; /* White */
    --color-blue:     #3B82F6;
    --color-skyblue:  #38BDF8;
    --color-purple:   #7C3AED;
    --color-green:    #10B981;
    --color-magenta:  #EF4444;

    /* Semantic */
    --primary:    var(--color-red);
    --secondary:  var(--color-golden);
    --accent:     var(--color-black);

    /* Gradients */
    --gradient-brand:   linear-gradient(135deg, #D32F2F 0%, #F44336 100%);
    --gradient-premium: linear-gradient(135deg, #D4AF37 0%, #FFAA00 100%);
    --gradient-cool:    linear-gradient(135deg, #38BDF8 0%, #3B82F6 100%);
    --gradient-golden:  linear-gradient(135deg, #D4AF37 0%, #FFAA00 100%);
    --gradient-purple:  linear-gradient(135deg, #7C3AED 0%, #A78BFA 100%);
    --gradient-success: linear-gradient(135deg, #10B981 0%, #34D399 100%);

    /* Surfaces */
    --bg-body:     #F9FAFB;
    --bg-card:     #FFFFFF;
    --bg-sidebar:  #FFFFFF;
    --text-dark:   #111827;
    --text-muted:  #4B5563;
    --text-light:  #9CA3AF;
    --border-soft: #E5E7EB;

    /* Layout */
    --sidebar-w: 270px;
    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-xl: 32px;
    --shadow-sm:  0 2px 8px rgba(0,0,0,0.05);
    --shadow-md:  0 8px 30px rgba(0,0,0,0.06);
    --shadow-lg:  0 16px 48px rgba(0,0,0,0.08);
    --shadow-xl:  0 24px 64px rgba(0,0,0,0.1);
    --shadow-premium: 0 12px 40px rgba(211, 47, 47, 0.15);
}

/* Category Specific Theme Variables */
body.theme-grocery {
    --primary: #22C55E; /* Green */
    --gradient-brand: linear-gradient(135deg, #22C55E 0%, #16A34A 100%);
    --bg-body: #E8F5E9; /* Light Green background */
    --text-dark: #064E3B; /* Dark Green text */
    --border-soft: #A7F3D0;
    --shadow-premium: 0 12px 40px rgba(34, 197, 94, 0.15);
}
body.theme-grocery .page-title,
body.theme-grocery .section-heading span,
body.theme-grocery .sidebar-brand {
    color: #22C55E !important;
}

body.theme-beauty {
    --primary: #EC4899; /* Pink */
    --gradient-brand: linear-gradient(135deg, #EC4899 0%, #DB2777 100%);
    --bg-body: #FCE7F3; /* Light Pink background */
    --text-dark: #831843; /* Dark Pink text */
    --border-soft: #FBCFE8;
    --shadow-premium: 0 12px 40px rgba(236, 72, 153, 0.15);
}
body.theme-beauty .page-title,
body.theme-beauty .section-heading span,
body.theme-beauty .sidebar-brand {
    color: #EC4899 !important;
}

body.theme-food {
    --primary: #D32F2F; /* Red */
    --gradient-brand: linear-gradient(135deg, #D32F2F 0%, #B71C1C 100%);
    --bg-body: #FFEBEE; /* Light Red background */
    --text-dark: #7F1D1D; /* Dark Red text */
    --border-soft: #FECACA;
    --shadow-premium: 0 12px 40px rgba(211, 47, 47, 0.15);
}
body.theme-food .page-title,
body.theme-food .section-heading span,
body.theme-food .sidebar-brand {
    color: #D32F2F !important;
}

body.theme-shopkeeper {
    --primary: #F59E0B;
    --gradient-brand: linear-gradient(135deg, #F59E0B 0%, #E87900 100%);
    --bg-body: #FFFAEB;
    --text-dark: #92400E;
    --border-soft: #FCD88B;
    --shadow-premium: 0 12px 40px rgba(245, 158, 11, 0.15);
}
body.theme-shopkeeper .page-title,
body.theme-shopkeeper .section-heading span,
body.theme-shopkeeper .sidebar-brand {
    color: #F59E0B !important;
}

body.theme-delivery_boy {
    --primary: #2563EB;
    --gradient-brand: linear-gradient(135deg, #2563EB 0%, #60A5FA 100%);
    --bg-body: #EFF6FF;
    --text-dark: #1D4ED8;
    --border-soft: #93C5FD;
    --shadow-premium: 0 12px 40px rgba(37, 99, 235, 0.15);
}
body.theme-delivery_boy .page-title,
body.theme-delivery_boy .section-heading span,
body.theme-delivery_boy .sidebar-brand {
    color: #2563EB !important;
}

body.theme-customer {
    --primary: #DC2626;
    --gradient-brand: linear-gradient(135deg, #DC2626 0%, #EF4444 100%);
    --bg-body: #FEF2F2;
    --text-dark: #991B1B;
    --border-soft: #FECACA;
    --shadow-premium: 0 12px 40px rgba(220, 38, 38, 0.15);
}
body.theme-customer .page-title,
body.theme-customer .section-heading span,
body.theme-customer .sidebar-brand {
    color: #DC2626 !important;
}

body.theme-admin {
    --primary: #7C3AED;
    --gradient-brand: linear-gradient(135deg, #7C3AED 0%, #A78BFA 100%);
    --bg-body: #F8F4FF;
    --text-dark: #4C1D95;
    --border-soft: #D8B4FE;
    --shadow-premium: 0 12px 40px rgba(124, 58, 237, 0.15);
}
body.theme-admin .page-title,
body.theme-admin .section-heading span,
body.theme-admin .sidebar-brand {
    color: #7C3AED !important;
}

.detail-layout {
    display: grid;
    grid-template-columns: 1.8fr 1fr;
    gap: 1.5rem;
    align-items: start;
    margin-bottom: 1.5rem;
}

.item-detail {
    background: #fff;
    border-radius: 24px;
    box-shadow: 0 15px 40px rgba(15, 23, 42, 0.08);
    overflow: hidden;
}

.item-detail img {
    width: 100%;
    height: 320px;
    object-fit: cover;
}

.detail-body {
    padding: 1.6rem;
    display: grid;
    gap: 1.25rem;
}

.detail-title {
    font-size: 1.9rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.detail-description {
    color: #4b5563;
    line-height: 1.8;
}

.detail-price {
    color: #dc2626;
    font-size: 1.6rem;
    font-weight: 900;
}

.option-group {
    display: grid;
    gap: 0.85rem;
}

.option-label {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.option-label input {
    accent-color: var(--primary);
}

.option-label:hover {
    border-color: var(--primary);
    background: rgba(220, 38, 38, 0.05);
}

.detail-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
}

.detail-cta {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 1rem 1.4rem;
    border-radius: 16px;
    font-weight: 800;
    cursor: pointer;
}

.secondary-link {
    color: #6b7280;
    font-weight: 700;
}

.related-items {
    display: grid;
    gap: 1rem;
}

.related-item {
    cursor: pointer;
    border: 1px solid #e5e7eb;
    border-radius: 22px;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.related-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
}

.related-item img {
    width: 100%;
    height: 160px;
    object-fit: cover;
}

.related-info {
    padding: 1rem;
}

.related-name {
    font-size: 1.05rem;
    font-weight: 800;
    margin-bottom: 0.45rem;
}

.related-price {
    color: var(--primary);
    font-weight: 800;
    margin-bottom: 0.55rem;
}

/* ── 2. RESET & BASE ─────────────────────────────────────── */
*, *::before, *::after {
    margin: 0; padding: 0; box-sizing: border-box;
}

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg-body);
    color: #000 !important;
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
body, body * {
    color: #000 !important;
}
::placeholder {
    color: rgba(0,0,0,0.55) !important;
}

ul { list-style: none; }
a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }

/* ── 3. TYPOGRAPHY ───────────────────────────────────────── */
h1, h2, h3, h4, h5, h6, .font-display {
    font-family: 'Poppins', 'Inter', sans-serif;
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-dark);
}

.page-title {
    font-family: 'Poppins', sans-serif;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--color-red);
    margin-bottom: 1.5rem;
    letter-spacing: -0.3px;
}

/* ── 4. LAYOUT — SIDEBAR + MAIN ──────────────────────────── */
.app-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-w);
    background: var(--bg-sidebar);
    color: var(--text-dark);
    border-right: 1px solid var(--border-soft);
    padding: 2rem 1.2rem;
    position: fixed;
    top: 0; left: 0;
    height: 100vh;
    z-index: 900;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.sidebar-brand {
    font-family: 'Poppins', sans-serif;
    font-size: 1.6rem;
    font-weight: 900;
    color: var(--color-red);
    text-align: center;
    margin-bottom: 2rem;
    display: block;
    letter-spacing: 0.5px;
}

.sidebar-nav { flex: 1; }

.sidebar-nav li { margin-bottom: 4px; }

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0.85rem 1.1rem;
    border-radius: var(--radius-md);
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.92rem;
    transition: all 0.25s ease;
}

.sidebar-nav a i {
    font-style: normal;
    font-size: 1.15rem;
    width: 22px;
    text-align: center;
}

.sidebar-nav a:hover {
    background: rgba(0, 0, 0, 0.04);
    color: var(--text-dark);
}

.sidebar-nav a.active {
    background: var(--primary);
    color: #fff;
    font-weight: 800;
    box-shadow: var(--shadow-premium);
}

/* ── 5. MAIN CONTENT ─────────────────────────────────────── */
.main-content {
    flex: 1;
    padding: 2rem 2.5rem;
    min-height: 100vh;
}

.app-layout .main-content {
    margin-left: var(--sidebar-w);
}

.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-soft);
}

.app-container { max-width: 1100px; }

/* ── 6. CARDS ────────────────────────────────────────────── */
.card {
    background: var(--bg-card);
    padding: 1.8rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-soft);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    box-shadow: var(--shadow-lg);
}

/* ── 7. BUTTONS ──────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    border: none;
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    font-size: 0.92rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    line-height: 1.4;
}

.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn-primary {
    background: var(--gradient-brand);
    color: #fff;
    box-shadow: 0 4px 14px rgba(255, 71, 87, 0.3);
}
.btn-primary:hover {
    box-shadow: 0 8px 25px rgba(255, 71, 87, 0.4);
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
}
.btn-outline:hover {
    background: var(--primary);
    color: #fff;
}

.btn-cool {
    background: var(--gradient-cool);
    color: #fff;
    box-shadow: 0 4px 14px rgba(59, 130, 246, 0.3);
}

.btn-success {
    background: var(--gradient-success);
    color: #fff;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
}

.btn-golden {
    background: var(--gradient-golden);
    color: var(--color-red);
    box-shadow: 0 4px 14px rgba(255, 170, 0, 0.3);
}

.btn-purple {
    background: var(--gradient-purple);
    color: #fff;
    box-shadow: 0 4px 14px rgba(124, 58, 237, 0.3);
}

/* ── 8. FORMS ────────────────────────────────────────────── */
.form-group { margin-bottom: 1.4rem; }

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 700;
    font-size: 0.88rem;
    color: var(--text-muted);
}

.form-control {
    width: 100%;
    padding: 0.9rem 1rem;
    border: 2px solid var(--border-soft);
    border-radius: var(--radius-md);
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    color: var(--text-dark);
    background: rgba(255,255,255,0.04);
    outline: none;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(255, 71, 87, 0.08);
}

.form-control::placeholder { color: var(--text-light); }

/* ── 9. METRICS ──────────────────────────────────────────── */
.metric-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.2rem;
    margin-bottom: 2rem;
}

.metric-card {
    background: var(--bg-card);
    padding: 1.8rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    text-align: center;
    border-top: 4px solid var(--primary);
    transition: transform 0.3s ease;
}

.metric-card:hover { transform: translateY(-4px); }

.metric-label {
    font-size: 0.78rem;
    text-transform: uppercase;
    font-weight: 800;
    color: var(--text-muted);
    letter-spacing: 1.5px;
    margin-bottom: 8px;
}

.metric-value {
    font-family: 'Poppins', sans-serif;
    font-size: 2rem;
    font-weight: 900;
    color: var(--color-red);
}

/* ── 10. BADGES ──────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-active {
    background: rgba(34,197,94,0.15);
    color: #22C55E;
}

.badge-pending {
    background: rgba(245,158,11,0.15);
    color: #FBBF24;
}

.badge-rejected {
    background: rgba(239,68,68,0.15);
    color: #EF4444;
}

/* ── 11. PRICE ROWS ──────────────────────────────────────── */
.price-breakdown { margin-top: 1rem; }

.price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.7rem 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-soft);
}

.price-row.total {
    border-bottom: none;
    border-top: 2px solid var(--color-red);
    margin-top: 0.5rem;
    padding-top: 1rem;
    font-size: 1.2rem;
    font-weight: 900;
    color: var(--color-red);
}

/* ── 12. BOTTOM NAV (MOBILE) ─────────────────────────────── */
.bottom-nav {
    position: fixed;
    bottom: 16px;
    left: 16px;
    right: 16px;
    height: 68px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: none;
    justify-content: space-around;
    align-items: center;
    border-radius: 22px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.08);
    z-index: 950;
    border: 1px solid var(--border-soft);
}

.bottom-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--text-muted);
    transition: color 0.2s ease;
    padding: 6px 12px;
    border-radius: 12px;
}

.bottom-nav a i {
    font-style: normal;
    font-size: 1.3rem;
}

.bottom-nav a.active,
.bottom-nav a:hover {
    color: var(--primary);
}

.bottom-nav a.active {
    background: rgba(0, 0, 0, 0.04);
}

/* ── 13. ANIMATIONS ──────────────────────────────────────── */
@keyframes slideUp {
    from { opacity: 0; transform: translateY(30px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes float {
    0%   { transform: translateY(0px); }
    50%  { transform: translateY(-12px); }
    100% { transform: translateY(0px); }
}

@keyframes pulse-glow {
    0%   { box-shadow: 0 0 0 0 rgba(255,71,87,0.4); }
    70%  { box-shadow: 0 0 0 14px rgba(255,71,87,0); }
    100% { box-shadow: 0 0 0 0 rgba(255,71,87,0); }
}

@keyframes shimmer {
    0%   { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.slide-up { animation: slideUp 0.6s ease-out both; }
.floating { animation: float 3s ease-in-out infinite; }
.pulse-glow { animation: pulse-glow 2s infinite; }

/* ── 14. RESPONSIVE ──────────────────────────────────────── */
@media (max-width: 991px) {
    .sidebar { display: none; }

    .app-layout .main-content,
    .main-content {
        margin-left: 0 !important;
        padding: 1.5rem 1rem;
        padding-bottom: 100px;
    }

    .bottom-nav { display: flex; }

    .app-header {
        margin-bottom: 1.5rem;
        padding-bottom: 0.8rem;
    }

    .metric-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.8rem;
    }

    .metric-card { padding: 1.2rem; }
    .metric-value { font-size: 1.5rem; }
}

@media (max-width: 480px) {
    .metric-grid { grid-template-columns: 1fr; }
    .main-content { padding: 1rem 0.8rem; padding-bottom: 100px; }
}

/* ── 15. SCROLLBAR ───────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: #D1D5DB;
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover { background: #9CA3AF; }

/* ── 16. SELECTION ───────────────────────────────────────── */
::selection {
    background: rgba(255,71,87,0.15);
    color: var(--color-red);
}