/* ========================================
   Product Card — Profile-style Design
   ======================================== */

.product-table-item {
  border-radius: 16px;
  border: 1px solid #e5e7eb;
  background-color: #ffffff;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  display: flex;
  flex-direction: column;
  cursor: default;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  height: auto;
}

.product-table-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(59, 130, 246, 0.12);
}

/* ---- Header: Avatar + Name ---- */
.pc-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 20px 12px;
}

.pc-avatar-wrap {
  position: relative;
  flex-shrink: 0;
}

.pc-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #e5e7eb;
  background: #f3f4f6;
}

.pc-avatar.out-of-stock {
  filter: grayscale(100%);
  opacity: 0.5;
}

.pc-verified-badge {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 20px;
  height: 20px;
  background: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.pc-verified-badge svg {
  width: 16px;
  height: 16px;
}

.pc-name-area {
  min-width: 0;
  flex: 1;
}

.pc-name {
  font-size: 15px;
  font-weight: 700;
  color: #111827;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pc-published {
  font-size: 10px;
  font-weight: 600;
  color: #9ca3af;
  letter-spacing: 0.5px;
  margin-top: 2px;
  text-transform: uppercase;
}

/* ---- Divider ---- */
.pc-divider {
  height: 1px;
  background: #f0f0f0;
  margin: 0 20px;
}

/* ---- Stats Row ---- */
.pc-stats-row {
  display: flex;
  justify-content: space-around;
  padding: 14px 16px;
  gap: 4px;
}

.pc-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex: 1;
}

.pc-stat-label {
  font-size: 10px;
  font-weight: 600;
  color: #9ca3af;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.pc-stat-value {
  font-size: 15px;
  font-weight: 700;
  color: #3b82f6;
}

/* ---- Footer: Price + Button ---- */
.pc-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px 18px;
  gap: 12px;
}

.pc-price-area {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.pc-price-label {
  font-size: 11px;
  color: #9ca3af;
  font-weight: 400;
}

.pc-price {
  font-size: 18px;
  font-weight: 800;
  color: #111827;
  line-height: 1.2;
}

/* View Profile Button — outlined blue */
.view-product-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 18px;
  border: 2px solid #3b82f6;
  border-radius: 10px;
  background: transparent;
  color: #3b82f6;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.25s ease;
  text-decoration: none;
}

.view-product-btn:hover {
  background: #3b82f6;
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.35);
  transform: translateY(-1px);
}

/* ---- Stock Badge (hidden by default, shown when needed) ---- */
.stock-badge {
  position: absolute;
  width: 28px;
  height: 28px;
  top: 12px;
  right: 12px;
  background-color: var(--yellow-color1, #facc15);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  color: black;
  padding: 6px 7.5px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 400;
}

.stock-badge.out-of-stock-badge {
  width: auto;
  height: 28px;
  background-color: var(--secondary-red, #ef4444);
  background-image: var(--secondary-red-gradient, none);
  color: white;
  padding: 0 10px;
  font-weight: 600;
  white-space: nowrap;
  border: none;
}

/* ---- Image & Links ---- */
.product-image-container a,
.product-card-content a,
.view-product-btn {
  cursor: pointer;
}

/* ---- Favorite Icon ---- */
.favorite-icon .heart-outline {
  opacity: 1;
}

.favorite-icon .heart-fill {
  opacity: 0;
}

.favorite-icon.is-favorite .heart-outline {
  opacity: 0;
}

.favorite-icon.is-favorite .heart-fill {
  opacity: 1;
}

.favorite-icon.is-favorite .heart-fill path {
  fill: white !important;
}

.favorite-icon:hover .heart-outline {
  opacity: 0;
}

.favorite-icon:hover .heart-fill {
  opacity: 1;
}

.favorite-icon:hover .heart-fill path {
  fill: white !important;
}

.favorite-icon.is-favorite:hover .heart-outline {
  opacity: 0;
}

.favorite-icon.is-favorite:hover .heart-fill {
  opacity: 1;
}

/* ---- Skeleton ---- */
.skeleton-container {
  position: relative;
  overflow: hidden;
}

.skeleton-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  aspect-ratio: 16/9;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s ease-in-out infinite;
  border-radius: 8px 8px 0 0;
  z-index: 1;
  pointer-events: none;
}

.skeleton-container .product-image-loading {
  opacity: 0 !important;
  transition: opacity 0.4s ease-in;
}

.product-image-container:not(.skeleton-container) .product-image-loading {
  opacity: 1 !important;
}

@keyframes skeleton-loading {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}

.product-card-content {
  padding: 12px;
}

/* ---- Responsive ---- */
@media (max-width: 575.98px) {
  .product-table-item {
    border-radius: 12px;
    padding: 12px 10px 12px 64px; /* 64px left padding for avatar */
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    min-height: 74px;
  }

  /* Avatar positioned left center */
  .pc-header {
    padding: 0;
    gap: 0;
    margin: 0;
    display: block;
  }

  .pc-avatar-wrap {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
  }

  .pc-avatar {
    width: 44px;
    height: 44px;
  }

  .pc-verified-badge {
    width: 16px;
    height: 16px;
    bottom: -2px;
    right: -2px;
  }
  .pc-verified-badge svg { width: 12px; height: 12px; }

  /* Title naturally flows, reserve right space for price/button */
  .pc-name-area {
    padding-right: 90px;
  }

  .pc-name {
    font-size: 13px;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .pc-published { display: none; } /* Hide to save space */
  .pc-divider { display: none; }

  /* Stats compressed */
  .pc-stats-row {
    padding: 0;
    justify-content: flex-start;
    gap: 12px;
  }

  .pc-stat {
    flex-direction: row;
    align-items: center;
    gap: 3px;
  }

  .pc-stat-label {
    font-size: 9px;
    color: #6b7280;
  }

  .pc-stat-value {
    font-size: 11px;
  }

  /* Footer (Price & Button) absolutely positioned right center */
  .pc-footer {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    padding: 0;
    margin: 0;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
  }

  .pc-price-area {
    text-align: right;
  }

  .pc-price-label { display: none; }

  .pc-price {
    font-size: 15px;
    line-height: 1;
  }

  .view-product-btn {
    padding: 5px 12px;
    font-size: 11px;
    border-radius: 6px;
    border-width: 1px;
    width: auto;
  }

  .favorite-icon {
    display: none;
  }

  .product-table-item .guarantee-badge {
    display: none; /* Hide guarantees on mobile to keep compact */
  }

  .stock-badge {
    position: absolute;
    top: -4px;
    left: 4px;
    z-index: 2;
    transform: scale(0.7);
  }
}

/* Medium devices */
@media (min-width: 576px) and (max-width: 991.98px) {
  .product-card-content {
    padding: 12px;
  }

  .favorite-icon {
    width: 34px;
    height: 34px;
  }

  .product-table-item .guarantee-badge {
    font-size: 10px;
    min-width: 60px;
  }
}

/* Large devices */
@media (min-width: 992px) {
  .product-card-content {
    padding: 12px;
  }

  .favorite-icon {
    width: 32px;
    height: 32px;
  }
}