/* Exceed COA Manager — Frontend Styles */

/* ── Hide Woodmart page-title banner on COA pages ─────────────────── */
/* Belt-and-suspenders fallback in case the PHP filter doesn't fire.  */
body.excoa-page .wd-page-title,
body.excoa-page .woodmart-title-section,
body.excoa-page .page-title-bar { display: none !important; }

/* ── Page wrapper ─────────────────────────────────────────────────── */
.excoa-page-wrapper {
    max-width: 1100px;
    margin: 0 auto;
    padding: 30px 20px 60px;
}

/* ── Breadcrumb ───────────────────────────────────────────────────── */
.excoa-breadcrumb {
    font-size: 14px;
    margin-bottom: 16px;
    color: #888;
}
.excoa-breadcrumb a { color: var(--excoa-accent, #00bfa5); text-decoration: none; }
.excoa-breadcrumb a:hover { text-decoration: underline; }

/* ── Page title ───────────────────────────────────────────────────── */
.excoa-page-title {
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 8px;
}

.excoa-qr-note {
    font-size: 13px;
    color: #888;
    margin-bottom: 20px;
}
.excoa-qr-note code {
    background: #f4f4f4;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 12px;
}

.excoa-product-link {
    color: var(--excoa-accent, #00bfa5);
    font-size: 14px;
    text-decoration: none;
    font-weight: 500;
}
.excoa-product-link:hover { text-decoration: underline; }

/* ── Intro text ───────────────────────────────────────────────────── */
.excoa-intro {
    font-size: 15px;
    color: #555;
    max-width: 700px;
    margin-bottom: 30px;
    line-height: 1.6;
}

/* ── Search bar ───────────────────────────────────────────────────── */
.excoa-search-bar {
    position: relative;
    display: flex;
    align-items: center;
    max-width: 420px;
    margin-bottom: 28px;
}

.excoa-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #aaa;
    pointer-events: none;
    display: flex;
    align-items: center;
}

.excoa-search-input {
    width: 100%;
    padding: 10px 40px 10px 38px;
    font-size: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
    box-sizing: border-box;
    background: #fff;
    color: #1a1a1a;
}
.excoa-search-input:focus {
    border-color: var(--excoa-accent, #00bfa5);
    box-shadow: 0 0 0 3px var(--excoa-accent-subtle, rgba(0,191,165,.12));
}
.excoa-search-input::placeholder { color: #bbb; }

.excoa-search-clear {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: #aaa;
    display: none;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    font-size: 13px;
    line-height: 1;
    padding: 0;
    transition: color .15s, background .15s;
}
.excoa-search-clear:hover {
    color: #555;
    background: #f0f0f0;
}

.excoa-search-no-results {
    color: #888;
    font-style: italic;
    margin-bottom: 20px;
}

/* ── Catalog ──────────────────────────────────────────────────────── */
.excoa-category { margin-bottom: 36px; }

.excoa-cat-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 12px;
    padding-bottom: 6px;
    border-bottom: 2px solid var(--excoa-accent, #00bfa5);
    color: #1a1a1a;
}

/* Collapsible toggle */
.excoa-cat-toggle {
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.excoa-cat-toggle:focus-visible {
    outline: 2px solid var(--excoa-accent, #00bfa5);
    outline-offset: 2px;
    border-radius: 3px;
}
.excoa-cat-name { flex: 1; }

.excoa-cat-chevron {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--excoa-accent, #00bfa5);
    transition: transform .22s ease;
}
/* Draw chevron via CSS (no extra asset needed) */
.excoa-cat-chevron::before {
    content: '';
    display: block;
    width: 9px;
    height: 9px;
    border-right: 2.2px solid currentColor;
    border-bottom: 2.2px solid currentColor;
    transform: rotate(45deg) translateY(-2px);
    transition: transform .22s ease;
}

/* Collapsed state */
.excoa-cat-collapsed .excoa-cat-chevron::before {
    transform: rotate(-45deg) translateY(0);
}
.excoa-cat-collapsed .excoa-product-list {
    display: none;
}

.excoa-product-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.excoa-product-item {
    border: 1px solid #e8e8e8;
    border-radius: 6px;
    margin-bottom: 8px;
    overflow: hidden;
}

.excoa-product-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #fff;
    flex-wrap: wrap;
}

.excoa-product-name {
    font-weight: 600;
    font-size: 15px;
    flex: 1;
    min-width: 160px;
}

.excoa-entry-meta {
    font-size: 13px;
    color: #888;
    flex-shrink: 0;
}

.excoa-catalog-link {
    color: var(--excoa-accent, #00bfa5);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
}
.excoa-catalog-link:hover { text-decoration: underline; }

/* Variation sub-list */
.excoa-variation-list {
    list-style: none;
    margin: 0;
    padding: 0;
    background: #f9f9f9;
    border-top: 1px solid #e8e8e8;
}

.excoa-variation-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 20px 9px 32px;
    border-bottom: 1px solid #f0f0f0;
    flex-wrap: wrap;
}
.excoa-variation-item:last-child { border-bottom: none; }

.excoa-var-name {
    font-size: 13px;
    flex: 1;
    color: #444;
    min-width: 120px;
}

/* ── Product / variation page ─────────────────────────────────────── */
.excoa-product-page { padding-top: 10px; }

.excoa-variation-section {
    margin-top: 36px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.excoa-var-heading {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 6px;
}

/* ── Entries grid ─────────────────────────────────────────────────── */
.excoa-entries-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.excoa-entry-card {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,.05);
    transition: box-shadow .2s;
}
.excoa-entry-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,.1);
}

.excoa-entry-photo {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
    border-bottom: 1px solid #eee;
}

.excoa-no-photo {
    width: 100%;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
    color: #bbb;
    font-size: 13px;
    border-bottom: 1px solid #eee;
}

.excoa-entry-meta {
    padding: 14px 16px;
}

.excoa-entry-row {
    font-size: 14px;
    color: #444;
    margin-bottom: 6px;
    line-height: 1.5;
}

.excoa-label {
    font-weight: 600;
    color: #1a1a1a;
}

.excoa-results-link { margin-top: 10px; }

.excoa-results-btn {
    display: inline-block;
    background: var(--excoa-accent, #00bfa5);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    padding: 8px 14px;
    border-radius: 5px;
    text-decoration: none;
    transition: background .2s;
}
.excoa-results-btn:hover {
    background: var(--excoa-accent-hover, #009e8a);
    color: #fff;
    text-decoration: none;
}

.excoa-no-entries {
    color: #888;
    font-style: italic;
    margin-top: 20px;
}

/* ── WooCommerce product page button ─────────────────────────────── */
.excoa-product-btn-wrap {
    margin: 10px 0 16px;
}

.excoa-product-btn {
    display: inline-flex;
    align-items: center;
    background: transparent;
    border: 2px solid var(--excoa-accent, #00bfa5);
    color: var(--excoa-accent, #00bfa5);
    font-size: 14px;
    font-weight: 600;
    padding: 9px 18px;
    border-radius: 5px;
    text-decoration: none;
    transition: background .2s, color .2s;
    cursor: pointer;
}
.excoa-product-btn:hover {
    background: var(--excoa-accent, #00bfa5);
    color: #fff;
    text-decoration: none;
}

/* ── Responsive ───────────────────────────────────────────────────── */
@media (max-width: 600px) {
    .excoa-product-row,
    .excoa-variation-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    .excoa-entries-grid {
        grid-template-columns: 1fr;
    }

    .excoa-page-title { font-size: 22px; }
}
