/* Frontend COA Button Styles */
.coa-buttons-container {
    margin: 1.5rem 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    clear: both;
}

.coa-view-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, #d7c27d, #CAA145); /* Site's golden yellow brand color */
    color: #1a1a1a !important; /* Dark text for readability over gold */
    font-weight: 600;
    padding: 0.75rem 1.25rem;
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 4px 6px rgba(215, 194, 125, 0.2);
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    line-height: 1.2;
}

.coa-view-button:hover {
    background: linear-gradient(135deg, #CAA145, #BFA939);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(215, 194, 125, 0.35);
    color: #1a1a1a !important;
}

.coa-view-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(215, 194, 125, 0.2);
}

.coa-pdf-icon {
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.coa-view-button:hover .coa-pdf-icon {
    transform: scale(1.1);
}

/* Library styles */
.coa-library-wrapper {
    max-width: 1200px;
    margin: 3rem auto;
    padding: 0 2rem;
    box-sizing: border-box;
}

.coa-library-header {
    margin-bottom: 2rem;
    display: flex;
    justify-content: flex-end;
}

#coa-library-search {
    width: 100%;
    max-width: 400px;
    padding: 0.85rem 1.5rem;
    border: 1px solid #dcdcdc;
    border-radius: 30px;
    font-size: 0.95rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.03);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#coa-library-search:focus {
    border-color: #d7c27d;
    box-shadow: 0 4px 15px rgba(215, 194, 125, 0.25);
    outline: none;
}

.coa-library-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Premium Card Row */
.coa-product-row {
    background: #ffffff;
    border: 1px solid #eef0f2;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02);
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.coa-product-row:hover {
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.05);
}

.coa-product-main {
    display: flex;
    align-items: center;
    padding: 1.5rem;
    gap: 1.5rem;
    flex-wrap: wrap;
}

/* Columns */
.coa-product-image-col {
    flex-shrink: 0;
}

.coa-product-thumbnail {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

.coa-product-info-col {
    flex: 2;
    min-width: 200px;
}

.coa-product-info-col .coa-product-title {
    margin: 0 0 0.25rem 0;
    font-size: 1.2rem;
    font-weight: 700;
    color: #1a1a1a;
    line-height: 1.3;
}

.coa-product-info-col .coa-product-sku {
    display: inline-block;
    font-size: 0.75rem;
    color: #64748b;
    background-color: #f1f5f9;
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: 600;
}

.coa-batch-meta-col {
    flex: 3;
    display: flex;
    gap: 2rem;
    min-width: 250px;
    border-left: 1px solid #f1f5f9;
    border-right: 1px solid #f1f5f9;
    padding: 0 2rem;
}

.coa-meta-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.coa-meta-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #94a3b8;
}

.coa-meta-val {
    font-size: 0.95rem;
    color: #1e293b;
    font-weight: 600;
}

.coa-meta-val code {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.85rem;
    color: #0f172a;
}

.coa-actions-col {
    flex: 2;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    min-width: 180px;
    align-items: stretch;
}

/* Shop Button Styles */
.coa-shop-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: transparent;
    border: 1px solid #1a1a1a;
    color: #1a1a1a !important;
    font-weight: 600;
    padding: 0.5rem 0.9rem;
    border-radius: 4px;
    text-decoration: none;
    transition: all 0.2s ease;
    font-size: 0.85rem;
    line-height: 1.2;
    cursor: pointer;
}

.coa-shop-button:hover {
    background: #1a1a1a;
    color: #ffffff !important;
}

.coa-cart-icon {
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.coa-shop-button:hover .coa-cart-icon {
    transform: scale(1.1);
}

/* History Toggle Button */
.coa-history-toggle-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    color: #475569;
    padding: 0.65rem 1rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.coa-purity-badge {
    display: inline-block;
    background-color: #e6f4ea; /* Soft emerald green background */
    border: 1px solid #137333; /* Distinct solid green border */
    color: #137333; /* Dark green text */
    padding: 4px 10px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.85rem;
}

.coa-history-toggle-btn:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
    color: #1e293b;
}

.coa-history-toggle-btn.active {
    background: #e2e8f0;
    border-color: #cbd5e1;
}

.coa-chevron {
    font-size: 0.7rem;
    transition: transform 0.2s ease;
}

/* History Collapsible Panel */
.coa-product-history {
    background-color: #fafbfd;
    border-top: 1px solid #f1f5f9;
    padding: 1.5rem;
}

.coa-history-inner {
    max-width: 1000px;
    margin: 0 auto;
}

.coa-history-title {
    margin: 0 0 1rem 0;
    font-size: 0.95rem;
    font-weight: 700;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.coa-history-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.coa-history-table th {
    text-align: left;
    padding: 0.75rem 1rem;
    border-bottom: 2px solid #cbd5e1;
    color: #475569;
    font-weight: 700;
}

.coa-history-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e2e8f0;
    color: #334155;
    vertical-align: middle;
}

.coa-history-table tr:last-child td {
    border-bottom: none;
}

.coa-view-button.table-btn.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
    border-radius: 4px;
}

/* Responsive Scaling */
@media screen and (max-width: 991px) {
    .coa-batch-meta-col {
        border-left: none;
        border-right: none;
        padding: 1rem 0;
    }
}

@media screen and (max-width: 768px) {
    .coa-library-wrapper {
        padding: 0 1rem;
    }

    .coa-product-main {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }

    .coa-product-image-col {
        text-align: center;
    }

    .coa-product-info-col {
        text-align: center;
    }

    .coa-batch-meta-col {
        flex-direction: column;
        gap: 1rem;
        padding: 0.5rem 0;
    }

    .coa-meta-item {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }

    .coa-history-table, 
    .coa-history-table thead, 
    .coa-history-table tbody, 
    .coa-history-table th, 
    .coa-history-table td, 
    .coa-history-table tr {
        display: block;
    }

    .coa-history-table thead {
        display: none;
    }

    .coa-history-table tr {
        border: 1px solid #e2e8f0;
        border-radius: 6px;
        margin-bottom: 0.75rem;
        padding: 0.5rem;
        background: #fff;
    }

    .coa-history-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.5rem 0.75rem;
        border-bottom: 1px solid #f1f5f9;
        text-align: right;
    }

    .coa-history-table td:last-child {
        border-bottom: none;
        justify-content: center;
    }

    .coa-history-table td::before {
        content: attr(data-label);
        font-weight: 700;
        color: #64748b;
        font-size: 0.8rem;
        text-transform: uppercase;
    }

    .coa-history-table td:last-child::before {
        display: none;
    }
}
