/* Soft2Print WooCommerce — front-end styles */

.s2p-designer-wrap {
    margin: 12px 0 16px;
}

/* Hide standard WC quantity + add to cart button for S2P products.
   The quantity is normally collected inside the Soft2Print designer
   itself, so we hide the WC qty selector by default. */
.s2p-active-product form.cart .quantity,
.s2p-active-product form.cart button[type="submit"].single_add_to_cart_button,
.s2p-active-product form.cart input[name="add-to-cart"] {
    display: none !important;
}

/* EXCEPTION: when the product (or one of its categories) opts in to a
   quantity selector via the "Show quantity selector before designer"
   setting, body gets the s2p-show-qty class — bring the qty input back.
   We still hide the standard WC add-to-cart button because the Design
   button replaces it; the chosen qty rides along to the designer. */
.s2p-active-product.s2p-show-qty form.cart .quantity {
    display: inline-flex !important;
    /* Sensible default placement — sits above the Design button on its own line. */
    margin: 0 0 14px !important;
    vertical-align: middle;
}

/* On themes that lay the qty + button out as flex/inline siblings, the
   Design button should sit on the same row as the qty. */
.s2p-active-product.s2p-show-qty .s2p-designer-wrap {
    display: inline-block;
    vertical-align: middle;
}

/* "Design" button on single product page */
.s2p-open-designer {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 14px 24px !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    cursor: pointer;
    border-radius: 4px;
    transition: opacity 0.2s;
}

.s2p-open-designer:disabled {
    opacity: 0.6;
    cursor: wait;
}

/* "Design" button on shop/category/search pages */
.s2p-loop-btn {
    display: inline-block;
    font-weight: 600;
}

/* Cart preview thumbnail */
.s2p-cart-preview {
    max-width: 80px !important;
    width: 80px !important;
    height: auto !important;
    border-radius: 4px;
    border: 1px solid #ddd;
    display: block;
}

@media (max-width: 768px) {
    .s2p-cart-preview {
        max-width: 60px !important;
        width: 60px !important;
    }
}

/* ============================================================
   Soft-prompt modal (S2P_Resume)
   Hidden by default; .is-open is added by JS.
   ============================================================ */

.s2p-account-prompt {
    position: fixed;
    inset: 0;
    z-index: 99998; /* below typical WC modals (99999) so we don't fight stacking */
    display: none;
    align-items: center;
    justify-content: center;
}

.s2p-account-prompt.is-open {
    display: flex;
}

.s2p-account-prompt__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
}

.s2p-account-prompt__dialog {
    position: relative;
    background: #fff;
    border-radius: 8px;
    padding: 28px 24px;
    max-width: 460px;
    width: 92%;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
    z-index: 1;
}

.s2p-account-prompt__title {
    margin: 0 0 12px;
    font-size: 20px;
    font-weight: 600;
}

.s2p-account-prompt__body {
    margin: 0 0 12px;
    font-size: 15px;
    line-height: 1.5;
    color: #444;
}

.s2p-account-prompt__body:last-of-type {
    margin-bottom: 16px;
}

/* "Tips: …" callout — subtle muted background to distinguish it from
   the main body paragraphs without competing with the action buttons. */
.s2p-account-prompt__tip {
    margin: 0 0 20px;
    padding: 10px 12px;
    font-size: 14px;
    line-height: 1.5;
    color: #444;
    background: #f6f9fc;
    border-left: 3px solid #1f3a5f;
    border-radius: 3px;
}

.s2p-account-prompt__actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.s2p-account-prompt__actions .button {
    width: 100%;
    text-align: center;
    justify-content: center;
}

.s2p-account-prompt__actions .button-link {
    background: transparent !important;
    border: none !important;
    text-decoration: underline;
    padding: 6px !important;
    color: #666 !important;
    cursor: pointer;
}

@media (min-width: 480px) {
    .s2p-account-prompt__actions {
        flex-direction: row;
        flex-wrap: wrap;
    }
    .s2p-account-prompt__actions .button {
        flex: 1 1 auto;
        width: auto;
    }
    /* "Continue as guest" goes full-width on its own line below the
       two primary actions — visually de-emphasised. */
    .s2p-account-prompt__actions .button-link {
        flex: 1 1 100%;
        margin-top: 4px;
    }
}

/* ============================================================
   My Designs (WC My Account tab)
   ============================================================ */

.s2p-my-designs__list {
    list-style: none;
    padding: 0;
    margin: 16px 0 0;
}

.s2p-my-designs__item {
    display: flex;
    gap: 14px;
    padding: 14px;
    border: 1px solid #e5e5e5;
    border-radius: 6px;
    margin-bottom: 12px;
    align-items: center;
}

.s2p-my-designs__thumb img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    border-radius: 4px;
    display: block;
    background: #f7f7f7;
}

.s2p-my-designs__meta {
    flex: 1;
    min-width: 0;
}

.s2p-my-designs__meta h4 {
    margin: 0 0 4px;
    font-size: 16px;
}

.s2p-my-designs__date {
    margin: 0 0 8px;
    font-size: 13px;
    opacity: 0.7;
}

.s2p-my-designs__actions {
    margin: 0;
}

.s2p-my-designs__warn {
    margin: 0 0 8px;
    color: #a00;
    font-size: 13px;
}

@media (max-width: 480px) {
    .s2p-my-designs__item {
        flex-direction: column;
        align-items: flex-start;
    }
    .s2p-my-designs__thumb img {
        width: 100%;
        height: auto;
        max-height: 200px;
    }
}

/* "Bestilt" badge — ordered/in-production design.
   Sits next to the product name; visually clear that this item is final. */
.s2p-my-designs__badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    background: #1f3a5f;
    color: #fff;
    padding: 2px 8px;
    border-radius: 10px;
    vertical-align: middle;
    margin-left: 6px;
}

.s2p-my-designs__item--ordered {
    background: #fafafa;
    opacity: 0.85;
}

.s2p-my-designs__ordered-note {
    display: inline-block;
    font-size: 13px;
    color: #666;
    font-style: italic;
}
