/* NaijaPharm - Mobile First Styles */
:root {
    --np-primary: #0d9488;
    --np-primary-dark: #0f766e;
    --np-danger: #dc2626;
    --np-warning: #d97706;
    --np-info: #2563eb;
    --np-bg: #f8fafc;
    --np-card: #ffffff;
    --np-text: #1e293b;
    --np-muted: #64748b;
    --np-border: #e2e8f0;
    --np-radius: 12px;
    --np-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

* { box-sizing: border-box; }

.np-app {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--np-bg);
    color: var(--np-text);
    min-height: 100vh;
    padding-bottom: 70px;
    max-width: 100%;
    overflow-x: hidden;
}

/* Header */
.np-header {
    background: var(--np-primary);
    color: #fff;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.np-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    max-width: 600px;
    margin: 0 auto;
}
.np-logo { font-size: 1.15rem; font-weight: 700; margin: 0; }
.np-back { color: #fff; text-decoration: none; font-size: 1.4rem; padding: 4px 8px; }
.np-header-btn {
    background: rgba(255,255,255,0.2);
    border: none;
    color: #fff;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
}
.np-user { font-size: 0.85rem; opacity: 0.9; }

/* Main */
.np-main {
    max-width: 600px;
    margin: 0 auto;
    padding: 16px;
}

/* Stats */
.np-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 20px;
}
.np-stat-card {
    background: var(--np-card);
    border-radius: var(--np-radius);
    padding: 16px;
    box-shadow: var(--np-shadow);
    border-left: 4px solid var(--np-primary);
}
.np-stat-card.warning { border-left-color: var(--np-warning); }
.np-stat-card.danger { border-left-color: var(--np-danger); }
.np-stat-card.info { border-left-color: var(--np-info); }
.np-stat-label { font-size: 0.75rem; color: var(--np-muted); margin-bottom: 4px; }
.np-stat-value { font-size: 1.35rem; font-weight: 700; }

/* Quick Actions */
.np-quick-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.np-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--np-card);
    border-radius: var(--np-radius);
    padding: 20px 12px;
    text-decoration: none;
    color: var(--np-text);
    box-shadow: var(--np-shadow);
    font-size: 0.9rem;
    font-weight: 500;
    transition: transform 0.15s;
}
.np-action-btn:active { transform: scale(0.97); }
.np-action-btn.primary {
    background: var(--np-primary);
    color: #fff;
}
.np-icon { font-size: 1.6rem; }

/* Bottom Nav */
.np-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    border-top: 1px solid var(--np-border);
    display: flex;
    justify-content: space-around;
    padding: 8px 0 calc(8px + env(safe-area-inset-bottom));
    z-index: 200;
    max-width: 600px;
    margin: 0 auto;
}
.np-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--np-muted);
    font-size: 1.2rem;
    padding: 4px 12px;
}
.np-nav-item small { font-size: 0.65rem; margin-top: 2px; }
.np-nav-item.active { color: var(--np-primary); font-weight: 600; }

/* Forms & Inputs */
.np-input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--np-border);
    border-radius: 10px;
    font-size: 1rem;
    background: #fff;
    -webkit-appearance: none;
}
.np-input:focus {
    outline: none;
    border-color: var(--np-primary);
    box-shadow: 0 0 0 3px rgba(13,148,136,0.15);
}
.np-search-wrap { margin-bottom: 12px; }
.np-search { font-size: 1rem; }

.np-form-group { margin-bottom: 14px; }
.np-form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--np-muted);
}

.np-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 20px;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}
.np-btn-primary {
    background: var(--np-primary);
    color: #fff;
}
.np-btn-primary:active { background: var(--np-primary-dark); }
.np-btn-block { width: 100%; }
.np-link {
    background: none;
    border: none;
    color: var(--np-primary);
    font-size: 0.9rem;
    cursor: pointer;
}

/* Product List / Cards */
.np-product-list, .np-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.np-product-card, .np-list-item {
    background: var(--np-card);
    border-radius: var(--np-radius);
    padding: 14px;
    box-shadow: var(--np-shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}
.np-product-info h4 { margin: 0 0 4px; font-size: 0.95rem; }
.np-product-info p { margin: 0; font-size: 0.8rem; color: var(--np-muted); }
.np-product-price { font-weight: 700; color: var(--np-primary); white-space: nowrap; }
.np-stock-badge {
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 20px;
    background: #e0f2fe;
    color: #0369a1;
}
.np-stock-badge.low { background: #fef3c7; color: #b45309; }
.np-stock-badge.out { background: #fee2e2; color: #b91c1c; }

/* Cart */
.np-cart {
    position: sticky;
    bottom: 70px;
    background: #fff;
    border-radius: var(--np-radius) var(--np-radius) 0 0;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.1);
    padding: 12px 16px 16px;
    z-index: 50;
}
.np-cart.hidden { display: none; }
.np-cart-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}
.np-cart-items { max-height: 180px; overflow-y: auto; }
.np-cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--np-border);
    font-size: 0.9rem;
}
.np-qty-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}
.np-qty-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid var(--np-border);
    background: #fff;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.np-cart-footer { margin-top: 12px; }
.np-cart-total { font-size: 1.1rem; margin-bottom: 10px; }
.np-big-total { font-size: 1.5rem; font-weight: 700; color: var(--np-primary); }

/* Sheets / Modals */
.np-sheet {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 300;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}
.np-sheet.hidden { display: none; }
.np-sheet-content {
    background: #fff;
    width: 100%;
    max-width: 600px;
    border-radius: 20px 20px 0 0;
    max-height: 90vh;
    overflow-y: auto;
    animation: npSlideUp 0.25s ease;
}
@keyframes npSlideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}
.np-sheet-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--np-border);
}
.np-sheet-header h3 { margin: 0; font-size: 1.1rem; }
.np-sheet-close {
    background: none;
    border: none;
    font-size: 1.6rem;
    cursor: pointer;
    color: var(--np-muted);
    line-height: 1;
}
.np-sheet-body { padding: 16px 20px 30px; }

/* Overlay Success */
.np-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255,255,255,0.97);
    z-index: 400;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.np-overlay.hidden { display: none; }
.np-success-box { text-align: center; max-width: 320px; }
.np-success-icon {
    width: 70px;
    height: 70px;
    background: #d1fae5;
    color: #059669;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin: 0 auto 16px;
}

/* Tabs */
.np-tabs {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    margin-bottom: 14px;
    padding-bottom: 4px;
}
.np-tab {
    flex-shrink: 0;
    padding: 8px 14px;
    border: 1px solid var(--np-border);
    background: #fff;
    border-radius: 20px;
    font-size: 0.85rem;
    cursor: pointer;
}
.np-tab.active {
    background: var(--np-primary);
    color: #fff;
    border-color: var(--np-primary);
}

/* Dropdown */
.np-dropdown {
    background: #fff;
    border: 1px solid var(--np-border);
    border-radius: 8px;
    max-height: 180px;
    overflow-y: auto;
    margin-top: 4px;
}
.np-dropdown-item {
    padding: 10px 12px;
    cursor: pointer;
    border-bottom: 1px solid var(--np-border);
    font-size: 0.9rem;
}
.np-dropdown-item:active { background: #f1f5f9; }

/* Shop Grid */
.np-product-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.np-shop-card {
    background: var(--np-card);
    border-radius: var(--np-radius);
    padding: 12px;
    box-shadow: var(--np-shadow);
    text-align: center;
}
.np-shop-card h4 { font-size: 0.9rem; margin: 0 0 4px; }
.np-shop-card .price { font-weight: 700; color: var(--np-primary); margin: 6px 0; }
.np-shop-card .np-btn { padding: 8px; font-size: 0.85rem; width: 100%; }

/* Notices */
.np-notice {
    padding: 16px;
    border-radius: var(--np-radius);
    margin: 20px;
    text-align: center;
}
.np-error { background: #fee2e2; color: #991b1b; }

.hidden { display: none !important; }

/* Larger phones / small tablets */
@media (min-width: 480px) {
    .np-stats { grid-template-columns: repeat(4, 1fr); }
}

/* Store Switcher */
.np-store-select {
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.4);
    color: #fff;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.8rem;
    max-width: 130px;
}
.np-store-select option {
    color: #1e293b;
    background: #fff;
}

/* Receipt print helpers */
@media print {
    body * { visibility: hidden; }
    #np-receipt-print, #np-receipt-print * { visibility: visible; }
    #np-receipt-print { position: absolute; left: 0; top: 0; width: 100%; }
}

/* FORCE readable text - fix white-on-white from theme conflicts */
.np-app,
.np-app * {
    color: inherit;
}
.np-app {
    color: #1e293b !important;
}
.np-main,
.np-list,
.np-list-item,
.np-product-card,
.np-product-info,
.np-product-info h4,
.np-product-info p,
.np-form-group label,
.np-cart,
.np-cart-item,
.np-sheet-body,
.np-sheet-header h3,
.np-success-box,
.np-success-box h2,
.np-success-box p {
    color: #1e293b !important;
}
.np-product-info p,
.np-stat-label,
.np-muted {
    color: #64748b !important;
}
.np-header,
.np-header * ,
.np-header .np-logo,
.np-header a,
.np-nav-item span {
    color: #ffffff !important;
}
.np-nav-item small {
    color: inherit !important;
}
.np-nav-item.active {
    color: var(--np-primary) !important;
}
.np-action-btn {
    color: #1e293b !important;
}
.np-action-btn.primary,
.np-action-btn.primary * {
    color: #ffffff !important;
}
.np-btn-primary,
.np-btn-primary * {
    color: #ffffff !important;
}
.np-input {
    color: #1e293b !important;
    background: #ffffff !important;
}
.np-tab {
    color: #1e293b !important;
}
.np-tab.active {
    color: #ffffff !important;
}
