/* COA Product Viewer - Public Styles */

.coa-product-viewer {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
}

/* Search Bar */
.coa-search-bar {
    position: relative;
    margin-bottom: 30px;
}

.coa-search-input {
    width: 100%;
    padding: 12px 45px 12px 15px;
    font-size: 16px;
    border: 2px solid #ddd;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.coa-search-input:focus {
    outline: none;
    border-color: #2271b1;
    box-shadow: 0 0 0 3px rgba(34, 113, 177, 0.1);
}

.coa-search-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    pointer-events: none;
}

/* Product Grid */
.coa-products-grid {
    display: grid;
    gap: 25px;
    margin-bottom: 40px;
}

.coa-columns-1 { grid-template-columns: 1fr; }
.coa-columns-2 { grid-template-columns: repeat(2, 1fr); }
.coa-columns-3 { grid-template-columns: repeat(3, 1fr); }
.coa-columns-4 { grid-template-columns: repeat(4, 1fr); }

/* Product Card */
.coa-product-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0.0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    opacity: 1;
    transform: scale(1);
    transform-origin: center;
}

.coa-product-card:hover {
    transform: translateY(-4px) scale(1);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
    border-color: #2271b1;
}

.coa-product-image {
    width: 100%;
    aspect-ratio: 1;
    overflow: hidden;
    background: #f9f9f9;
    display: flex;
    align-items: center;
    justify-content: center;
}

.coa-product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.coa-product-card:hover .coa-product-image img {
    transform: scale(1.05);
}

.coa-product-info {
    padding: 20px;
}

.coa-product-title {
    margin: 0 0 8px;
    font-size: 18px;
    font-weight: 600;
    color: #333;
    line-height: 1.4;
}

.coa-product-sku {
    margin: 0 0 15px;
    font-size: 13px;
    color: #666;
}

.coa-view-coas-btn {
    width: 100%;
    padding: 12px 20px;
    background: #2271b1;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.coa-view-coas-btn:hover {
    background: #135e96;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(34, 113, 177, 0.3);
}

.coa-view-coas-btn:active {
    transform: translateY(0);
}

/* No Products Message */
.coa-no-products {
    text-align: center;
    padding: 60px 20px;
    background: #f9f9f9;
    border-radius: 12px;
    border: 2px dashed #ddd;
}

.coa-no-products p {
    margin: 0;
    font-size: 16px;
    color: #666;
}

/* Detail View */
.coa-viewer-detail {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.coa-detail-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
}

.coa-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 500;
    color: #333;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 15px;
}

.coa-back-btn:hover {
    background: #e0e0e0;
    transform: translateX(-4px);
}

.coa-back-btn .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
}

.coa-detail-title {
    margin: 0;
    font-size: 28px;
    color: #333;
}

/* COA Cards in Detail View */
.coa-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.coa-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 25px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.coa-card:hover {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.coa-card-header {
    padding-bottom: 15px;
    border-bottom: 1px solid #e0e0e0;
}

.coa-card-title {
    margin: 0 0 5px;
    font-size: 16px;
    font-weight: 600;
    color: #2271b1;
}

.coa-card-filename {
    margin: 0;
    font-size: 13px;
    color: #666;
    word-break: break-all;
}

.coa-card-footer {
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.coa-view-pdf-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    padding: 12px 20px;
    background: #2271b1;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.coa-view-pdf-btn:hover {
    background: #135e96;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(34, 113, 177, 0.3);
}

.coa-view-pdf-btn .dashicons {
    margin-right: 5px;
}

.coa-download-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    padding: 12px 20px;
    background: #28a745;
    color: #fff;
    text-decoration: none;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.coa-download-btn:hover {
    background: #218838;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

.coa-download-btn .dashicons {
    margin-right: 5px;
}

.coa-buy-now-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    padding: 12px 20px;
    background: #ff6f00;
    color: #fff;
    text-decoration: none;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.coa-buy-now-btn:hover {
    background: #e65100;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 111, 0, 0.3);
}

.coa-buy-now-btn .dashicons {
    margin-right: 5px;
}

/* PDF Viewer Modal */
.coa-pdf-modal {
    display: none;
    position: fixed;
    z-index: 999999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    animation: fadeIn 0.3s ease;
}

.coa-pdf-modal-content {
    background-color: #fff;
    margin: 2% auto;
    width: 90%;
    max-width: 1200px;
    height: 90vh;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
}

.coa-pdf-modal-header {
    padding: 20px;
    border-bottom: 1px solid #ddd;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f9f9f9;
    border-radius: 8px 8px 0 0;
}

.coa-pdf-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #333;
}

.coa-pdf-modal-close {
    background: none;
    border: none;
    font-size: 32px;
    cursor: pointer;
    color: #999;
    padding: 0;
    width: 40px;
    height: 40px;
    line-height: 1;
    transition: all 0.3s ease;
}

.coa-pdf-modal-close:hover {
    color: #333;
    transform: rotate(90deg);
}

.coa-pdf-modal-body {
    flex: 1;
    padding: 0;
    overflow: hidden;
    background: #525659;
}

.coa-pdf-modal-body iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.coa-pdf-modal-footer {
    padding: 15px 20px;
    border-top: 1px solid #ddd;
    background: #f9f9f9;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    border-radius: 0 0 8px 8px;
}

.coa-pdf-modal-footer .button {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 10px 20px;
    background: #2271b1;
    color: #fff;
    text-decoration: none;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.coa-pdf-modal-footer .button:hover {
    background: #135e96;
    color: #fff;
}

/* Loading Spinner */
.coa-loading {
    text-align: center;
    padding: 60px 20px;
}

.coa-spinner {
    display: inline-block;
    width: 50px;
    height: 50px;
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-top-color: #2271b1;
    border-radius: 50%;
    animation: coa-spin 1s linear infinite;
}

@keyframes coa-spin {
    to { transform: rotate(360deg); }
}

.coa-loading p {
    margin-top: 15px;
    font-size: 16px;
    color: #666;
}

/* Error Message */
.coa-error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #f5c6cb;
    text-align: center;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .coa-columns-4 {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .coa-columns-3,
    .coa-columns-4 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .coa-detail-title {
        font-size: 24px;
    }
    
    .coa-cards-grid {
        grid-template-columns: 1fr;
    }
    
    .coa-card-footer {
        flex-direction: column;
    }
    
    .coa-pdf-modal-content {
        width: 95%;
        height: 85vh;
        margin: 5% auto;
    }
    
    .coa-pdf-modal-header h3 {
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .coa-columns-2,
    .coa-columns-3,
    .coa-columns-4 {
        grid-template-columns: 1fr;
    }
    
    .coa-product-viewer {
        padding: 0 15px;
    }
    
    .coa-detail-title {
        font-size: 20px;
    }
    
    .coa-pdf-modal-content {
        width: 98%;
        height: 90vh;
        margin: 2% auto;
    }
    
    .coa-pdf-modal-header {
        padding: 15px;
    }
    
    .coa-pdf-modal-footer {
        flex-direction: column;
    }
}

/* Filtering animations */
.coa-product-card.coa-filtering-out {
    opacity: 0;
    transform: scale(0.8);
    pointer-events: none;
}

.coa-product-card.coa-hidden {
    display: none;
}

.coa-product-card.coa-filtering-in {
    animation: filterIn 0.4s cubic-bezier(0.4, 0.0, 0.2, 1) forwards;
}

@keyframes filterIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* No results message */
.coa-no-results {
    text-align: center;
    padding: 40px 20px;
    background: #f9f9f9;
    border-radius: 8px;
    margin-top: 20px;
}

.coa-no-results p {
    margin: 0;
    font-size: 16px;
    color: #666;
}
