/* ========================================
   CASH REGISTER
======================================== */


/* ----------------------------------------
   Page
---------------------------------------- */

html {
  scroll-behavior: smooth;
}

.pos-page {
  width: 100%;
  min-height: calc(100vh - 52px);

  background: var(--color-background);
}

.pos-layout {
  display: grid;

  grid-template-columns:
    minmax(0, 1fr)
    var(--cash-register-sidebar-width);

  align-items: start;

  width: 100%;
  min-height: calc(100vh - 52px);
}


/* ----------------------------------------
   Main content
---------------------------------------- */

.pos-main {
  min-width: 0;

  padding:
    32px
    36px
    72px;
}


/* ----------------------------------------
   Header
---------------------------------------- */

.pos-header {
  max-width: 1120px;

  margin:
    0
    auto
    28px;
}

.pos-back-link {
  display: inline-flex;
  align-items: center;

  margin-bottom: 20px;

  color: var(--color-text-muted);

  font-size: 13px;
  font-weight: 650;

  text-decoration: none;

  transition:
    color var(--transition-fast);
}

.pos-back-link:hover {
  color: var(--color-text);
}

.pos-header-title {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;

  gap: 24px;
}

.pos-eyebrow {
  display: block;

  margin-bottom: 6px;

  color: var(--color-text-muted);

  font-size: 10px;
  font-weight: 750;

  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.pos-header h1 {
  margin: 0;

  color: var(--color-text);

  font-size: clamp(30px, 4vw, 46px);
  font-weight: 750;

  line-height: 1.03;

  letter-spacing: -0.045em;
}

.pos-header p {
  max-width: 680px;

  margin:
    10px
    0
    0;

  color: var(--color-text-muted);

  font-size: 13px;

  line-height: 1.5;
}

.pos-status {
  display: inline-flex;
  align-items: center;

  gap: 8px;

  min-height: 34px;

  padding:
    0
    12px;

  flex-shrink: 0;

  background: var(--color-success-light);

  border-radius: var(--radius-pill);

  color: var(--color-success);

  font-size: 11px;
  font-weight: 750;
}

.pos-status-dot {
  width: 7px;
  height: 7px;

  background: var(--color-success);

  border-radius: 50%;
}


/* ----------------------------------------
   Success
---------------------------------------- */

.pos-payment-success {
  display: flex;
  align-items: center;

  gap: 14px;

  max-width: 1120px;

  margin:
    0
    auto
    22px;

  padding:
    14px
    16px;

  background: var(--color-success-light);

  border:
    1px
    solid
    rgba(22, 130, 93, 0.14);

  border-radius: var(--radius-md);
}

.pos-payment-success-icon {
  display: flex;
  align-items: center;
  justify-content: center;

  width: 30px;
  height: 30px;

  flex-shrink: 0;

  background: var(--color-success);

  border-radius: 50%;

  color: #ffffff;

  font-size: 13px;
  font-weight: 800;
}

.pos-payment-success-content {
  display: flex;
  flex: 1;
  flex-direction: column;

  gap: 2px;
}

.pos-payment-success-content strong {
  color: var(--color-success);

  font-size: 12px;
}

.pos-payment-success-content span {
  color: var(--color-text-muted);

  font-size: 11px;
}

.pos-payment-success-link {
  color: var(--color-success);

  font-size: 11px;
  font-weight: 750;

  text-decoration: none;
}


/* ----------------------------------------
   Alert
---------------------------------------- */

.pos-alert {
  display: flex;
  flex-direction: column;

  gap: 3px;

  max-width: 1120px;

  margin:
    0
    auto
    22px;

  padding:
    14px
    16px;

  background: var(--color-danger-light);

  border:
    1px
    solid
    var(--color-danger-border);

  border-radius: var(--radius-md);

  color: var(--color-danger);

  font-size: 12px;
}


/* ----------------------------------------
   Category navigation
---------------------------------------- */

.pos-category-nav {
  position: sticky;

  top: 0;

  max-width: 1120px;

  margin:
    0
    auto
    34px;

  padding:
    10px
    0;

  background:
    linear-gradient(
      to bottom,
      var(--color-background) 80%,
      rgba(244, 246, 248, 0)
    );

  z-index: 40;
}

.pos-category-nav-inner {
  display: flex;
  align-items: center;

  gap: 18px;

  min-height: 58px;

  padding:
    9px
    10px
    9px
    18px;

  background: var(--color-surface);

  border:
    1px
    solid
    var(--color-border);

  border-radius: var(--radius-lg);

  box-shadow:
    0 4px 18px rgba(16, 24, 40, 0.06);
}

.pos-category-nav-label {
  flex-shrink: 0;

  color: var(--color-text-muted);

  font-size: 9px;
  font-weight: 750;

  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.pos-category-nav-links {
  display: flex;
  align-items: center;

  gap: 7px;

  min-width: 0;
}

.pos-category-anchor {
  display: inline-flex;
  align-items: center;

  gap: 8px;

  min-height: 38px;

  padding:
    0
    13px;

  background: var(--color-surface-secondary);

  border:
    1px
    solid
    transparent;

  border-radius: var(--radius-sm);

  color: var(--color-text);

  font-size: 11px;
  font-weight: 800;

  letter-spacing: 0.025em;

  text-decoration: none;

  transition:
    background var(--transition-fast),
    border-color var(--transition-fast),
    transform var(--transition-fast);
}

.pos-category-anchor:hover {
  background: #ffffff;

  border-color: var(--color-border);

  transform: translateY(-1px);
}

.pos-category-anchor-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  min-width: 21px;
  height: 21px;

  padding:
    0
    6px;

  background: var(--color-primary);

  border-radius: var(--radius-pill);

  color: #ffffff;

  font-size: 9px;
}


/* ----------------------------------------
   Categories
---------------------------------------- */

.pos-categories {
  display: flex;
  flex-direction: column;

  gap: 46px;

  max-width: 1120px;

  margin: 0 auto;
}


/* ----------------------------------------
   Products section
---------------------------------------- */

.pos-products-section {
  scroll-margin-top: 88px;
}

.pos-section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;

  gap: 24px;

  margin-bottom: 18px;

  padding-bottom: 16px;

  border-bottom:
    1px
    solid
    var(--color-border);
}

.pos-section-heading h2 {
  margin: 0;

  color: var(--color-text);

  font-size: 24px;
  font-weight: 800;

  line-height: 1;

  letter-spacing: -0.035em;
}

.pos-section-heading p {
  margin:
    7px
    0
    0;

  color: var(--color-text-muted);

  font-size: 11px;
}

.pos-product-count {
  display: inline-flex;
  align-items: center;

  min-height: 30px;

  padding:
    0
    10px;

  flex-shrink: 0;

  background: var(--color-surface);

  border:
    1px
    solid
    var(--color-border);

  border-radius: var(--radius-pill);

  color: var(--color-text-muted);

  font-size: 10px;
  font-weight: 700;
}


/* ----------------------------------------
   Product grid
---------------------------------------- */

.pos-products-grid {
  display: grid;

  grid-template-columns:
    repeat(
      auto-fill,
      minmax(190px, 1fr)
    );

  gap: 12px;
}

.pos-product-card {
  position: relative;

  min-width: 0;

  background: var(--color-surface);

  border:
    1px
    solid
    var(--color-border);

  border-radius: var(--radius-md);

  box-shadow:
    0 1px 2px rgba(16, 24, 40, 0.025);

  overflow: hidden;

  transition:
    border-color var(--transition-fast),
    box-shadow var(--transition-fast),
    transform var(--transition-fast);
}

.pos-product-card:hover {
  border-color: #cfd4da;

  box-shadow:
    0 6px 18px rgba(16, 24, 40, 0.07);

  transform: translateY(-1px);
}

.pos-product-card.is-selected {
  border-color: var(--color-primary);

  box-shadow:
    0 0 0 1px var(--color-primary);
}

.pos-product-button {
  display: flex;
  flex-direction: column;
  align-items: stretch;

  width: 100%;
  min-height: 154px;

  padding: 18px;

  background: transparent;

  border: 0;

  color: inherit;

  font: inherit;
  text-align: left;

  cursor: pointer;
}

.pos-product-quantity {
  position: absolute;

  top: 11px;
  right: 11px;

  display: flex;
  align-items: center;
  justify-content: center;

  min-width: 25px;
  height: 25px;

  padding:
    0
    7px;

  background: var(--color-primary);

  border-radius: var(--radius-pill);

  color: #ffffff;

  font-size: 10px;
  font-weight: 800;

  opacity: 0;
  transform: scale(0.8);

  transition:
    opacity var(--transition-fast),
    transform var(--transition-fast);
}

.pos-product-quantity.is-visible {
  opacity: 1;
  transform: scale(1);
}

.pos-product-name {
  max-width: calc(100% - 24px);

  margin-bottom: 9px;

  color: var(--color-text);

  font-size: 14px;
  font-weight: 750;

  line-height: 1.3;
}

.pos-product-price {
  color: var(--color-text-muted);

  font-size: 12px;
  font-weight: 650;
}

.pos-product-add {
  display: flex;
  align-items: center;
  justify-content: space-between;

  gap: 10px;

  margin-top: auto;
  padding-top: 22px;

  color: var(--color-text-muted);

  font-size: 10px;
  font-weight: 750;

  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.pos-product-add > span {
  display: flex;
  align-items: center;
  justify-content: center;

  width: 27px;
  height: 27px;

  background: var(--color-surface-secondary);

  border-radius: var(--radius-xs);

  color: var(--color-text);

  font-size: 16px;

  transition:
    background var(--transition-fast),
    color var(--transition-fast);
}

.pos-product-card:hover .pos-product-add > span,
.pos-product-card.is-selected .pos-product-add > span {
  background: var(--color-primary);

  color: #ffffff;
}

.pos-hidden-quantity {
  position: absolute;

  width: 1px;
  height: 1px;

  margin: -1px;
  padding: 0;

  border: 0;

  overflow: hidden;

  clip: rect(0 0 0 0);
}


/* ----------------------------------------
   Empty products
---------------------------------------- */

.pos-empty-products {
  max-width: 680px;

  margin:
    80px
    auto;

  padding:
    52px
    30px;

  background: var(--color-surface);

  border:
    1px
    solid
    var(--color-border);

  border-radius: var(--radius-lg);

  text-align: center;
}

.pos-empty-icon {
  display: flex;
  align-items: center;
  justify-content: center;

  width: 48px;
  height: 48px;

  margin:
    0
    auto
    18px;

  background: var(--color-primary);

  border-radius: 50%;

  color: #ffffff;

  font-size: 22px;
}

.pos-empty-products h2 {
  margin:
    0
    0
    8px;

  font-size: 20px;
}

.pos-empty-products p {
  max-width: 430px;

  margin:
    0
    auto
    20px;

  color: var(--color-text-muted);

  font-size: 12px;

  line-height: 1.6;
}

.pos-primary-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  min-height: 42px;

  padding:
    0
    16px;

  background: var(--color-primary);

  border-radius: var(--radius-sm);

  color: #ffffff;

  font-size: 12px;
  font-weight: 750;

  text-decoration: none;
}


/* ========================================
   CART
======================================== */

.pos-cart {
  position: sticky;

  top: 0;

  display: flex;
  flex-direction: column;

  height: calc(100vh - 52px);

  background: var(--color-surface);

  border-left:
    1px
    solid
    var(--color-border);

  overflow: hidden;
}


/* ----------------------------------------
   Cart header
---------------------------------------- */

.pos-cart-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;

  gap: 16px;

  padding:
    24px
    22px
    20px;

  border-bottom:
    1px
    solid
    var(--color-border);
}

.pos-cart-header h2 {
  margin: 0;

  font-size: 22px;
  font-weight: 800;

  letter-spacing: -0.035em;
}

.pos-cart-header-actions {
  display: flex;
  align-items: center;

  gap: 8px;
}

.pos-cart-count {
  color: var(--color-text-muted);

  font-size: 10px;
  font-weight: 650;
}

.pos-clear-button {
  padding: 0;

  background: transparent;

  border: 0;

  color: var(--color-text-muted);

  font: inherit;
  font-size: 10px;
  font-weight: 750;

  cursor: pointer;
}

.pos-clear-button:hover {
  color: var(--color-danger);
}


/* ----------------------------------------
   Empty cart
---------------------------------------- */

.pos-cart-empty {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  min-height: 200px;

  padding: 30px;

  color: var(--color-text-muted);

  text-align: center;
}

.pos-cart-empty-icon {
  position: relative;

  width: 38px;
  height: 38px;

  margin-bottom: 14px;

  border:
    2px
    solid
    var(--color-border);

  border-radius: 50%;
}

.pos-cart-empty-icon::before,
.pos-cart-empty-icon::after {
  content: "";

  position: absolute;

  top: 50%;
  left: 50%;

  width: 13px;
  height: 2px;

  background: var(--color-border);

  transform: translate(-50%, -50%);
}

.pos-cart-empty-icon::after {
  transform:
    translate(-50%, -50%)
    rotate(90deg);
}

.pos-cart-empty strong {
  margin-bottom: 5px;

  color: var(--color-text);

  font-size: 12px;
}

.pos-cart-empty p {
  margin: 0;

  font-size: 10px;
}


/* ----------------------------------------
   Cart lines
---------------------------------------- */

.pos-cart-lines {
  flex: 1;

  padding:
    8px
    22px;

  overflow-y: auto;
}

.pos-cart-line {
  padding:
    16px
    0;

  border-bottom:
    1px
    solid
    var(--color-border);
}

.pos-cart-line.is-hidden,
.is-hidden {
  display: none !important;
}

.pos-cart-line-main {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;

  gap: 15px;

  margin-bottom: 12px;
}

.pos-cart-product {
  display: flex;
  flex-direction: column;

  gap: 4px;

  min-width: 0;
}

.pos-cart-product strong {
  color: var(--color-text);

  font-size: 12px;

  line-height: 1.35;
}

.pos-cart-product span {
  color: var(--color-text-muted);

  font-size: 9px;

  line-height: 1.4;
}

.pos-cart-line-total {
  flex-shrink: 0;

  color: var(--color-text);

  font-size: 12px;

  white-space: nowrap;
}


/* ----------------------------------------
   Quantity
---------------------------------------- */

.pos-quantity-control {
  display: inline-flex;
  align-items: center;

  gap: 5px;

  padding: 3px;

  background: var(--color-surface-secondary);

  border-radius: var(--radius-xs);
}

.pos-quantity-button {
  display: flex;
  align-items: center;
  justify-content: center;

  width: 29px;
  height: 29px;

  padding: 0;

  background: var(--color-surface);

  border:
    1px
    solid
    var(--color-border);

  border-radius: 6px;

  color: var(--color-text);

  font: inherit;
  font-size: 15px;
  font-weight: 700;

  cursor: pointer;

  transition:
    background var(--transition-fast);
}

.pos-quantity-button:hover {
  background: var(--color-border);
}

.pos-quantity-value {
  min-width: 28px;

  color: var(--color-text);

  font-size: 11px;
  font-weight: 800;

  text-align: center;
}


/* ----------------------------------------
   Checkout
---------------------------------------- */

.pos-cart-footer {
  flex-shrink: 0;

  padding:
    20px
    22px
    22px;

  background: var(--color-surface);

  border-top:
    1px
    solid
    var(--color-border);
}

.pos-total {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;

  gap: 15px;

  margin-bottom: 20px;
}

.pos-total span {
  color: var(--color-text-muted);

  font-size: 10px;
  font-weight: 650;
}

.pos-total strong {
  color: var(--color-text);

  font-size: 28px;
  font-weight: 800;

  letter-spacing: -0.04em;

  white-space: nowrap;
}

.pos-payment-title {
  margin-bottom: 9px;

  color: var(--color-text-muted);

  font-size: 9px;
  font-weight: 750;

  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.pos-payment-buttons {
  display: grid;

  grid-template-columns:
    1fr;

  gap: 7px;
}

.pos-payment-button {
  display: flex;
  align-items: center;

  gap: 12px;

  width: 100%;
  min-height: 55px;

  padding:
    8px
    11px;

  background: var(--color-surface);

  border:
    1px
    solid
    var(--color-border);

  border-radius: var(--radius-sm);

  color: var(--color-text);

  font: inherit;
  text-align: left;

  cursor: pointer;

  transition:
    border-color var(--transition-fast),
    background var(--transition-fast),
    transform var(--transition-fast);
}

.pos-payment-button:not(:disabled):hover {
  background: var(--color-surface-secondary);

  border-color: #c8ced5;

  transform: translateY(-1px);
}

.pos-payment-button:disabled {
  opacity: 0.4;

  cursor: not-allowed;
}

.pos-payment-card:not(:disabled) {
  background: var(--color-primary);

  border-color: var(--color-primary);

  color: #ffffff;
}

.pos-payment-card:not(:disabled):hover {
  background: var(--color-primary-hover);
}

.pos-payment-icon {
  display: flex;
  align-items: center;
  justify-content: center;

  width: 34px;
  height: 34px;

  flex-shrink: 0;

  background: var(--color-surface-secondary);

  border-radius: var(--radius-xs);

  color: var(--color-text);

  font-size: 9px;
  font-weight: 850;
}

.pos-payment-card:not(:disabled) .pos-payment-icon {
  background: rgba(255, 255, 255, 0.12);

  color: #ffffff;
}

.pos-payment-button > span:last-child {
  display: flex;
  flex-direction: column;

  gap: 2px;
}

.pos-payment-button strong {
  font-size: 11px;
}

.pos-payment-button small {
  color: var(--color-text-muted);

  font-size: 9px;
}

.pos-payment-card:not(:disabled) small {
  color: rgba(255, 255, 255, 0.65);
}

.pos-payment-help {
  margin:
    11px
    0
    0;

  color: var(--color-text-muted);

  font-size: 9px;

  line-height: 1.45;
}


/* ========================================
   RESPONSIVE
======================================== */

@media (max-width: 1180px) {
  .pos-layout {
    grid-template-columns:
      minmax(0, 1fr)
      350px;
  }

  .pos-main {
    padding:
      28px
      26px
      60px;
  }

  .pos-products-grid {
    grid-template-columns:
      repeat(
        auto-fill,
        minmax(175px, 1fr)
      );
  }
}


@media (max-width: 920px) {
  .pos-layout {
    display: block;
  }

  .pos-main {
    padding:
      26px
      22px
      42px;
  }

  .pos-cart {
    position: relative;

    top: auto;

    width: calc(100% - 44px);
    height: auto;

    margin:
      0
      22px
      30px;

    border:
      1px
      solid
      var(--color-border);

    border-radius: var(--radius-lg);

    box-shadow: var(--shadow-card);
  }

  .pos-cart-lines {
    max-height: 420px;
  }

  .pos-category-nav {
    position: relative;

    top: auto;
  }
}


@media (max-width: 700px) {
  .pos-main {
    padding:
      22px
      14px
      36px;
  }

  .pos-header-title {
    align-items: flex-start;
    flex-direction: column;

    gap: 14px;
  }

  .pos-header h1 {
    font-size: 30px;
  }

  .pos-category-nav {
    margin-bottom: 28px;

    padding: 0;
  }

  .pos-category-nav-inner {
    display: block;

    padding:
      12px;
  }

  .pos-category-nav-label {
    display: block;

    margin-bottom: 9px;
  }

  .pos-category-nav-links {
    overflow-x: auto;

    padding-bottom: 2px;
  }

  .pos-category-anchor {
    flex-shrink: 0;
  }

  .pos-categories {
    gap: 38px;
  }

  .pos-section-heading {
    align-items: flex-start;

    gap: 12px;
  }

  .pos-products-grid {
    grid-template-columns:
      repeat(2, minmax(0, 1fr));

    gap: 9px;
  }

  .pos-product-button {
    min-height: 142px;

    padding: 15px;
  }

  .pos-product-name {
    font-size: 13px;
  }

  .pos-cart {
    width: calc(100% - 28px);

    margin:
      0
      14px
      24px;
  }
}


@media (max-width: 430px) {
  .pos-products-grid {
    grid-template-columns: 1fr;
  }

  .pos-product-button {
    min-height: 125px;
  }

  .pos-section-heading {
    flex-direction: column;
  }

  .pos-cart-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .pos-cart-header-actions {
    width: 100%;

    justify-content: space-between;
  }

  .pos-total strong {
    font-size: 25px;
  }
}
