/**
 * Sticky cart bar — mobile-only bottom action bar for product pages.
 * Visible at viewports ≤ 768px; hidden on tablet/desktop where the
 * sidebar purchase card lives next to the article.
 *
 * Class prefix: .hg-scb-* ("sticky cart bar")
 */

.hg-scb {
  display: none;
}

@media (max-width: 768px) {
  .hg-scb {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 100000000035;
    background: #fff;
    border-top: 1px solid #d8e2dd;
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.12);
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
    transform: translateY(110%);
    transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: inherit;
  }
  .hg-scb.is-open {
    transform: translateY(0);
  }
  .hg-scb[hidden] {
    display: none;
  }

  .hg-scb-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
  }
  .hg-scb-cover {
    flex-shrink: 0;
    display: block;
    width: 40px;
    height: 54px;
    border-radius: 4px;
    overflow: hidden;
    background: #e8f4ee;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  }
  .hg-scb-cover img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
  .hg-scb-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.25;
  }
  .hg-scb-name {
    font-size: 13px;
    font-weight: 700;
    color: #1e2e22;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .hg-scb-price {
    font-size: 13px;
    color: #5a6b60;
    margin-top: 1px;
  }

  .hg-scb-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
  }
  .hg-scb-btn {
    min-height: 40px;
    padding: 0 14px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
  }
  .hg-scb-btn-add {
    background: #fff;
    color: #1a6b4a;
    border: 2px solid #1a6b4a;
  }
  .hg-scb-btn-add:hover { background: #e8f4ee; }
  .hg-scb-btn-add[data-in-cart="true"] {
    background: #e8f4ee;
    color: #145a3e;
  }
  .hg-scb-btn-add[data-in-cart="true"] span::before {
    content: "✓ ";
  }
  .hg-scb-btn-add.is-pulsing {
    animation: hg-scb-pulse 0.6s ease;
  }
  .hg-scb-btn-buy {
    background: #1a6b4a;
    color: #fff;
  }
  .hg-scb-btn-buy:hover { background: #145a3e; }
  .hg-scb-btn-buy:disabled { opacity: 0.6; cursor: wait; }

  @keyframes hg-scb-pulse {
    0%   { transform: scale(1); }
    40%  { transform: scale(1.06); background: #e8f4ee; }
    100% { transform: scale(1); }
  }
}

@media print {
  .hg-scb { display: none !important; }
}
