/* =============================================================================
   Luxxri / Lovebuy – Frontend Styles
   Covers: toast, importer tabs, input cards, results grid, product cards,
           load-more button. Responsive down to 420px.
   ============================================================================= */

:root {
    --brand:       #ff7601;
    --brand-dark:  #e06600;
    --brand-light: #fff4ec;
    --dark:        #0f172a;
    --gray-800:    #1e293b;
    --gray-600:    #475569;
    --gray-400:    #94a3b8;
    --gray-200:    #e2e8f0;
    --gray-100:    #f8fafc;
    --white:       #ffffff;
    --success:     #10b981;
    --error:       #ef4444;
    /* Importer: inputs stay slightly frosted; outer shell is one transparent panel */
    --zts-glass-input:   rgba(255, 255, 255, 0.65);
}

.zts-importer *, .zts-importer *::before, .zts-importer *::after,
.zts-results  *, .zts-results  *::before, .zts-results  *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ── Toast notification ────────────────────────────────────────────────────── */
.zts-toast {
    position: fixed;
    bottom: 28px;
    right: 28px;
    z-index: 999999;
    padding: 14px 22px;
    border-radius: 12px;
    max-width: 340px;
    font-size: 14px;
    font-weight: 600;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    box-shadow: 0 8px 28px rgba(0, 0, 0, .18);
    transform: translateY(16px);
    opacity: 0;
    transition: transform .3s ease, opacity .3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}
.zts-toast.show          { transform: translateY(0); opacity: 1; }
.zts-toast.zts-t-success { background: #10b981; color: #fff; }
.zts-toast.zts-t-error   { background: #ef4444; color: #fff; }
.zts-toast.zts-t-info    { background: #2563eb; color: #fff; }
.zts-toast a             { color: #fff; text-decoration: underline; }

/* ── Importer: one transparent shell (tabs + all tab bodies) ─────────────── */
.zts-importer {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    position: relative;
    z-index: 1;
}

/* Single outer box: fully transparent fill; light border + blur reads hero behind whole widget */
.zts-importer-panel {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.42);
    border-radius: 20px;
    padding: 14px 16px 18px;
    box-shadow: none;
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
}

.zts-tabs {
    display: flex;
    gap: 6px;
    padding: 4px 4px 14px;
    margin: 0 0 14px;
    border-radius: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.28);
    background: transparent;
    box-shadow: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
}
.zts-tab {
    flex: 1;
    padding: 9px 4px;
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.78);
    font-size: 13px;
    font-weight: 600;
    border-radius: 100px;
    cursor: pointer;
    transition: background .2s, color .2s, box-shadow .2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}
.zts-tab:hover { color: #fff; }
.zts-tab:hover,
.zts-tab.active {
    background: var(--brand);
    color: var(--white);
    box-shadow: 0 2px 12px rgba(255, 118, 1, 0.35);
}

.zts-section        { display: none; animation: zts-fadein .3s ease; }
.zts-section.active { display: block; }

@keyframes zts-fadein {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Inner cards: no second “white box” — height follows content */
.zts-input-card {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
}

.zts-importer-panel .zts-subtitle {
    font-size: 12px;
    color: rgba(248, 250, 252, 0.92);
    margin-bottom: 12px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

.zts-input-group          { position: relative; margin-bottom: 12px; }
.zts-input-group input {
    width: 100%;
    padding: 12px 14px 12px 40px;
    border: 1px solid rgba(255, 255, 255, 0.65);
    border-radius: 12px;
    font-size: 13px;
    outline: none;
    background: var(--zts-glass-input);
    color: var(--dark);
    transition: border-color .2s, box-shadow .2s, background .2s;
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}
.zts-input-group input::placeholder {
    color: rgba(71, 85, 105, 0.75);
}
.zts-input-group input:focus {
    border-color: rgba(255, 118, 1, 0.65);
    background: rgba(255, 255, 255, 0.82);
    box-shadow: 0 0 0 3px rgba(255, 118, 1, 0.15);
}
.zts-input-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 15px;
    pointer-events: none;
}

.zts-btn-primary {
    width: 100%;
    padding: 11px;
    background: var(--brand);
    color: var(--white);
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: background .2s, transform .15s;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}
.zts-btn-primary:hover    { background: var(--brand-dark); transform: translateY(-1px); }
.zts-btn-primary:disabled { opacity: .6; cursor: not-allowed; transform: none; }
.zts-btn-primary:focus,
.zts-btn-primary:focus-visible,
.zts-btn-primary:active {
    background: var(--brand-dark) !important;
    color: #fff !important;
    box-shadow: 0 0 0 3px rgba(255, 118, 1, 0.24) !important;
    outline: none !important;
}

.zts-inline-msg {
    display: none;
    margin-top: 10px;
    padding: 9px 14px;
    border-radius: 8px;
    font-size: 12px;
    text-align: center;
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}
.zts-inline-msg.success {
    background: rgba(240, 253, 244, 0.88);
    color: var(--success);
    border: 1px solid rgba(187, 247, 208, 0.9);
}
.zts-inline-msg.error {
    background: rgba(254, 242, 242, 0.88);
    color: var(--error);
    border: 1px solid rgba(254, 202, 202, 0.9);
}

/* ── Image upload placeholder ───────────────────────────────────────────── */
.zts-input-card > .zts-upload-area {
    margin-bottom: 12px;
}

.zts-upload-area {
    background: rgba(255, 255, 255, 0.12);
    border: 2px dashed rgba(255, 255, 255, 0.4);
    border-radius: 16px;
    padding: 28px 20px;
    text-align: center;
    cursor: pointer;
    transition: border-color .2s, background .2s, box-shadow .2s;
    position: relative;
    min-height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}
.zts-upload-area:hover {
    border-color: var(--brand);
    background: rgba(255, 244, 236, 0.22);
    box-shadow: 0 4px 20px rgba(255, 118, 1, 0.12);
}
.zts-upload-icon        { font-size: 40px; margin-bottom: 10px; }
.zts-upload-title       { font-size: 15px; font-weight: 700; color: rgba(248, 250, 252, 0.98); margin-bottom: 4px; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35); }
.zts-upload-hint        { font-size: 12px; color: rgba(226, 232, 240, 0.85); }

/* Image preview inside upload area */
#zts-img-preview-wrap {
    position: relative;
    width: 100%;
    text-align: center;
}
#zts-img-preview {
    max-width: 100%;
    max-height: 200px;
    border-radius: 10px;
    object-fit: contain;
    border: 2px solid var(--gray-200);
}
.zts-img-clear {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 26px;
    height: 26px;
    background: var(--error);
    color: var(--white);
    border: none;
    border-radius: 50%;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0,0,0,.2);
    transition: background .2s;
    z-index: 2;
}
.zts-img-clear:hover { background: #c0392b; }

/* ── Results section ──────────────────────────────────────────────────────── */
.zts-results {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    width: 100%;
}
.zts-results-loader {
    display: none;
    text-align: center;
    padding: 60px 20px;
}
.zts-spinner {
    width: 46px;
    height: 46px;
    border: 3px solid var(--gray-200);
    border-top-color: var(--brand);
    border-radius: 50%;
    animation: zts-spin .9s linear infinite;
    margin: 0 auto 14px;
}
@keyframes zts-spin { to { transform: rotate(360deg); } }
.zts-results-loader p { font-size: 14px; color: var(--gray-400); }

.zts-results-header {
    display: none;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--gray-200);
}
.zts-results-title { font-size: 20px; font-weight: 800; color: var(--dark); }
.zts-results-count {
    font-size: 12px;
    color: var(--gray-400);
    background: var(--gray-100);
    padding: 4px 12px;
    border-radius: 100px;
}

.zts-results-msg {
    display: none;
    padding: 12px 18px;
    border-radius: 10px;
    font-size: 13px;
    text-align: center;
    margin-bottom: 18px;
}
.zts-results-msg.success { background: #f0fdf4; color: var(--success); border: 1px solid #bbf7d0; }
.zts-results-msg.error   { background: #fef2f2; color: var(--error);   border: 1px solid #fecaca; }

/* ── Product grid ─────────────────────────────────────────────────────────── */
.zts-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}

/* WC product category archive — fixed columns (default 4 × 3 rows target via shortcode) */
.zts-wc-category-api-root.zts-results--wc-category .zts-cat-products-grid {
    grid-template-columns: repeat(4, 1fr);
}
@media (max-width: 1100px) {
    .zts-wc-category-api-root.zts-results--wc-category .zts-cat-products-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}
@media (max-width: 768px) {
    .zts-wc-category-api-root.zts-results--wc-category .zts-cat-products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
    }
}
@media (max-width: 420px) {
    .zts-wc-category-api-root.zts-results--wc-category .zts-cat-products-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
}

/* ── Product card ─────────────────────────────────────────────────────────── */
.zts-product-card {
    background: var(--white);
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--gray-200);
    box-shadow: 0 2px 10px rgba(0, 0, 0, .07);
    transition: transform .25s, box-shadow .25s;
}
.zts-product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 32px rgba(0, 0, 0, .13);
}

.zts-card-img {
    position: relative;
    height: 210px;
    background: var(--gray-100);
    overflow: hidden;
}
.zts-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .35s;
}
.zts-product-card:hover .zts-card-img img { transform: scale(1.05); }

.zts-badges-top {
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    pointer-events: none;
}
.zts-rank {
    background: var(--brand);
    color: var(--white);
    font-size: 11px;
    font-weight: 800;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(255, 118, 1, .45);
}
.zts-trending {
    background: rgba(255, 255, 255, .93);
    color: var(--dark);
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 100px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .12);
}
.zts-platform-badge {
    position: absolute;
    bottom: 10px;
    left: 10px;
    background: rgba(0, 0, 0, .55);
    color: var(--white);
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
    letter-spacing: .4px;
    text-transform: uppercase;
}

.zts-card-body { padding: 14px 16px 16px; }
.zts-card-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-800);
    line-height: 1.45;
    height: 38px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    margin-bottom: 10px;
}
.zts-price-meta  { display: flex; justify-content: space-between; margin-bottom: 4px; }
.zts-base-lbl    { font-size: 12px; color: var(--gray-400); }
.zts-service-lbl { font-size: 11px; color: var(--gray-400); }
.zts-price-total { font-size: 22px; font-weight: 800; color: var(--brand); letter-spacing: -.4px; margin-bottom: 4px; }
.zts-sold        { font-size: 12px; color: var(--gray-400); margin-bottom: 14px; }

.zts-actions { display: flex; gap: 8px; }
.zts-btn-cart {
    flex: 1;
    padding: 9px 6px;
    background: var(--brand);
    color: var(--white);
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: background .2s, transform .15s;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}
.zts-btn-cart:hover    { background: var(--brand-dark); transform: translateY(-1px); }
.zts-btn-cart:disabled { opacity: .6; cursor: not-allowed; transform: none; }
.zts-btn-cart:focus,
.zts-btn-cart:focus-visible,
.zts-btn-cart:active {
    background: var(--brand-dark) !important;
    color: #fff !important;
    box-shadow: 0 0 0 3px rgba(255, 118, 1, 0.24) !important;
    outline: none !important;
}

.zts-btn-view {
    flex: 1;
    padding: 9px 6px;
    background: var(--white);
    color: var(--brand);
    border: 2px solid var(--brand);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .2s, color .2s, transform .15s;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}
.zts-btn-view:hover { background: var(--brand); color: var(--white); transform: translateY(-1px); }
.zts-btn-view:focus,
.zts-btn-view:focus-visible,
.zts-btn-view:active {
    background: var(--brand) !important;
    color: #fff !important;
    border-color: var(--brand) !important;
    box-shadow: 0 0 0 3px rgba(255, 118, 1, 0.24) !important;
    outline: none !important;
}

/* ── Load more ────────────────────────────────────────────────────────────── */
.zts-load-more-wrap { text-align: center; margin-top: 36px; }
.zts-btn-load-more {
    padding: 12px 48px;
    background: var(--white);
    color: var(--brand);
    border: 2px solid var(--brand);
    border-radius: 100px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: background .2s, color .2s, transform .2s;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}
.zts-btn-load-more:hover    { background: var(--brand); color: var(--white); transform: translateY(-2px); }
.zts-btn-load-more:disabled { opacity: .6; cursor: not-allowed; transform: none; }
.zts-btn-load-more:focus,
.zts-btn-load-more:focus-visible,
.zts-btn-load-more:active {
    background: var(--brand) !important;
    color: #fff !important;
    border-color: var(--brand) !important;
    box-shadow: 0 0 0 3px rgba(255, 118, 1, 0.24) !important;
    outline: none !important;
}

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .zts-products-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
    .zts-card-img      { height: 170px; }
    .zts-price-total   { font-size: 18px; }
}
@media (max-width: 420px) {
    .zts-products-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
}
