/* ==============================================================
   IRON AMINO LABS — Cart Components
   Header cart icon + floating bottom cart bar
   ============================================================== */

/* ===== HEADER CART ICON ===== */
.ial-header-cart {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  color: var(--ink);
  text-decoration: none;
  padding: 8px;
  border-radius: 10px;
  transition: color 0.25s, background 0.25s;
  margin-left: 8px;
}

.ial-header-cart:hover {
  color: var(--readout);
  background: var(--elev);
}

.ial-header-cart-icon {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ial-header-cart-badge {
  position: absolute;
  top: -6px;
  right: -8px;
  min-width: 18px;
  height: 18px;
  border-radius: 100px;
  background: var(--mut-2);
  color: #000;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  line-height: 1;
  opacity: 0;
  transform: scale(0.5);
  transition: opacity 0.3s cubic-bezier(0.34,1.56,0.64,1),
              transform 0.3s cubic-bezier(0.34,1.56,0.64,1),
              background 0.25s;
  pointer-events: none;
}

.ial-header-cart-badge.has-items {
  opacity: 1;
  transform: scale(1);
  background: var(--readout);
}

/* Pulse animation on update */
@keyframes ial-badge-pulse {
  0% { transform: scale(1); }
  40% { transform: scale(1.35); }
  100% { transform: scale(1); }
}

.ial-header-cart-badge.ial-pulse {
  animation: ial-badge-pulse 0.4s cubic-bezier(0.34,1.56,0.64,1);
}

/* ===== FLOATING BOTTOM CART BAR ===== */
.ial-bottom-cart {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100000;
  padding: 0 20px 20px;
  pointer-events: none;
  transform: translateY(120%);
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1), bottom 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.ial-bottom-cart.is-visible {
  transform: translateY(0);
  pointer-events: auto;
}

.ial-bottom-cart-inner {
  max-width: 720px;
  margin: 0 auto;
  background: rgba(14, 17, 20, 0.92);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: 0 -4px 40px -12px rgba(0,0,0,0.7),
              0 0 0 1px rgba(127,231,212,0.04);
}

/* Slide-up entrance animation */
@keyframes ial-bar-entrance {
  from {
    transform: translateY(40px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.ial-bottom-cart.ial-bar-animate .ial-bottom-cart-inner {
  animation: ial-bar-entrance 0.5s cubic-bezier(0.34,1.56,0.64,1);
}

/* ===== LEFT: INFO ===== */
.ial-bottom-cart-info {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.ial-bottom-cart-badge-wrap {
  position: relative;
  color: var(--readout);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: var(--readout-dim);
  border: 1px solid rgba(127,231,212,0.15);
  border-radius: 12px;
  flex-shrink: 0;
}

.ial-bottom-cart-count {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 18px;
  height: 18px;
  border-radius: 100px;
  background: var(--readout);
  color: #06201b;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  line-height: 1;
}

.ial-bottom-cart-summary {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.ial-bottom-cart-label {
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
}

.ial-bottom-cart-total {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 700;
  color: var(--readout);
  letter-spacing: -0.01em;
}

/* ===== CENTER: ITEM THUMBNAILS ===== */
.ial-bottom-cart-items {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
  justify-content: center;
  padding: 0 8px;
}

.ial-bottom-cart-item {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 6px 10px 6px 6px;
  max-width: 180px;
  min-width: 0;
  flex-shrink: 1;
}

.ial-bottom-cart-item-img {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--elev);
}

.ial-bottom-cart-item-name {
  font-family: var(--font);
  font-size: 11px;
  font-weight: 500;
  color: var(--mut);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.ial-bottom-cart-item-qty {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  color: var(--readout);
  flex-shrink: 0;
  opacity: 0.7;
}

.ial-bottom-cart-more {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--mut-2);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ===== RIGHT: VIEW CART BUTTON ===== */
.ial-bottom-cart-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--readout);
  color: #06201b;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 700;
  padding: 10px 18px;
  border-radius: 10px;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.25s, box-shadow 0.25s, transform 0.2s;
  box-shadow: 0 0 16px -4px rgba(127,231,212,0.25);
}

.ial-bottom-cart-btn:hover {
  background: #96f0df;
  box-shadow: 0 0 24px -4px rgba(127,231,212,0.4);
  transform: translateY(-1px);
  color: #06201b;
}

.ial-bottom-cart-btn:active {
  transform: translateY(0);
}

/* ===== RESPONSIVE ===== */
/* On product pages, offset above the product sticky bar only if active */
.single-product .ial-bottom-cart {
  bottom: 0;
}
.single-product.has-stickybar-active .ial-bottom-cart {
  bottom: 110px;
}

@media (max-width: 768px) {
  .ial-bottom-cart {
    padding: 0 16px 16px;
  }
  .ial-bottom-cart-inner {
    padding: 12px 14px;
    gap: 10px;
    border-radius: 14px;
  }
  .ial-bottom-cart-items {
    display: none;
  }
  .ial-bottom-cart-btn {
    padding: 10px 16px;
    font-size: 12px;
  }
  .ial-bottom-cart-badge-wrap {
    width: 36px;
    height: 36px;
    border-radius: 10px;
  }
  .single-product .ial-bottom-cart {
    bottom: 0;
  }
  .single-product.has-stickybar-active .ial-bottom-cart {
    bottom: 110px;
  }
}

@media (max-width: 480px) {
  .ial-bottom-cart-summary {
    flex-direction: row;
    align-items: center;
    gap: 8px;
  }
  .ial-bottom-cart-label {
    font-size: 12px;
  }
  .ial-bottom-cart-total {
    font-size: 13px;
  }
}
