/* Product Card Base */
.product-card {
    position: relative;
    /* border: 1px solid #eee; */ /* Removed border */
    border-radius: 0.75rem; /* Increased border-radius */
    overflow: hidden;
    background-color: #fff;
}


.product-cards-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem; /* 16px gap between cards */
    justify-content: center; /* Center cards if they don't fill the row */
    padding: 1rem; /* Padding around the wrapper */
}

.product-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

/* Thumbnail Section */
.product-card-thumbnail {
    position: relative;
    width: 100%;
    padding-top: 65%; /* Reduced height for images */
    overflow: hidden;
    background-color: #f0f0f0; /* Placeholder background */
    border-radius: 0.75rem 0.75rem 0 0; /* Match card border-radius */
}

.product-card-thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.2s ease-in-out; /* Removed transition for image scale */
}

.product-card:hover .product-card-thumbnail img { 
    transform: scale(1.05); /* Removed scale up image on hover */
}

.product-delivery-tag {
    background-color: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 0.1875rem 0.375rem; /* Reduced padding */
    border-radius: 0.25rem;
    font-size: 0.75rem;
}

.product-subscription-tag {
    background-color: rgba(0, 0, 0, 0.7); /* Changed to match product-delivery-tag */
    color: #fff;
    padding: 0.1875rem 0.375rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
}

/* Body Section */
.product-card-body {
    padding: 0.75rem 0.75rem 0 0.75rem; /* Reduced padding for a more compact look */
}

.product-card-title {
  font-size: 1rem; /* Slightly smaller */
  font-weight: normal;
  line-height: 1.4;
  margin-bottom: 0.375rem;
  white-space: normal; /* 여러 줄로 표시 */
  display: -webkit-box;
  -webkit-line-clamp: 1; /* 두 줄로 제한 */
  -webkit-box-orient: vertical;
  overflow: hidden; /* 넘치는 텍스트 숨김 */
  text-overflow: ellipsis; /* 넘치는 텍스트에 말줄임표 표시 */
}

.product-card-brand {
    color: #777; /* Softer color */
    margin-bottom: 0.375rem; /* Reduced margin */
    display: flex !important; /* Added for alignment */
    flex-direction: row !important; /* Explicitly set to row */
    align-items: center; /* Added for alignment */
    gap: 0.5rem; /* Gap between icon and text group */
}

.product-brand-icon {
    width: 2.375rem; /* Increased to 42px */
    height: 2.375rem; /* 42px -> 2.625rem */
    display: inline-block; /* Ensure it behaves as an inline block */
    flex-shrink: 0; /* Prevent shrinking */
}

.brand-text-group {
    display: flex;
    flex-direction: column; /* Stack brand name and subscriptions vertically */
}

.brand-name {
    font-size: 0.9rem; /* Reverted to 0.85rem */
    color: #777;
    line-height: 1.2;
}

.brand-subscriptions {
    font-size: 0.75rem; /* Reverted to 0.75rem */
    color: #a0a0a0;
    line-height: 1.2;
}

.product-card-price-info {
    display: flex;
    align-items: baseline;
}

.product-price {
    font-size: 1.2rem; /* Emphasized price */
    font-weight: 700;
    color: #333;
    margin-right: 0.5rem;
}

.product-discount {
    font-size: 0.8rem; /* Slightly smaller */
    color: #e60023; /* Red for discount */
    font-weight: 500;
}

.product-tags {
    display: flex;
    align-items: center;
    gap: 0.3rem; /* 태그 간 간격 */
}

.product-tags-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
    color: #999;
}

.product-metrics-group {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* Heart Button */
.product-card-heart-btn {
    background-color: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem; /* 호버 영역과 원형 배경을 위해 크기 지정 */
    height: 2.5rem;
    border-radius: 50%; /* 원형으로 만들기 */
}

.product-card-heart-btn:hover {
    background-color: #e9e9e9; /* 더 잘보이는 배경색 */
}

.product-card-heart-btn img {
    width: 1.5rem;
    height: 1.5rem;
    transition: transform 0.2s ease-in-out; /* 아이콘 전환 효과 */
}

.product-card-heart-btn:hover img {
    transform: scale(1.2); /* 아이콘 살짝 확대 */
}

.product-likes {
    font-size: 0.8rem;
    color: #999;
}

.product-delivery-tag,
.product-subscription-tag {
    background-color: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 0.375rem 0.375rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    line-height: 1;
}


[data-bs-theme="dark"] .product-card {
    background-color: #1e1e1e;
    border-color: #333;
}

[data-bs-theme="dark"] .product-card-title,
[data-bs-theme="dark"] .product-price {
    color: #f1f1f1;
}

[data-bs-theme="dark"] .product-card-brand,
[data-bs-theme="dark"] .product-card-meta {
    color: #aaa;
}

[data-bs-theme="dark"] .product-delivery-tag,
[data-bs-theme="dark"] .product-subscription-tag {
    background-color: rgba(255, 255, 255, 0.25);
    color: #f1f1f1;
}

[data-bs-theme="dark"] .product-card-heart-btn {
    background-color: transparent;
}

[data-bs-theme="dark"] .product-card-heart-btn:hover {
    background-color: #3a3a3a;
}

[data-bs-theme="dark"] .product-card-heart-btn img {
    filter: invert(1);
}

.no-col-padding > .col {
    padding-left: 0 !important;
}

/* 판매자 프로필 버튼 스타일 */
.btn-seller-profile {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    transition: transform 0.2s, opacity 0.2s;
    display: inline-block;
    line-height: 0;
    text-decoration: none;
}

.btn-seller-profile:hover {
    transform: scale(1.05);
    opacity: 0.9;
}

/* 접근성을 위한 포커스 스타일 */
.btn-seller-profile:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
    border-radius: 50%;
}

/* 다크 테마 지원 */
[data-bs-theme="dark"] .btn-seller-profile:focus {
    outline-color: #66b3ff;
}

/* 찜 토글 버튼 (찜 목록에서만 표시) */
.wishlist-toggle-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background-color: rgba(255, 255, 255, 0.95);
    border: none;
    border-radius: 50%;
    width: 2.25rem;
    height: 2.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.wishlist-toggle-btn:hover {
    background-color: rgba(255, 255, 255, 1);
    transform: scale(1.1);
}

.wishlist-toggle-btn.active:hover {
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

.wishlist-toggle-btn:active {
    transform: scale(0.95);
}

.wishlist-toggle-btn svg {
    width: 1.25rem;
    height: 1.25rem;
    transition: transform 0.2s ease;
}

.wishlist-toggle-btn:hover svg {
    transform: scale(1.1);
}

/* 다크 모드 지원 */
[data-bs-theme="dark"] .wishlist-toggle-btn {
    background-color: rgba(30, 30, 30, 0.95);
}

[data-bs-theme="dark"] .wishlist-toggle-btn:hover {
    background-color: rgba(30, 30, 30, 1);
}
