/* Pharmacy point-of-sale counter */
.page-pharmacy-pos .page-subtitle {
    margin-bottom: 0;
}

.pharmacy-pos-shell {
    margin-top: 1rem;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(300px, 380px);
    gap: 1rem;
    align-items: start;
}

.pharmacy-pos-main {
    display: grid;
    gap: 1rem;
    min-width: 0;
}

.pharmacy-pos-panel__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.85rem;
}

.pharmacy-pos-panel__title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 800;
    color: #0f172a;
}

.pharmacy-pos-panel__lede {
    margin: 0.15rem 0 0;
    font-size: 0.8125rem;
}

.pharmacy-pos-kbd-hints {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    font-size: 0.72rem;
}

.pharmacy-pos-kbd-hints kbd {
    display: inline-block;
    padding: 0.08rem 0.35rem;
    border-radius: 4px;
    border: 1px solid rgba(148, 163, 184, 0.45);
    background: #fff;
    font-family: inherit;
    font-size: 0.68rem;
}

.pharmacy-pos-search-hero {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.55rem 0.75rem;
    border-radius: 14px;
    border: 2px solid rgba(109, 40, 217, 0.22);
    background: linear-gradient(180deg, #fff 0%, #faf5ff 100%);
    box-shadow: 0 8px 24px rgba(109, 40, 217, 0.08);
}

.pharmacy-pos-search-hero:focus-within {
    border-color: var(--module-accent, #6d28d9);
    box-shadow: 0 0 0 4px rgba(109, 40, 217, 0.12);
}

.pharmacy-pos-search-hero__icon {
    color: var(--module-accent, #6d28d9);
    flex-shrink: 0;
}

.pharmacy-pos-search-input {
    flex: 1;
    min-width: 0;
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    font-size: 1.05rem;
    font-weight: 600;
    padding: 0.35rem 0 !important;
}

.pharmacy-pos-search-clear {
    border: none;
    background: rgba(148, 163, 184, 0.18);
    color: #64748b;
    width: 28px;
    height: 28px;
    border-radius: 999px;
    cursor: pointer;
    font-size: 1.1rem;
    line-height: 1;
}

.pharmacy-pos-scan-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.pharmacy-pos-scan-row__icon {
    color: #64748b;
    flex-shrink: 0;
}

.pharmacy-pos-barcode-input {
    flex: 1;
    min-width: 0;
}

.pharmacy-pos-results {
    margin-top: 0.85rem;
    max-height: min(52vh, 520px);
    overflow: auto;
}

.pharmacy-pos-results__empty {
    padding: 1.25rem;
    text-align: center;
    border: 1px dashed rgba(148, 163, 184, 0.45);
    border-radius: 12px;
    color: #64748b;
    font-size: 0.875rem;
}

.pharmacy-pos-result-grid {
    display: grid;
    gap: 0.55rem;
}

.pharmacy-pos-result-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.65rem;
    align-items: center;
    padding: 0.75rem 0.85rem;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.28);
    background: #fff;
    cursor: pointer;
    text-align: left;
    transition: border-color 0.14s ease, box-shadow 0.14s ease, transform 0.12s ease;
}

.pharmacy-pos-result-card:hover,
.pharmacy-pos-result-card:focus-visible,
.pharmacy-pos-result-card.is-selected {
    border-color: rgba(109, 40, 217, 0.45);
    box-shadow: 0 6px 18px rgba(109, 40, 217, 0.1);
    transform: translateY(-1px);
    outline: none;
}

.pharmacy-pos-result-card__name {
    margin: 0;
    font-size: 0.9375rem;
    font-weight: 800;
    color: #0f172a;
}

.pharmacy-pos-result-card__meta {
    margin: 0.2rem 0 0;
    font-size: 0.78rem;
    color: #64748b;
}

.pharmacy-pos-result-card__price {
    text-align: right;
    font-size: 0.875rem;
}

.pharmacy-pos-result-card__price strong {
    display: block;
    font-size: 1rem;
    color: var(--module-accent-dark, #5b21b6);
}

.pharmacy-pos-stock {
    display: inline-flex;
    align-items: center;
    padding: 0.12rem 0.45rem;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 700;
    background: rgba(16, 185, 129, 0.12);
    color: #047857;
}

.pharmacy-pos-stock.is-low {
    background: rgba(245, 158, 11, 0.14);
    color: #b45309;
}

.pharmacy-pos-stock.is-out {
    background: rgba(239, 68, 68, 0.12);
    color: #b91c1c;
}

.pharmacy-pos-cart-list {
    display: grid;
    gap: 0.55rem;
    min-height: 120px;
}

.pharmacy-pos-cart-empty {
    padding: 1.5rem 1rem;
    text-align: center;
    border: 1px dashed rgba(148, 163, 184, 0.35);
    border-radius: 12px;
}

.pharmacy-pos-cart-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.65rem;
    padding: 0.75rem;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.25);
    background: #f8fafc;
}

.pharmacy-pos-cart-item__name {
    margin: 0;
    font-weight: 700;
    font-size: 0.9rem;
}

.pharmacy-pos-cart-item__meta {
    margin: 0.15rem 0 0;
    font-size: 0.75rem;
    color: #64748b;
}

.pharmacy-pos-cart-item__side {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.35rem;
}

.pharmacy-pos-qty-stepper {
    display: inline-flex;
    align-items: center;
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: 999px;
    overflow: hidden;
    background: #fff;
}

.pharmacy-pos-qty-stepper button {
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 1rem;
    color: #475569;
}

.pharmacy-pos-qty-stepper input {
    width: 52px;
    border: none;
    text-align: center;
    font-weight: 700;
    font-size: 0.8125rem;
    padding: 0.2rem;
}

.pharmacy-pos-cart-item__line-total {
    font-weight: 800;
    color: #0f172a;
}

.pharmacy-pos-cart-remove {
    border: none;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
    font-size: 1.1rem;
    line-height: 1;
}

.pharmacy-pos-checkout {
    position: sticky;
    top: 1rem;
    display: grid;
    gap: 0.75rem;
}

.pharmacy-pos-checkout__field {
    display: grid;
    gap: 0.35rem;
    border: none;
    margin: 0;
    padding: 0;
}

.pharmacy-pos-checkout__legend {
    font-size: 0.78rem;
    font-weight: 700;
    color: #475569;
    margin-bottom: 0.15rem;
}

.pharmacy-pos-discount-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.5rem;
}

.pharmacy-pos-pay-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.pharmacy-pos-pay-pill {
    position: relative;
    cursor: pointer;
}

.pharmacy-pos-pay-pill input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.pharmacy-pos-pay-pill span {
    display: inline-flex;
    align-items: center;
    padding: 0.38rem 0.72rem;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: #fff;
    font-size: 0.78rem;
    font-weight: 700;
    color: #475569;
    transition: all 0.14s ease;
}

.pharmacy-pos-pay-pill.is-active span,
.pharmacy-pos-pay-pill input:checked + span {
    color: #fff;
    border-color: transparent;
    background: linear-gradient(135deg, var(--module-accent, #6d28d9), #7c3aed);
    box-shadow: 0 4px 12px rgba(109, 40, 217, 0.25);
}

.pharmacy-pos-online-pay {
    display: grid;
    gap: 0.65rem;
    padding: 0.75rem;
    border-radius: 12px;
    background: rgba(109, 40, 217, 0.05);
    border: 1px solid rgba(109, 40, 217, 0.14);
}

.pharmacy-pos-totals {
    padding: 0.85rem;
    border-radius: 12px;
    background: linear-gradient(180deg, #faf5ff 0%, #f5f3ff 100%);
    border: 1px solid rgba(109, 40, 217, 0.12);
}

.pharmacy-pos-totals__row {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.18rem 0;
    font-size: 0.875rem;
    color: #475569;
}

.pharmacy-pos-totals__row--grand {
    margin-top: 0.35rem;
    padding-top: 0.55rem;
    border-top: 1px dashed rgba(109, 40, 217, 0.2);
    font-size: 1rem;
}

.pharmacy-pos-totals__row--grand strong {
    font-size: 1.35rem;
    color: var(--module-accent-dark, #5b21b6);
}

.input--lg {
    font-size: 1.05rem;
    font-weight: 700;
}

.pharmacy-pos-change {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.55rem 0.75rem;
    border-radius: 10px;
    background: rgba(16, 185, 129, 0.1);
    color: #047857;
    font-size: 0.875rem;
}

.pharmacy-pos-change strong {
    font-size: 1.05rem;
}

.pharmacy-pos-complete-btn {
    width: 100%;
    min-height: 46px;
    font-size: 0.95rem;
}

.pharmacy-pos-complete-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.pharmacy-pos-error {
    margin: 0;
    color: var(--danger, #b42318);
}

.pharmacy-pos-cart-item--low {
    border-color: rgba(234, 179, 8, 0.45);
    background: rgba(254, 243, 199, 0.35);
}

.pharmacy-stock-alert-banner {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-top: 0.75rem;
    padding: 0.85rem 1rem;
    border-radius: var(--radius-md, 10px);
    border: 1px solid transparent;
}

.pharmacy-stock-alert-banner--warn {
    background: #fffbeb;
    border-color: #fde68a;
    color: #92400e;
}

.pharmacy-stock-alert-banner--critical {
    background: #fef2f2;
    border-color: #fecaca;
    color: #991b1b;
}

.pharmacy-stock-alert-banner__icon {
    flex: 0 0 auto;
    margin-top: 0.1rem;
}

.pharmacy-stock-alert-banner__copy {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 0;
}

.pharmacy-stock-alert-banner__copy strong {
    font-size: 0.95rem;
}

.module-subnav__badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.15rem;
    height: 1.15rem;
    margin-left: 0.35rem;
    padding: 0 0.3rem;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 700;
    line-height: 1;
    background: #f59e0b;
    color: #fff;
    vertical-align: middle;
}

.module-subnav__badge--danger {
    background: #dc2626;
}

.pharmacy-pos-success {
    margin: 0;
    padding: 0.55rem 0.75rem;
    border-radius: 10px;
    background: rgba(16, 185, 129, 0.12);
    color: #047857;
    font-size: 0.8125rem;
    font-weight: 600;
}

@media (max-width: 960px) {
    .pharmacy-pos-shell {
        grid-template-columns: 1fr;
    }

    .pharmacy-pos-checkout {
        position: static;
        order: -1;
    }

    .pharmacy-pos-kbd-hints {
        display: none;
    }
}

@media (max-width: 640px) {
    .pharmacy-pos-result-card {
        grid-template-columns: 1fr;
    }

    .pharmacy-pos-result-card__price {
        text-align: left;
    }

    .pharmacy-pos-cart-item {
        grid-template-columns: 1fr;
    }

    .pharmacy-pos-cart-item__side {
        align-items: flex-start;
        flex-direction: row;
        justify-content: space-between;
        width: 100%;
    }
}
