/* JW Home — AI Product Search Frontend */

.jw-front-wrap {
    max-width: 1100px;
    margin: 0 auto;
    padding: 40px 20px;
    font-family: inherit;
    color: #2d2d2d;
    box-sizing: border-box;
}

.jw-front-wrap * { box-sizing: border-box; }

/* ── Header ── */
.jw-front-header { text-align: center; margin-bottom: 32px; }
.jw-front-header h2 { font-size: 1.8rem; font-weight: 700; margin: 0 0 10px; color: #1a1a1a; }
.jw-front-header p  { font-size: 15px; color: #666; margin: 0; }

/* ── Form ── */
.jw-front-form { background: #fff; border: 1px solid #e5e5e5; border-radius: 16px; padding: 28px; margin-bottom: 20px; box-shadow: 0 2px 16px rgba(0,0,0,0.06); }

/* ── Upload area ── */
.jw-front-upload-area {
    border: 2px dashed #d0d0d0;
    border-radius: 12px;
    min-height: 180px;
    margin-bottom: 14px;
    transition: border-color .2s, background .2s;
    position: relative;
    overflow: hidden;
}
.jw-front-upload-area.drag-over { border-color: #c9973b; background: #fffbf3; }

.jw-front-drop-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 36px 20px;
    text-align: center;
    color: #888;
}
.jw-front-drop-icon { font-size: 2.4rem; margin-bottom: 10px; }
.jw-front-drop-inner p { margin: 0 0 12px; font-size: 14px; line-height: 1.6; }
.jw-front-drop-inner strong { color: #333; }
.jw-front-or { font-size: 12px; color: #bbb; margin: 8px 0; }

.jw-front-browse-btn {
    display: inline-block;
    background: #1a3a5c;
    color: #fff;
    padding: 10px 22px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s;
}
.jw-front-browse-btn:hover { background: #0f2540; }

/* ── Preview ── */
.jw-front-preview { position: relative; padding: 8px; }
.jw-front-preview img { width: 100%; max-height: 280px; object-fit: contain; border-radius: 8px; display: block; }
.jw-front-remove-btn {
    position: absolute; top: 14px; right: 14px;
    background: rgba(0,0,0,0.55); color: #fff;
    border: none; border-radius: 50%;
    width: 28px; height: 28px;
    cursor: pointer; font-size: 13px;
    display: flex; align-items: center; justify-content: center;
}
.jw-front-remove-btn:hover { background: #c0392b; }

/* ── URL row ── */
.jw-front-url-row { display: flex; gap: 8px; margin-bottom: 16px; }
.jw-front-url-row input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 13px;
    color: #333;
    outline: none;
}
.jw-front-url-row input:focus { border-color: #1a3a5c; }
.jw-front-load-btn {
    background: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 10px 18px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    color: #333;
    transition: background .2s;
}
.jw-front-load-btn:hover { background: #e0e0e0; }

/* ── Notes ── */
.jw-front-notes-wrap { margin-bottom: 20px; }
.jw-front-notes-wrap label { display: block; font-size: 13px; font-weight: 600; color: #444; margin-bottom: 6px; }
.jw-front-notes-wrap label span { font-weight: 400; color: #999; }
.jw-front-notes-wrap textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.6;
    color: #333;
    resize: vertical;
    outline: none;
    font-family: inherit;
}
.jw-front-notes-wrap textarea:focus { border-color: #1a3a5c; }

/* ── Search button ── */
.jw-front-search-btn {
    width: 100%;
    background: #c9973b;
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 14px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: background .2s;
    letter-spacing: 0.01em;
}
.jw-front-search-btn:hover:not(:disabled) { background: #b8852d; }
.jw-front-search-btn:disabled { opacity: 0.45; cursor: not-allowed; }

.jw-front-status { font-size: 12px; color: #888; text-align: center; margin: 8px 0 0; min-height: 18px; }

/* ── Pinterest help ── */
.jw-front-pinterest-help {
    background: #fff8f0;
    border: 1px solid #f5c6a0;
    border-radius: 10px;
    padding: 14px 18px;
    margin-bottom: 16px;
    font-size: 13px;
}
.jw-front-pinterest-help strong { color: #c0392b; display: block; margin-bottom: 6px; }
.jw-front-pinterest-help ol { margin: 0 0 0 16px; padding: 0; line-height: 2; }

/* ── Loading ── */
.jw-front-loading { text-align: center; padding: 48px 20px; }
.jw-front-spinner {
    width: 44px; height: 44px;
    border: 4px solid #e0e0e0;
    border-top-color: #1a3a5c;
    border-radius: 50%;
    animation: jw-spin 0.8s linear infinite;
    margin: 0 auto 16px;
}
@keyframes jw-spin { to { transform: rotate(360deg); } }
.jw-front-loading p { font-size: 14px; color: #888; margin: 0; }

/* ── Results ── */
.jw-front-results { margin-top: 32px; }
.jw-front-results-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.jw-front-results-header h3 { margin: 0; font-size: 1.2rem; color: #1a1a1a; }
.jw-front-results-header h3 span { font-size: 13px; font-weight: 400; color: #888; margin-left: 6px; }
.jw-front-results-meta { font-size: 12px; color: #aaa; }

.jw-front-inspiration {
    background: #f0f4f8;
    border-left: 4px solid #1a3a5c;
    border-radius: 0 8px 8px 0;
    padding: 12px 16px;
    font-size: 13px;
    color: #555;
    line-height: 1.6;
    margin-bottom: 24px;
    display: none;
}
.jw-front-inspiration.visible { display: block; }

/* ── Category tabs ── */
.jw-front-category-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.jw-front-tab {
    background: #fff; border: 1px solid #e0e0e0; border-radius: 999px;
    padding: 7px 14px; font-size: 12px; font-weight: 600; color: #444;
    cursor: pointer; text-transform: capitalize; transition: all .15s;
}
.jw-front-tab:hover { border-color: #1a3a5c; color: #1a3a5c; }
.jw-front-tab.active { background: #1a3a5c; border-color: #1a3a5c; color: #fff; }
.jw-front-tab span { opacity: .75; font-weight: 400; margin-left: 4px; }

/* ── Section labels ── */
.jw-front-section-label { display: flex; align-items: center; gap: 10px; margin: 24px 0 14px; }
.jw-front-label-exact   { font-size: 14px; font-weight: 700; color: #1a3a5c; }
.jw-front-label-related { font-size: 14px; font-weight: 700; color: #c9973b; }
.jw-front-label-sub     { font-size: 12px; color: #aaa; }

/* ── Product grid ── */
.jw-front-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

/* ── Product card ── */
.jw-front-card {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: transform .15s, box-shadow .15s;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
}
.jw-front-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
    text-decoration: none;
    color: inherit;
}

.jw-front-card-score-bar { height: 3px; background: #eee; }
.jw-front-card-score-fill { height: 100%; background: linear-gradient(90deg, #c9973b, #1a3a5c); border-radius: 2px; }

.jw-front-card-img {
    height: 190px;
    background: #f8f8f8;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}
.jw-front-card-img img { max-width: 100%; max-height: 190px; object-fit: contain; padding: 8px; }
.jw-front-card-img .jw-no-img { font-size: 2.5rem; opacity: .25; }

.jw-front-score-pill {
    position: absolute;
    top: 8px; right: 8px;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 10px;
    color: #fff;
}
.jw-front-score-pill.high { background: #2d8653; }
.jw-front-score-pill.med  { background: #c9973b; }
.jw-front-score-pill.low  { background: #aaa; }

.jw-front-card-body { padding: 14px; flex: 1; display: flex; flex-direction: column; gap: 5px; }
.jw-front-card-type { font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: #c9973b; margin: 0; }
.jw-front-card-title { font-size: 13px; font-weight: 600; color: #1a1a1a; line-height: 1.4; margin: 0; }
.jw-front-card-price { font-size: 14px; font-weight: 700; color: #1a3a5c; margin: 0; }
.jw-front-card-dims  { font-size: 11px; color: #aaa; margin: 0; }
.jw-front-card-stock { font-size: 11px; margin: 0; }
.jw-front-card-stock.in  { color: #2d8653; }
.jw-front-card-stock.out { color: #c0392b; }
.jw-front-card-reason { font-size: 11px; color: #888; line-height: 1.5; background: #f8f8f8; border-radius: 6px; padding: 7px 9px; margin-top: auto; border-left: 2px solid #c9973b; }

.jw-front-card-footer { padding: 12px 14px; border-top: 1px solid #f0f0f0; }
.jw-front-card-footer a {
    display: block;
    text-align: center;
    background: #1a3a5c;
    color: #fff !important;
    border-radius: 7px;
    padding: 9px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    transition: background .2s;
}
.jw-front-card-footer a:hover { background: #0f2540; }

/* ── No results ── */
.jw-front-no-results { text-align: center; padding: 48px 20px; color: #aaa; }
.jw-front-no-results span { font-size: 3rem; display: block; margin-bottom: 12px; }
.jw-front-no-results p { font-size: 14px; }

/* ── Reset ── */
.jw-front-reset-wrap { text-align: center; margin-top: 32px; padding-top: 24px; border-top: 1px solid #eee; }
.jw-front-reset-btn {
    background: transparent;
    border: 2px solid #1a3a5c;
    color: #1a3a5c;
    border-radius: 8px;
    padding: 10px 28px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s;
}
.jw-front-reset-btn:hover { background: #1a3a5c; color: #fff; }

/* ── Cache / speed badges ── */
.jw-front-cache-badge { background: #e8f8ef; color: #2d8653; border: 1px solid #b7e4c7; padding: 3px 10px; border-radius: 10px; font-size: 11px; font-weight: 700; }
.jw-front-speed-badge { background: #eef4fb; color: #1a3a5c; border: 1px solid #c5d8ee; padding: 3px 10px; border-radius: 10px; font-size: 11px; font-weight: 700; }

/* ── Responsive ── */
@media (max-width: 600px) {
    .jw-front-header h2 { font-size: 1.4rem; }
    .jw-front-form { padding: 18px; }
    .jw-front-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
    .jw-front-card-img { height: 150px; }
}

/* ── Pagination ──────────────────────────────────────────────────────────── */
.jw-front-pagination { margin: 24px 0 8px; }
.jw-front-pag-info { text-align: center; font-size: 12px; color: #aaa; margin-bottom: 12px; }
.jw-front-pag-buttons { display: flex; align-items: center; justify-content: center; gap: 6px; flex-wrap: wrap; }
.jw-front-pag-btn {
    min-width: 36px; height: 36px;
    padding: 0 10px;
    border: 1px solid #ddd;
    border-radius: 7px;
    background: #fff;
    color: #333;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all .15s;
}
.jw-front-pag-btn:hover { background: #f0f4f8; border-color: #1a3a5c; color: #1a3a5c; }
.jw-front-pag-btn.active { background: #1a3a5c; color: #fff; border-color: #1a3a5c; font-weight: 700; }
.jw-front-pag-dots { color: #aaa; font-size: 13px; padding: 0 4px; }

/* ── Notes field improvement ─────────────────────────────────────────────── */
.jw-front-notes-wrap label { font-size: 14px; font-weight: 600; color: #1a1a1a; margin-bottom: 8px; }
.jw-front-notes-wrap label span { font-weight: 400; color: #999; font-size: 12px; }
.jw-front-notes-wrap textarea { font-size: 13px; color: #333; }
.jw-front-notes-wrap textarea::placeholder { color: #bbb; line-height: 1.8; }

/* ── Feedback widget ──────────────────────────────────────────────────────── */
.jw-front-feedback-wrap { max-width: 600px; margin: 24px auto 0; text-align: center; }
.jw-front-feedback-toggle {
    background: none;
    border: 1px solid #ddd;
    border-radius: 20px;
    padding: 8px 18px;
    font-size: 13px;
    color: #666;
    cursor: pointer;
    transition: all .15s;
}
.jw-front-feedback-toggle:hover { border-color: #1a3a5c; color: #1a3a5c; }
.jw-front-feedback-form {
    text-align: left;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 12px;
    padding: 20px;
    margin-top: 12px;
    box-shadow: 0 2px 16px rgba(0,0,0,0.06);
}
.jw-front-feedback-form p { margin: 0 0 12px; font-size: 13px; color: #666; }
.jw-front-feedback-form input,
.jw-front-feedback-form textarea {
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 10px;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 13px;
}
.jw-front-feedback-submit {
    background: #1a3a5c;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 10px 22px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s;
}
.jw-front-feedback-submit:hover { background: #0f2540; }
.jw-front-feedback-submit:disabled { opacity: .6; cursor: not-allowed; }
.jw-front-feedback-status { margin: 8px 0 0; font-size: 12px; }
