/* =============================================================
   Product Card Flip Effect
   Depends on variables.css being loaded first.
   ============================================================= */

/* --- Flip container wrapper -------------------------------- */

.product-card-wrapper {
    perspective: 1000px;
    width: 280px;
    height: 380px;
}

/* --- The flipping card ------------------------------------ */

.product-card {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.product-card-wrapper:hover .product-card {
    transform: rotateY(180deg);
}

/* --- Front side: Product ---------------------------------- */

.product-front,
.product-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.product-front {
    background-color: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    padding: var(--spacing-5);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-4);
    z-index: 2;
}

.product-image {
    width: 100%;
    height: 180px;
    background-color: var(--color-bg-light);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.product-image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-info {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-2);
}

.product-name {
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-bold);
    color: var(--color-text-primary);
    margin: 0;
}

.product-description {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
    margin: 0;
}

.product-price {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-bold);
    color: var(--color-primary);
    margin: 0;
}

/* --- Back side: QR Code ----------------------------------- */

.product-back {
    background-color: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    padding: var(--spacing-5);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-4);
    transform: rotateY(180deg);
    z-index: 1;
}

.qr-showcase {
    width: 200px;
    height: 200px;
    background-color: var(--color-white);
    border: 2px solid var(--color-border);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.qr-code {
    width: 180px;
    height: 180px;
}

.qr-text {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    text-align: center;
    margin: 0;
    line-height: var(--line-height-normal);
}

/* --- Responsive ------------------------------------------ */

@media (max-width: 1024px) {
    .product-card-wrapper {
        width: 240px;
        height: 340px;
    }

    .product-image {
        height: 150px;
    }

    .product-name {
        font-size: var(--font-size-sm);
    }

    .product-price {
        font-size: var(--font-size-base);
    }

    .qr-showcase {
        width: 160px;
        height: 160px;
    }

    .qr-code {
        width: 140px;
        height: 140px;
    }
}

@media (max-width: 768px) {
    .product-card-wrapper {
        width: 200px;
        height: 300px;
    }

    .product-front,
    .product-back {
        padding: var(--spacing-3);
    }

    .product-image {
        height: 120px;
    }

    .product-front {
        gap: var(--spacing-3);
    }

    .product-back {
        gap: var(--spacing-2);
    }

    .product-name {
        font-size: var(--font-size-xs);
    }

    .product-description {
        font-size: var(--font-size-xs);
    }

    .product-price {
        font-size: var(--font-size-sm);
    }

    .qr-showcase {
        width: 140px;
        height: 140px;
    }

    .qr-code {
        width: 120px;
        height: 120px;
    }

    .qr-text {
        font-size: var(--font-size-xs);
    }
}

