/* ============================================================================
   FlexERP - Header Cart + Dropdown ONLY
   File: flexerp/public/css/eshop-cart.css
   Purpose:
   - Styles for header cart button + badge
   - Styles for header dropdown mini-cart
   NOTE:
   - Do NOT put cart page (.fe-cart-*) styles here. Put them in eshop-cart-page.css
============================================================================ */

/* ============================================================================
   CART BUTTON (HEADER)
============================================================================ */
.header-cart {
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
}

.header-cart .icon {
  font-size: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.header-cart-badge {
  position: absolute;
  top: -8px;
  left: 12px;
  background: var(--primary);
  color: #fff;
  border-radius: 999px;
  min-width: 18px;
  height: 18px;
  padding: 0 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
}

.header-cart-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.header-cart-text .cart-label {
  opacity: 0.8;
  font-size: 13px;
}

.header-cart-text .header-cart-total {
  font-size: 13px;
  font-weight: 700;
}

/* ============================================================================
   CART DROPDOWN (HEADER)
============================================================================ */
.cart-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 360px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.18);
  z-index: 99999;
  overflow: hidden;
  display: none;
  flex-direction: column;
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.cart-dropdown.open {
  display: flex;
}

/* Optional: little arrow */
.cart-dropdown::before {
  content: "";
  position: absolute;
  top: -8px;
  right: 18px;
  width: 14px;
  height: 14px;
  background: #fff;
  transform: rotate(45deg);
  border-left: 1px solid rgba(0, 0, 0, 0.06);
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

/* Header row */
.cart-dropdown-header {
  padding: 14px 18px;
  background: #f8fafc;
  border-bottom: 1px solid #eef2f7;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #111827;
  font-weight: 800;
  font-size: 14px;
}

/* Items list */
.cart-items {
  flex: 1;
  max-height: 320px;
  overflow-y: auto;
}

/* Item row */
.cart-item {
  display: grid;
  grid-template-columns: 56px 1fr auto auto;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid #eef2f7;
  align-items: center;
}

.cart-item:last-child {
  border-bottom: none;
}

/* Image */
.cart-item-image {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  border: 1px solid #eef2f7;
  background: #f9fafb;
  object-fit: contain;
  display: block;
}

/* Info */
.cart-item-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.cart-item-title {
  font-weight: 800;
  font-size: 14px;
  color: #111827;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cart-item-sku,
.cart-item-qty {
  font-size: 12px;
  color: #6b7280;
}

/* Price */
.cart-item-price {
  align-self: end;
  font-weight: 900;
  color: #111827;
  font-size: 14px;
  white-space: nowrap;
}

/* Delete button */
.cart-item-delete {
  align-self: start;
  color: #ef4444;
  font-size: 18px;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 8px;
  line-height: 1;
  user-select: none;
}

.cart-item-delete:hover {
  background: rgba(239, 68, 68, 0.10);
}

/* Footer */
.cart-bottom {
  background: #fff;
  padding: 12px 0 14px;
  box-shadow: 0 -3px 12px rgba(0, 0, 0, 0.06);
  border-top: 1px solid #eef2f7;
}

/* Subtotal row */
.cart-subtotal {
  padding: 0 18px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 900;
  color: #111827;
}

.subtotal-amount {
  color: var(--primary);
}

/* Buttons */
.cart-btn-primary,
.cart-btn-secondary {
  width: calc(100% - 36px);
  margin: 6px 18px;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.cart-btn-primary {
  background: var(--primary);
  color: #fff;
  border: none;
}

.cart-btn-primary:hover {
  filter: brightness(0.95);
}

.cart-btn-secondary {
  background: #fff;
  color: #111827;
  border: 1px solid #d1d5db;
}

.cart-btn-secondary:hover {
  background: #f9fafb;
}

/* Empty state */
.cart-items .cart-empty {
  padding: 18px;
  text-align: center;
  color: #6b7280;
  font-size: 14px;
}
