/* ========================================
   SwaraPlace Product Card Styles v2.0
   Clean & CTR Optimized
   ======================================== */

.product-card {
    background-color: var(--swaraplace-white);
    border: 1px solid var(--swaraplace-gray-200);
    border-radius: var(--swaraplace-radius-lg);
    overflow: hidden;
    transition: var(--swaraplace-transition);
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    box-shadow: var(--swaraplace-shadow-sm);
}

.product-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--swaraplace-shadow-lg);
    border-color: var(--swaraplace-primary);
}

.product-card-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* ========================================
   Product Image Section
   ======================================== */

.product-image-section {
    position: relative;
    background-color: var(--swaraplace-gray-50);
    overflow: hidden;
}

.product-image-link {
    display: block;
    position: relative;
    text-decoration: none;
    cursor: pointer;
}

/* Product Images Container */
.product-images-container {
    aspect-ratio: 1;
    position: relative;
    overflow: hidden;
    background-color: var(--swaraplace-gray-50);
}

.product-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.4s ease-in-out;
}

.product-image.active {
    opacity: 1;
}

.product-image img {
    width: 100% !important;
    height: auto !important;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.product-card:hover .product-image.active img {
    transform: scale(1.02);
}

/* Sale Badge */
.sale-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: linear-gradient(135deg, var(--swaraplace-primary), #ff4757);
    color: var(--swaraplace-white);
    padding: 4px 10px;
    border-radius: var(--swaraplace-radius);
    font-size: 0.75rem;
    font-weight: 700;
    z-index: 3;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Wishlist Button */
.wishlist-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    background-color: rgba(255, 255, 255, 0.95);
    border: 1px solid var(--swaraplace-gray-200);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--swaraplace-transition);
    z-index: 3;
    color: var(--swaraplace-gray-600);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.wishlist-btn:hover,
.wishlist-btn.active {
    background-color: var(--swaraplace-primary);
    border-color: var(--swaraplace-primary);
    color: var(--swaraplace-white);
    transform: scale(1.1);
}

/* ========================================
   Gallery Controls
   ======================================== */

.gallery-controls {
    position: absolute;
    bottom: 12px;
    left: 12px;
    right: 12px;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    z-index: 3;
    pointer-events: none;
}

/* Gallery Counter Badge */
.gallery-counter {
    display: flex;
    align-items: center;
    gap: 6px;
    background-color: rgba(0, 0, 0, 0.7);
    color: var(--swaraplace-white);
    padding: 6px 10px;
    border-radius: var(--swaraplace-radius);
    font-size: 0.75rem;
    font-weight: 600;
    backdrop-filter: blur(8px);
    pointer-events: auto;
    cursor: pointer;
    transition: var(--swaraplace-transition);
}

.gallery-counter:hover {
    background-color: rgba(0, 0, 0, 0.8);
    transform: scale(1.05);
}

.gallery-counter svg {
    opacity: 0.9;
}

.gallery-count {
    white-space: nowrap;
}

/* Gallery Dots */
.gallery-dots {
    display: flex;
    align-items: center;
    gap: 4px;
    pointer-events: auto;
}

.gallery-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: var(--swaraplace-transition-fast);
}

.gallery-dot.active {
    background-color: var(--swaraplace-white);
    transform: scale(1.2);
}

.gallery-dot:hover {
    background-color: rgba(255, 255, 255, 0.8);
}

.gallery-dot-more {
    font-size: 0.625rem;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 600;
    margin-left: 2px;
}

/* ========================================
   Product Content
   ======================================== */

.product-content {
    padding: 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Product Title */
.product-title {
    margin: 0;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.4;
    height: 2.4em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.product-title-link {
    color: var(--swaraplace-gray-900);
    text-decoration: none;
    transition: var(--swaraplace-transition-fast);
}

.product-title-link:hover {
    color: var(--swaraplace-primary);
    text-decoration: none;
}

/* Product Rating */
.product-rating {
    display: flex;
    align-items: center;
    font-size: 0.75rem;
    min-height: 20px;
}

.star-rating-wrapper {
    display: flex;
    align-items: center;
    gap: 6px;
}

.star-rating {
    font-size: 0.875rem;
}

.rating-count {
    color: var(--swaraplace-gray-600);
    font-size: 0.75rem;
}

.no-rating .rating-text {
    color: var(--swaraplace-gray-500);
    font-size: 0.75rem;
}

/* Product Price */
.product-price {
    font-weight: 600;
    font-size: 0.8rem !important;
    line-height: 1.2;
}

.product-price .price {
    color: var(--swaraplace-primary);
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.product-price .price del {
    color: var(--swaraplace-gray-500);
    font-weight: 400;
    font-size: 0.875rem;
}

/* Shipping Info */
.shipping-info {
    font-size: 0.75rem;
    margin-top: auto;
}

.free-shipping,
.shipping-available {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
}

.free-shipping {
    color: var(--swaraplace-success);
}

.shipping-available {
    color: var(--swaraplace-gray-600);
}

.free-shipping svg,
.shipping-available svg {
    flex-shrink: 0;
}

/* ========================================
   Product Actions
   ======================================== */

.product-actions {
    padding: 0 16px 16px 16px;
    display: flex;
    gap: 8px;
}

.add-to-cart-btn {
    flex: 1;
    padding: 12px 16px;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: var(--swaraplace-radius);
    transition: var(--swaraplace-transition);
    border: none;
    background-color: var(--swaraplace-primary);
    color: var(--swaraplace-white);
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.add-to-cart-btn:hover {
    background-color: var(--swaraplace-primary-dark);
    color: var(--swaraplace-white);
    text-decoration: none;
    transform: translateY(-1px);
}

.whatsapp-contact-btn {
    width: 44px;
    height: 44px;
    background-color: #25d366;
    color: var(--swaraplace-white);
    border-radius: var(--swaraplace-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: var(--swaraplace-transition);
    flex-shrink: 0;
}

.whatsapp-contact-btn:hover {
    background-color: #128c7e;
    color: var(--swaraplace-white);
    text-decoration: none;
    transform: scale(1.05);
}

/* ========================================
   Gallery Slideshow States
   ======================================== */

.product-card.gallery-active .gallery-counter {
    background-color: var(--swaraplace-primary);
}

.product-card.gallery-slideshow .product-images-container {
    cursor: pointer;
}

/* Touch/Click feedback */
.product-images-container.touching {
    transform: scale(0.98);
    transition: transform 0.1s ease;
}

/* ========================================
   Loading States
   ======================================== */

.product-image.loading {
    background: linear-gradient(90deg, var(--swaraplace-gray-200) 25%, transparent 37%, var(--swaraplace-gray-200) 63%);
    background-size: 400% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
}

@keyframes shimmer {
    0% { background-position: 100% 50%; }
    100% { background-position: -100% 50%; }
}

/* ========================================
   Responsive Design
   ======================================== */

@media (max-width: 480px) {
    .product-content {
        gap: 8px;
    }
    
    .shipping-info {
        font-size: 0.6875rem;
    }
    
    .gallery-counter {
        font-size: 0.625rem;
        padding: 3px 6px;
    }
    
    .gallery-counter svg {
        width: 12px;
        height: 12px;
    }
    
    .gallery-dots {
        gap: 3px;
    }
    
    .gallery-dot {
        width: 5px;
        height: 5px;
    }
}

/* ========================================
   Accessibility & Preferences
   ======================================== */

/* High contrast mode support */
@media (prefers-contrast: high) {
    .product-card {
        border-width: 2px;
    }
    
    .sale-badge,
    .gallery-counter {
        border: 1px solid var(--swaraplace-white);
    }
    
    .gallery-dot {
        border: 1px solid var(--swaraplace-white);
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .product-card,
    .product-image,
    .product-image img,
    .wishlist-btn,
    .add-to-cart-btn,
    .whatsapp-contact-btn,
    .gallery-counter,
    .gallery-dot {
        transition: none;
    }
    
    .product-card:hover {
        transform: none;
    }
    
    .product-card:hover .product-image.active img {
        transform: none;
    }
    
    .loading {
        animation: none;
    }
}

/* Removed dark mode support */

/* Print styles */
@media print {
    .product-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ccc;
    }
    
    .gallery-controls,
    .wishlist-btn,
    .product-actions {
        display: none;
    }
}

/* ========================================
   Component States for JavaScript
   ======================================== */

/* Gallery interaction states */
.product-card[data-gallery-loaded="true"] .gallery-counter {
    opacity: 1;
}

.product-card[data-gallery-loaded="false"] .gallery-counter {
    opacity: 0.7;
}

/* Touch device specific styles */
.touch-device .product-card:hover {
    transform: none;
    box-shadow: var(--swaraplace-shadow-sm);
}

.touch-device .product-card:hover .product-image.active img {
    transform: none;
}

/* Desktop-only hover effects */
.no-touch .product-card:hover .gallery-counter {
    transform: scale(1.05);
}

/* Focus states for keyboard navigation */
.product-image-link:focus,
.add-to-cart-btn:focus,
.whatsapp-contact-btn:focus,
.wishlist-btn:focus {
    outline: 2px solid var(--swaraplace-primary);
    outline-offset: 2px;
}

.gallery-dot:focus {
    outline: 1px solid var(--swaraplace-white);
    outline-offset: 1px;
}max-width: 768px) {
    .product-content {
        padding: 12px;
        gap: 10px;
    }
    
    .product-title {
        font-size: 0.8125rem;
    }
    
    .product-price {
        font-size: 0.9375rem;
    }
    
    .product-actions {
        padding: 0 12px 12px 12px;
        gap: 6px;
    }
    
    .add-to-cart-btn {
        padding: 10px 12px;
        font-size: 0.8125rem;
    }
    
    .whatsapp-contact-btn {
        width: 40px;
        height: 40px;
    }
    
    .gallery-controls {
        bottom: 8px;
        left: 8px;
        right: 8px;
    }
    
    .gallery-counter {
        padding: 4px 8px;
        font-size: 0.6875rem;
    }
    
    .sale-badge,
    .wishlist-btn {
        top: 8px;
    }
    
    .sale-badge {
        left: 8px;
        padding: 3px 8px;
        font-size: 0.6875rem;
    }
    
    .wishlist-btn {
        right: 8px;
        width: 28px;
        height: 28px;
    }
    
    .wishlist-btn svg {
        width: 14px;
        height: 14px;
    }
