/* Nxtal Customer Price - Frontend Styles */

.ncp-offer-wrapper {
    margin: 15px 0;
}

li .ncp-offer-wrapper {
    text-align: center;
}

.ncp-offer-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.ncp-offer-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    color: white;
}

.ncp-offer-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.3);
}

/* Offer list */
.ncp-offers-table {
    font-size: .875em;
    width: 100%;
}
.ncp-offers-table th, .ncp-offers-table td {
    padding: 12px 15px;
    text-align: center;
}
.ncp-offers-table thead th {
    background-color: #f8f8f8;
}
.ncp-offers-table tbody .ncp-light td {
    background-color: #fdfdfd;
}
.ncp-offers-table tbody .ncp-dark td {
    /* background-color: #fbfbfb; */
    background-color: #9e9e9e14;
}
.ncp-offers-table .ncp-offer-row {
    display: flex;
    align-items: center;
    gap: 10px;
}
.ncp-offers-table .ncp-offer-product-image {
    max-width: 100%;
    min-width: 50px;
    min-height: 50px;
    max-height: 50px;
    object-fit: cover;
}
.ncp-offers-table .ncp-offer-product-name {
    min-width: 80%;
    text-align: left;
}
.ncp-offers-table .ncp-offer-attrs {
    margin-bottom: 5px;
}
.ncp-offers-table .ncp-offer-attrs span {
    font-weight: 600;
}
.ncp-offers-table .ncp-price {
    display: flex;
    flex-direction: column-reverse;
    gap: 5px;
}
.ncp-offers-table .ncp-min-quantity {
    font-size: 12px;
    white-space: nowrap;
}
.ncp-offers-table .ncp-price.ncp-approved > div ~ div {
    text-decoration: line-through;
}
.ncp-offers-table .ncp-price-current {
    background: #eee;
    padding: 4px;
}
.ncp-offers-table .ncp-price-offered {
    font-weight: 600;
    color: #0073aa;
}
.ncp-offers-table .ncp-price-counter {
    font-weight: 600;
    color: #d63384;
}
.ncp-expired .ncp-price-counter, .ncp-expired .ncp-price-offered {
    font-weight: normal;
    text-decoration: line-through;
}
.ncp-offers-table .ncp-status-badge {
    padding: 1px 8px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    word-break: keep-all;
    white-space: nowrap;
    margin: 3px;
    display: inline-block;
    text-align: center;
}
.ncp-offers-table .ncp-status-pending {
    background: #00BCD4;
    color: #fff;
}
.ncp-offers-table .ncp-status-moderate {
    background: #FFC107;
    color: #fff;
}
.ncp-offers-table .ncp-status-approved {
    background: #4CAF50;
    color: #fff;
}
.ncp-offers-table .ncp-status-expires {
    background: #FF9800;
    text-transform: none;
    color: #fff;
}
.ncp-offers-table .ncp-status-expired {
    background: #ff0000;
    color: #fff;
}
.ncp-offers-table .ncp-status-rejected {
    background: #e1747d;
    color: #fff;
}
.ncp-offers-table .ncp-status-used {
    background: #9E9E9E;
    color: #fff;
}
.ncp-offers-table .ncp-offer-message {
    margin-bottom: 10px;
    font-size: 14px;
    text-align: left;
}
.ncp-offers-table .ncp-admin-message {
    background: #FFF3E0;
    border: 1px solid #EF6C00;
}
.ncp-offers-table .ncp-customer-message {
    border: 1px solid #ccc;
    padding: 5px 10px;
    border-radius: 5px;
}
.ncp-alert, .ncp-offers-table .ncp-admin-message {
    padding: 5px 10px;
    border-radius: 5px;
    margin-top: 10px;
}
.ncp-alert.ncp-error {
    background: #FFF3E0;
    border: 1px solid #EF6C00;
}
.ncp-alert.ncp-success {
    background: #8bc34a38;
    border: 1px solid #4CAF50;
}
.ncp-offers-table .ncp-offers-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
}

.ncp-offers-table .ncp-offers-actions .ncp-offer-btn {
    margin: 0 10px 10px 0;
    padding: 5px 10px;
    width: 30px;
    height: 30px;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    min-width: unset;
    background: #eeeeee;
    border-color: #eeeeee;
    color: #333333;
    box-sizing: border-box;
}
.ncp-offers-table .ncp-buy-link {
    white-space: nowrap;
    word-break: keep-all;
    padding: 5px 10px;
    margin-top: 5px;
}

/* Modal Styles */
#ncp-offer-modal {
    display: none;
    position: fixed;
    z-index: 999999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
    overflow-y: auto;
}

.ncp-modal-content {
    background-color: #fff;
    margin: 5% auto;
    padding: 30px;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    position: relative;
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ncp-close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    position: absolute;
    right: 15px;
    top: 15px;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.ncp-close:hover {
    color: #333;
    background-color: #f0f0f0;
}

.ncp-modal-header {
    margin-bottom: 25px;
    padding-right: 40px;
}

.ncp-modal-header h2 {
    margin: 0;
    color: #333;
    font-size: 24px;
    font-weight: 600;
}

.ncp-form-group {
    margin-bottom: 20px;
}

.ncp-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #555;
}

.ncp-form-group input,
.ncp-form-group textarea {
    width: 100%;
    max-width: 100%;
    padding: 12px;
    border: 2px solid #e1e5e9;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s ease;
    box-sizing: border-box;
}

.ncp-form-group input:focus,
.ncp-form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.ncp-submit-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 14px 24px;
    border-radius: 6px;
    width: 100%;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.ncp-submit-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.ncp-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

#ncp-form-messages {
    margin-top: 15px;
    padding: 12px;
    border-radius: 6px;
    display: none;
    font-size: 14px;
}

#ncp-form-messages.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    display: block;
}

#ncp-form-messages.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    display: block;
}

/* Loading state */
.ncp-loading {
    position: relative;
}

.ncp-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #fff;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 768px) {
    .ncp-modal-content {
        margin: 10% auto;
        padding: 20px;
        width: 95%;
    }
    
    .ncp-offer-btn {
        padding: 10px 16px;
        font-size: 13px;
    }
}

/* Shop loop specific styles */
.woocommerce ul.products li.product .ncp-offer-wrapper {
    margin: 10px 0 5px 0;
}

.woocommerce ul.products li.product .ncp-offer-btn {
    padding: 8px 16px;
    font-size: 12px;
    /*width: 100%;*/
    justify-content: center;
}

/* Offer Status Styles */
.ncp-offer-status {
    margin-top: 8px;
    font-size: 13px;
    color: #666;
   /* text-align: center; */
}

.ncp-offer-status.ncp-rejected {
    color: #d63638;
}

.ncp-countdown {
    margin-top: 5px;
    font-size: 12px;
    color: #e47911;
    font-weight: 500;
}

.ncp-countdown-timer {
    font-weight: 600;
    color: #d63638;
}

/* Best Price Modal */
#ncp-best-price-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 999999;
    display: none;
}

.ncp-best-price-content {
    text-align: center;
    padding: 20px;
}

.ncp-success-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.ncp-best-price-message {
    font-size: 16px;
    line-height: 1.5;
    margin-bottom: 15px;
    color: #333;
}

.ncp-modal-footer {
    text-align: center;
    padding: 15px 20px;
    border-top: 1px solid #eee;
}

.ncp-btn-primary {
    background-color: #0073aa;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.ncp-btn-primary:hover {
    background-color: #005a87;
}

/* Button variations */
.ncp-offer-btn.ncp-edit-offer {
    background: linear-gradient(135deg, #e47911 0%, #cc6600 100%);
}

.ncp-offer-btn.ncp-edit-offer:hover {
    box-shadow: 0 4px 12px rgba(228, 121, 17, 0.4);
}

.ncp-offer-btn.ncp-best-price {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    cursor: default;
}

.ncp-offer-btn.ncp-best-price:hover {
    transform: none;
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.4);
}

/* .woocommerce-variation-add-to-cart.ncp-offer-approve-btn{ */
.ncp-offer-approve-btn, li .ncp-offer-approve-btn{
    display: inline-flex !important;
}

.woocommerce-variation-add-to-cart.ncp-offer-approve-btn button.single_add_to_cart_button{
    pointer-events: all !important;
}

.wc-block-components-product-sale-badge.ncp-private-price {
    background: #fff;
    border: 1px solid #43454b;
    border-radius: 4px;
    box-sizing: border-box;
    color: #43454b;
    display: inline-block;
    font-size: clamp(12px, .875em, 16px);
    font-weight: 600;
    padding: .25em .75em;
    position: static;
    text-align: center;
    text-transform: uppercase;
    width: fit-content;
    z-index: 9;
}
