#tth-wfp-form-wrap, .tth-wfp-modal-content {
    max-width: 700px;
    margin: 20px auto;
    padding: 20px;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.tth-wfp-block {
    margin-bottom: 15px;
}
.tth-wfp-block label {
    display: block;
    font-weight: bold;
    margin-bottom: 5px;
}
.tth-wfp-block input[type="text"],
.tth-wfp-block input[type="number"],
.tth-wfp-block textarea,
.tth-wfp-block select {
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
}
.tth-wfp-cats {
    max-height: 150px;
    overflow-y: auto;
    border: 1px solid #ccc;
    padding: 10px;
    background: #fff;
}
.tth-wfp-cats label {
    display: block;
    font-weight: normal;
}

.tth-wfp-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

#tth-add-type-btn {
    margin: 10px 0;
}

#tth-wfp-form-result .tth-success { color: green; }
#tth-wfp-form-result .tth-error { color: red; }

/* Loading Overlay */
#tth-wfp-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}
.tth-wfp-loader {
    font-size: 1.2em;
    font-weight: bold;
    color: #333;
}

/* Products Grid */
.tth-wfp-products-grid {
    display: grid;
    grid-template-columns: 1fr; /* mobile: 1 column */
    gap: 20px;
}

@media (min-width: 600px) {
    .tth-wfp-products-grid {
        grid-template-columns: repeat(2, 1fr); /* tablet: 2 columns */
    }
}

@media (min-width: 992px) {
    .tth-wfp-products-grid {
        grid-template-columns: repeat(3, 1fr); /* desktop: 3 columns */
    }
}
.tth-wfp-product-card {
    border: 1px solid #ddd;
    border-radius: 5px;
    display: flex;
    flex-direction: column;
}
.tth-wfp-card-image {
    width: 100%;
    padding-top: 100%; /* 1:1 Aspect Ratio */
    position: relative;
    background: #eee;
}
.tth-wfp-card-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.tth-wfp-card-body {
    padding: 15px;
    flex-grow: 1;
}
.tth-wfp-card-actions {
    padding: 15px;
    border-top: 1px solid #ddd;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Modal */
.tth-wfp-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.5);
}
.tth-wfp-modal-content {
    position: relative;
    margin: 5% auto;
    max-height: 80vh;
    overflow-y: auto;
}
.tth-wfp-modal-close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

/* Image Previews */
.tth-wfp-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}
/* Ensure wrapper can anchor the delete button */
.tth-wfp-preview .tth-wfp-preview-wrapper {
    position: relative;
    width: 100px;
    height: 100px;
}
.tth-wfp-preview img {
    width: 100%;
    height: 100%;
    border: 1px solid #ddd;
    border-radius: 4px;
    object-fit: cover;
}

/* New circular trash-button design */
.tth-wfp-delete-img-btn {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(180deg, #ff5f56 0%, #ff3b30 100%);
    /* Make the × visible and centered */
    color: #fff;            /* show the glyph */
    font-size: 16px;        /* readable size */
    font-weight: 700;       /* bold for clarity */
    line-height: 28px;      /* match the button height for perfect centering */
    text-shadow: 0 1px 2px rgba(0,0,0,0.25);
    /* keep the circle design you liked */
    position: absolute;
    top: 6px;
    right: 6px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(180deg, #ff5f56 0%, #ff3b30 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.25);
    cursor: pointer;
    opacity: 0.95;
    transition: transform 0.15s ease, opacity 0.15s ease, box-shadow 0.15s ease;
}
/* Inline SVG trash icon */
.tth-wfp-delete-img-btn::before {
    content: "";
    width: 16px;
    height: 16px;
    background-size: 16px 16px;
    background-repeat: no-repeat;
    background-position: center;
    background-image: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0id2hpdGUiPjxwYXRoIGQ9Ik0xMCAyYTUgNSAwIDAxNCAwaDFsMSAySDloMWwxLTJ6TTQgOGgxNnYySDRWOHptMiAzaDE0bC0xLjMgMTFIOC4zTDEwIDExeiIvPjwvc3ZnPg==');
    /* Disable the pseudo-element since the icon didn't render */
    display: none;
}
/* Hover/focus states */
.tth-wfp-delete-img-btn:hover {
    transform: scale(1.08);
    opacity: 1;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}
.tth-wfp-delete-img-btn:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}
.tth-type-group {
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 16px;
    background: #fff;
}
.tth-type-heading {
    margin: 0 0 10px 0;
    font-size: 25px;
    font-weight: 600;
    color: #333;
    margin-bottom: 30px;
}

/* Sizes pills */
.tth-wfp-sizes-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin: 8px 0 12px;
}
.tth-wfp-pill {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 9999px;
    background: #fff;
    color: #333;
    cursor: pointer;
    user-select: none;
    transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}
.tth-wfp-pill:hover {
    border-color: #0073aa;
}
.tth-wfp-pill input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    width: 0;
    height: 0;
}
.tth-wfp-pill.active {
    border-color: #0073aa;
    background: #f0f8ff;
    color: #0073aa;
}

/* Filters bar */
.tth-wfp-filters {
    display: flex;
    gap: 10px;
    align-items: center;
    margin: 10px 0 20px;
}
.tth-wfp-filters input[type="text"], .tth-wfp-filters select {
    padding: 6px 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

/* Make Select2/SelectWoo filters wider */
#tth-filter-text-select.tth-select2,
#tth-filter-author-store-select.tth-select2 {
    width: 300px; /* base width for original selects */
    min-width: 300px;
}

/* Select2/SelectWoo rendered containers */
.tth-wfp-filters .select2-container {
    min-width: 300px;
    width: 300px !important; /* ensure wider visible field */
}

.tth-wfp-filters .select2-selection--single {
    min-height: 36px; /* a bit taller for better usability */
    padding: 6px 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

/* Gallery thumbnails in cards */
.tth-wfp-card-gallery-thumbs {
    display: flex;
    gap: 6px;
    padding: 8px 12px;
    flex-wrap: wrap;
}
.tth-wfp-thumb img {
    width: 40px;
    height: 40px;
    border: 1px solid #ddd;
    border-radius: 4px;
    object-fit: cover;
}

/* Status badge */
.tth-wfp-status-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 9999px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #fff;
}
.tth-wfp-status-badge.is-online { background: #28a745; }   /* green */
.tth-wfp-status-badge.is-offline { background: #6c757d; }  /* gray */
.tth-wfp-status-badge.is-pending { background: #dc3545; }  /* red */

/* Apply Montserrat across plugin UI */
.tth-wfp-products-grid,
.tth-wfp-filters,
.tth-wfp-product-card,
.tth-wfp-card-body,
.tth-wfp-card-actions,
.tth-wfp-card-meta,
.tth-wfp-status-badge,
.tth-wfp-card-title {
    font-family: 'Montserrat', sans-serif;
}

/* Action button colors (existing) */
.tth-btn-blue { background: #0073aa; color: #fff; border-color: #006799; }
.tth-btn-green { background: #28a745; color: #fff; border-color: #1e7e34; }
.tth-btn-orange { background: #fd7e14; color: #fff; border-color: #e26a00; }
.tth-btn-red { background: #dc3545; color: #fff; border-color: #c82333; }
.tth-btn-grey { background: #6c757d; color: #fff; border-color: #5c636a; }
/* New: black button for View Product */
.tth-btn-black { background: #000; color: #fff; border-color: #000; }

.tth-wfp-card-actions .button {
    padding: 6px 10px;
    border-radius: 4px;
}

/* Card meta */
.tth-wfp-card-meta {
    display: grid;
    grid-template-columns: 1fr;
    gap: 4px;
    margin: 8px 0;
    font-size: 13px;
}

#tth-wfp-count {
    font-family: 'Montserrat', sans-serif;
    margin: 10px 0 16px;
    padding: 10px 14px;
    background: #f8f9fa;
    border: 1px solid #e1e4e8;
    border-radius: 6px;
    color: #333;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
#tth-wfp-count::before {
    content: "📦";
    font-size: 16px;
    line-height: 1;
}
#tth-wfp-count .tth-count-badge {
    display: inline-block;
    padding: 2px 8px;
    background: #0073aa;
    color: #fff;
    border-radius: 9999px;
    font-size: 12px;
    font-weight: 600;
}