/**
 * Product Card Styles
 * Centralized styles for product cards used across the theme
 *
 * @package Dara Flower
 */

.product-grid {
    display: grid;
    gap: 24px;
    margin-bottom: 48px;
    grid-template-columns: repeat(2, 1fr);
    /* Mobile: 2 columns minimum */
}

/* Responsive Grid: 2 to 6 columns */
@media (min-width: 640px) {
    .product-grid {
        grid-template-columns: repeat(3, 1fr);
        /* Small tablets: 3 columns */
    }
}

@media (min-width: 768px) {
    .product-grid {
        grid-template-columns: repeat(4, 1fr);
        /* Tablets: 4 columns */
    }
}

@media (min-width: 1024px) {
    .product-grid {
        grid-template-columns: repeat(5, 1fr);
        /* Desktop: 5 columns */
    }
}

@media (min-width: 1280px) {
    .product-grid {
        grid-template-columns: repeat(6, 1fr);
        /* Large desktop: 6 columns maximum */
    }
}

/* Product Card */
.product-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    background-color: var(--md-sys-color-surface-container-lowest);
    transition: all 0.3s ease;
    animation: fadeInUp 0.6s ease-out backwards;
}

.product-card:nth-child(1) {
    animation-delay: 0.1s;
}

.product-card:nth-child(2) {
    animation-delay: 0.2s;
}

.product-card:nth-child(3) {
    animation-delay: 0.3s;
}

.product-card:nth-child(4) {
    animation-delay: 0.4s;
}

.product-card:nth-child(5) {
    animation-delay: 0.5s;
}

.product-card:nth-child(6) {
    animation-delay: 0.6s;
}

.product-card:nth-child(7) {
    animation-delay: 0.7s;
}

.product-card:nth-child(8) {
    animation-delay: 0.8s;
}

.product-card:nth-child(9) {
    animation-delay: 0.9s;
}

.product-card:nth-child(10) {
    animation-delay: 1s;
}

.product-card:nth-child(11) {
    animation-delay: 1.1s;
}

.product-card:nth-child(12) {
    animation-delay: 1.2s;
}

.product-card:nth-child(13) {
    animation-delay: 1.3s;
}

.product-card:nth-child(14) {
    animation-delay: 1.4s;
}

.product-card:nth-child(15) {
    animation-delay: 1.5s;
}

.product-card:nth-child(16) {
    animation-delay: 1.6s;
}

.product-card:nth-child(17) {
    animation-delay: 1.7s;
}

.product-card:nth-child(18) {
    animation-delay: 1.8s;
}

.product-card:nth-child(19) {
    animation-delay: 1.9s;
}

.product-card:nth-child(20) {
    animation-delay: 2s;
}

.product-card:nth-child(21) {
    animation-delay: 2.1s;
}

.product-card:nth-child(22) {
    animation-delay: 2.2s;
}

.product-card:nth-child(23) {
    animation-delay: 2.3s;
}

.product-card:nth-child(24) {
    animation-delay: 2.4s;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--md-sys-elevation-level3);
}

.product-card-link {
    display: flex;
    flex-direction: column;
    height: 100%;
    text-decoration: none;
    color: inherit;
}

.product-card-image {
    position: relative;
    overflow: visible !important;
    background-color: var(--md-sys-color-surface-container);
}

.product-card-image img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    transition: transform 0.3s ease;
    display: block;
}

.product-card:hover .product-card-image img {
    transform: scale(1.05);
}

/* Best Seller Badge */
.best-seller-badge {
    position: absolute !important;
    top: 12px !important;
    right: 0 !important;
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: #1a1a1a;
    padding: 6px 12px;
    border-radius: 20px 0 0 20px;
    font-size: 0.75rem;
    font-weight: 700;
    display: flex !important;
    align-items: center;
    gap: 4px;
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.4);
    z-index: 10 !important;
    animation: badge-pulse 2s ease-in-out infinite;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    pointer-events: none;
}

.best-seller-badge svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.best-seller-badge span {
    white-space: nowrap;
}

@keyframes badge-pulse {

    0%,
    100% {
        transform: scale(1);
        box-shadow: 0 4px 12px rgba(255, 215, 0, 0.4);
    }

    50% {
        transform: scale(1.05);
        box-shadow: 0 6px 16px rgba(255, 215, 0, 0.6);
    }
}

.product-card-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px;
}

.product-card-title {
    color: var(--md-sys-color-on-surface);
    margin: 0 0 8px 0;
    font-size: 0.95rem;
    line-height: 1.3;
    min-height: 2.47rem;
    /* Reserve space for exactly 2 lines (0.95rem * 1.3 * 2) */
    height: 2.47rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Price Group - New Design */
.product-card-price-group {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 0;
}

.price-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.price-current {
    color: var(--md-sys-color-error);
    font-weight: 700;
    margin: 0;
    line-height: 1.2;
}

.product-card-price-group .price-current {
    font-size: 20px;
    line-height: 28px;
}

.product-price-container .product-price {
    font-size: 28px;
    line-height: 36px;
}

@keyframes discount-pulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.85;
        transform: scale(1.05);
    }
}

@keyframes discount-blink {

    0%,
    49% {
        opacity: 1;
    }

    50%,
    99% {
        opacity: 0;
    }
}

.discount-badge {
    background-color: var(--md-sys-color-error-container);
    color: var(--md-sys-color-on-error-container);
    padding: 4px 10px;
    border-radius: var(--md-sys-shape-corner-full);
    font-weight: 700;
    font-size: 0.75rem;
    line-height: 1;
    animation: discount-pulse 1s ease-in-out infinite;
}

.price-original {
    color: var(--md-sys-color-outline);
    text-decoration: line-through;
    margin: 0;
    font-size: 0.875rem;
    line-height: 1.2;
}

.product-card-excerpt {
    color: var(--md-sys-color-on-surface-variant);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.5;
}

.product-card-actions {
    margin-top: auto;
    padding: 8px 12px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.product-card-actions .md-button {
    width: 100%;
    justify-content: center;
    text-decoration: none;
    padding: 8px 12px;
    font-size: 0.875rem;
}

.line-order-button {
    background: linear-gradient(135deg, #06C755 0%, #00B900 100%) !important;
    color: white !important;
    display: inline-flex !important;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.line-order-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(6, 199, 85, 0.3);
}

.line-order-button svg {
    fill: white;
    flex-shrink: 0;
}

/* Mobile Responsive */
@media (max-width: 767px) {
    .product-grid {
        margin-bottom: 32px;
    }

    .product-card-title {
        min-height: auto;
    }
}

/* Animation Keyframes */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}