/* ============================================
   AvaStore Cart Config Block
   Appended inside .product-line-grid-body
   ============================================ */

.avastore-cart-config {
    margin-top: 12px;
    padding: 10px 12px;
    background: #f8f9fa;
    border: 1px solid #ececec;
    border-left: 3px solid #2e7d32;
    border-radius: 4px;
    width: 100%;
}

.avastore-cart-config-title {
    margin: 0 0 6px;
    font-size: 0.72em;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #2e7d32;
}

/* Config rows — definition list layout */
.avastore-config-rows {
    margin: 0;
    padding: 0;
    list-style: none;
}

.avastore-config-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 3px 0;
    font-size: 0.82em;
    line-height: 1.4;
    border-bottom: 1px dashed #e6e6e6;
}

.avastore-config-row:last-child {
    border-bottom: none;
}

.avastore-config-row dt {
    font-weight: 500;
    color: #777;
    width: 70%;
    flex-basis: 70%;
}

.avastore-config-row dd {
    margin: 0;
    color: #333;
    font-weight: 600;
    text-align: right;
    word-break: break-word;
}

/* Sì/No values rendered as small pill badges instead of plain text */
.avastore-config-row dd.avastore-badge {
    display: inline-block;
    padding: 1px 9px;
    border-radius: 10px;
    font-size: 0.92em;
    font-weight: 600;
    width: 30%;
    flex-basis: 30%;
}

.avastore-config-row dd.avastore-yes {
    background: #e6f4ea;
    color: #2e7d32;
}

.avastore-config-row dd.avastore-no {
    background: #f1f1f1;
    color: #999;
}

/* Project reference */
.avastore-project-ref {
    margin: 8px 0 0;
    font-size: 0.72em;
    color: #bbb;
    word-break: break-all;
}

/* Responsive — narrow screens */
@media (max-width: 543px) {
    .avastore-config-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
        padding: 5px 0;
    }

    .avastore-config-row dd {
        text-align: left;
    }
}

/* ============================================
   AvaStore Preview Image — swapped state + lightbox
   Applied to the product <img> once swapProductImages()
   (cart_product_config.js) has replaced its src with the
   customer's AvaStore preview URL.
   ============================================ */

/* Applied to the original PS image's wrapper (never the cloned preview
   wrapper) so the two stacked images aren't flush against each other. */
.avastore-original-has-preview {
    margin-bottom: 10px;
    display: inline-block;
}

.avastore-preview-swapped {
    border: 2px solid transparent;
    border-radius: 6px;
    box-shadow: 0 1px 4px rgba(46, 125, 50, 0.12);
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
    object-fit: contain;
    max-width: 100%;
}

.avastore-preview-swapped:hover,
.avastore-preview-swapped:focus {
    box-shadow: 0 2px 10px rgba(46, 125, 50, 0.22);
    transform: translateY(-1px);
}

.avastore-preview-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.65);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s ease;
    z-index: 10000;
    padding: 24px;
}

.avastore-preview-modal-overlay.is-open {
    opacity: 1;
    visibility: visible;
}

.avastore-preview-modal {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
}

.avastore-preview-modal img {
    display: block;
    max-width: 90vw;
    max-height: 90vh;
    border-radius: 6px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
}

.avastore-preview-modal-close {
    position: absolute;
    top: -14px;
    right: -14px;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: #fff;
    color: #333;
    font-size: 18px;
    line-height: 32px;
    text-align: center;
    cursor: pointer;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.3);
}

.avastore-preview-modal-close:hover,
.avastore-preview-modal-close:focus {
    color: #2e7d32;
}
