/**
 * File: css/add-to-cart-card.css
 * Description: Styles for the add-to-cart confirmation card (#12), rendered by
 *              inc/features/add-to-cart-card.php and driven by js/add-to-cart-card.js.
 * Version: 1.0.0
 * Last Modified: 2026-07-29
 *
 * ===========================================
 * Table of Contents:
 * ===========================================
 * 1. Card Container & Visibility
 * 2. Auto-dismiss Progress Bar
 * 3. Header Row (tick, title, close)
 * 4. Product Row (thumb, name, price)
 * 5. Meta & Actions
 * 6. Reduced Motion
 */

/* ===========================================
 * 1. Card Container & Visibility
 * =========================================== */

.epic-atc-card {
  position: fixed;
  z-index: 100000;
  top: 84px;
  right: 16px;
  width: 340px;
  max-width: calc(100vw - 24px);
  padding: 14px 16px 16px;
  background: #ffffff;
  border-radius: 14px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.18);
  font-family: inherit;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none; /* Non-interactive until shown */
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.epic-atc-card.epic-atc-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* Full-width sheet at the bottom on mobile */
@media (max-width: 782px) {
  .epic-atc-card {
    top: auto;
    right: 12px;
    bottom: 12px;
    left: 12px;
    width: auto;
    transform: translateY(20px);
  }

  .epic-atc-card.epic-atc-visible {
    transform: translateY(0);
  }
}

/* ===========================================
 * 2. Auto-dismiss Progress Bar
 * ===========================================
 * Width is animated from scaleX(1) to scaleX(0) by the script over the
 * auto-hide delay; it pauses on hover/focus.
 */

.epic-atc-progress {
  position: absolute;
  top: 0;
  left: 0;
  height: 3px;
  width: 100%;
  background: #00a2ff;
  border-radius: 14px 14px 0 0;
  transform-origin: left;
}

/* ===========================================
 * 3. Header Row (tick, title, close)
 * =========================================== */

.epic-atc-row1 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.epic-atc-tick {
  width: 22px;
  height: 22px;
  min-width: 22px;
  border-radius: 50%;
  background: #0077cc;
  display: flex;
  align-items: center;
  justify-content: center;
}

.epic-atc-title {
  flex: 1;
  font-weight: 600;
  font-size: 14px;
  color: #222;
}

/* Negative margin keeps the 44px touch target without inflating the row */
.epic-atc-close {
  background: none;
  border: none;
  font-size: 20px;
  line-height: 1;
  color: #999;
  cursor: pointer;
  padding: 8px;
  margin: -8px;
  min-width: 44px;
  min-height: 44px;
}

/* ===========================================
 * 4. Product Row (thumb, name, price)
 * =========================================== */

.epic-atc-row2 {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 8px;
}

.epic-atc-thumb {
  width: 56px;
  height: 56px;
  min-width: 56px;
  border-radius: 8px;
  overflow: hidden;
  background: #f4f4f4;
}

.epic-atc-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.epic-atc-name {
  font-size: 13px;
  color: #333;
  line-height: 1.35;
  max-height: 36px; /* ~2 lines, longer titles clip */
  overflow: hidden;
}

.epic-atc-price {
  font-size: 13px;
  font-weight: 600;
  color: #0077cc;
  margin-top: 2px;
}

/* ===========================================
 * 5. Meta & Actions
 * =========================================== */

.epic-atc-meta {
  font-size: 12px;
  color: #777;
  margin-bottom: 12px;
}

.epic-atc-actions {
  display: flex;
  gap: 8px;
}

.epic-atc-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 10px 12px;
  min-height: 40px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}

.epic-atc-btn-primary {
  background: #0077cc;
  color: #ffffff;
}

.epic-atc-btn-secondary {
  background: #ffffff;
  color: #0077cc;
  border: 1.5px solid #0077cc;
}

/* ===========================================
 * 6. Reduced Motion
 * =========================================== */

@media (prefers-reduced-motion: reduce) {
  .epic-atc-card {
    transition: none;
  }

  .epic-atc-progress {
    transition: none !important;
  }
}
