/**
 * POS Store Page Styles - Refactored
 * صفحة المتجر للكاشير
 * 
 * Table of Contents:
 * 1. CSS Variables
 * 2. Base & Reset
 * 3. Layout Structure
 * 4. Header
 * 5. Search
 * 6. Categories
 * 7. Product Grid & Cards
 * 8. Product Modal
 * 9. Cart Modal
 * 10. Forms & Checkout
 * 11. Utilities (Toast, Loader, Empty States)
 * 12. Responsive Breakpoints
 * 13. Animations
 */

/* ========================================
   1. CSS VARIABLES
======================================== */
:root {
    /* Colors */
    --pos-primary: #2563eb;
    --pos-primary-hover: #1d4ed8;
    --pos-primary-rgb: 37, 99, 235;
    --pos-price-accent: var(--pos-primary);
    --pos-action-accent: var(--pos-primary);
    --pos-success: #2563eb;
    --pos-success-hover: #1d4ed8;
    --pos-danger: #ef4444;
    --pos-danger-hover: #dc2626;

    /* Text Colors */
    --pos-text: #1e293b;
    --pos-text-secondary: #475569;
    --pos-text-muted: #64748b;
    --pos-text-light: #94a3b8;

    /* Backgrounds */
    --pos-bg: #f3f4f6;
    --pos-bg-secondary: #f8fafc;
    --pos-bg-tertiary: #f1f5f9;
    --pos-card-bg: #fff;

    /* Borders */
    --pos-border: #e2e8f0;
    --pos-border-light: #f1f5f9;

    /* Shadows */
    --pos-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --pos-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    --pos-shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.06);
    --pos-shadow-xl: 0 10px 40px rgba(0, 0, 0, 0.2);

    /* Radii */
    --pos-radius-sm: 6px;
    --pos-radius: 8px;
    --pos-radius-md: 10px;
    --pos-radius-lg: 12px;
    --pos-radius-xl: 16px;
    --pos-radius-full: 99px;

    /* Sizing */
    --pos-header-height: 52px;
    --pos-categories-height: 50px;
    --pos-safe-area-top: env(safe-area-inset-top, 0px);
    --pos-spacing-top: calc(var(--pos-header-height) + var(--pos-categories-height) + 20px + var(--pos-safe-area-top));

    /* Typography */
    --pos-font: 'Noto Sans Arabic', sans-serif;

    /* Transitions */
    --pos-transition: 0.2s ease;
    --pos-transition-slow: 0.3s ease;
}

:root[data-pos-theme="dark"],
html.pos-theme-dark,
body.pos-theme-dark {
    --pos-text: var(--pos-theme-text, #e2e8f0);
    --pos-text-secondary: #cbd5e1;
    --pos-text-muted: var(--pos-theme-text-muted, #94a3b8);
    --pos-text-light: #64748b;
    --pos-price-accent: var(--pos-theme-text, #f5f5f5);
    --pos-action-accent: color-mix(in srgb, var(--pos-theme-text, #f5f5f5) 88%, transparent);
    --pos-bg: var(--pos-theme-surface-2, #111827);
    --pos-bg-secondary: var(--pos-theme-surface-3, #1e293b);
    --pos-bg-tertiary: color-mix(in srgb, var(--pos-theme-surface-3, #1e293b) 82%, white 18%);
    --pos-card-bg: var(--pos-theme-surface, #0f172a);
    --pos-border: var(--pos-theme-border, #334155);
    --pos-border-light: color-mix(in srgb, var(--pos-theme-border, #334155) 65%, transparent);
    --pos-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
    --pos-shadow: 0 2px 8px rgba(0, 0, 0, 0.32);
    --pos-shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.28);
    --pos-shadow-xl: 0 10px 40px rgba(0, 0, 0, 0.45);
}

html.pos-theme-dark .pos-shop-category-btn.active,
body.pos-theme-dark .pos-shop-category-btn.active {
    background: linear-gradient(180deg, var(--pos-theme-surface-3, #151518) 0%, var(--pos-theme-surface-2, #0b0b0c) 100%);
    color: var(--pos-theme-text, #f5f5f5);
    border-color: var(--pos-theme-border-strong, #3f3f46);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

html.pos-theme-dark .pos-shop-category-btn.active .count,
body.pos-theme-dark .pos-shop-category-btn.active .count {
    color: var(--pos-theme-text-muted, #a1a1aa);
}

html.pos-theme-dark .pos-shop-add-btn:hover:not(:disabled),
body.pos-theme-dark .pos-shop-add-btn:hover:not(:disabled),
html.pos-theme-dark .pos-shop-btn:hover,
body.pos-theme-dark .pos-shop-btn:hover {
    background: linear-gradient(180deg, var(--pos-theme-surface-3, #151518) 0%, var(--pos-theme-surface-2, #0b0b0c) 100%);
    color: var(--pos-theme-text, #f5f5f5);
    border-color: var(--pos-theme-border-strong, #3f3f46);
}

/* ========================================
   2. BASE & RESET
======================================== */
* {
    -webkit-tap-highlight-color: transparent;
    box-sizing: border-box;
    -webkit-touch-callout: none;
}

html,
body {
    margin: 0;
    padding: 0;
    height: 100%;
    -webkit-user-select: none;
    user-select: none;
    scroll-behavior: smooth;
}

input,
textarea {
    -webkit-user-select: text;
    user-select: text;
}

body {
    background-color: var(--pos-bg);
    font-family: var(--pos-font);
    color: var(--pos-text);
}

a {
    text-decoration: none;
    color: inherit;
}

/* ========================================
   3. LAYOUT STRUCTURE
======================================== */
.pos-shop-wrap {
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}

.pos-shop-main {
    padding: 12px;
    padding-top: var(--pos-spacing-top);
    flex: 1;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y pinch-zoom;
    overscroll-behavior: contain;
}

/* ========================================
   4. HEADER
======================================== */
.pos-shop-header {
    background: var(--pos-card-bg);
    padding: 0 24px;
    padding-top: var(--pos-safe-area-top);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: calc(var(--pos-header-height) + var(--pos-safe-area-top));
    z-index: 50;
    box-shadow: var(--pos-shadow-sm);
    overflow: hidden;
}

.pos-shop-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.pos-shop-logo .dashicons {
    font-size: 26px;
    width: 26px;
    height: 26px;
    color: var(--pos-primary);
}

.pos-shop-logo h1 {
    font-family: 'Tajawal', var(--pos-font);
    font-size: 18px;
    margin: 0;
    font-weight: 700;
    line-height: 1.2;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pos-shop-logo-img {
    width: 36px;
    height: 36px;
    object-fit: contain;
    border-radius: var(--pos-radius-sm);
}

.pos-shop-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pos-shop-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--pos-radius);
    background: var(--pos-bg-tertiary);
    color: var(--pos-text-muted);
    border: none;
    position: relative;
    cursor: pointer;
    transition: all var(--pos-transition);
}

.pos-shop-btn:hover {
    background: var(--pos-bg-secondary);
    color: var(--pos-primary);
    border-color: var(--pos-primary);
}

.pos-shop-cart-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--pos-danger);
    color: white;
    font-size: 11px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: var(--pos-radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--pos-card-bg);
}

/* ========================================
   5. SEARCH
======================================== */
.pos-shop-search-wrap {
    flex: 1;
    max-width: 600px;
    position: relative;
    background: var(--pos-bg-tertiary);
    border-radius: var(--pos-radius-full);
    height: 32px;
    padding: 0 12px;
    margin: 8px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.pos-shop-search-wrap .dashicons {
    color: var(--pos-text-light);
}

.pos-shop-search-wrap form {
    flex: 1;
    display: flex;
}

.pos-shop-search-wrap input {
    border: none;
    background: transparent;
    width: 100%;
    outline: none;
    font-family: inherit;
    font-size: 13px;
    height: 100%;
    line-height: 1.2;
}

/* Mobile Header Search */
.pos-shop-mobile-search {
    display: none;
    align-items: center;
    gap: 8px;
    margin: 0;
    flex: 1 1 auto;
    min-width: 0;
    opacity: 0;
    pointer-events: none;
    overflow: hidden;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.pos-shop-mobile-search-inner {
    flex: 1;
    min-width: 0;
    height: 32px;
    background: var(--pos-bg-tertiary);
    border-radius: var(--pos-radius-full);
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 12px;
}

.pos-shop-mobile-search-inner .dashicons {
    color: var(--pos-text-light);
    font-size: 16px;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.pos-shop-mobile-search-inner input {
    border: none;
    background: transparent;
    width: 100%;
    min-width: 0;
    outline: none;
    font-family: inherit;
    font-size: 13px;
    line-height: 1.2;
    color: var(--pos-text);
}

.pos-shop-mobile-search-inner input::placeholder {
    color: var(--pos-text-light);
}

.pos-mobile-search-submit {
    border: none;
    height: 32px;
    border-radius: var(--pos-radius-full);
    padding: 0 12px;
    background: var(--pos-primary);
    color: white;
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    flex-shrink: 0;
}

.pos-mobile-search-submit:active {
    background: var(--pos-primary-hover);
}

/* ========================================
   6. CATEGORIES
======================================== */
.pos-shop-categories {
    margin: 0;
    overflow-x: auto;
    padding-bottom: 10px;
    padding-top: 10px;
    -ms-overflow-style: none;
    scrollbar-width: none;
    cursor: grab;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x pan-y;
    overscroll-behavior-x: contain;
    position: fixed;
    top: calc(var(--pos-header-height) + var(--pos-safe-area-top) - 1px);
    left: 0;
    right: 0;
    width: auto;
    z-index: 40;
    background: var(--pos-bg);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.pos-shop-categories.active {
    cursor: grabbing;
}

.pos-shop-categories::-webkit-scrollbar {
    display: none;
}

.pos-shop-categories-inner {
    display: inline-flex;
    min-width: 100%;
    box-sizing: border-box;
    gap: 12px;
    padding-left: 12px;
    padding-right: 12px;
}

.pos-shop-category-btn {
    white-space: nowrap;
    padding: 4px 16px;
    background: var(--pos-card-bg);
    border: 1px solid transparent;
    border-radius: var(--pos-radius-full);
    font-size: 14px;
    font-weight: 600;
    color: var(--pos-text-secondary);
    transition: all var(--pos-transition);
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.pos-shop-category-btn:hover {
    border-color: var(--pos-primary);
    color: var(--pos-primary);
}

.pos-shop-category-btn.active {
    background: var(--pos-primary);
    color: white;
    border-color: var(--pos-primary);
    box-shadow: 0 4px 6px rgba(var(--pos-primary-rgb), 0.2);
}

.pos-shop-category-btn.loading {
    opacity: 0.78;
}

.pos-shop-category-btn.loading::after {
    content: none;
}

.pos-shop-category-btn.active .count {
    color: rgba(255, 255, 255, 0.7);
}

.pos-shop-category-btn .count {
    font-size: 12px;
    color: var(--pos-text-light);
}

/* ========================================
   7. PRODUCT GRID & CARDS
======================================== */
.pos-shop-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
    padding-bottom: 20px;
    align-content: start;
    min-height: 300px;
    position: relative;
    opacity: 1;
    transform-origin: top center;
}

/* ── Scale-OUT: shrink old cards smoothly ── */
.pos-shop-products-grid.pos-grid-scale-out {
    animation: pos-grid-scale-out 0.18s cubic-bezier(0.4, 0, 1, 1) forwards;
    pointer-events: none;
}

/* ── Scale-IN: pop new cards in ── */
.pos-shop-products-grid.pos-grid-scale-in {
    animation: pos-grid-scale-in 0.24s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes pos-grid-scale-out {
    0% {
        opacity: 1;
        transform: scale(1);
    }

    100% {
        opacity: 0;
        transform: scale(0.94);
    }
}

@keyframes pos-grid-scale-in {
    0% {
        opacity: 0;
        transform: scale(0.96);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Product Card */
.pos-shop-product-card {
    background: var(--pos-card-bg);
    border-radius: var(--pos-radius-lg);
    overflow: hidden;
    box-shadow: var(--pos-shadow);
    transition: all var(--pos-transition-slow);
    display: flex;
    flex-direction: column;
    height: 100%;
    border: 1px solid var(--pos-border-light);
}

.pos-shop-product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
    border-color: var(--pos-border);
}

/* Product Image */
.pos-product-image-wrapper {
    position: relative;
    width: 100%;
    padding-top: 100%;
    overflow: hidden;
    cursor: pointer;
    background: var(--pos-bg-secondary);
}

.pos-product-image-wrapper img,
.pos-shop-product-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--pos-transition-slow);
}

.pos-product-image-wrapper:hover img {
    transform: scale(1.05);
}

.pos-product-no-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--pos-border);
    color: var(--pos-text-light);
}

.pos-product-no-image .dashicons {
    font-size: 48px;
    width: 48px;
    height: 48px;
}

/* Badges */
.pos-product-sale-badge,
.pos-shop-sale-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: var(--pos-danger);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    z-index: 2;
}

.pos-shop-out-of-stock {
    position: absolute;
    top: 8px;
    left: 8px;
    background: #475569;
    color: white;
    padding: 3px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    z-index: 2;
}

/* Product Info */
.pos-product-info-section,
.pos-shop-product-info {
    padding: 12px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.pos-product-name,
.pos-shop-product-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--pos-text);
    margin: 0 0 10px 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: 40px;
}

/* Product Action Row */
.pos-product-action-row {
    display: flex;
    align-items: center;
    gap: 0;
    margin-top: auto;
    border-top: 1px solid var(--pos-border);
    margin-left: -12px;
    margin-right: -12px;
    margin-bottom: -12px;
    height: 50px;
}

.pos-product-price-section {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    background: var(--pos-bg-secondary);
    height: 100%;
}

.pos-product-price,
.pos-shop-product-price {
    font-size: 16px;
    font-weight: 700;
    color: var(--pos-price-accent);
}

.pos-product-price del,
.pos-shop-product-price del {
    font-size: 13px;
    color: var(--pos-text-light);
    margin-left: 6px;
    font-weight: 400;
}

.pos-product-price ins {
    text-decoration: none;
}

.pos-product-add-section {
    flex: 0 0 60px;
    display: flex;
    height: 100%;
    border-right: 1px solid var(--pos-border);
}

/* Add Button */
.pos-shop-add-btn {
    width: 100%;
    height: 100%;
    border: none;
    background: var(--pos-bg-secondary);
    color: var(--pos-action-accent);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.25s ease, color 0.25s ease, transform 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.pos-shop-add-btn:hover:not(:disabled) {
    background: var(--pos-primary);
    color: var(--pos-card-bg);
}

.pos-shop-add-btn:active:not(:disabled) {
    background: var(--pos-primary-hover);
    color: var(--pos-card-bg);
    transform: scale(0.9);
}

.pos-shop-add-btn:disabled {
    background: var(--pos-bg-secondary);
    color: var(--pos-text-light);
    cursor: not-allowed;
}

.pos-shop-add-btn .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ===== Adding State — icon-only bounce ===== */
.pos-shop-add-btn.pos-adding {
    background: var(--pos-primary);
    color: white;
    pointer-events: none;
}

.pos-shop-add-btn.pos-adding .dashicons {
    animation: pos-icon-pop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes pos-icon-pop {
    0% {
        transform: scale(1);
    }

    40% {
        transform: scale(1.4);
    }

    70% {
        transform: scale(0.9);
    }

    100% {
        transform: scale(1);
    }
}

/* ===== Card highlight flash on add ===== */
.pos-shop-product-card.pos-card-added {
    animation: pos-card-flash 0.6s ease;
}

@keyframes pos-card-flash {
    0% {
        box-shadow: 0 0 0 0 rgba(var(--pos-primary-rgb), 0.4);
    }

    40% {
        box-shadow: 0 0 0 6px rgba(var(--pos-primary-rgb), 0.15);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(var(--pos-primary-rgb), 0);
    }
}

/* ===== Cart badge bounce ===== */
.pos-badge-bounce {
    animation: pos-bounce 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes pos-bounce {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.35);
    }

    100% {
        transform: scale(1);
    }
}

.pos-cart-receiving {
    animation: pos-cart-target-pop 0.52s cubic-bezier(0.2, 0.9, 0.2, 1);
}

@keyframes pos-cart-target-pop {
    0% {
        transform: scale(1);
    }

    55% {
        transform: scale(1.08);
    }

    100% {
        transform: scale(1);
    }
}

.pos-cart-flyer {
    position: fixed;
    z-index: 10040;
    pointer-events: none;
    object-fit: cover;
    border-radius: 22px;
    box-shadow: 0 18px 48px rgba(15, 23, 42, 0.2);
    will-change: transform, opacity;
}

/* ─────────────────────────────────────────
   PRODUCT MODAL — Shared overlay
───────────────────────────────────────── */
.pos-product-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
}

.pos-product-modal.active {
    display: block;
}

.pos-product-modal-overlay {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    cursor: pointer;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.pos-product-modal.active .pos-product-modal-overlay {
    opacity: 1;
}

/* ─────────────────────────────────────────
   MOBILE + TABLET: Bottom Sheet (default)
   Slides up from the bottom
───────────────────────────────────────── */
.pos-product-modal-content {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-height: 92vh;
    background: var(--pos-card-bg);
    border-radius: 24px 24px 0 0;
    z-index: 10001;
    overflow: hidden;
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
    display: flex;
    flex-direction: column;
}

.pos-product-modal-content.slide-up {
    transform: translateY(0);
}

/* ─────────────────────────────────────────
   DESKTOP: Right-side Drawer (≥1024px)
   Slides in from the right like the cart
───────────────────────────────────────── */
@media (min-width: 1024px) {
    .pos-product-modal-content {
        top: 0;
        bottom: 0;
        left: auto;
        right: 0;
        width: min(440px, 100vw);
        max-height: 100vh;
        height: 100vh;
        border-radius: 0;
        border-right: none;
        border-left: 1px solid var(--pos-border);
        transform: translateX(100%);
        transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
        box-shadow: -4px 0 32px rgba(0, 0, 0, 0.15);
    }

    .pos-product-modal-content.slide-up {
        transform: translateX(0);
    }
}

.pos-product-modal-close {
    position: absolute;
    top: 12px;
    left: 12px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--pos-card-bg) 90%, transparent);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all var(--pos-transition);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.pos-product-modal-close:hover {
    background: var(--pos-card-bg);
    transform: scale(1.1);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.pos-product-modal-close:active {
    transform: scale(0.95);
}

.pos-product-modal-close .dashicons {
    font-size: 22px;
    width: 22px;
    height: 22px;
    color: var(--pos-text-secondary);
}

/* Modal Body Layout — unified vertical for drawer & bottom-sheet */
.pos-product-modal-body {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    min-height: 0;
    overflow: hidden;
}

.pos-product-modal-image {
    flex: 0 0 auto;
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    border-radius: 0;
    overflow: hidden;
    background: linear-gradient(180deg, var(--pos-card-bg) 0%, var(--pos-bg-secondary) 100%);
    position: relative;
    border-bottom: 1px solid var(--pos-border);
}

@media (min-width: 1024px) {
    .pos-product-modal-image {
        flex: 0 0 auto;
        aspect-ratio: 1 / 1;
    }
}

.pos-product-modal-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    display: block;
    padding: 18px;
    box-sizing: border-box;
}

.pos-product-modal-info {
    flex: 1;
    width: 100%;
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding: 0;
    overflow: hidden;
    box-sizing: border-box;
    -webkit-overflow-scrolling: touch;
}

.pos-product-modal-scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 0;
    box-sizing: border-box;
    overscroll-behavior: contain;
}

.pos-product-modal-details {
    padding: 20px 20px 16px;
    box-sizing: border-box;
}

.pos-product-modal-footer {
    flex-shrink: 0;
    padding: 12px 16px 14px;
    border-top: 1px solid var(--pos-border);
    background: linear-gradient(180deg, color-mix(in srgb, var(--pos-card-bg) 94%, transparent) 0%, var(--pos-card-bg) 24px);
    box-shadow: 0 -8px 24px rgba(15, 23, 42, 0.05);
}

.pos-product-modal-info h2 {
    font-size: 20px;
    margin: 0 0 8px 0;
    color: var(--pos-text);
    font-weight: 700;
}

.pos-product-modal-price {
    font-size: 18px;
    color: var(--pos-primary);
    font-weight: 700;
    margin-bottom: 12px;
}

.pos-product-modal-description {
    font-size: 14px;
    color: var(--pos-text-muted);
    line-height: 1.6;
    margin-bottom: 16px;
}

/* Social Sharing */
.pos-product-modal-share {
    margin: 16px 0;
}

.pos-product-modal-share label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--pos-text-secondary);
    margin-bottom: 12px;
}

.pos-social-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.pos-social-btn {
    width: 48px;
    height: 48px;
    border-radius: var(--pos-radius-lg);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--pos-transition);
    color: white;
}

.pos-social-btn .dashicons {
    font-size: 24px;
    width: 24px;
    height: 24px;
}

.pos-share-whatsapp {
    background: #25D366;
}

.pos-share-whatsapp:hover {
    background: #1da851;
    transform: translateY(-2px);
}

.pos-share-facebook {
    background: #1877F2;
}

.pos-share-facebook:hover {
    background: #0c63d4;
    transform: translateY(-2px);
}

.pos-share-twitter {
    background: #1DA1F2;
}

.pos-share-twitter:hover {
    background: #0c85d0;
    transform: translateY(-2px);
}

.pos-share-telegram {
    background: #0088cc;
}

.pos-share-telegram:hover {
    background: #006ba6;
    transform: translateY(-2px);
}

/* Quantity & Actions */
.pos-product-modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 0;
    padding-bottom: 0;
    align-items: stretch;
}

.pos-quantity-selector {
    display: flex;
    align-items: center;
    gap: 0;
    border: 1px solid var(--pos-border);
    border-radius: var(--pos-radius-md);
    overflow: hidden;
    background: var(--pos-card-bg);
}

.pos-qty-btn {
    width: 42px;
    height: 42px;
    border: none;
    background: var(--pos-bg-secondary);
    color: var(--pos-text-secondary);
    font-size: 20px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--pos-transition);
}

.pos-qty-btn:hover {
    background: var(--pos-border);
    color: var(--pos-primary);
}

.pos-qty-btn:active {
    transform: scale(0.95);
}

.pos-qty-input {
    width: 56px;
    height: 42px;
    border: none;
    border-left: 1px solid var(--pos-border);
    border-right: 1px solid var(--pos-border);
    text-align: center;
    font-size: 16px;
    font-weight: 600;
    font-family: inherit;
    color: var(--pos-text);
}

.pos-modal-add-cart {
    flex: 1;
    height: 42px;
    border-radius: var(--pos-radius-md);
    border: none;
    background: var(--pos-success);
    color: white;
    font-size: 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: all var(--pos-transition);
    font-family: inherit;
}

.pos-modal-add-cart:hover {
    background: var(--pos-success-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.pos-modal-add-cart:active {
    transform: translateY(0);
}

.pos-modal-add-cart .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
}

@media (min-width: 1024px) {
    .pos-product-modal-close {
        top: 16px;
        left: 16px;
    }

    .pos-product-modal-scroll {
        padding-top: 0;
    }

    .pos-product-modal-details {
        padding: 18px 18px 12px;
    }

    .pos-product-modal-info h2 {
        font-size: 22px;
        line-height: 1.35;
    }

    .pos-product-modal-description {
        font-size: 15px;
    }

    .pos-product-modal-actions {
        position: static;
        gap: 8px;
    }

    .pos-quantity-selector {
        flex: 0 0 126px;
    }
}

/* ========================================
   9. CART MODAL
======================================== */
.pos-cart-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9998;
    display: none;
}

.pos-cart-modal.active {
    display: block;
}

.pos-cart-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 0;
    background: rgba(0, 0, 0, 0);
    backdrop-filter: blur(0px);
    transition: background 0.5s ease-out, backdrop-filter 0.5s ease-out;
}

.pos-cart-modal.active .pos-cart-modal-overlay {
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.pos-cart-modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1;
    background: var(--pos-card-bg);
    border-radius: var(--pos-radius-xl);
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--pos-shadow-xl);
    transition: transform var(--pos-transition-slow);
}

.pos-cart-modal-header {
    padding: 20px;
    border-bottom: 1px solid var(--pos-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.pos-cart-modal-header h2 {
    font-size: 20px;
    margin: 0;
    color: var(--pos-text);
}

.pos-cart-modal-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--pos-bg-tertiary);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--pos-transition);
}

.pos-cart-modal-close:hover {
    background: var(--pos-border);
    transform: scale(1.1);
}

.pos-cart-modal-close .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
    color: var(--pos-text-muted);
}

.pos-cart-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.pos-cart-checkout-section {
    display: none;
    padding: 20px;
    overflow-y: auto;
}

.pos-cart-checkout-section.active {
    display: block;
}

.pos-cart-loading,
.pos-cart-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--pos-text-light);
}

.pos-cart-loading .dashicons,
.pos-cart-empty .dashicons {
    font-size: 48px;
    width: 48px;
    height: 48px;
    margin-bottom: 12px;
    animation: spin 1s linear infinite;
}

.pos-cart-items-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* ===== Cart Item - نفس تصميم الكاشير ===== */
.pos-cart-preview-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    margin-bottom: 0;
    background: var(--pos-card-bg);
    border: 1px solid var(--pos-border);
    border-radius: 12px;
    transition: all 0.2s ease;
    animation: slideIn 0.2s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.pos-cart-preview-item:hover {
    border-color: var(--pos-primary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.pos-cart-preview-item img {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    object-fit: cover;
    background: var(--pos-bg-secondary);
    order: 1;
    flex-shrink: 0;
}

.pos-cart-item-details {
    flex: 1;
    min-width: 0;
    order: 2;
    text-align: right;
}

.pos-cart-item-details h4 {
    font-size: 15px;
    font-weight: 700;
    margin: 0 0 6px 0;
    color: var(--pos-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* صف الكمية والسعر */
.pos-cart-item-row {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
}

.pos-cart-item-price {
    font-size: 14px;
    color: var(--pos-primary);
    font-weight: 700;
}

/* أزرار الكمية */
.pos-cart-item-qty {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pos-cart-qty-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s, box-shadow 0.2s;
    font-weight: 700;
    font-size: 18px;
    color: white;
    background: var(--pos-primary);
    box-shadow: 0 2px 6px rgba(var(--pos-primary-rgb), 0.3);
}

.pos-cart-qty-btn:hover {
    background: var(--pos-primary-hover);
    transform: scale(1.1);
}

.pos-cart-qty-btn:active {
    transform: scale(0.9);
}

/* مربع إدخال الكمية - دائري */
.pos-cart-qty-input {
    width: 32px;
    height: 32px;
    text-align: center;
    font-weight: 700;
    font-size: 14px;
    border: 2px solid var(--pos-border);
    border-radius: 50%;
    background: var(--pos-card-bg);
    color: var(--pos-text);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    appearance: textfield;
    -moz-appearance: textfield;
    padding: 0;
}

.pos-cart-qty-input::-webkit-outer-spin-button,
.pos-cart-qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.pos-cart-qty-input:focus {
    border-color: var(--pos-primary);
    box-shadow: 0 0 0 3px rgba(var(--pos-primary-rgb), 0.1);
}

/* زر الحذف */
.pos-cart-remove-btn {
    order: 3;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--pos-bg-secondary);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    color: var(--pos-text-light);
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.pos-cart-remove-btn:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--pos-danger);
    transform: scale(1.1);
}

.pos-cart-remove-btn .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.pos-cart-modal-footer {
    padding: 12px 16px;
    border-top: 1px solid var(--pos-border);
    background: var(--pos-bg-primary);
    flex-shrink: 0;
}

.pos-cart-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 16px;
    margin-bottom: 12px;
    color: var(--pos-text);
    background: var(--pos-bg-secondary);
    padding: 10px 14px;
    border-radius: var(--pos-radius);
    border: 1px solid var(--pos-border);
}

.pos-cart-total-row strong {
    color: var(--pos-primary);
    font-size: 18px;
    font-weight: 800;
}

.pos-cart-checkout-btn {
    width: 100%;
    padding: 14px;
    border-radius: var(--pos-radius-md);
    border: none;
    background: var(--pos-success);
    color: white;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: all var(--pos-transition);
    font-family: inherit;
}

.pos-cart-checkout-btn:hover {
    background: var(--pos-success-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(var(--pos-primary-rgb), 0.3);
}

.pos-cart-checkout-btn .dashicons {
    width: 20px;
    height: 20px;
}

/* ========================================
   10. FORMS & CHECKOUT
======================================== */
.pos-form-group {
    margin-bottom: 16px;
}

.pos-form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--pos-text-secondary);
    margin-bottom: 6px;
}

.pos-form-group .required {
    color: var(--pos-danger);
}

.pos-form-group .optional {
    font-size: 12px;
    color: var(--pos-text-light);
    font-weight: 400;
}

.pos-form-group input[type="text"],
.pos-form-group input[type="tel"],
.pos-form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--pos-border);
    border-radius: var(--pos-radius);
    font-size: 14px;
    font-family: inherit;
    color: var(--pos-text);
    background: var(--pos-card-bg);
    transition: all var(--pos-transition);
}

.pos-form-group input:focus,
.pos-form-group textarea:focus {
    outline: none;
    border-color: var(--pos-primary);
    box-shadow: 0 0 0 3px rgba(var(--pos-primary-rgb), 0.1);
}

.pos-form-group textarea {
    resize: vertical;
    min-height: 60px;
}

/* Expandable input - same size as other inputs, expands when content is longer */
.pos-expandable-input {
    width: 100%;
    min-height: 44px;
    height: auto;
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.pos-payment-method {
    margin: 20px 0;
    padding: 16px;
    background: var(--pos-bg-secondary);
    border-radius: var(--pos-radius);
    border: 1px solid var(--pos-border);
}

.pos-payment-method label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--pos-text-secondary);
    margin-bottom: 12px;
}

.pos-payment-option {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--pos-success);
}

.pos-payment-option .dashicons {
    font-size: 24px;
    width: 24px;
    height: 24px;
}

.pos-back-to-cart-btn,
.pos-submit-order-slider {
    width: 100%;
    padding: 14px;
    border-radius: var(--pos-radius-md);
    border: none;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: all var(--pos-transition);
    font-family: inherit;
    margin-bottom: 12px;
}

.pos-back-to-cart-btn {
    background: var(--pos-bg-secondary);
    color: var(--pos-text-muted);
    border: 1px solid var(--pos-border);
}

.pos-back-to-cart-btn:hover {
    border-color: var(--pos-primary);
    color: var(--pos-primary);
}

.pos-submit-order-slider {
    background: var(--pos-success);
    color: white;
}

.pos-submit-order-slider:hover {
    background: var(--pos-success-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

/* ========================================
   11. UTILITIES
======================================== */
/* Toast */
.pos-shop-toast {
    visibility: hidden;
    min-width: 280px;
    max-width: 400px;
    background-color: var(--pos-white);
    color: var(--pos-gray-800);
    border-radius: 12px;
    padding: 12px 18px;
    position: fixed;
    z-index: 120000;
    left: 50%;
    bottom: 24px;
    transform: translate(-50%, 20px) scale(0.95);
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--pos-gray-200);
    opacity: 0;
    transition: visibility 0.4s, opacity 0.4s ease, transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    align-items: center;
    gap: 12px;
    pointer-events: none;
}

.pos-shop-toast.show {
    visibility: visible;
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
    bottom: max(24px, env(safe-area-inset-bottom));
}

.pos-shop-toast .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.pos-shop-toast .pos-toast-text {
    flex: 1;
    text-align: right;
    line-height: 1.4;
    white-space: normal;
}

/* Store Toast States */
.pos-shop-toast.success {
    border-right: 4px solid var(--pos-success);
}

.pos-shop-toast.success .dashicons {
    color: var(--pos-success);
}

.pos-shop-toast.error {
    border-right: 4px solid var(--pos-danger);
}

.pos-shop-toast.error .dashicons {
    color: var(--pos-danger);
}

.pos-shop-toast.warning {
    border-right: 4px solid var(--pos-warning);
}

.pos-shop-toast.warning .dashicons {
    color: var(--pos-warning);
}

.pos-shop-toast.info {
    border-right: 4px solid var(--pos-primary);
}

.pos-shop-toast.info .dashicons {
    color: var(--pos-primary);
}

/* Empty State */
.pos-shop-empty {
    text-align: center;
    padding: 40px;
    grid-column: 1 / -1;
    color: var(--pos-text-light);
}

.pos-shop-empty .dashicons {
    font-size: 40px;
    width: 40px;
    height: 40px;
    margin-bottom: 10px;
}

/* Loader */
.pos-grid-loader {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    background: color-mix(in srgb, var(--pos-card-bg) 92%, transparent);
    padding: 24px;
    border-radius: var(--pos-radius-xl);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(4px);
    border: 1px solid color-mix(in srgb, var(--pos-border) 60%, transparent);
}

.pos-grid-loader-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--pos-border);
    border-top-color: var(--pos-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.pos-grid-loader-text {
    font-size: 15px;
    color: var(--pos-text-secondary);
    font-weight: 600;
}

/* Hidden Pagination (Infinite Scroll) */
.pos-shop-pagination {
    display: none;
    visibility: hidden;
    opacity: 0;
    height: 0;
    width: 0;
    overflow: hidden;
    position: absolute;
    pointer-events: none;
}

/* ========================================
   12. RESPONSIVE BREAKPOINTS
======================================== */
/* Desktop Large (1200px+): 8 columns */
@media (min-width: 1200px) {
    .pos-shop-products-grid {
        grid-template-columns: repeat(8, 1fr);
    }

    .pos-shop-header {
        padding: 0 24px;
    }

    .pos-shop-main {
        padding: 16px 24px;
        padding-top: var(--pos-spacing-top);
    }

    .pos-shop-categories-inner {
        margin-left: 0;
        margin-right: 0;
        padding-left: 24px;
        padding-right: 24px;
    }

    .pos-social-btn {
        width: 52px;
        height: 52px;
    }

    .pos-shop-logo h1 {
        font-size: 18px;
        line-height: 1.2;
    }
}

/* Desktop (992px - 1199px): 5 columns */
@media (min-width: 992px) and (max-width: 1199px) {
    .pos-shop-products-grid {
        grid-template-columns: repeat(5, 1fr);
    }

    .pos-shop-logo h1 {
        font-size: 18px;
        line-height: 1.2;
    }
}

/* Tablet header/logo alignment with main POS pages */
@media (min-width: 768px) and (max-width: 1024px) {
    .pos-shop-logo h1 {
        font-size: 18px;
        line-height: 1.2;
        padding-top: 2px;
        margin: 0;
        display: flex;
        align-items: center;
    }
}

/* Desktop: Cart Slider */
@media (min-width: 768px) {

    /* Hide floating cart on desktop */
    .pos-floating-cart {
        display: none !important;
    }

    .pos-cart-modal-content {
        position: fixed;
        top: 0;
        right: 0;
        left: auto;
        bottom: 0;
        width: 450px;
        max-width: 450px;
        max-height: 100vh;
        height: 100vh;
        border-radius: 0;
        transform: translateX(100%);
    }

    .pos-cart-modal.active .pos-cart-modal-content {
        transform: translateX(0);
    }
}

/* Tablet Landscape (768px - 991px): 4 columns */
@media (min-width: 768px) and (max-width: 991px) {
    .pos-shop-products-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .pos-shop-category-btn {
        height: 32px;
        padding: 0 10px;
    }

    .pos-social-btn {
        width: 50px;
        height: 50px;
    }
}

/* Tablet Portrait (576px - 767px): 3 columns */
@media (min-width: 576px) and (max-width: 767px) {
    .pos-shop-products-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .pos-shop-category-btn {
        height: 32px;
        padding: 0 10px;
    }
}

/* Phone (< 576px): 2 columns */
@media (max-width: 575px) {
    .pos-shop-products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .pos-shop-header {
        padding: 0 12px;
    }

    .pos-shop-logo h1 {
        font-size: 17px;
        line-height: 20.4px;
        padding-top: 3px;
    }

    .pos-shop-logo-img {
        width: 38px;
        height: 38px;
    }

    .pos-shop-main {
        padding-inline-start: 16px;
        padding-inline-end: 16px;
        padding-top: var(--pos-spacing-top);
        padding-bottom: 16px;
    }

    .pos-shop-categories {
        margin: 0;
        width: 100%;
    }

    .pos-shop-categories-inner {
        margin-inline-start: 0;
        margin-inline-end: 0;
        padding-inline-start: 16px;
        padding-inline-end: 16px;
        gap: 2px;
    }

    .pos-shop-category-btn {
        height: 32px;
        padding: 0 10px;
    }

    .pos-shop-product-info,
    .pos-product-info-section {
        padding: 8px;
    }

    .pos-product-name,
    .pos-shop-product-name {
        font-size: 13px;
        min-height: 36px;
    }

    .pos-product-price,
    .pos-shop-product-price {
        font-size: 14px;
    }

    .pos-product-add-section {
        flex: 0 0 50px;
    }

    .pos-product-action-row {
        height: 45px;
    }

    .pos-shop-add-btn {
        width: 50px;
    }

    .pos-shop-add-btn .dashicons {
        font-size: 16px;
        width: 16px;
        height: 16px;
    }

    /* Modal adjustments */
    .pos-product-modal-info h2 {
        font-size: 18px;
    }

    .pos-product-modal-price {
        font-size: 16px;
    }

    .pos-social-btn {
        width: 44px;
        height: 44px;
    }

    .pos-social-btn .dashicons {
        font-size: 20px;
        width: 20px;
        height: 20px;
    }
}

/* ========================================
   12.5. MOBILE/TABLET CART MODAL (Slide-up from bottom)
======================================== */
@media (max-width: 991px) {
    .pos-cart-modal {
        display: none;
        align-items: flex-end;
        justify-content: center;
    }

    .pos-cart-modal.active {
        display: flex;
    }

    .pos-cart-modal-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0);
        backdrop-filter: blur(0px);
        -webkit-backdrop-filter: blur(0px);
        cursor: pointer;
        z-index: 10000;
        transition: background 0.5s ease-out, backdrop-filter 0.5s ease-out;
    }

    .pos-cart-modal.active .pos-cart-modal-overlay {
        background: rgba(0, 0, 0, 0.5);
        backdrop-filter: blur(4px);
        -webkit-backdrop-filter: blur(4px);
    }

    .pos-cart-modal-content {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        top: auto;
        transform: translateY(100%);
        width: 100%;
        max-width: 100%;
        height: 90vh;
        max-height: 90vh;
        border-radius: 12px 12px 0 0;
        opacity: 1;
        transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
        box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.2);
        z-index: 10001;
    }

    .pos-cart-modal.active .pos-cart-modal-content {
        transform: translateY(0);
    }

    .pos-cart-modal-header {
        padding: 16px 20px;
        border-bottom: 1px solid var(--pos-border);
    }

    .pos-cart-modal-header h2 {
        font-size: 18px;
    }

    .pos-cart-modal-body {
        padding: 16px;
        flex: 1;
        overflow-y: auto;
        scrollbar-gutter: stable;
        /* Stability fix */
    }

    .pos-cart-modal-footer {
        padding: 16px;
    }

    .pos-cart-total-row {
        font-size: 16px;
        margin-bottom: 12px;
    }

    .pos-cart-total-row strong {
        font-size: 18px;
    }

    .pos-cart-modal-close {
        position: absolute;
        right: 16px;
        left: auto;
        top: 50%;
        transform: translateY(-50%);
    }

    .pos-cart-modal-header {
        position: relative;
        justify-content: center;
    }
}

/* ========================================
   12.6. MOBILE/TABLET PRODUCT MODAL (Slide-up from bottom)
======================================== */
@media (max-width: 991px) {
    .pos-product-modal {
        display: none;
        align-items: flex-end;
        justify-content: center;
    }

    .pos-product-modal.active {
        display: flex;
    }

    .pos-product-modal-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0);
        backdrop-filter: blur(0px);
        -webkit-backdrop-filter: blur(0px);
        cursor: pointer;
        z-index: 10000;
        transition: background 0.5s ease-out, backdrop-filter 0.5s ease-out;
    }

    .pos-product-modal.active .pos-product-modal-overlay {
        background: rgba(0, 0, 0, 0.5);
        backdrop-filter: blur(4px);
        -webkit-backdrop-filter: blur(4px);
    }

    .pos-product-modal-content {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        top: auto;
        transform: translateY(100%);
        width: 100%;
        max-width: 100%;
        height: 90vh;
        max-height: 90vh;
        aspect-ratio: auto;
        border-radius: 12px 12px 0 0;
        opacity: 1;
        transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
        box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.2);
        z-index: 10001;
    }

    .pos-product-modal-content.slide-up {
        transform: translateY(0);
    }

    .pos-product-modal-body {
        flex-direction: column;
        height: 100%;
        min-height: 0;
        overflow: hidden;
    }

    .pos-product-modal-image {
        flex: 0 0 auto;
        width: 100%;
        height: auto;
        aspect-ratio: 1 / 1;
        border-radius: 12px 12px 0 0;
        flex-shrink: 0;
    }

    .pos-product-modal-info {
        flex: 1 1 auto;
        width: 100%;
        min-height: 0;
        padding: 0;
        overflow: hidden;
    }

    .pos-product-modal-scroll {
        padding: 20px 20px 12px;
    }

    .pos-product-modal-footer {
        padding: 14px 20px calc(20px + env(safe-area-inset-bottom));
    }

    .pos-product-modal-close {
        top: 16px;
        right: 16px;
        left: auto;
        width: 36px;
        height: 36px;
        background: color-mix(in srgb, var(--pos-card-bg) 88%, transparent);
    }

    .pos-product-modal-close .dashicons {
        font-size: 20px;
        width: 20px;
        height: 20px;
    }
}

/* ========================================
   12.7. DESKTOP PRODUCT DRAWER POLISH
======================================== */
@media (min-width: 1024px) {
    .pos-product-modal-content {
        width: min(440px, 100vw) !important;
        max-width: min(440px, 100vw) !important;
        height: 100vh !important;
        max-height: 100vh !important;
    }

    .pos-product-modal-body {
        flex: 1 1 auto !important;
        min-height: 0 !important;
    }

    .pos-product-modal-image {
        flex: 0 0 auto !important;
        width: 100% !important;
        height: auto !important;
        aspect-ratio: 1 / 1 !important;
        border-bottom: 1px solid var(--pos-border);
    }

    .pos-product-modal-image img {
        width: 100% !important;
        height: 100% !important;
        object-fit: contain !important;
        object-position: center !important;
        padding: 16px !important;
        box-sizing: border-box !important;
    }

    .pos-product-modal-info {
        flex: 1 1 auto !important;
        display: flex !important;
        flex-direction: column !important;
        min-height: 0 !important;
        overflow: hidden !important;
        padding: 0 !important;
    }

    .pos-product-modal-scroll {
        flex: 1 1 auto !important;
        min-height: 0 !important;
        overflow-y: auto !important;
        padding: 0 !important;
    }

    .pos-product-modal-details {
        padding: 18px 18px 12px !important;
    }

    .pos-product-modal-footer {
        flex-shrink: 0 !important;
        margin-top: auto !important;
        padding: 10px 14px 12px !important;
        border-top: 1px solid var(--pos-border) !important;
        background: linear-gradient(180deg, color-mix(in srgb, var(--pos-card-bg) 94%, transparent) 0%, var(--pos-card-bg) 20px) !important;
        box-shadow: 0 -6px 18px rgba(15, 23, 42, 0.04) !important;
    }

    .pos-product-modal-actions {
        margin: 0 !important;
        padding: 0 !important;
        position: static !important;
        gap: 8px !important;
        align-items: stretch !important;
    }

    .pos-quantity-selector {
        flex: 0 0 122px !important;
    }

    .pos-qty-btn {
        width: 38px !important;
        height: 38px !important;
        font-size: 18px !important;
    }

    .pos-qty-input {
        width: 46px !important;
        height: 38px !important;
        font-size: 15px !important;
    }

    .pos-modal-add-cart {
        height: 38px !important;
        font-size: 14px !important;
        gap: 6px !important;
    }

    .pos-modal-add-cart .dashicons {
        font-size: 18px !important;
        width: 18px !important;
        height: 18px !important;
    }
}

/* ========================================
   13. ANIMATIONS
======================================== */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes pos-grid-sheen {
    0% {
        transform: translateX(-120%);
    }

    100% {
        transform: translateX(120%);
    }
}

@keyframes pos-grid-progress {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -20% 0;
    }
}

@keyframes pos-chip-sheen {
    0% {
        transform: translateX(-130%);
    }

    100% {
        transform: translateX(130%);
    }
}

@keyframes fadeInGrid {
    from {
        opacity: 0.28;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   14. RESPONSIVE UTILITIES
======================================== */
.pos-mobile-only {
    display: none;
}

.pos-desktop-only {
    display: flex;
}

@media (max-width: 767px) {
    :root {
        --pos-header-height: 56px;
    }

    .pos-mobile-only {
        display: flex;
    }

    .pos-desktop-only {
        display: none !important;
    }

    .pos-shop-header {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        padding: 0 12px;
        gap: 8px;
    }

    .pos-shop-logo {
        grid-column: 1;
        grid-row: 1;
        gap: 8px;
        max-width: 100%;
        opacity: 1;
        transform: translateY(0) scale(1);
        transform-origin: right center;
    }

    .pos-shop-logo-img {
        width: 38px;
        height: 38px;
    }

    .pos-shop-logo h1 {
        font-size: 17px;
        line-height: 20.4px;
        padding-top: 3px;
        margin: 0;
        display: flex;
        align-items: center;
    }

    .pos-shop-actions {
        grid-column: 2;
        grid-row: 1;
        justify-self: end;
        position: relative;
        z-index: 2;
    }

    .pos-shop-mobile-search {
        display: flex;
        grid-column: 1;
        grid-row: 1;
        width: 100%;
        max-width: 100%;
        opacity: 0;
        visibility: hidden;
        transform: translateY(-3px) scale(0.985);
        transform-origin: right center;
        pointer-events: none;
        transition: opacity 0.22s cubic-bezier(0.22, 0.61, 0.36, 1),
            transform 0.22s cubic-bezier(0.22, 0.61, 0.36, 1),
            visibility 0s linear 0.22s;
    }

    #toggle-mobile-search .dashicons {
        transition: transform 0.2s ease, opacity 0.2s ease;
    }

    .pos-shop-header.mobile-search-active .pos-shop-logo {
        opacity: 0;
        transform: translateY(3px) scale(0.985);
        pointer-events: none;
    }

    .pos-shop-header.mobile-search-active .pos-shop-mobile-search {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
        pointer-events: auto;
        transition: opacity 0.22s cubic-bezier(0.22, 0.61, 0.36, 1),
            transform 0.22s cubic-bezier(0.22, 0.61, 0.36, 1),
            visibility 0s;
    }

    .pos-shop-header.mobile-search-active #toggle-mobile-search .dashicons {
        transform: rotate(90deg);
    }
}

/* ========================================
   15. FLOATING CART (Mobile)
======================================== */
.pos-floating-cart {
    position: fixed;
    bottom: 16px;
    right: 16px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--pos-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(var(--pos-primary-rgb), 0.4);
    z-index: 1000;
    cursor: pointer;
    transition: all var(--pos-transition);
}

.pos-floating-cart:active {
    background: var(--pos-primary-hover);
}

.pos-floating-cart .dashicons {
    font-size: 22px;
    width: 22px;
    height: 22px;
}

.pos-floating-cart-count {
    position: absolute;
    top: -3px;
    left: -3px;
    background: var(--pos-danger);
    color: white;
    font-size: 10px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
}

/* ========================================
   14. CHECKOUT LAYOUT & FIXED FOOTER
   (Consolidated - Stability Fixes)
======================================== */

.pos-cart-checkout-section {
    display: none;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    height: auto;
    padding: 0;
    overflow: hidden;
    background: var(--pos-card-bg);
}

.pos-cart-checkout-section.active {
    display: flex;
}

#slider-checkout-form {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    height: auto;
    overflow: hidden;
}

/* Scroll Area with Stability Fixes */
.pos-checkout-scroll-area {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 20px;
    -webkit-overflow-scrolling: touch;
    scrollbar-gutter: stable;
    /* Stability Fix: Reserve scrollbar space */
}

/* Apply stability to Cart Body globally too */
.pos-cart-modal-body {
    scrollbar-gutter: stable;
    /* Stability Fix */
    overflow-y: auto;
    /* Ensure standard behavior */
}

/* Footer Container - Desktop/Default (12px 16px) */
.pos-checkout-footer {
    flex-shrink: 0;
    padding: 12px 16px;
    background: var(--pos-bg-primary);
    border-top: 1px solid var(--pos-border);
    z-index: 10;
    margin: 0;
}

/* Mobile Footer Override - Match .pos-cart-modal-footer on Mobile */
@media (max-width: 991px) {
    .pos-checkout-scroll-area {
        padding: 16px;
    }

    .pos-checkout-footer {
        padding: 16px;
    }
}

/* Summary Box */
.pos-checkout-total-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--pos-bg-secondary);
    border-radius: var(--pos-radius);
    border: 1px solid var(--pos-border);
    margin: 0 0 12px 0;
}

/* Label Styling */
.pos-checkout-total-summary label {
    font-size: 16px;
    font-weight: 400;
    color: var(--pos-text);
    margin: 0;
}

.pos-checkout-total-summary strong {
    font-size: 18px;
    font-weight: 800;
    color: var(--pos-primary);
}

/* Action Buttons */
.pos-checkout-actions {
    display: flex;
    gap: 8px;
    align-items: stretch;
    margin-top: 0;
}

.pos-checkout-actions .pos-submit-order-slider {
    flex: 1;
    margin-bottom: 0;
    height: 100%;
}

.pos-checkout-actions .pos-back-to-cart-btn {
    flex: 0 0 52px;
    width: 52px;
    margin-bottom: 0;
    background: var(--pos-bg-tertiary);
    color: var(--pos-text-secondary);
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pos-checkout-actions .pos-back-to-cart-btn:hover {
    background: var(--pos-bg-secondary);
    color: var(--pos-primary);
}

.pos-checkout-actions .pos-back-to-cart-btn .dashicons {
    font-size: 24px;
    width: 24px;
    height: 24px;
}
