/* =============================================================
   POS SYSTEM — Global Stylesheet
   File  : css/main.css
   ใช้ร่วมกันทุกหน้า — import ก่อน css อื่นๆ เสมอ
   ============================================================= */


/* -------------------------------------------------------------
   1. CSS VARIABLES — แก้สีและขนาดได้จากที่เดียว
   ------------------------------------------------------------- */
:root {
    /* -- Brand Colors -- */
    --primary:          #2563eb;   /* น้ำเงินหลัก */
    --primary-dark:     #1d4ed8;
    --primary-light:    #dbeafe;
    --secondary:        #64748b;
    --success:          #16a34a;
    --success-light:    #dcfce7;
    --danger:           #dc2626;
    --danger-light:     #fee2e2;
    --warning:          #d97706;
    --warning-light:    #fef3c7;
    --info:             #0891b2;
    --info-light:       #cffafe;

    /* -- Neutrals -- */
    --white:            #ffffff;
    --gray-50:          #f8fafc;
    --gray-100:         #f1f5f9;
    --gray-200:         #e2e8f0;
    --gray-300:         #cbd5e1;
    --gray-400:         #94a3b8;
    --gray-500:         #64748b;
    --gray-600:         #475569;
    --gray-700:         #334155;
    --gray-800:         #1e293b;
    --gray-900:         #0f172a;

    /* -- Layout -- */
    --navbar-h:         56px;
    --sidebar-w:        220px;
    --radius-sm:        6px;
    --radius-md:        10px;
    --radius-lg:        14px;
    --radius-xl:        20px;

    /* -- Shadows -- */
    --shadow-sm:        0 1px 3px rgba(0,0,0,.08);
    --shadow-md:        0 4px 12px rgba(0,0,0,.10);
    --shadow-lg:        0 8px 24px rgba(0,0,0,.12);

    /* -- Typography -- */
    --font:             'Sarabun', 'Noto Sans Thai', sans-serif;
    --font-size-base:   15px;
    --line-height:      1.6;

    /* -- Transitions -- */
    --transition:       0.18s ease;
}


/* -------------------------------------------------------------
   2. RESET & BASE
   ------------------------------------------------------------- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: var(--font-size-base);
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font);
    background: var(--gray-100);
    color: var(--gray-800);
    line-height: var(--line-height);
    min-height: 100dvh;
}

a {
    color: var(--primary);
    text-decoration: none;
}
a:hover { text-decoration: underline; }

img, svg { display: block; max-width: 100%; }

ul, ol { list-style: none; }

button, input, select, textarea {
    font-family: inherit;
    font-size: inherit;
}

/* Scrollbar (Webkit) */
::-webkit-scrollbar       { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--gray-100); }
::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--gray-400); }


/* -------------------------------------------------------------
   3. TYPOGRAPHY
   ------------------------------------------------------------- */
h1 { font-size: 1.75rem; font-weight: 700; }
h2 { font-size: 1.4rem;  font-weight: 700; }
h3 { font-size: 1.15rem; font-weight: 600; }
h4 { font-size: 1rem;    font-weight: 600; }

.text-sm    { font-size: .85rem; }
.text-xs    { font-size: .75rem; }
.text-lg    { font-size: 1.15rem; }
.text-xl    { font-size: 1.4rem; }
.text-2xl   { font-size: 1.75rem; }
.text-muted { color: var(--gray-500); }
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-danger  { color: var(--danger); }
.text-warning { color: var(--warning); }
.fw-bold     { font-weight: 700; }
.fw-semibold { font-weight: 600; }
.text-end    { text-align: right; }
.text-center { text-align: center; }


/* -------------------------------------------------------------
   4. LAYOUT — App Shell
   ------------------------------------------------------------- */

/* Wrapper หลัก ทุกหน้า wrap ใน .app-wrapper */
.app-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
}

/* หน้าที่มี sidebar (stock, admin, report) */
.app-body {
    display: flex;
    flex: 1;
    overflow: hidden;
    height: calc(100dvh - var(--navbar-h));
}

.main-content {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

/* -------------------------------------------------------------
   5. NAVBAR
   ------------------------------------------------------------- */
.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    height: 68px;                                          /* เพิ่มจาก 56px */
    background: linear-gradient(135deg, #1e40af 0%, #2563eb 60%, #1d4ed8 100%);
    color: var(--white);
    display: flex;
    align-items: center;
    padding: 0 24px;
    gap: 16px;
    box-shadow: 0 2px 16px rgba(37,99,235,.35), 0 1px 3px rgba(0,0,0,.15);
    user-select: none;
    border-bottom: 1px solid rgba(255,255,255,.12);
}

.navbar__brand {
    font-size: 1.35rem;                                    /* +50% จาก .9rem */
    font-weight: 700;
    color: var(--white);
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
    letter-spacing: .01em;
}
.navbar__brand i {
    font-size: 1.45rem;
    filter: drop-shadow(0 1px 3px rgba(0,0,0,.2));
}

.navbar__nav {
    display: flex;
    align-items: center;
    gap: 2px;
    flex: 1;
    margin-left: 16px;
}

.navbar__nav a {
    color: rgba(255,255,255,.80);
    padding: 7px 16px;
    border-radius: 8px;
    font-size: 1.0rem;                                     /* +50% จาก .9rem → ~1.0rem (เดิม .9 × 1.5 = 1.35 แต่ใหญ่ไป ใช้ 1.0 เหมาะสม) */
    font-weight: 600;
    transition: background var(--transition), color var(--transition),
                transform .12s ease;
    display: flex;
    align-items: center;
    gap: 7px;
    letter-spacing: .01em;
}
.navbar__nav a:hover {
    background: rgba(255,255,255,.16);
    color: var(--white);
    text-decoration: none;
    transform: translateY(-1px);
}
.navbar__nav a.active {
    background: rgba(255,255,255,.22);
    color: var(--white);
    text-decoration: none;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.2);
}

.navbar__right {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-left: auto;
}

.navbar__time {
    font-size: 1.0rem;                                     /* +50% จาก .85rem */
    color: rgba(255,255,255,.80);
    white-space: nowrap;
    font-weight: 600;
    background: rgba(255,255,255,.10);
    padding: 4px 12px;
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,.15);
}

.navbar__user {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--white);
    font-size: 1.0rem;                                     /* +50% จาก .9rem */
    font-weight: 600;
    cursor: pointer;
    padding: 6px 14px;
    border-radius: 8px;
    transition: background var(--transition);
    background: rgba(255,255,255,.10);
    border: 1px solid rgba(255,255,255,.15);
}
.navbar__user:hover { background: rgba(255,255,255,.20); }

/* Hamburger (mobile) */
.navbar__toggle {
    display: none;
    background: none;
    border: none;
    color: var(--white);
    font-size: 1.4rem;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}

/* ปุ่ม nav ที่เป็น button (ไม่ใช่ link) — เช่น แลกเงินสด */
.navbar__nav-btn {
    background: none;
    border: none;
    color: rgba(255,255,255,.80);
    padding: 7px 16px;
    border-radius: 8px;
    font-size: 1.0rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 7px;
    letter-spacing: .01em;
    transition: background var(--transition), color var(--transition),
                transform .12s ease;
}
.navbar__nav-btn:hover {
    background: rgba(255,255,255,.16);
    color: var(--white);
    transform: translateY(-1px);
}


/* -------------------------------------------------------------
   6. SIDEBAR
   ------------------------------------------------------------- */
.sidebar {
    width: var(--sidebar-w);
    background: var(--white);
    border-right: 1px solid var(--gray-200);
    overflow-y: auto;
    flex-shrink: 0;
    padding: 12px 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    transition: transform var(--transition);
}

.sidebar__label {
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--gray-400);
    padding: 10px 10px 4px;
}

.sidebar__link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    color: var(--gray-600);
    font-size: .9rem;
    transition: background var(--transition), color var(--transition);
}
.sidebar__link i { width: 18px; text-align: center; font-size: .95rem; }
.sidebar__link:hover {
    background: var(--gray-100);
    color: var(--gray-900);
    text-decoration: none;
}
.sidebar__link.active {
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 600;
}


/* -------------------------------------------------------------
   7. CARD
   ------------------------------------------------------------- */
.card {
    background: var(--white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
    overflow: hidden;
}

.card__header {
    padding: 14px 18px;
    border-bottom: 1px solid var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.card__title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-800);
    display: flex;
    align-items: center;
    gap: 8px;
}
.card__body  { padding: 18px; }
.card__footer {
    padding: 12px 18px;
    border-top: 1px solid var(--gray-100);
    background: var(--gray-50);
}


/* -------------------------------------------------------------
   8. BUTTONS
   ------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 18px;
    border-radius: var(--radius-sm);
    border: 1.5px solid transparent;
    font-weight: 600;
    font-size: .9rem;
    cursor: pointer;
    transition: background var(--transition), box-shadow var(--transition), transform var(--transition);
    white-space: nowrap;
    user-select: none;
    line-height: 1.4;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* Variants */
.btn-primary   { background: var(--primary);  color: var(--white); border-color: var(--primary); }
.btn-primary:hover   { background: var(--primary-dark); border-color: var(--primary-dark); }

.btn-success   { background: var(--success);  color: var(--white); border-color: var(--success); }
.btn-success:hover   { background: #15803d; border-color: #15803d; }

.btn-danger    { background: var(--danger);   color: var(--white); border-color: var(--danger); }
.btn-danger:hover    { background: #b91c1c; border-color: #b91c1c; }

.btn-warning   { background: var(--warning);  color: var(--white); border-color: var(--warning); }
.btn-warning:hover   { background: #b45309; border-color: #b45309; }

.btn-secondary { background: var(--white); color: var(--gray-700); border-color: var(--gray-300); }
.btn-secondary:hover { background: var(--gray-100); }

.btn-ghost     { background: transparent; color: var(--gray-600); border-color: transparent; }
.btn-ghost:hover { background: var(--gray-100); color: var(--gray-900); }

/* Sizes */
.btn-sm  { padding: 5px 12px; font-size: .82rem; }
.btn-lg  { padding: 12px 28px; font-size: 1rem; }
.btn-xl  { padding: 15px 32px; font-size: 1.1rem; }
.btn-block { width: 100%; }
.btn-icon  { padding: 8px; border-radius: var(--radius-sm); }


/* -------------------------------------------------------------
   9. FORM ELEMENTS
   ------------------------------------------------------------- */
.form-group  { display: flex; flex-direction: column; gap: 5px; }
.form-label  { font-size: .88rem; font-weight: 600; color: var(--gray-700); }
.form-required::after { content: ' *'; color: var(--danger); }

.form-control {
    width: 100%;
    padding: 9px 12px;
    border: 1.5px solid var(--gray-300);
    border-radius: var(--radius-sm);
    background: var(--white);
    color: var(--gray-800);
    font-size: .92rem;
    transition: border-color var(--transition), box-shadow var(--transition);
    outline: none;
}
.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,.15);
}
.form-control::placeholder { color: var(--gray-400); }
.form-control:disabled { background: var(--gray-100); cursor: not-allowed; }

.form-control.is-invalid { border-color: var(--danger); }
.form-control.is-invalid:focus { box-shadow: 0 0 0 3px rgba(220,38,38,.15); }

.form-hint { font-size: .78rem; color: var(--gray-500); }
.form-error { font-size: .78rem; color: var(--danger); }

select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 90px; }

.input-group {
    display: flex;
    align-items: stretch;
}
.input-group .form-control {
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
    flex: 1;
}
.input-group .btn {
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    border-left: none;
}


/* -------------------------------------------------------------
   10. BADGE / TAG
   ------------------------------------------------------------- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 9px;
    border-radius: 99px;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .02em;
    white-space: nowrap;
}
.badge-primary { background: var(--primary-light); color: var(--primary-dark); }
.badge-success { background: var(--success-light); color: var(--success); }
.badge-danger  { background: var(--danger-light);  color: var(--danger); }
.badge-warning { background: var(--warning-light); color: var(--warning); }
.badge-info    { background: var(--info-light);    color: var(--info); }
.badge-gray    { background: var(--gray-100);      color: var(--gray-600); }


/* -------------------------------------------------------------
   11. TABLE
   ------------------------------------------------------------- */
.table-wrap { overflow-x: auto; }

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: .9rem;
}
.table th {
    background: var(--gray-50);
    color: var(--gray-600);
    font-size: .78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    padding: 10px 14px;
    border-bottom: 1px solid var(--gray-200);
    text-align: left;
    white-space: nowrap;
}
.table td {
    padding: 11px 14px;
    border-bottom: 1px solid var(--gray-100);
    color: var(--gray-700);
    vertical-align: middle;
}
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover td { background: var(--gray-50); }
.table .text-end { text-align: right; }


/* -------------------------------------------------------------
   12. STAT CARD (Dashboard / Report)
   ------------------------------------------------------------- */
.stat-card {
    background: var(--white);
    border-radius: var(--radius-md);
    border: 1px solid var(--gray-200);
    padding: 18px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
}
.stat-card__icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}
.stat-card__label { font-size: .82rem; color: var(--gray-500); margin-bottom: 2px; }
.stat-card__value { font-size: 1.6rem; font-weight: 700; line-height: 1.2; }
.stat-card__sub   { font-size: .78rem; color: var(--gray-500); margin-top: 2px; }

.stat-primary .stat-card__icon { background: var(--primary-light); color: var(--primary); }
.stat-success .stat-card__icon { background: var(--success-light); color: var(--success); }
.stat-warning .stat-card__icon { background: var(--warning-light); color: var(--warning); }
.stat-danger  .stat-card__icon { background: var(--danger-light);  color: var(--danger);  }


/* -------------------------------------------------------------
   13. PRODUCT CARD (POS grid)
   ------------------------------------------------------------- */
.product-card {
    background: var(--white);
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-md);
    padding: 10px;
    display: grid;                                           /* ← เปลี่ยนจาก flex */
    grid-template-rows: auto 1fr auto auto;                  /* img | name | price | stock */
    align-items: start;
    cursor: pointer;
    transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
    user-select: none;
    text-align: center;
    gap: 6px;
}
.product-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}
.product-card:active { transform: scale(.96); }

.product-card__img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: var(--radius-sm);
    background: var(--gray-100);
}
.product-card__img-placeholder {
    width: 100%;
    aspect-ratio: 1;
    border-radius: var(--radius-sm);
    background: var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-300);
    font-size: 2rem;
}
.product-card__name {
    font-size: 1.64rem;
    color: var(--gray-700);
    line-height: 1.3;
    /* ล็อก 2 บรรทัด */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    align-self: start;
}
.product-card__price {
    font-size: 1.9rem;
    font-weight: 700;
    color: var(--primary);
    align-self: end;             /* ← ดันลงล่างสุดของ row */
}
.product-card__stock {
    font-size: 1.44rem;
    color: var(--gray-400);
    align-self: start;
}
.product-card--out   { opacity: .45; pointer-events: none; }
.product-card--low .product-card__stock { color: var(--danger); font-weight: 600; }


/* -------------------------------------------------------------
   14. CART ITEM
   ------------------------------------------------------------- */
.cart-item {
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: 8px;
    padding: 9px 0;
    border-bottom: 1px solid var(--gray-100);
}
.cart-item:last-child { border-bottom: none; }

.cart-item__name  { font-size: .88rem; font-weight: 600; color: var(--gray-800); }
.cart-item__price { font-size: .78rem; color: var(--gray-500); }

.qty-control {
    display: flex;
    align-items: center;
    gap: 4px;
}
.qty-control button {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 1.5px solid var(--gray-300);
    background: var(--white);
    color: var(--gray-700);
    font-size: .9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition);
}
.qty-control button:hover { background: var(--gray-100); }
.qty-control span { min-width: 24px; text-align: center; font-weight: 700; font-size: .9rem; }

.cart-item__total {
    font-weight: 700;
    font-size: .9rem;
    color: var(--gray-800);
    white-space: nowrap;
    text-align: right;
    min-width: 64px;
}


/* -------------------------------------------------------------
   15. MODAL OVERLAY
   ------------------------------------------------------------- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,.45);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    backdrop-filter: blur(2px);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition);
}
.modal-overlay.open {
    opacity: 1;
    pointer-events: all;
}

.modal {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 500px;
    max-height: 90dvh;
    overflow-y: auto;
    transform: translateY(12px);
    transition: transform var(--transition);
}
.modal-overlay.open .modal { transform: translateY(0); }

.modal__header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    background: var(--white);
    z-index: 1;
}
.modal__title { font-size: 1rem; font-weight: 700; }
.modal__close {
    width: 30px;
    height: 30px;
    border: none;
    background: var(--gray-100);
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-600);
    transition: background var(--transition);
}
.modal__close:hover { background: var(--gray-200); }
.modal__body   { padding: 20px; }
.modal__footer { padding: 14px 20px; border-top: 1px solid var(--gray-100); display: flex; gap: 10px; justify-content: flex-end; }


/* -------------------------------------------------------------
   16. UTILITY CLASSES
   ------------------------------------------------------------- */
.d-flex        { display: flex; }
.d-grid        { display: grid; }
.align-center  { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-4  { gap: 4px; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-20 { gap: 20px; }
.flex-1 { flex: 1; }
.w-full { width: 100%; }
.mt-4   { margin-top: 4px; }
.mt-8   { margin-top: 8px; }
.mt-12  { margin-top: 12px; }
.mt-16  { margin-top: 16px; }
.mb-4   { margin-bottom: 4px; }
.mb-8   { margin-bottom: 8px; }
.mb-12  { margin-bottom: 12px; }
.mb-16  { margin-bottom: 16px; }
.p-4    { padding: 4px; }
.p-8    { padding: 8px; }
.p-12   { padding: 12px; }
.p-16   { padding: 16px; }

.divider {
    border: none;
    border-top: 1px solid var(--gray-200);
    margin: 12px 0;
}
.divider-dashed { border-style: dashed; }

/* Loading spinner */
.spinner {
    width: 20px;
    height: 20px;
    border: 2.5px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin .6s linear infinite;
    display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Low stock indicator */
.low-stock-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--danger);
    animation: pulse 1.5s ease-in-out infinite;
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: .35; }
}

/* Page header (title + actions row) */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.page-header h2 { margin: 0; }

/* Product modal: storefront visibility */
.product-storefront-control {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 14px;
    padding: 13px 14px;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    transition: border-color .18s, background .18s, box-shadow .18s;
}
.product-storefront-control.is-visible {
    background: #f0fdf4;
    border-color: #bbf7d0;
    box-shadow: 0 4px 12px rgba(22, 163, 74, .07);
}
.product-storefront-control__copy { min-width: 0; }
.product-storefront-control__copy strong { display: block; color: var(--gray-700); font-size: .9rem; }
.product-storefront-control__copy strong i { margin-right: 5px; color: var(--primary); }
.product-storefront-control__copy small { display: block; margin-top: 3px; color: var(--gray-400); font-size: .72rem; line-height: 1.35; }
.product-storefront-switch { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; cursor: pointer; }
.product-storefront-switch input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.product-storefront-switch__track {
    position: relative;
    width: 48px;
    height: 26px;
    background: #cbd5e1;
    border-radius: 99px;
    transition: background .18s;
}
.product-storefront-switch__track::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(15, 23, 42, .24);
    transition: transform .18s;
}
.product-storefront-switch input:checked + .product-storefront-switch__track { background: #16a34a; }
.product-storefront-switch input:checked + .product-storefront-switch__track::after { transform: translateX(22px); }
.product-storefront-switch input:focus-visible + .product-storefront-switch__track { outline: 3px solid rgba(225, 29, 46, .2); }
.product-storefront-switch b { min-width: 24px; color: var(--gray-500); font-size: .78rem; }
.product-storefront-control.is-visible .product-storefront-switch b { color: #15803d; }
@media (max-width: 480px) {
    .product-storefront-control { align-items: flex-start; }
    .product-storefront-control__copy small { max-width: 230px; }
}
