/* ===== COA Grid Page (shortcode) ===== */
.coa-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
    margin: 30px 0;
}
.coa-grid-item {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    background: #fafafa;
    transition: box-shadow 0.2s ease;
}
.coa-grid-item:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.coa-grid-icon { font-size: 32px; margin-bottom: 10px; }
.coa-grid-item h4 { margin: 5px 0; font-size: 15px; }
.coa-lot, .coa-products { font-size: 13px; color: #666; margin: 4px 0; }
.coa-view-btn {
    display: inline-block;
    margin-top: 10px;
    padding: 8px 16px;
    background: #222;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    font-size: 13px;
}
.coa-view-btn:hover { background: #444; color: #fff; }

/* ===== Product Page Button ===== */
.view-coa-btn {
    margin: 15px 0;
    padding: 10px 20px;
    background: #222;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}
.view-coa-btn:hover { background: #444; }

/* ===== Modal Popup (product page) ===== */
.coa-modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.6);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}
.coa-modal-overlay.active {
    display: flex;
}
.coa-modal-box {
    background: #fff;
    max-width: 500px;
    width: 90%;
    padding: 28px;
    border-radius: 10px;
    position: relative;
    max-height: 85vh;
    overflow-y: auto;
}
.coa-modal-close {
    position: absolute;
    top: 12px; right: 16px;
    font-size: 24px;
    cursor: pointer;
    color: #888;
    line-height: 1;
    transition: color 0.15s;
}
.coa-modal-close:hover { color: #333; }
.coa-modal-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}
.coa-modal-item:last-child { border-bottom: none; }
.coa-modal-item a {
    background: #222;
    color: #fff;
    padding: 6px 12px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 13px;
    white-space: nowrap;
    margin-left: 12px;
}

/* ===== Elementor: COA Grid Widget ===== */
.coa-elementor-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}
.coa-e-card {
    text-align: left;
    background: #fff;
    border: 1px solid #e2e2e2;
    border-radius: 16px;
    padding: 32px 24px;
    display: flex;
    flex-direction: column;
}
.coa-e-title {
    font-weight: 600;
    font-size: 18px;
    line-height: 1.3;
    color: #1a1a1a;
    margin-bottom: 4px;
}
.coa-e-subtitle {
    font-size: 13px;
    color: #8a8a8a;
    margin-top: 0;
    margin-bottom: 18px;
}
.coa-e-label {
    font-size: 14px;
    color: #4a4a4a;
}
.coa-e-lot {
    font-size: 12px;
    color: #9a9a9a;
    margin-top: 6px;
}
.coa-e-btn-wrap {
    margin-top: 18px;
}
.coa-e-btn {
    display: inline-block;
    text-decoration: none;
    font-size: 13px;
    line-height: 1;
    background: #5a6270;
    color: #fff;
    padding: 10px 22px;
    border-radius: 24px;
    transition: background 0.2s;
}
.coa-e-btn:hover {
    background: #434955;
    color: #fff;
    text-decoration: none;
}

/* ===== Elementor: View All COAs Button Widget ===== */
.coa-viewall-wrap {
    display: block;
}
.coa-viewall-btn {
    border: none;
    cursor: pointer;
    display: inline-block;
    transition: background 0.2s, color 0.2s;
}

/* ===== Popup Overlay (Elementor widget) ===== */
.coa-viewall-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.6);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}
.coa-viewall-overlay.active {
    display: flex;
}
.coa-viewall-box {
    background: #fff;
    max-width: 900px;
    width: 100%;
    padding: 32px;
    border-radius: 12px;
    position: relative;
    max-height: 88vh;
    overflow-y: auto;
    box-sizing: border-box;
}
.coa-viewall-heading {
    font-size: 22px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 24px 0;
    padding-right: 32px;
}
.coa-viewall-close {
    position: absolute;
    top: 14px; right: 18px;
    font-size: 24px;
    cursor: pointer;
    color: #888;
    line-height: 1;
    transition: color 0.15s;
    background: none;
    border: none;
    padding: 0;
}
.coa-viewall-close:hover { color: #333; }

/* Grid inside popup */
.coa-viewall-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

/* ===== Responsive ===== */
@media (max-width: 767px) {
    .coa-elementor-grid { grid-template-columns: 1fr !important; }
    .coa-viewall-grid   { grid-template-columns: 1fr !important; }
    .coa-viewall-box    { padding: 20px 16px; }
}
@media (min-width: 768px) and (max-width: 1024px) {
    .coa-elementor-grid { grid-template-columns: repeat(2, 1fr) !important; }
    .coa-viewall-grid   { grid-template-columns: repeat(2, 1fr) !important; }
}


/* ===== COA Filter Page Widget ===== */

/* Controls row — filter buttons left, search right, single line */
.coa-fp-controls {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
    width: 100%;
    box-sizing: border-box;
}

/* Filter buttons — take only as much space as needed */
.coa-fp-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    flex-shrink: 1;
    min-width: 0;
}

.coa-fp-filter-btn {
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    font-size: 14px;
    background: #f3f4f6;
    color: #374151;
    border-radius: 24px;
    padding: 8px 20px;
    transition: background 0.18s, color 0.18s;
    line-height: 1;
    white-space: nowrap;
    flex-shrink: 0;
}
.coa-fp-filter-btn:hover  { background: #e5e7eb; }
.coa-fp-filter-btn.active { background: #1a1a1a; color: #fff; }
.coa-fp-filter-btn .coa-btn-prefix,
.coa-fp-filter-btn .coa-btn-suffix {
    display: inline;
    /* margin controlled via Elementor style controls */
}

/* Search — fixed width, right side of row */
.coa-fp-search-wrap {
    width: 260px;
    flex-shrink: 0;
    flex-grow: 0;
}
.coa-fp-search {
    display: block;
    width: 100%;
    padding: 9px 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    background: #fff;
    color: #111827;
    box-sizing: border-box;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
    -webkit-appearance: none;
}
.coa-fp-search:focus {
    border-color: #6b7280;
    box-shadow: 0 0 0 3px rgba(107,114,128,0.12);
}
.coa-fp-search::-webkit-search-cancel-button { display: none; }

/* Grid — display:grid is set via inline style from PHP for theme compat */
.coa-fp-grid {
    width: 100%;
    box-sizing: border-box;
}

/* Cards */
.coa-fp-card {
    text-align: left;
    background: #fff;
    border: 1px solid #e2e2e2;
    border-radius: 16px;
    padding: 32px 24px;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    min-width: 0; /* prevent grid blowout */
}

/* SKU line */
.coa-e-sku {
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 8px;
}

/* No results */
.coa-fp-no-results {
    color: #9ca3af;
    font-size: 15px;
    padding: 24px 0;
    text-align: center;
    width: 100%;
}

/* Responsive — fallback (widget also injects scoped media queries) */
@media (max-width: 767px) {
    .coa-fp-controls {
        flex-direction: column;
        flex-wrap: wrap;
        align-items: stretch;
    }
    .coa-fp-filters { flex-wrap: wrap; }
    .coa-fp-search-wrap { width: 100% !important; flex-shrink: 1; }
}
