/* Product Animations */
.product-showcase {
    position: relative;
    overflow: hidden;
    /* responsive: use viewport units so height scales with screen */
    min-height: 60vh;
    background: #f8f9fa;
}

.product-image-container {
    width: 45%;
    position: relative;
    float: left;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
}

.product-details {
    width: 55%;
    float: right;
    padding: 40px;
    position: relative;
    /* ensure product-info area scales with viewport */
    min-height: 60vh;
}

.product-image {
    position: absolute;
    width: 80%;
    max-width: 400px;
    opacity: 0;
    transform: translateX(100%);
    transition: opacity 1.2s ease-in-out, transform 1.2s ease-in-out;
}

.product-image.active {
    opacity: 1;
    transform: translateX(0);
}

.product-image.exit {
    opacity: 0;
    transform: translateX(-150%);
    transition: opacity 1s ease-in-out, transform 1s ease-in-out;
}

.product-info {
    position: absolute; /* overlay within product-details to prevent layout reflow */
    top: 0;
    left: 0;
    right: 0;
    padding-right: 40px;
    padding-top: 10px;
    /* keep long product descriptions readable without clipping */
    max-height: calc(60vh - 40px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch; /* smooth scrolling on mobile */
    padding-bottom: 20px; /* breathing room for last line */
}

.product-detail-line {
    margin-bottom: 18px;
    font-size: 16px;
    line-height: 1.6;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.9s ease, transform 0.9s ease;
    padding: 12px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
}

/* Base active and exit states for text */
.product-detail-line.active {
    opacity: 1;
    transform: translateY(0);
}

.product-detail-line.exit {
    opacity: 0;
    transition: all 1s ease-in-out;
}

/* Text Animations */
.product-detail-line.slide-in-left { transform: translateX(-50px); }
.product-detail-line.slide-in-right { transform: translateX(50px); }
.product-detail-line.slide-in-top { transform: translateY(-30px); }
.product-detail-line.slide-in-bottom { transform: translateY(30px); }

.product-detail-line.exit.slide-out-left { transform: translateX(-100%); }
.product-detail-line.exit.slide-out-right { transform: translateX(100%); }
.product-detail-line.exit.slide-out-top { transform: translateY(-50px); }
.product-detail-line.exit.slide-out-bottom { transform: translateY(50px); }

.product-detail-line strong {
    color: #333;
    display: block;
    margin-bottom: 5px;
}

.clearfix::after {
    content: "";
    clear: both;
    display: table;
}
