/* =============================================================================
 * PrintifySign — Add-To-Cart Confirmation
 * File:    assets/cart-checkout/css/atc-confirm.css
 * Feature: HIGH PRIORITY FIX #1 — Add-To-Cart customer feedback
 * Version: 1.0.0
 *
 * Purpose:
 *   Lightweight, calm, premium confirmation surface shown after a successful
 *   add-to-cart. Replaces the silent editor dead-end and the abrupt configure
 *   redirect with a clear "Added" state + next-step options.
 *
 * Design intent:
 *   - One focal point: the checkmark + "Added to cart".
 *   - Two next-step options only: View Cart (primary) / Continue Shopping.
 *   - No modal, no overlay, no Porto styling. Inline panel anchored to the
 *     add-to-cart action area.
 *   - Adapts to both surfaces: the dark immersive editor and the lighter
 *     configure pages, by reading existing PSD tokens with safe fallbacks.
 *
 * Rules honoured:
 *   - Additive only. No existing selectors modified.
 *   - No `!important`.
 *   - All rules scoped under the feature root class `.psd-atc-confirm`.
 * ========================================================================== */

/* Local token layer — resolves against the host page's existing variables
 * when present, otherwise falls back to PrintifySign-safe defaults. This is
 * how one component serves both the dark editor and the light configure page
 * without branching. */
.psd-atc-confirm {
    --atc-bg:        var(--psd-l-paper, #faf9f7);
    --atc-border:    var(--psd-l-border-light-firm, rgba(10, 10, 10, 0.18));
    --atc-shadow:    var(--glass-shadow, 0 8px 32px rgba(0, 0, 0, 0.12));
    --atc-text:      var(--psd-l-text-primary, #0a0a0a);
    --atc-text-soft: var(--psd-l-text-secondary, #5c5950);
    --atc-success:   var(--success, #1f9d57);
    --atc-cta-bg:    var(--psd-l-ink-soft, #1a1a1a);
    --atc-cta-text:  var(--psd-l-text-inverse, #f5f4f0);
    --atc-radius:    var(--psd-l-radius-lg, 18px);
    --atc-font:      var(--psd-l-font-body, -apple-system, "Segoe UI", Roboto, sans-serif);
}

/* The panel. Hidden until activated by JS (additive class .is-visible). */
.psd-atc-confirm {
    display: none;
    box-sizing: border-box;
    width: 100%;
    margin-top: 14px;
    padding: 18px 18px 16px;
    border: 1px solid var(--atc-border);
    border-radius: var(--atc-radius);
    background: var(--atc-bg);
    box-shadow: var(--atc-shadow);
    font-family: var(--atc-font);
    color: var(--atc-text);
    text-align: left;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.28s ease, transform 0.28s ease;
}

.psd-atc-confirm.is-visible {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

/* Header row: checkmark + message. One focal point. */
.psd-atc-confirm__head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.psd-atc-confirm__check {
    flex: 0 0 auto;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--atc-success);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transform: scale(0.6);
    opacity: 0;
    transition: transform 0.32s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.2s ease;
}

.psd-atc-confirm.is-visible .psd-atc-confirm__check {
    transform: scale(1);
    opacity: 1;
}

.psd-atc-confirm__check svg {
    width: 14px;
    height: 14px;
    display: block;
}

.psd-atc-confirm__msg {
    font-size: 15px;
    font-weight: 500;
    line-height: 1.3;
    color: var(--atc-text);
}

.psd-atc-confirm__sub {
    display: block;
    margin-top: 2px;
    font-size: 12.5px;
    font-weight: 400;
    line-height: 1.35;
    color: var(--atc-text-soft);
}

/* Next-step actions. Two options, calm. */
.psd-atc-confirm__actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.psd-atc-confirm__btn {
    flex: 1 1 auto;
    min-width: 130px;
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 11px 16px;
    border-radius: var(--psd-l-radius-md, 12px);
    font-family: var(--atc-font);
    font-size: 14px;
    font-weight: 500;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease, opacity 0.16s ease;
}

/* Primary: View Cart */
.psd-atc-confirm__btn--primary {
    background: var(--atc-cta-bg);
    color: var(--atc-cta-text);
    border: 1px solid var(--atc-cta-bg);
}

.psd-atc-confirm__btn--primary:hover,
.psd-atc-confirm__btn--primary:focus-visible {
    opacity: 0.9;
}

/* Secondary: Continue Shopping */
.psd-atc-confirm__btn--ghost {
    background: transparent;
    color: var(--atc-text);
    border: 1px solid var(--atc-border);
}

.psd-atc-confirm__btn--ghost:hover,
.psd-atc-confirm__btn--ghost:focus-visible {
    border-color: var(--atc-text-soft);
}

.psd-atc-confirm__btn:focus-visible {
    outline: 2px solid var(--atc-success);
    outline-offset: 2px;
}

/* Reduced motion: honour the user's preference. */
@media (prefers-reduced-motion: reduce) {
    .psd-atc-confirm,
    .psd-atc-confirm__check {
        transition: none;
    }
}

/* Mobile: stack the two actions for comfortable tap targets on the
 * primarily-mobile customer base. */
@media (max-width: 480px) {
    .psd-atc-confirm__actions {
        flex-direction: column;
    }

    .psd-atc-confirm__btn {
        width: 100%;
    }
}
