/**
 * HeadCode Theme - Easy Digital Downloads (EDD) Store CSS
 * Product cards, pricing tags, tech stack badges, download buttons, checkout and single download layout.
 * @package HeadCode
 */

/* ==========================================================================
   Product Cards & Store Grid
   ========================================================================== */

.hc-product-card {
  position: relative;
  background-color: var(--hc-bg-surface-1);
  border: 1px solid var(--hc-border-subtle);
  border-radius: var(--hc-radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: var(--hc-transition);
}

.hc-product-card:hover {
  transform: translateY(-4px);
  border-color: var(--hc-border-accent);
  box-shadow: var(--hc-shadow-lg);
}

.hc-product-card__thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  background-color: var(--hc-bg-surface-2);
  overflow: hidden;
}

.hc-product-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.hc-product-card:hover .hc-product-card__thumb img {
  transform: scale(1.04);
}

.hc-product-card__price-tag {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 4px 10px;
  border-radius: var(--hc-radius-full);
  font-family: var(--hc-font-mono);
  font-size: var(--hc-text-xs);
  font-weight: 700;
  box-shadow: var(--hc-shadow-sm);
  z-index: 2;
}

.hc-product-card__price-tag--free {
  background-color: var(--hc-accent-emerald);
  color: #ffffff;
}

.hc-product-card__price-tag--paid {
  background-color: var(--hc-accent-blue);
  color: #ffffff;
}

.hc-product-card__content {
  padding: var(--hc-space-5);
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.hc-product-card__tech {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: var(--hc-space-3);
}

.hc-tech-chip {
  padding: 2px 8px;
  border-radius: var(--hc-radius-sm);
  background-color: var(--hc-bg-surface-2);
  border: 1px solid var(--hc-border-subtle);
  font-family: var(--hc-font-mono);
  font-size: 11px;
  color: var(--hc-text-secondary);
}

.hc-product-card__title {
  font-size: var(--hc-text-lg);
  font-weight: 700;
  margin-bottom: var(--hc-space-2);
  line-height: 1.35;
}

.hc-product-card__title a {
  color: var(--hc-text-primary);
}

.hc-product-card__title a:hover {
  color: var(--hc-accent-cyan);
}

.hc-product-card__desc {
  font-size: var(--hc-text-sm);
  color: var(--hc-text-secondary);
  line-height: 1.5;
  margin-bottom: var(--hc-space-4);
  flex-grow: 1;
}

.hc-product-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: var(--hc-space-4);
  border-top: 1px solid var(--hc-border-subtle);
}

/* ==========================================================================
   Single Download / Product Page
   ========================================================================== */

.hc-download-header {
  margin-bottom: var(--hc-space-8);
}

.hc-download-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--hc-space-2);
  margin-bottom: var(--hc-space-3);
}

.hc-download-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--hc-space-8);
}

@media (min-width: 992px) {
  .hc-download-layout {
    grid-template-columns: minmax(0, 1fr) 380px;
    gap: var(--hc-space-10);
    align-items: start;
  }
}

.hc-download-main-preview {
  border-radius: var(--hc-radius-lg);
  overflow: hidden;
  border: 1px solid var(--hc-border-strong);
  margin-bottom: var(--hc-space-8);
  aspect-ratio: 16 / 9;
  background-color: var(--hc-bg-surface-2);
}

.hc-download-main-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Purchase Sidebar Box */
.hc-purchase-box {
  background-color: var(--hc-bg-surface-1);
  border: 1px solid var(--hc-border-strong);
  border-radius: var(--hc-radius-xl);
  padding: var(--hc-space-6);
  position: sticky;
  top: calc(var(--hc-header-height) + 24px);
  box-shadow: var(--hc-shadow-md);
}

.hc-purchase-box__pricing {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: var(--hc-space-4);
  padding-bottom: var(--hc-space-4);
  border-bottom: 1px solid var(--hc-border-subtle);
}

.hc-purchase-box__amount {
  font-family: var(--hc-font-mono);
  font-size: 2.25rem;
  font-weight: 800;
  color: var(--hc-text-primary);
}

.hc-purchase-box__meta-list {
  list-style: none;
  padding: 0;
  margin: var(--hc-space-4) 0;
  display: flex;
  flex-direction: column;
  gap: var(--hc-space-3);
  font-size: var(--hc-text-sm);
  color: var(--hc-text-secondary);
}

.hc-purchase-box__meta-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.hc-purchase-box__meta-item span:first-child {
  color: var(--hc-text-muted);
}

.hc-purchase-box__meta-item span:last-child {
  font-family: var(--hc-font-mono);
  color: var(--hc-text-primary);
  font-weight: 600;
}

/* Trust Guarantee Badge */
.hc-trust-badge {
  display: flex;
  align-items: center;
  gap: var(--hc-space-3);
  padding: var(--hc-space-3) var(--hc-space-4);
  background-color: var(--hc-accent-emerald-soft);
  border: 1px solid rgba(5, 150, 105, 0.25);
  border-radius: var(--hc-radius-md);
  margin-top: var(--hc-space-4);
  font-size: var(--hc-text-xs);
  color: var(--hc-accent-emerald);
}

/* ==========================================================================
   EDD Native Form and Button Overrides
   ========================================================================== */

.edd-submit,
.edd-add-to-cart,
input[type="submit"].edd-submit,
.edd_download_purchase_form .edd-add-to-cart {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  padding: 0.85rem 1.5rem !important;
  min-height: 48px !important;
  border-radius: var(--hc-radius-md) !important;
  background: linear-gradient(135deg, var(--hc-accent-cyan) 0%, var(--hc-accent-blue) 100%) !important;
  color: #ffffff !important;
  font-size: var(--hc-text-base) !important;
  font-weight: 700 !important;
  border: none !important;
  cursor: pointer !important;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35) !important;
  transition: var(--hc-transition) !important;
  text-decoration: none !important;
}

.edd-submit:hover,
.edd-add-to-cart:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 6px 20px rgba(56, 189, 248, 0.45) !important;
}

.edd_cart_item,
#edd_checkout_cart,
#edd_checkout_form_wrap {
  background-color: var(--hc-bg-surface-1) !important;
  border: 1px solid var(--hc-border-subtle) !important;
  border-radius: var(--hc-radius-lg) !important;
  color: var(--hc-text-primary) !important;
}

#edd_checkout_cart th,
#edd_checkout_cart td {
  border-color: var(--hc-border-subtle) !important;
  padding: 12px 16px !important;
}
