/* EM Quick Options — modal styling (mirrors the EM-Swaps modal pattern). */

.emqo-choose-options {
    margin-top: 6px;
}

.emqo-modal {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: none;
    align-items: center;
    justify-content: center;
}

.emqo-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
}

.emqo-modal__panel {
    position: relative;
    background: #fff;
    border-radius: 8px;
    padding: 24px;
    max-width: 560px;
    width: 92%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

/* Compact, corner-pinned close button. !important + explicit size override
   theme button styles (e.g. Flatsome pads <button>, which otherwise widens this
   and pushes the × away from the corner). */
.emqo-modal__close {
    position: absolute !important;
    top: 10px;
    right: 10px;
    width: 34px;
    min-width: 0;
    height: 34px;
    padding: 0 !important;
    margin: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    font-size: 26px;
    line-height: 34px;
    text-align: center;
    cursor: pointer;
    color: #555;
    z-index: 5;
}

.emqo-modal__close:hover,
.emqo-modal__close:focus {
    color: #111;
}

/* Keep modal content clear of the close button. */
.emqo-modal__body {
    padding-right: 8px;
}

.emqo-modal__body {
    margin-top: 8px;
}

.emqo-loading,
.emqo-error {
    margin: 16px 0;
}

.emqo-error {
    color: #b32d2e;
}

/* Lock background scroll while the modal is open. */
body.emqo-modal-open {
    overflow: hidden;
}

/* Product header */
.emqo-product {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    margin-bottom: 16px;
}

.emqo-product__media {
    flex: 0 0 84px;
    max-width: 84px;
}

.emqo-product__media img {
    width: 100%;
    height: auto;
    border-radius: 6px;
    display: block;
}

.emqo-product__title {
    margin: 0 0 4px;
    font-size: 1.15em;
    line-height: 1.25;
}

.emqo-product__price {
    font-weight: 600;
}

/* Variation form */
.emqo-variations-form .variations {
    width: 100%;
    margin: 0 0 12px;
    border: 0;
}

.emqo-variations-form .variations th,
.emqo-variations-form .variations td {
    padding: 6px 0;
    border: 0;
    text-align: left;
    vertical-align: middle;
}

.emqo-variations-form .variations th.label {
    width: 35%;
    padding-right: 12px;
    font-weight: 600;
}

.emqo-variations-form .reset_variations {
    display: inline-block;
    margin-left: 8px;
    font-size: 0.85em;
}

.emqo-variation-summary {
    margin: 8px 0;
    min-height: 1em;
    font-weight: 600;
}

/* Quantity + add-to-cart row */
.emqo-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-top: 12px;
}

.emqo-actions .quantity {
    margin: 0;
}

.emqo-add-to-cart {
    flex: 1 1 auto;
}

.emqo-add-to-cart.loading {
    opacity: 0.6;
    pointer-events: none;
}

.emqo-add-to-cart[disabled],
.emqo-add-to-cart.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Inline form error + success states */
.emqo-form-error {
    display: none;
    margin: 0 0 12px;
    padding: 10px 12px;
    border-radius: 6px;
    background: #fbeaea;
    color: #b32d2e;
}

.emqo-success {
    margin: 24px 0;
    padding: 14px 16px;
    border-radius: 6px;
    background: #e8f6ec;
    color: #1e7a3c;
    text-align: center;
    font-weight: 600;
}

/* Swap UI wrapper (EM-Swaps owns its inner markup; we just lay it out). */
.emqo-swaps-wrap {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #eee;
}

/* Desktop: widen the modal when swaps are present and place the Swap / Extra
   columns side by side. Floats (not flex on .em-swaps-sections) so the layout
   survives the inline display jQuery's slideDown/slideUp sets on that
   container. Mobile stays stacked. */
@media (min-width: 600px) {
    .emqo-modal.emqo-has-swaps .emqo-modal__panel {
        max-width: 760px;
    }
    .emqo-swaps-wrap .em-swaps-sections::after {
        content: "";
        display: table;
        clear: both;
    }
    .emqo-swaps-wrap .em-swaps-section {
        float: left;
        width: 50%;
        box-sizing: border-box;
    }
    .emqo-swaps-wrap .em-swaps-section-swap {
        padding-right: 24px;
    }
}

@media (max-width: 480px) {
    .emqo-product__media {
        flex-basis: 64px;
        max-width: 64px;
    }
    .emqo-actions {
        flex-direction: column;
        align-items: stretch;
    }
}
