/**
 * Product Component Styles
 * Reusable styles for shop products across the application
 * @version 1.0.0
 * @updated 2026-02-12
 */

/* ================================================
   PRODUCT CARD GRID (Vertical) - Bootstrap Grid
   ================================================ */

.product-card-grid {
    background: var(--bg-primary);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    position: relative;
    height: 100%;
}

.product-card-grid:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.product-card-grid .product-image-wrapper {
    height: 140px;
}

.product-card-grid .product-details {
    padding: 12px;
}

.product-card-grid .product-name {
    font-size: 14px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0;
}

.product-card-grid .product-price {
    font-size: 16px;
}

/* ================================================
   PRODUCT CARD HORIZONTAL (Slider)
   ================================================ */

.product-scroll {
    display: flex !important;
    gap: 1rem !important;
    overflow-x: auto !important;
    scroll-behavior: smooth !important;
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
    padding: 0 1rem 1rem !important;
}

.product-scroll::-webkit-scrollbar {
    display: none !important;
}

.product-card-horizontal {
    flex: 0 0 auto;
    width: calc(100vw - 32px);
    max-width: 380px;
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    text-decoration: none;
    color: inherit;
}

.product-card-horizontal:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-color: var(--border-hover);
}

@media (min-width: 640px) {
    .product-card-horizontal {
        width: 360px;
    }
}

/* ================================================
   PRODUCT IMAGE
   ================================================ */

.product-image-wrapper {
    position: relative;
    width: 100%;
    height: 180px;
    overflow: hidden;
    background: var(--bg-secondary);
    flex-shrink: 0;
}

.product-card-horizontal .product-image-wrapper {
    width: 40%;
    height: 100%;
}

.product-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.product-card-grid:hover .product-image,
.product-card-horizontal:hover .product-image {
    transform: scale(1.05);
}

/* ================================================
   PRODUCT DETAILS
   ================================================ */

.product-details {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.product-card-horizontal .product-details {
    padding: 16px;
    justify-content: space-between;
}

.product-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 8px 0;
    line-height: 1.3;
}

.product-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.4;
}

.product-card-horizontal .product-title {
    font-size: 1rem;
    -webkit-line-clamp: 3;
}

.product-seller {
    font-size: 0.75rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.375rem;
    margin: 0;
}

.product-seller i {
    font-size: 14px;
}

.seller-row {
    font-size: 13px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0 0 8px 0;
}

.product-pricing,
.product-price-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.product-price {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.product-card-horizontal .product-price {
    font-size: 1.125rem;
}

.product-old-price {
    font-size: 0.8125rem;
    color: var(--text-tertiary);
    text-decoration: line-through;
}

.product-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}

.product-rating {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--text-secondary);
}

.product-rating i,
.rating-star {
    color: #f97316;
    font-size: 14px;
}

.product-action-btn {
    background: transparent;
    border: 1px solid var(--border-light);
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.product-action-btn:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.product-card-horizontal .product-action-btn {
    padding: 8px 16px;
    font-size: 14px;
}

/* ================================================
   PRODUCT BADGES
   ================================================ */

.discount-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: var(--danger);
    color: white;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    z-index: 2;
}

.product-bookmark,
.bookmark-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 2;
}

.product-bookmark:hover,
.bookmark-btn:hover {
    background: white;
    transform: scale(1.1);
}

.product-bookmark.bookmarked,
.bookmark-btn.bookmarked {
    color: var(--primary);
}

.product-bookmark i,
.bookmark-btn i {
    font-size: 18px;
}

/* ================================================
   EMPTY STATE
   ================================================ */

.empty-state {
    text-align: center;
    padding: 48px 32px;
    color: var(--text-secondary);
}

.empty-icon {
    font-size: 64px;
    opacity: 0.3;
    margin-bottom: 16px;
    display: block;
}

.empty-message,
.empty-state-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.empty-subtitle,
.empty-state-text {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
}

/* ================================================
   SKELETON LOADING
   ================================================ */

.skeleton {
    background: var(--bg-tertiary);
    border-radius: 4px;
    animation: shimmer 1.5s infinite;
}

.skeleton-image {
    width: 100%;
    height: 180px;
    background: var(--bg-tertiary);
}

.skeleton-text {
    height: 16px;
    background: var(--bg-tertiary);
    margin-bottom: 8px;
}

.skeleton-text.short {
    width: 60%;
}

@keyframes shimmer {
    0% { opacity: 1; }
    50% { opacity: 0.6; }
    100% { opacity: 1; }
}

/* ================================================
   RESPONSIVE
   ================================================ */

@media (max-width: 640px) {
    .product-card-horizontal {
        flex-direction: column;
        max-width: 280px;
    }
    
    .product-card-horizontal .product-image-wrapper {
        width: 100%;
        height: 160px;
    }
}
