/**
 * Public styles for JG Wishlist
 */

.jgw-wishlist-buttons {
    margin: 20px 0;
}

.jgw-add-to-wishlist,
.jgw-view-wishlist {
    margin-right: 10px;
}

.jgw-back-in-stock {
    margin-top: 10px;
    display: block;
}

.jgw-wishlist-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.jgw-wishlist-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

.jgw-wishlist-header .jgw-wishlist-title {
    margin: 0;
}

.jgw-remove-all,
.jgw-remove-item,
.jgw-add-to-wishlist,
.jgw-view-wishlist {
    cursor: pointer !important;
}

.jgw-remove-all {
    background-color: #dc3545 !important;
    border-color: #dc3545 !important;
    color: #fff !important;
}

.jgw-remove-all:hover {
    background-color: #c82333 !important;
    border-color: #bd2130 !important;
}

.jgw-remove-item {
    background-color: #6c757d !important;
    border-color: #6c757d !important;
    color: #fff !important;
}

.jgw-remove-item:hover {
    background-color: #5a6268 !important;
    border-color: #545b62 !important;
}

.jgw-wishlist-items {
    list-style: none;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.jgw-wishlist-item {
    border: 1px solid #ddd;
    padding: 15px;
    background: #fff;
}

.jgw-item-image img {
    width: 100%;
    height: auto;
}

.jgw-item-details h3 {
    margin-top: 10px;
    margin-bottom: 5px;
}

.jgw-item-actions {
    margin-top: 15px;
}

.jgw-item-actions .button {
    margin-right: 10px;
}

/* ─── Shared form primitives ─────────────────────────────────────────────── */

.jgw-form-intro {
    margin: 0 0 24px;
    color: #6b7280;
    font-size: 0.925rem;
    line-height: 1.6;
}

.jgw-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

@media (max-width: 600px) {
    .jgw-form-row {
        grid-template-columns: 1fr;
    }
}

.jgw-form-field {
    margin-bottom: 18px;
}

.jgw-form-field label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 0.875rem;
    color: #374151;
}

.jgw-required {
    color: #dc3545;
    margin-left: 2px;
}

.jgw-form-field input[type="text"],
.jgw-form-field input[type="email"],
.jgw-form-field input[type="tel"] {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 14px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.975rem;
    line-height: 1.5;
    color: #111827;
    background: #fff;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    -webkit-appearance: none;
    appearance: none;
}

.jgw-form-field input[type="text"]:focus,
.jgw-form-field input[type="email"]:focus,
.jgw-form-field input[type="tel"]:focus {
    outline: none;
    border-color: #6b7280;
    box-shadow: 0 0 0 3px rgba(107, 114, 128, 0.15);
}

.jgw-form-field--checkbox label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: normal;
    color: #374151;
    cursor: pointer;
}

.jgw-form-field--checkbox input[type="checkbox"] {
    width: 17px;
    height: 17px;
    flex-shrink: 0;
    cursor: pointer;
    accent-color: #374151;
}

.jgw-form-actions {
    margin-top: 8px;
}

.jgw-submit-btn {
    min-width: 160px;
}

/* ─── Quote form container ───────────────────────────────────────────────── */

.jgw-quote-form-container {
    margin-top: 48px;
    padding: 32px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.06);
}

.jgw-quote-form-container h3 {
    margin: 0 0 8px;
    font-size: 1.25rem;
}

/* ─── Modal ──────────────────────────────────────────────────────────────── */

.jgw-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    inset: 0;
    overflow-y: auto;
    background-color: rgba(0, 0, 0, 0.55);
    padding: 24px 16px;
    box-sizing: border-box;
}

.jgw-modal-content {
    background: #fff;
    margin: 6% auto;
    border: none;
    border-radius: 12px;
    width: 100%;
    max-width: 460px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    overflow: hidden;
}

.jgw-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e5e7eb;
}

.jgw-modal-header h2 {
    margin: 0;
    font-size: 1.1rem;
    line-height: 1.3;
}

.jgw-modal-close {
    background: none;
    border: none;
    padding: 4px;
    line-height: 1;
    font-size: 22px;
    color: #9ca3af;
    cursor: pointer;
    border-radius: 4px;
    transition: color 0.1s ease, background 0.1s ease;
}

.jgw-modal-close:hover {
    color: #111827;
    background: #f3f4f6;
}

.jgw-modal-body {
    padding: 24px;
}

.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;
}

/* Product Loop Wishlist Button */
.jgw-wishlist-button-loop {
    margin-top: 10px;
    text-align: center;
}

.jgw-wishlist-button-loop .button {
    display: inline-block;
    width: 100%;
    box-sizing: border-box;
}

/* Loading state */
.jgw-add-to-wishlist.jgw-loading {
    opacity: 0.6;
    cursor: wait;
}

/* Added state with tick animation */
.jgw-added {
    background-color: #46a74e !important;
    border-color: #46a74e !important;
    color: #fff !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 6px;
    opacity: 1 !important;
}

.jgw-tick {
    display: inline-block;
    vertical-align: middle;
}

.jgw-tick-path {
    stroke-dasharray: 30;
    stroke-dashoffset: 30;
    animation: jgw-draw-tick 0.5s ease forwards;
}

@keyframes jgw-draw-tick {
    to {
        stroke-dashoffset: 0;
    }
}

/* Stock status badges */
.jgw-in-stock {
    color: #46a74e;
    font-weight: 600;
}

.jgw-out-of-stock {
    color: #dc3545;
    font-weight: 600;
}

/* DataTables overrides for wishlist table */
#jgw-wishlist-table img {
    max-width: 80px;
    height: auto;
}

#jgw-wishlist-table td {
    vertical-align: middle;
}

#jgw-wishlist-table .jgw-item-actions {
    white-space: nowrap;
    text-align: center;
    margin-top: 0;
}

#jgw-wishlist-table .jgw-item-actions .button {
    margin: 2px;
}

/* Success/Error messages */
.jgw-success-message {
    color: #46a74e;
    font-weight: 600;
    padding: 15px;
    text-align: center;
    background: rgba(70, 167, 78, 0.1);
    border-radius: 4px;
}

.jgw-error-message {
    color: #dc3545;
    font-weight: 600;
    padding: 10px;
    margin-bottom: 15px;
    background: rgba(220, 53, 69, 0.1);
    border-radius: 4px;
}

/* Loading state for all buttons */
.jgw-loading {
    opacity: 0.6;
    cursor: wait;
    pointer-events: none;
}


