/* KB Product Import – Certificates Page
   Shortcode: [kb_certificati]
   --------------------------------------------------------------- */

/* ---------------------------------------------------------------
   Page wrapper
--------------------------------------------------------------- */
.kb-certs-page {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 0 40px;
    font-size: 0.95em;
    color: #444;
}

/* ---------------------------------------------------------------
   Search form
--------------------------------------------------------------- */
.kb-certs-search-form {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.kb-certs-search-input {
    flex: 1 1 240px;
    min-width: 0;
    padding: 9px 14px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.95em;
    line-height: 1.4;
    outline: none;
    transition: border-color 0.2s;
}

.kb-certs-search-input:focus {
    border-color: #e87722;
}

.kb-certs-search-btn {
    padding: 9px 20px;
    background: #e87722;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 0.95em;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s;
}

.kb-certs-search-btn:hover,
.kb-certs-search-btn:focus {
    background: #c96210;
}

.kb-certs-reset-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #f0f0f0;
    color: #666;
    text-decoration: none;
    font-size: 1.1em;
    font-weight: 700;
    line-height: 1;
    transition: background 0.2s, color 0.2s;
}

.kb-certs-reset-btn:hover {
    background: #e0e0e0;
    color: #333;
    text-decoration: none;
}

/* ---------------------------------------------------------------
   Login notice (for guests)
--------------------------------------------------------------- */
.kb-certs-login-notice {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    margin-bottom: 24px;
    background: #fff8f2;
    border: 1px solid #f5c49a;
    border-radius: 4px;
    font-size: 0.9em;
    color: #7a4a1e;
}

.kb-certs-login-notice a {
    color: #e87722;
    font-weight: 600;
    text-decoration: underline;
}

.kb-certs-login-notice a:hover {
    color: #c96210;
}

/* ---------------------------------------------------------------
   Results summary
--------------------------------------------------------------- */
.kb-certs-summary {
    font-size: 0.88em;
    color: #888;
    margin-bottom: 16px;
}

/* ---------------------------------------------------------------
   Product cards list
--------------------------------------------------------------- */
.kb-certs-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.kb-certs-card {
    background: #fff;
    border: 1px solid #e2e2e2;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,.05);
}

/* ---------------------------------------------------------------
   Card header (product name + category)
--------------------------------------------------------------- */
.kb-certs-card-header {
    display: flex;
    align-items: baseline;
    gap: 12px;
    padding: 14px 18px;
    background: #f8f8f8;
    border-bottom: 1px solid #e2e2e2;
    flex-wrap: wrap;
}

.kb-certs-product-name {
    font-weight: 600;
    font-size: 1em;
    color: #222;
    text-decoration: none;
    flex: 1 1 auto;
    min-width: 0;
}

.kb-certs-product-name:hover {
    color: #e87722;
    text-decoration: underline;
}

.kb-certs-product-cat {
    font-size: 0.82em;
    color: #888;
    white-space: nowrap;
    flex-shrink: 0;
}

/* ---------------------------------------------------------------
   Document list inside a card
--------------------------------------------------------------- */
.kb-certs-doc-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.kb-certs-doc-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 11px 18px;
    border-bottom: 1px solid #f0f0f0;
}

.kb-certs-doc-row:last-child {
    border-bottom: none;
}

.kb-certs-doc-label {
    flex: 1 1 auto;
    font-size: 0.9em;
    color: #555;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ---------------------------------------------------------------
   Download button (logged-in variant: compact, matches frontend.css)
--------------------------------------------------------------- */
.kb-download-btn--sm {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    width: auto;
    height: auto;
    border-radius: 4px;
    background: #e87722;
    color: #fff;
    text-decoration: none;
    font-size: 0.85em;
    font-weight: 600;
    white-space: nowrap;
    transition: background 0.2s;
    flex-shrink: 0;
}

.kb-download-btn--sm:hover,
.kb-download-btn--sm:focus {
    background: #c96210;
    color: #fff;
    text-decoration: none;
}

.kb-download-btn--sm .kb-download-icon {
    font-size: 1.05em;
}

/* ---------------------------------------------------------------
   Login gate button (guest variant)
--------------------------------------------------------------- */
.kb-login-gate-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 4px;
    background: #f5f5f5;
    border: 1px solid #ddd;
    color: #777;
    text-decoration: none;
    font-size: 0.85em;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
    transition: background 0.2s, color 0.2s;
}

.kb-login-gate-btn:hover,
.kb-login-gate-btn:focus {
    background: #e8e8e8;
    color: #333;
    text-decoration: none;
}

.kb-lock-icon {
    font-size: 0.95em;
    line-height: 1;
}

/* ---------------------------------------------------------------
   Pagination
--------------------------------------------------------------- */
.kb-certs-pagination {
    margin-top: 32px;
}

.kb-certs-pagination .page-numbers {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 4px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.kb-certs-pagination .page-numbers li {
    display: block;
}

.kb-certs-pagination .page-numbers a,
.kb-certs-pagination .page-numbers span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.88em;
    text-decoration: none;
    color: #444;
    background: #fff;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.kb-certs-pagination .page-numbers a:hover {
    background: #f5f5f5;
    border-color: #bbb;
    color: #222;
}

.kb-certs-pagination .page-numbers .current {
    background: #e87722;
    border-color: #e87722;
    color: #fff;
    font-weight: 600;
}

/* ---------------------------------------------------------------
   No results / empty state
--------------------------------------------------------------- */
.kb-certs-no-results {
    padding: 32px 20px;
    text-align: center;
    color: #888;
    background: #fafafa;
    border: 1px dashed #ddd;
    border-radius: 6px;
    font-size: 0.95em;
}

/* ---------------------------------------------------------------
   Responsive — narrow screens
--------------------------------------------------------------- */
@media (max-width: 640px) {
    .kb-certs-card-header {
        flex-direction: column;
        gap: 4px;
    }

    .kb-certs-product-cat {
        white-space: normal;
    }

    .kb-certs-doc-row {
        flex-wrap: wrap;
        gap: 8px;
    }

    .kb-certs-doc-label {
        white-space: normal;
        overflow: visible;
        flex-basis: 100%;
    }

    .kb-certs-search-form {
        flex-wrap: wrap;
    }

    .kb-certs-search-input {
        flex-basis: 100%;
    }
}
