/* ==========================================================================
   ICCON Sticky Add-to-Cart Bar
   Fixed bar at bottom of single product pages
   ========================================================================== */

.iccon-sticky-cart {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9998;
  background: var(--iccon-white, #fff);
  border-top: 1px solid var(--iccon-border, #E2E5EB);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: var(--font-primary, 'Inter', sans-serif);
}

.iccon-sticky-cart.visible {
  transform: translateY(0);
}

.iccon-sticky-cart-inner {
  max-width: var(--container-max, 1320px);
  margin: 0 auto;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.iccon-sticky-cart-product {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

.iccon-sticky-cart-img {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
  border: 1px solid var(--iccon-border-light, #F0F1F3);
}

.iccon-sticky-cart-img img {
  width: 100%;
  height: 100%;
  object-fit: contain; /* never crop a product shot, even at 48px */
  padding: 2px;
  background: var(--iccon-off-white, #F7F8FA);
}

.iccon-sticky-cart-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.iccon-sticky-cart-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--iccon-text, #1A1A2E);
  /* Client: product names must never be cut short with "…" — wrap the full
     name instead of truncating it. */
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  overflow-wrap: break-word;
  line-height: 1.25;
}

.iccon-sticky-cart-price {
  font-size: 0.95rem;
  font-weight: 700;
  /* Never break a price mid-number ("€75.9 9") when the name wraps beside it */
  white-space: nowrap;
  color: var(--iccon-navy, #1B2A4A);
}

.iccon-sticky-cart-price del {
  color: var(--iccon-text-muted, #94A3B8);
  font-weight: 400;
  font-size: 0.82rem;
}

.iccon-sticky-cart-price ins {
  text-decoration: none;
  color: var(--iccon-red, #EF4444);
}

.iccon-sticky-cart-actions {
  flex-shrink: 0;
}

/* WooCommerce's add-to-cart.js appends a "View cart" link after an AJAX add.
   In this one-row bar it crushed the product name to one letter wide and the
   bar grew to ~370px tall (client's Galaxy, 24 Sep 2026). The add is already
   confirmed by the tick flash and the header basket count, so hide it here. */
.iccon-sticky-cart .added_to_cart {
  display: none;
}

.iccon-sticky-cart-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 28px;
  background: #0B7A53;
  color: white !important;
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
  border-radius: 10px;
  transition: all 0.25s ease;
  white-space: nowrap;
  cursor: pointer;
  border: none;
  letter-spacing: 0.01em;
}

.iccon-sticky-cart-btn:hover {
  background: #085E40;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(43, 182, 115, 0.3);
  color: white !important;
}

.iccon-sticky-cart-btn-oos {
  background: var(--iccon-text-dim, #CBD5E1);
  cursor: not-allowed;
}

.iccon-sticky-cart-btn-oos:hover {
  background: var(--iccon-text-dim, #CBD5E1);
  transform: none;
  box-shadow: none;
}

/* Hide on mobile admin bar */
.admin-bar .iccon-sticky-cart {
  /* Don't overlap admin bar */
}

@media (max-width: 480px) {
  /* Phones: product name on its own top row, in regular weight, running up to
     the left edge of the button column and wrapping there when long; image,
     price and button on the row below (client, 24 Sep 2026). `display: contents`
     lets the name, image and price sit directly on the grid without changing
     the HTML. */
  .iccon-sticky-cart-inner {
    display: grid;
    grid-template-columns: auto 1fr auto;
    grid-template-areas:
      "name name ."
      "img price btn";
    align-items: center;
    gap: 6px 12px;
    padding: 8px 12px;
  }

  .iccon-sticky-cart-product,
  .iccon-sticky-cart-info {
    display: contents;
  }

  /* Run the name right up to the button's left edge (through the 12px column
     gap) so it only wraps where the button starts. */
  .iccon-sticky-cart-name { grid-area: name; margin-right: -12px; }
  .iccon-sticky-cart-img { grid-area: img; }
  .iccon-sticky-cart-price { grid-area: price; }
  .iccon-sticky-cart-actions { grid-area: btn; }

  .iccon-sticky-cart-img {
    width: 40px;
    height: 40px;
  }

  .iccon-sticky-cart-name {
    font-size: 0.78rem;
    font-weight: 400;
  }

  .iccon-sticky-cart-btn {
    min-height: 44px; /* touch target */
    padding: 10px 14px;
    font-size: 0.82rem;
  }
}
