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

/* ── Hàng brand + nút Trả Giá ── */
.po-brand-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 4px;
}

/* ── Nút Trả Giá ── */
.btn-price-offer {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    position: relative;
    overflow: hidden;
    border: none;
    background: linear-gradient(135deg, #e65c00 0%, #f9a825 100%);
    color: #fff;
    font-size: .72rem;
    font-family: inherit;
    font-weight: 900;
    text-transform: uppercase;
    text-align: center;
    padding: 5px 13px 5px 10px;
    border-radius: 3px;
    cursor: pointer;
    text-decoration: none;
    letter-spacing: .4px;
    white-space: nowrap;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(230,92,0,.35);
    transition: box-shadow .2s, transform .15s;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

/* Tag giá góc trái */
.btn-price-offer::before {
    content: '%';
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    background: rgba(255,255,255,.25);
    border-radius: 50%;
    font-size: .65rem;
    font-weight: 900;
    flex-shrink: 0;
    line-height: 1;
}

/* Shimmer sweep */
.btn-price-offer::after {
    content: '';
    position: absolute;
    top: 0; left: -60%;
    width: 40%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,.35), transparent);
    transform: skewX(-20deg);
    animation: poShimmer 2.2s ease-in-out 1s infinite;
}

@keyframes poShimmer {
    0%   { left: -60%; }
    60%  { left: 130%; }
    100% { left: 130%; }
}

/* Pulse ring */
@keyframes poPulse {
    0%   { box-shadow: 0 2px 8px rgba(230,92,0,.35), 0 0 0 0 rgba(230,92,0,.4); }
    60%  { box-shadow: 0 2px 8px rgba(230,92,0,.35), 0 0 0 6px rgba(230,92,0,0); }
    100% { box-shadow: 0 2px 8px rgba(230,92,0,.35), 0 0 0 0 rgba(230,92,0,0); }
}
.btn-price-offer {
    animation: poPulse 2s ease 1.5s 4;
}

.btn-price-offer:hover {
    box-shadow: 0 4px 14px rgba(230,92,0,.5);
    transform: translateY(-1px);
    color: #fff;
    text-decoration: none;
}
.btn-price-offer:hover::after { animation: none; }
.btn-price-offer.po-hidden { display: none !important; }

/* ── 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,.55);
    z-index: 9990;
    backdrop-filter: blur(3px);
}
#po-overlay.po-show { display: block; animation: poFadeIn .2s ease; }
@keyframes poFadeIn { from { opacity:0 } to { opacity:1 } }

/* ── Modal ── */
#po-modal {
    display: none;
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -46%);
    width: 420px;
    max-width: 94vw;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,.25);
    z-index: 9991;
    overflow: hidden;
    opacity: 0;
}
#po-modal.po-show {
    display: block;
    animation: poModalIn .26s cubic-bezier(.22,.68,0,1.2) forwards;
}
@keyframes poModalIn {
    from { transform:translate(-50%,-44%); opacity:0; }
    to   { transform:translate(-50%,-50%); opacity:1; }
}

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

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

/* Product name */
.po-product-name {
    font-size: .78rem;
    color: #888;
    margin-bottom: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: .1px;
}

/* Price row */
.po-current-price {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f8faf8;
    border: 1px solid #e5ede6;
    border-radius: 10px;
    padding: 10px 14px;
    margin-bottom: 18px;
}
.po-price-label {
    font-size: .75rem;
    color: #999;
    font-weight: 500;
}
.po-current-price strong {
    color: #c0392b;
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: -.3px;
}

/* Input */
.po-input-label {
    font-size: .75rem;
    font-weight: 700;
    color: #555;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: .5px;
}
.po-input-wrap {
    position: relative;
    margin-bottom: 8px;
}
.po-input-wrap input[type=number] {
    width: 100%;
    border: 2px solid #e0e8e1;
    border-radius: 10px;
    padding: 12px 48px 12px 16px;
    font-size: 1.15rem;
    font-weight: 700;
    color: #1b4332;
    outline: none;
    background: #fff;
    transition: border-color .2s, box-shadow .2s;
    box-sizing: border-box;
    -moz-appearance: textfield;
    appearance: textfield;
}
.po-input-wrap input[type=number]::-webkit-inner-spin-button,
.po-input-wrap input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; }
.po-input-wrap input[type=number]::placeholder { color: #ccc; font-weight: 400; font-size: .95rem; }
.po-input-wrap input[type=number]:focus {
    border-color: #2e7d32;
    box-shadow: 0 0 0 4px rgba(46,125,50,.1);
}
.po-input-unit {
    position: absolute;
    right: 15px; top: 50%;
    transform: translateY(-50%);
    font-size: .8rem;
    font-weight: 800;
    color: #aaa;
    pointer-events: none;
    letter-spacing: -.5px;
}

.po-hint {
    font-size: .7rem;
    color: #bbb;
    margin-bottom: 14px;
    line-height: 1.5;
}

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

/* Buttons */
.po-btn-submit {
    width: 100%;
    background: linear-gradient(135deg, #1b5e20, #2e7d32);
    color: #fff;
    border: none;
    padding: 13px;
    border-radius: 10px;
    font-size: .9rem;
    font-weight: 700;
    cursor: pointer;
    transition: opacity .18s, transform .15s, box-shadow .18s;
    letter-spacing: .4px;
    box-shadow: 0 4px 14px rgba(27,94,32,.3);
}
.po-btn-submit:hover    { opacity: .92; transform: translateY(-1px); box-shadow: 0 6px 18px rgba(27,94,32,.38); }
.po-btn-submit:disabled { background: #d0d0d0; cursor: not-allowed; transform: none; box-shadow: none; }

.po-btn-cart {
    width: 100%;
    background: linear-gradient(135deg, #b71c1c, #e53935);
    color: #fff;
    border: none;
    padding: 13px;
    border-radius: 10px;
    font-size: .9rem;
    font-weight: 700;
    cursor: pointer;
    margin-top: 8px;
    transition: opacity .18s, transform .15s;
    display: none;
    letter-spacing: .4px;
    box-shadow: 0 4px 14px rgba(183,28,28,.25);
}
.po-btn-cart:hover   { opacity: .9; transform: translateY(-1px); }
.po-btn-cart.po-show { display: block; animation: poSlideIn .22s ease; }

.po-remaining {
    font-size: .7rem;
    color: #ccc;
    text-align: center;
    margin-top: 10px;
    letter-spacing: .2px;
}
