/* =========================================================
   Price Offer (Trả Giá) — Frontend Styles
   ========================================================= */

/* ── Brand row + Nút Trả Giá ── */
.po-brand-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
}
.po-brand-row .brand { margin-bottom: 0; }

/* ── Nút Trả Giá ── */
.btn-price-offer {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg,#e8f5e9 0%,#f1f8e9 100%);
    border: 1.5px solid #2e7d32;
    color: #1b5e20;
    font-size: .78rem;
    font-weight: 700;
    padding: 5px 14px;
    border-radius: 20px;
    cursor: pointer;
    letter-spacing: .2px;
    transition: all .2s ease;
    text-decoration: none;
    box-shadow: 0 1px 4px rgba(27,94,32,.15);
    position: relative;
    overflow: hidden;
}
.btn-price-offer::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg,#2e7d32,#1b5e20);
    opacity: 0;
    transition: opacity .2s;
    border-radius: inherit;
}
.btn-price-offer:hover::before   { opacity: 1; }
.btn-price-offer:hover           { color: #fff; box-shadow: 0 3px 10px rgba(27,94,32,.35); transform: translateY(-1px); }
.btn-price-offer:hover .po-ico   { filter: none; }
.btn-price-offer .po-ico,
.btn-price-offer span            { position: relative; z-index: 1; }
.btn-price-offer.po-hidden       { display: none !important; }

/* Pulse glow khi mới xuất hiện */
@keyframes poPulse {
    0%,100% { box-shadow: 0 1px 4px rgba(27,94,32,.15); }
    50%      { box-shadow: 0 0 0 5px rgba(46,125,50,.15); }
}
.btn-price-offer { animation: poPulse 2.4s ease 1.5s 3; }

/* ── Badge Giá thỏa thuận ── */
.po-accepted-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg,#e8f5e9,#f1f8e9);
    border: 1.5px solid #43a047;
    color: #1b5e20;
    font-size: .8rem;
    font-weight: 700;
    padding: 5px 14px;
    border-radius: 20px;
    box-shadow: 0 1px 6px rgba(67,160,71,.2);
    animation: poSlideIn .25s ease;
}
.po-accepted-badge .po-change-link {
    font-weight: 500;
    font-size: .72rem;
    color: #999;
    cursor: pointer;
    text-decoration: underline;
    margin-left: 2px;
    transition: color .15s;
}
.po-accepted-badge .po-change-link:hover { color: #555; }

@keyframes poSlideIn {
    from { opacity:0; transform:translateY(-4px); }
    to   { opacity:1; transform:translateY(0); }
}

/* ── Overlay ── */
#po-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 9990;
    backdrop-filter: blur(2px);
    transition: opacity .2s;
}
#po-overlay.po-show { display: block; animation: poFadeIn .2s; }
@keyframes poFadeIn { from { opacity:0 } to { opacity:1 } }

/* ── Modal ── */
#po-modal {
    display: none;
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -46%);
    width: 440px;
    max-width: 95vw;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 12px 48px rgba(0,0,0,.22);
    z-index: 9991;
    overflow: hidden;
    opacity: 0;
    transition: transform .25s ease, opacity .25s ease;
}
#po-modal.po-show {
    display: block;
    transform: translate(-50%, -50%);
    opacity: 1;
    animation: poModalIn .25s ease forwards;
}
@keyframes poModalIn {
    from { transform:translate(-50%,-46%); opacity:0; }
    to   { transform:translate(-50%,-50%); opacity:1; }
}

/* Header */
.po-modal-header {
    background: linear-gradient(135deg, #1b4332 0%, #2d6a4f 100%);
    color: #fff;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.po-modal-header h4 {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: .2px;
}
.po-modal-close {
    background: rgba(255,255,255,.15);
    border: none;
    color: #fff;
    font-size: 1.1rem;
    cursor: pointer;
    line-height: 1;
    width: 28px; height: 28px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    transition: background .15s;
}
.po-modal-close:hover { background: rgba(255,255,255,.3); }

/* Body */
.po-modal-body { padding: 20px; }

.po-product-name {
    font-size: .82rem;
    color: #666;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.po-current-price {
    display: flex;
    align-items: baseline;
    gap: 6px;
    font-size: .82rem;
    color: #888;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px dashed #eee;
}
.po-current-price strong {
    color: #c0392b;
    font-size: 1.1rem;
    font-weight: 700;
}

/* Input */
.po-input-label {
    font-size: .78rem;
    font-weight: 700;
    color: #444;
    margin-bottom: 6px;
}
.po-input-wrap {
    position: relative;
    margin-bottom: 6px;
}
.po-input-wrap input[type=number] {
    width: 100%;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 10px 44px 10px 14px;
    font-size: 1rem;
    font-weight: 600;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
    box-sizing: border-box;
}
.po-input-wrap input[type=number]:focus {
    border-color: #2e7d32;
    box-shadow: 0 0 0 3px rgba(46,125,50,.12);
}
.po-input-unit {
    position: absolute;
    right: 14px; top: 50%;
    transform: translateY(-50%);
    font-size: .75rem;
    font-weight: 700;
    color: #999;
    pointer-events: none;
}

.po-hint {
    font-size: .72rem;
    color: #aaa;
    margin-bottom: 14px;
}

/* Message */
.po-message {
    font-size: .82rem;
    padding: 9px 13px;
    border-radius: 7px;
    margin-bottom: 12px;
    display: none;
    line-height: 1.4;
}
.po-message.po-msg-success { background:#e8f5e9; color:#2e7d32; display:block; border-left:3px solid #43a047; }
.po-message.po-msg-error   { background:#fce4e4; color:#b71c1c; display:block; border-left:3px solid #e53935; }
.po-message.po-msg-warn    { background:#fff8e1; color:#e65100; display:block; border-left:3px solid #ffa726; }

/* Buttons */
.po-btn-submit {
    width: 100%;
    background: linear-gradient(135deg, #1b4332, #2d6a4f);
    color: #fff;
    border: none;
    padding: 11px;
    border-radius: 8px;
    font-size: .9rem;
    font-weight: 700;
    cursor: pointer;
    transition: opacity .18s, transform .15s;
    letter-spacing: .3px;
}
.po-btn-submit:hover    { opacity: .9; transform: translateY(-1px); }
.po-btn-submit:disabled { background: #ccc; cursor: not-allowed; transform: none; }

.po-btn-cart {
    width: 100%;
    background: linear-gradient(135deg, #c0392b, #e53935);
    color: #fff;
    border: none;
    padding: 11px;
    border-radius: 8px;
    font-size: .9rem;
    font-weight: 700;
    cursor: pointer;
    margin-top: 8px;
    transition: opacity .18s, transform .15s;
    display: none;
    letter-spacing: .3px;
}
.po-btn-cart:hover   { opacity: .9; transform: translateY(-1px); }
.po-btn-cart.po-show { display: block; animation: poSlideIn .2s ease; }

.po-remaining {
    font-size: .72rem;
    color: #bbb;
    text-align: center;
    margin-top: 10px;
}
