/**
 * WYSIWYG Product Digital Signage CSS
 * Main colors: #181743 (purple), #f38221 (orange)
 * Structure matches auction CSS exactly
 */

/* Reset for the WYSIWYG signage display - matches auction structure */
.wcap-wysiwyg-product.wcap-signage-container,
.wcap-signage-fallback {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100vh;
    overflow: hidden;
    background-color: #181743;
    color: white;
    font-family: 'Helvetica Neue', Arial, sans-serif;
    position: relative;
    display: flex;
    box-sizing: border-box;
}

/* Hide scrollbars on body and html when signage is active */
body:has(.wcap-wysiwyg-product) {
    overflow: hidden !important;
}

html:has(.wcap-wysiwyg-product) {
    overflow: hidden !important;
}

/* Fallback for browsers that don't support :has() */
body.wcap-signage-active {
    overflow: hidden !important;
}

html.wcap-signage-active {
    overflow: hidden !important;
}

/* Ensure the container takes full space without causing overflow */
.wcap-wysiwyg-product.wcap-signage-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999;
}

/* Container layout - matches auction layout */
.wcap-wysiwyg-product.wcap-signage-container {
    flex-direction: row;
}

/* Image section - matches auction image section */
.wcap-wysiwyg-product .wcap-signage-image {
    width: 50%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background-color: #000;
    position: relative;
}

.wcap-wysiwyg-product .wcap-signage-image img {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
    display: block;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Details section - matches auction details section */
.wcap-wysiwyg-product .wcap-signage-details {
    width: 50%;
    height: 100vh;
    padding: 60px;
    overflow: hidden; /* Changed from 'auto' to 'hidden' to prevent scrollbars */
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    justify-content: space-between;
}

/* Title - matches auction title */
.wcap-wysiwyg-product .wcap-signage-title {
    font-size: 48px;
    font-weight: bold;
    margin-bottom: 30px;
    color: white;
    line-height: 1.2;
    border-bottom: 2px solid #f38221;
    padding-bottom: 15px;
}

/* Status indicators */
.wcap-wysiwyg-product .wcap-signage-status {
    margin-bottom: 30px;
    display: flex;
    gap: 15px;
}

.wcap-wysiwyg-product .wcap-on-sale-indicator {
    display: inline-block;
    padding: 8px 16px;
    font-weight: bold;
    border-radius: 20px;
    text-transform: uppercase;
    font-size: 16px;
    background-color: #dc3545;
    color: white;
    animation: pulse 1.5s infinite;
}

/* SKU display */
.wcap-wysiwyg-product .wcap-signage-sku {
    margin-bottom: 20px;
    font-size: 20px;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
}

.wcap-wysiwyg-product .wcap-sku-label {
    font-weight: normal;
    color: #ccc;
}

.wcap-wysiwyg-product .wcap-sku-value {
    font-weight: bold;
    font-size: 22px;
    color: white;
    font-family: monospace;
}

/* Price container */
.wcap-wysiwyg-product .wcap-signage-price-container {
    margin-bottom: 25px;
    font-size: 36px;
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

/* Regular product price */
.wcap-wysiwyg-product .wcap-current-price {
    color: #f38221;
    font-weight: bold;
    font-size: 42px;
}

/* Sale pricing */
.wcap-wysiwyg-product .wcap-sale-price {
    color: #f38221;
    font-weight: bold;
    font-size: 42px;
}

.wcap-wysiwyg-product .wcap-regular-price {
    color: #999;
    font-size: 28px;
    text-decoration: line-through;
}

.wcap-wysiwyg-product .wcap-sale-badge {
    background-color: #dc3545;
    color: white;
    font-size: 16px;
    font-weight: bold;
    padding: 8px 16px;
    border-radius: 20px;
    text-transform: uppercase;
    animation: pulse 2s infinite;
    display: inline-block;
    margin-left: 10px;
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.3);
}

/* Stock status */
.wcap-wysiwyg-product .wcap-signage-stock {
    margin-bottom: 25px;
    font-size: 24px;
}

.wcap-wysiwyg-product .wcap-in-stock {
    color: #28a745;
    font-weight: bold;
}

/* Description styling */
.wcap-wysiwyg-product .wcap-signage-description {
    margin: 20px 0 30px;
    font-size: 20px;
    line-height: 1.5;
    flex-grow: 1;
    color: #ddd;
    overflow: hidden; /* Prevent description overflow */
    max-height: 200px; /* Limit description height */
}

.wcap-wysiwyg-product .wcap-signage-description p {
    margin-bottom: 15px;
}

/* Action section - matches auction action section */
.wcap-wysiwyg-product .wcap-signage-action {
    margin-top: auto;
    padding-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.wcap-wysiwyg-product .wcap-signage-qr {
    display: inline-block;
    background-color: white;
    padding: 15px;
    margin: 15px auto;
    border-radius: 8px;
    max-width: 250px;
}

.wcap-wysiwyg-product .wcap-signage-qr img {
    display: block;
    max-width: 100%;
    height: auto;
    width: 200px;
    height: 200px;
}

.wcap-wysiwyg-product .wcap-signage-add-cart {
    background-color: #28a745;
    color: white;
    font-size: 28px;
    font-weight: bold;
    padding: 15px 25px;
    margin: 20px auto;
    border-radius: 8px;
    display: inline-block;
    text-transform: uppercase;
    animation: pulse 2s infinite;
    text-align: center;
    line-height: 1.2;
}

.wcap-wysiwyg-product .wcap-signage-instructions {
    font-size: 22px;
    color: #ccc;
    margin-top: 10px;
    text-align: center;
}

/* Fallback display - matches auction fallback */
.wcap-signage-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.wcap-fallback-message {
    max-width: 80%;
    padding: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.wcap-fallback-message h1 {
    font-size: 60px;
    color: #f38221;
    margin-bottom: 40px;
}

.wcap-fallback-message p {
    font-size: 32px;
    margin-bottom: 30px;
    line-height: 1.5;
}

/* Alternating layouts - EXACTLY matches auction layouts */
.wcap-image-left {
    flex-direction: row;
}

.wcap-image-right {
    flex-direction: row-reverse;
}

/* Animation - matches auction animation */
@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

/* Media query for smaller height screens - matches auction responsive */
@media (max-height: 800px) {
    .wcap-wysiwyg-product .wcap-signage-title {
        font-size: 36px;
        margin-bottom: 15px;
    }
    
    .wcap-wysiwyg-product .wcap-signage-price-container {
        margin-bottom: 15px;
        font-size: 28px;
    }
    
    .wcap-wysiwyg-product .wcap-current-price,
    .wcap-wysiwyg-product .wcap-sale-price {
        font-size: 32px;
    }
    
    .wcap-wysiwyg-product .wcap-regular-price {
        font-size: 22px;
    }
    
    .wcap-wysiwyg-product .wcap-signage-description {
        font-size: 16px;
        margin: 15px 0 20px;
    }
    
    .wcap-wysiwyg-product .wcap-signage-qr img {
        width: 150px;
        height: 150px;
    }
    
    .wcap-wysiwyg-product .wcap-signage-add-cart {
        font-size: 24px;
        padding: 12px 24px;
    }
}

/* For screens that aren't 16:9 - matches auction responsive */
@media (min-aspect-ratio: 16/9) {
    .wcap-wysiwyg-product.wcap-signage-container {
        max-height: 100vh;
    }
    
    .wcap-wysiwyg-product .wcap-signage-image img {
        max-height: 95vh;
    }
}

@media (max-aspect-ratio: 16/9) {
    .wcap-wysiwyg-product.wcap-signage-container {
        height: auto;
        min-height: 100vh;
    }
}