/* ============================================================
   OrderFit B2B - Shop (거래처) Specific Styles
   Mobile-first, card-based layouts, large touch targets
   ============================================================ */

/* === Shop Header === */
.header--shop {
  height: var(--mobile-header-height);
  padding: 0 var(--space-4);
}

.header--shop .header__logo {
  font-size: var(--text-md);
}

/* === Shop Desktop Top Navigation === */
.shop-topnav {
  position: fixed;
  top: var(--header-height);
  left: 0;
  right: 0;
  height: 48px;
  background: var(--color-white);
  border-bottom: 1px solid var(--color-gray-200);
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
}

.shop-topnav__inner {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  max-width: 960px;
  width: 100%;
  padding: 0 var(--space-4);
  overflow-x: auto;
}

.shop-topnav__item {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
  color: var(--color-gray-600);
  text-decoration: none;
  white-space: nowrap;
  border-radius: var(--border-radius-md);
  transition: background var(--transition-fast), color var(--transition-fast);
  position: relative;
}

.shop-topnav__item .material-icons {
  font-size: 18px;
}

.shop-topnav__item:hover {
  background: var(--color-gray-100);
  color: var(--color-primary);
  text-decoration: none;
}

.shop-topnav__item.active {
  color: var(--color-primary);
  font-weight: var(--font-medium);
  background: var(--color-primary-light);
}

.shop-topnav__badge {
  background: var(--color-error);
  color: var(--color-white);
  font-size: 10px;
  font-weight: var(--font-bold);
  padding: 0 5px;
  border-radius: var(--border-radius-full);
  min-width: 16px;
  height: 16px;
  line-height: 16px;
  text-align: center;
}

/* Adjust layout-body for shop top nav */
.layout-body--shop {
  padding-top: calc(var(--header-height) + 48px);
}

/* === Product Grid (Card) === */
.product-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3);
}

.product-card {
  background: var(--color-white);
  border-radius: var(--border-radius-md);
  border: 1px solid var(--color-gray-200);
  overflow: hidden;
  cursor: pointer;
  transition: box-shadow var(--transition-fast);
}

.product-card:hover {
  box-shadow: var(--shadow-md);
}

.product-card__image {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  background: var(--color-gray-100);
}

.product-card__body {
  padding: var(--space-3);
}

.product-card__name {
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--color-black);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-card__unit {
  font-size: var(--text-xs);
  color: var(--color-gray-600);
  margin-top: 2px;
}

.product-card__price {
  font-size: var(--text-md);
  font-weight: var(--font-bold);
  color: var(--color-primary);
  margin-top: var(--space-2);
}

.product-card__stock {
  font-size: var(--text-xs);
  margin-top: 2px;
}

.product-card__stock--low {
  color: var(--color-warning);
}

.product-card__stock--out {
  color: var(--color-error);
}

/* === Shop Cart === */
.cart-item {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-4);
  border-bottom: 1px solid var(--color-gray-200);
}

.cart-item__image {
  width: 64px;
  height: 64px;
  border-radius: var(--border-radius-sm);
  object-fit: cover;
  background: var(--color-gray-100);
  flex-shrink: 0;
}

.cart-item__info {
  flex: 1;
  min-width: 0;
}

.cart-item__name {
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
}

.cart-item__price {
  font-size: var(--text-sm);
  color: var(--color-gray-600);
  margin-top: 2px;
}

.cart-item__actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-2);
}

/* Quantity Stepper */
.qty-stepper {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--color-gray-400);
  border-radius: var(--border-radius-sm);
}

.qty-stepper__btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--color-gray-800);
  cursor: pointer;
  font-size: var(--text-lg);
}

.qty-stepper__btn:hover {
  background: var(--color-gray-100);
}

.qty-stepper__input {
  width: 48px;
  height: 36px;
  text-align: center;
  border: none;
  border-left: 1px solid var(--color-gray-400);
  border-right: 1px solid var(--color-gray-400);
  font-family: var(--font-family);
  font-size: var(--text-base);
}

.qty-stepper__input:focus {
  outline: none;
}

/* === Shop Order Summary === */
.order-summary {
  background: var(--color-white);
  border-radius: var(--border-radius-md);
  border: 1px solid var(--color-gray-200);
  padding: var(--space-5);
}

.order-summary__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-2) 0;
  font-size: var(--text-sm);
}

.order-summary__row--total {
  border-top: 2px solid var(--color-black);
  margin-top: var(--space-2);
  padding-top: var(--space-3);
  font-size: var(--text-lg);
  font-weight: var(--font-bold);
}

/* === Category Chips === */
.category-chips {
  display: flex;
  gap: var(--space-2);
  overflow-x: auto;
  padding: var(--space-3) 0;
  -webkit-overflow-scrolling: touch;
}

.category-chip {
  padding: var(--space-2) var(--space-4);
  border-radius: var(--border-radius-full);
  font-size: var(--text-sm);
  white-space: nowrap;
  border: 1px solid var(--color-gray-400);
  color: var(--color-gray-800);
  text-decoration: none;
  background: var(--color-white);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.category-chip:hover,
.category-chip.active {
  background: var(--color-primary);
  color: var(--color-white);
  border-color: var(--color-primary);
  text-decoration: none;
}

/* === Shop Sticky Bottom Bar === */
.sticky-bottom {
  position: fixed;
  bottom: var(--mobile-bottom-nav-height);
  left: 0;
  right: 0;
  background: var(--color-white);
  border-top: 1px solid var(--color-gray-200);
  padding: var(--space-3) var(--space-4);
  z-index: 95;
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.sticky-bottom__total {
  flex: 1;
}

.sticky-bottom__label {
  font-size: var(--text-xs);
  color: var(--color-gray-600);
}

.sticky-bottom__amount {
  font-size: var(--text-lg);
  font-weight: var(--font-bold);
}

/* === Responsive: Shop === */
@media (max-width: 767px) {
  /* Mobile: hide top nav, show bottom nav */
  .shop-topnav {
    display: none;
  }

  .layout-body--shop {
    padding-top: var(--mobile-header-height);
  }
}

@media (min-width: 768px) {
  .product-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-4);
  }

  .sticky-bottom {
    bottom: 0;
  }

  .shop-topnav {
    top: var(--mobile-header-height);
  }

  .layout-body--shop {
    padding-top: calc(var(--mobile-header-height) + 48px);
  }
}

@media (min-width: 1024px) {
  .product-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-6);
  }

  .header--shop {
    height: var(--header-height);
    padding: 0 var(--space-6);
  }

  .shop-topnav {
    top: var(--header-height);
  }

  .layout-body--shop {
    padding-top: calc(var(--header-height) + 48px);
  }
}
