/* ═══════════════════════════════════════════════════════════════════════════════
   POS Terminal — CSS Foundation
   EN: Styles for POS front-of-house pages (Quick Sale, Payment, Reports)
   VI: Styles cho trang POS tuyến trước (Bán nhanh, Thanh toán, Báo cáo)
   Based on: pencil-design/src/pages/tPOS/pos/ tokens
   ═══════════════════════════════════════════════════════════════════════════════ */

/* ═════════════════════════════════════════════════════════════════════════
   1. POS DESIGN TOKENS
   ═════════════════════════════════════════════════════════════════════════ */
:root {
    /* EN: POS background colors / VI: Màu nền POS */
    --pos-bg-page: #0A0A0B;
    --pos-bg-elevated: #1A1A1D;
    --pos-bg-interactive: #2A2A2E;

    /* EN: POS text colors / VI: Màu chữ POS */
    --pos-text-primary: #FFFFFF;
    --pos-text-secondary: #ADADB0;
    --pos-text-tertiary: #8B8B90;

    /* EN: POS border colors / VI: Màu viền POS */
    --pos-border-default: #2A2A2E;
    --pos-border-subtle: #1F1F23;

    /* EN: POS brand & status colors / VI: Màu thương hiệu & trạng thái POS */
    --pos-orange-primary: #FF5C00;
    --pos-success: #22C55E;
    --pos-warning: #F59E0B;
    --pos-danger: #EF4444;
    --pos-info: #3B82F6;

    /* EN: POS spacing / VI: Khoảng cách POS */
    --pos-status-bar-height: 48px;
    --pos-footer-height: 64px;
    --pos-product-grid-gap: 12px;
    --pos-radius: 12px;

    /* EN: POS font / VI: Font POS */
    --pos-font: 'Roboto', 'Inter', sans-serif;
}

/* ═════════════════════════════════════════════════════════════════════════
   2. POS LAYOUT — Full-screen terminal
   ═════════════════════════════════════════════════════════════════════════ */

.pos-layout {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100vh;
    background-color: var(--pos-bg-page);
    font-family: var(--pos-font);
    color: var(--pos-text-primary);
    overflow: hidden;
}

/* EN: POS status bar / VI: Thanh trạng thái POS */
.pos-status-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--pos-status-bar-height);
    padding: 0 16px;
    background-color: var(--pos-bg-elevated);
    border-bottom: 1px solid var(--pos-border-subtle);
    flex-shrink: 0;
}

.pos-status-bar__left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.pos-status-bar__right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pos-status-bar__logo {
    font-size: 15px;
    font-weight: 700;
    color: var(--pos-orange-primary);
}

.pos-status-bar__store {
    font-size: 13px;
    color: var(--pos-text-secondary);
}

.pos-status-bar__indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
}

.pos-status-bar__indicator--online {
    background-color: rgba(34, 197, 94, 0.125);
    color: var(--pos-success);
}

.pos-status-bar__indicator--offline {
    background-color: rgba(239, 68, 68, 0.125);
    color: var(--pos-danger);
}

/* EN: POS main content area / VI: Vùng nội dung chính POS */
.pos-main {
    flex: 1;
    display: flex;
    overflow: hidden;
}

/* EN: POS product panel (left) / VI: Panel sản phẩm (trái) */
.pos-product-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* EN: POS cart panel (right) / VI: Panel giỏ hàng (phải) */
.pos-cart-panel {
    width: 380px;
    min-width: 380px;
    display: flex;
    flex-direction: column;
    background-color: var(--pos-bg-elevated);
    border-left: 1px solid var(--pos-border-subtle);
}

/* EN: Category tabs / VI: Tab danh mục */
.pos-category-tabs {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    overflow-x: auto;
    flex-shrink: 0;
}

.pos-category-tab {
    padding: 8px 16px;
    border-radius: var(--pos-radius);
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    background-color: var(--pos-bg-interactive);
    color: var(--pos-text-secondary);
}

.pos-category-tab--active {
    background-color: var(--pos-orange-primary);
    color: #FFFFFF;
    font-weight: 600;
}

/* EN: Product grid / VI: Lưới sản phẩm */
.pos-product-grid {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: var(--pos-product-grid-gap);
    padding: 16px;
    overflow-y: auto;
    align-content: start;
}

.pos-product-card {
    background-color: var(--pos-bg-elevated);
    border-radius: var(--pos-radius);
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.pos-product-card:hover {
    border-color: var(--pos-orange-primary);
    transform: translateY(-2px);
}

.pos-product-card__image {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 8px;
    background-color: var(--pos-bg-interactive);
    overflow: hidden;
}

.pos-product-card__name {
    font-size: 13px;
    font-weight: 600;
    color: var(--pos-text-primary);
}

.pos-product-card__price {
    font-size: 14px;
    font-weight: 700;
    color: var(--pos-orange-primary);
}

/* EN: Cart items / VI: Mục giỏ hàng */
.pos-cart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid var(--pos-border-subtle);
}

.pos-cart-header__title {
    font-size: 15px;
    font-weight: 600;
}

.pos-cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.pos-cart-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border-radius: var(--pos-radius);
    transition: background-color 0.2s ease;
}

.pos-cart-item:hover {
    background-color: var(--pos-bg-interactive);
}

.pos-cart-item__info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.pos-cart-item__name {
    font-size: 13px;
    font-weight: 500;
}

.pos-cart-item__price {
    font-size: 12px;
    color: var(--pos-text-tertiary);
}

.pos-cart-item__qty {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pos-cart-item__qty button {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    border: 1px solid var(--pos-border-default);
    background: transparent;
    color: var(--pos-text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

/* EN: Cart footer / VI: Footer giỏ hàng */
.pos-cart-footer {
    padding: 16px;
    border-top: 1px solid var(--pos-border-subtle);
}

.pos-cart-total {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.pos-cart-total__label {
    font-size: 14px;
    color: var(--pos-text-secondary);
}

.pos-cart-total__value {
    font-size: 22px;
    font-weight: 700;
    color: var(--pos-orange-primary);
}

.pos-btn-checkout {
    width: 100%;
    height: 48px;
    background-color: var(--pos-orange-primary);
    color: #FFFFFF;
    border: none;
    border-radius: var(--pos-radius);
    font-size: 15px;
    font-weight: 600;
    font-family: var(--pos-font);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.pos-btn-checkout:hover {
    background-color: #E05200;
}

/* EN: POS dialog overlay / VI: Overlay dialog POS */
.pos-dialog-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 300;
}

.pos-dialog {
    background-color: var(--pos-bg-elevated);
    border-radius: 16px;
    width: 90%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.4);
}