/**
 * Public styles for JG Wishlist
 */

.jgw-wishlist-buttons {
    margin: 20px 0;
}
.jgw-wishlist-buttons .button {margin: 15px 0;}

.jgw-add-to-wishlist,
.jgw-view-wishlist {
    margin-right: 10px;
}

/* Smooth swap from Add → View Wishlist */
.jgw-wishlist-buttons .jgw-add-quantity,
.jgw-wishlist-buttons .jgw-add-to-wishlist,
.jgw-wishlist-buttons .jgw-view-wishlist,
.jgw-wishlist-button-loop .jgw-add-quantity,
.jgw-wishlist-button-loop .jgw-add-to-wishlist,
.jgw-wishlist-button-loop .jgw-view-wishlist {
    transition: opacity 220ms ease, transform 220ms ease, box-shadow 500ms ease;
    transform-origin: center;
    display: inline-block;
}

.jgw-fade-out {
    opacity: 0 !important;
    transform: scale(0.92);
    pointer-events: none;
}

.jgw-fade-in-start {
    opacity: 0;
    transform: scale(0.92);
}

/* Pulse the freshly swapped-in View Wishlist button so the Add → View change
   is obvious: a bright amber halo that beats, plus an expanding ripple ring.
   The button glows for the whole animation and fades out smoothly afterwards
   via the box-shadow transition on the shared swap rule above. */
@keyframes jgw-pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 14px 3px rgba(255, 170, 40, 0.8),
                    0 0 0 0 rgba(255, 170, 40, 0.6);
    }
    50% {
        transform: scale(1.1);
        box-shadow: 0 0 26px 8px rgba(255, 170, 40, 0.95),
                    0 0 0 9px rgba(255, 170, 40, 0.3);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 14px 3px rgba(255, 170, 40, 0.8),
                    0 0 0 18px rgba(255, 170, 40, 0);
    }
}

.jgw-pulse {
    animation: jgw-pulse 900ms ease-out 4;
    position: relative;
    z-index: 1;
}

.jgw-back-in-stock {
    margin-top: 10px;
    display: block;
}

/* ---------------------------------------------------------------------------
   Wishlist page
   Shares the design language of the plugin's modals/toasts: navy #2a3b4d,
   green #1a8a3a, red #c0392b, rounded cards, soft shadows.
--------------------------------------------------------------------------- */

.jgw-wishlist-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Page title with a short navy accent bar */
.jgw-wishlist-title {
    position: relative;
    margin: 10px 0 26px;
    padding-bottom: 12px;
    color: #1f2a37;
}

.jgw-wishlist-title::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 56px;
    height: 4px;
    border-radius: 2px;
    background: #2a3b4d;
}

/* Wishlist selector bar (multiple lists) */
.jgw-wishlist-selector {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
    padding: 12px 16px;
    background: #f4f6f8;
    border: 1px solid #e3e8ee;
    border-radius: 8px;
}

.jgw-wishlist-selector label {
    margin: 0;
    font-weight: 600;
    color: #2a3b4d;
}

.jgw-wishlist-selector select {
    padding: 8px 10px;
    border: 1px solid #c8d1da;
    border-radius: 6px;
    background: #fff;
    color: #1f2a37;
}

/* Empty state ("Your wishlist is empty.") */
.jgw-wishlist-container > p {
    padding: 44px 20px;
    text-align: center;
    background: #f7f8fa;
    border: 1px dashed #c8d1da;
    border-radius: 10px;
    color: #5b6975;
    font-size: 16px;
}

.jgw-wishlist-items {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

/* Item cards */
.jgw-wishlist-item {
    display: flex;
    flex-direction: column;
    padding: 16px;
    background: #fff;
    border: 1px solid #e3e8ee;
    border-radius: 10px;
    transition: box-shadow 180ms ease, transform 180ms ease, border-color 180ms ease;
}

.jgw-wishlist-item:hover {
    border-color: #c8d1da;
    box-shadow: 0 10px 24px rgba(20, 30, 50, 0.1);
    transform: translateY(-2px);
}

.jgw-item-image a {
    display: block;
    border-radius: 8px;
    overflow: hidden;
    background: #f7f8fa;
}

.jgw-item-image img {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    height: auto;
    object-fit: contain;
}

.jgw-item-details {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
}

.jgw-item-details h3 {
    margin: 12px 0 4px;
    font-size: 16px;
    line-height: 1.35;
}

.jgw-item-details h3 a {
    color: #1f2a37;
    text-decoration: none;
}

.jgw-item-details h3 a:hover {
    color: #2a3b4d;
    text-decoration: underline;
}

.jgw-item-price {
    margin: 4px 0;
    font-size: 18px;
    font-weight: 700;
    color: #2a3b4d;
}

.jgw-item-price del {
    font-size: 14px;
    font-weight: 400;
    color: #98a4af;
}

.jgw-item-price ins {
    text-decoration: none;
}

/* Stock pills */
.jgw-item-stock {
    margin: 6px 0 0;
}

.jgw-in-stock,
.jgw-out-of-stock {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.5;
}

.jgw-in-stock {
    background: #e7f6ec;
    color: #1a8a3a;
}

.jgw-out-of-stock {
    background: #fdecea;
    color: #c0392b;
}

.jgw-item-quantity {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    font-size: 14px;
}

.jgw-item-quantity label {
    margin: 0;
    font-weight: 600;
    color: #2a3b4d;
}

.jgw-quantity-input {
    width: 72px;
    padding: 6px 8px;
    border: 1px solid #c8d1da;
    border-radius: 6px;
    color: #1f2a37;
}

.jgw-quantity-input:focus {
    border-color: #2a3b4d;
    outline: none;
    box-shadow: 0 0 0 3px rgba(42, 59, 77, 0.12);
}

.jgw-item-line-total {
    margin-top: 8px;
    font-size: 13px;
    color: #5b6975;
}

/* Card actions pinned to the bottom so buttons line up across cards */
.jgw-item-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-top: auto;
    padding-top: 16px;
}

.jgw-item-actions .button {
    margin: 0;
    padding: 9px 16px;
    border-radius: 6px;
    font-weight: 600;
    line-height: 1.3;
    text-decoration: none;
    cursor: pointer;
    transition: background 150ms ease, color 150ms ease, border-color 150ms ease;
}

.jgw-item-actions a.jgw-add-to-cart {
    background: #2a3b4d;
    border: 1px solid #2a3b4d;
    color: #ffffff;
}

.jgw-item-actions a.jgw-add-to-cart:hover {
    background: #1a2734;
    border-color: #1a2734;
    color: #ffffff;
}

.jgw-item-actions .jgw-remove-item {
    background: #ffffff;
    border: 1px solid #c8d1da;
    color: #5b6975;
}

.jgw-item-actions .jgw-remove-item:hover {
    background: #fdf5f4;
    border-color: #c0392b;
    color: #c0392b;
}

/* Wishlist total bar */
.jgw-wishlist-total {
    display: flex;
    justify-content: flex-end;
    align-items: baseline;
    gap: 12px;
    margin-top: 24px;
    padding: 16px 20px;
    background: #f4f6f8;
    border: 1px solid #e3e8ee;
    border-radius: 8px;
    font-size: 16px;
    color: #1f2a37;
}

#jgw-wishlist-total-value {
    font-size: 22px;
    font-weight: 700;
    color: #2a3b4d;
}

/* Quote request form */
.jgw-quote-form-container {
    margin-top: 32px;
    padding: 28px;
    background: #ffffff;
    border: 1px solid #e3e8ee;
    border-radius: 10px;
    box-shadow: 0 6px 18px rgba(20, 30, 50, 0.06);
}

.jgw-quote-form-container h3 {
    position: relative;
    margin: 0 0 20px;
    padding-bottom: 10px;
    font-size: 20px;
    color: #1f2a37;
}

.jgw-quote-form-container h3::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 40px;
    height: 3px;
    border-radius: 2px;
    background: #2a3b4d;
}

.jgw-quote-form p {
    margin-bottom: 16px;
}

.jgw-quote-form label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: #2a3b4d;
}

.jgw-quote-form input[type="text"],
.jgw-quote-form input[type="email"],
.jgw-quote-form input[type="tel"] {
    width: 100%;
    max-width: 400px;
    padding: 10px 12px;
    border: 1px solid #c8d1da;
    border-radius: 6px;
    background: #fff;
    color: #1f2a37;
}

.jgw-quote-form input[type="text"]:focus,
.jgw-quote-form input[type="email"]:focus,
.jgw-quote-form input[type="tel"]:focus {
    border-color: #2a3b4d;
    outline: none;
    box-shadow: 0 0 0 3px rgba(42, 59, 77, 0.12);
}

/* Newsletter checkbox row — label wraps the checkbox, keep it light */
.jgw-quote-form input[type="checkbox"] {
    margin-right: 8px;
}

.jgw-quote-form label input[type="checkbox"] + *,
.jgw-quote-form p label:has(input[type="checkbox"]) {
    font-weight: 400;
    color: #1f2a37;
}

.jgw-quote-form button[type="submit"] {
    padding: 11px 24px;
    background: #2a3b4d;
    border: 1px solid #2a3b4d;
    border-radius: 6px;
    color: #ffffff;
    font-weight: 600;
    cursor: pointer;
    transition: background 150ms ease, border-color 150ms ease;
}

.jgw-quote-form button[type="submit"]:hover {
    background: #1a2734;
    border-color: #1a2734;
}

/* Modal */
.jgw-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.5);
}

.jgw-modal-content {
    background-color: #fefefe;
    margin: 15% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 90%;
    max-width: 500px;
    position: relative;
}

.jgw-modal-close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.jgw-modal-close:hover {
    color: #000;
}

.jgw-posts-grid {
    list-style: none;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.jgw-post-item {
    border: 1px solid #ddd;
    padding: 15px;
    background: #fff;
}

.jgw-post-image img {
    width: 100%;
    height: auto;
}

/* Toast notifications */
.jgw-toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 100000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 360px;
    pointer-events: none;
}

.jgw-toast {
    pointer-events: auto;
    background: #ffffff;
    border-radius: 6px;
    box-shadow: 0 8px 24px rgba(20, 30, 50, 0.18);
    padding: 14px 18px 14px 16px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    border-left: 4px solid #2a3b4d;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    font-size: 14px;
    color: #222;
    opacity: 0;
    transform: translateX(20px);
    transition: opacity 200ms ease, transform 200ms ease;
}

.jgw-toast.is-visible {
    opacity: 1;
    transform: translateX(0);
}

.jgw-toast.jgw-toast-success {
    border-left-color: #1a8a3a;
}

.jgw-toast.jgw-toast-error {
    border-left-color: #c0392b;
}

.jgw-toast-icon {
    flex: 0 0 auto;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: #fff;
    background: #2a3b4d;
    font-size: 13px;
    line-height: 1;
}

.jgw-toast-success .jgw-toast-icon {
    background: #1a8a3a;
}

.jgw-toast-error .jgw-toast-icon {
    background: #c0392b;
}

.jgw-toast-message {
    flex: 1 1 auto;
    line-height: 1.4;
}

.jgw-toast-close {
    flex: 0 0 auto;
    background: transparent;
    border: 0;
    color: #888;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    padding: 0 0 0 8px;
}

.jgw-toast-close:hover {
    color: #222;
}

/* Styled confirmation modal (replaces window.confirm) */
.jgw-confirm-overlay {
    position: fixed;
    inset: 0;
    z-index: 100001;
    background: rgba(20, 30, 50, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 200ms ease;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

.jgw-confirm-overlay.is-visible {
    opacity: 1;
}

.jgw-confirm {
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 18px 48px rgba(20, 30, 50, 0.25);
    width: 100%;
    max-width: 420px;
    padding: 28px 28px 22px;
    text-align: center;
    transform: scale(0.92);
    transition: transform 220ms ease;
}

.jgw-confirm-overlay.is-visible .jgw-confirm {
    transform: scale(1);
}

.jgw-confirm-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #eef0f3;
    color: #2a3b4d;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: bold;
    margin: 0 auto 12px;
    line-height: 1;
}

.jgw-confirm-danger .jgw-confirm-icon {
    background: #fde8e6;
    color: #c0392b;
}

.jgw-confirm-title {
    margin: 0 0 8px;
    font-size: 18px;
    font-weight: 600;
    color: #1f2a37;
}

.jgw-confirm-message {
    margin: 0 0 20px;
    font-size: 14px;
    color: #5b6975;
    line-height: 1.5;
}

.jgw-confirm-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.jgw-confirm-actions .button {
    min-width: 110px;
    padding: 9px 18px;
    border-radius: 6px;
    font-weight: 600;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background 150ms ease, border-color 150ms ease, transform 150ms ease;
}

.jgw-confirm-cancel {
    background: #ffffff;
    color: #2a3b4d;
    border-color: #c8d1da;
}

.jgw-confirm-cancel:hover {
    background: #f4f6f8;
    border-color: #2a3b4d;
}

.jgw-confirm-ok {
    background: #2a3b4d;
    color: #ffffff;
    border-color: #2a3b4d;
}

.jgw-confirm-ok:hover {
    background: #1a2734;
    border-color: #1a2734;
    transform: translateY(-1px);
}

.jgw-confirm-danger .jgw-confirm-ok {
    background: #c0392b;
    border-color: #c0392b;
}

.jgw-confirm-danger .jgw-confirm-ok:hover {
    background: #a3271b;
    border-color: #a3271b;
}

/* Inline confirmation block (e.g. after a quote submit) */
.jgw-inline-confirm {
    margin: 20px 0;
    padding: 22px 24px;
    background: linear-gradient(180deg, #f3faf5 0%, #ffffff 100%);
    border: 1px solid #cfead7;
    border-left: 4px solid #1a8a3a;
    border-radius: 6px;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    color: #1d3a25;
}

.jgw-inline-confirm-icon {
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #1a8a3a;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 18px;
    line-height: 1;
}

.jgw-inline-confirm-title {
    margin: 0 0 4px;
    font-size: 16px;
    font-weight: 600;
    color: #1a8a3a;
}

.jgw-inline-confirm-message {
    margin: 0;
    font-size: 14px;
    color: #2a3b2a;
    line-height: 1.5;
}


/* Cloudflare Turnstile widget placeholder */
.jgw-turnstile {
    margin: 0 0 15px;
}
