/* Frontend Proposal Styles */
.stp-frontend-proposal {
    margin-top: 30px;
    font-family: inherit;
}

.stp-milestone-card {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.stp-milestone-header {
    margin-bottom: 20px;
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
}

.stp-milestone-title {
    font-size: 1.5em;
    margin: 0 0 10px 0;
    color: #333;
}

.stp-milestone-description {
    color: #666;
    font-size: 1.1em;
    line-height: 1.6;
}

.stp-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.stp-product-card {
    background: #f9f9f9;
    border: 1px solid #eee;
    border-radius: 6px;
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stp-product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
}

.stp-product-image {
    width: 60px;
    height: 60px;
    border-radius: 4px;
    object-fit: cover;
    background: #e1e1e1;
}

.stp-product-details {
    flex: 1;
}

.stp-product-name {
    font-weight: 600;
    font-size: 1.1em;
    color: #333;
    margin-bottom: 5px;
    display: block;
    text-decoration: none;
}

.stp-product-price-qty {
    font-size: 0.9em;
    color: #777;
    display: flex;
    gap: 10px;
    align-items: center;
}

.stp-qty-badge {
    background: #e0e0e0;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.85em;
    font-weight: 500;
}

.stp-order-status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.85em;
    font-weight: 600;
    text-transform: uppercase;
    float: right;
}

.stp-status-pending {
    background: #fff3cd;
    color: #856404;
}

.stp-status-processing {
    background: #d1ecf1;
    color: #0c5460;
}

.stp-status-completed {
    background: #d4edda;
    color: #155724;
}

.stp-status-cancelled {
    background: #f8d7da;
    color: #721c24;
}

@media (max-width: 600px) {
    .stp-milestone-card {
        padding: 15px;
    }

    .stp-milestone-title {
        font-size: 1.3em;
    }
}

/* ── Payment Status Banner ── */
.stp-payment-status-banner {
    position: sticky;
    top: 0;
    z-index: 999;
    padding: 12px 20px;
    margin-bottom: 24px;
    border-radius: 6px;
    border: 1px solid transparent;
}

/* Offset for WordPress admin bar */
.admin-bar .stp-payment-status-banner {
    top: 32px;
}

@media (max-width: 782px) {
    .admin-bar .stp-payment-status-banner {
        top: 46px;
    }
}

.stp-banner-inner {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px 16px;
}

.stp-banner-title {
    font-weight: 700;
    font-size: 1em;
    white-space: nowrap;
}

.stp-banner-title::after {
    content: ' —';
    font-weight: 400;
    opacity: 0.6;
}

.stp-banner-message {
    flex: 1;
    font-size: 0.95em;
    min-width: 0;
}

.stp-banner-action {
    margin-left: auto;
    flex-shrink: 0;
}

.stp-banner-action .stp-banner-pay-btn {
    white-space: nowrap;
}

/* Banner state colours */
.stp-banner-needs_payment {
    background: #fff3cd;
    color: #856404;
    border-color: #ffc107;
}

.stp-banner-processing {
    background: #d1ecf1;
    color: #0c5460;
    border-color: #bee5eb;
}

.stp-banner-completed {
    background: #d4edda;
    color: #155724;
    border-color: #c3e6cb;
}

.stp-banner-on_hold {
    background: #fff3cd;
    color: #856404;
    border-color: #ffc107;
}

@media (max-width: 600px) {
    .stp-payment-status-banner {
        padding: 10px 14px;
    }

    .stp-banner-inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .stp-banner-action {
        margin-left: 0;
        width: 100%;
    }

    .stp-banner-action .stp-pay-btn {
        width: 100%;
        text-align: center;
    }
}

/* ── Product Actions & Modals ── */
.stp-product-actions {
    margin-top: 12px;
    display: flex;
    gap: 10px;
}

.stp-action-btn {
    background: rgba(46, 125, 255, 0.08);
    color: #2e7dff;
    border: 1px solid rgba(46, 125, 255, 0.2);
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 0.85em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.stp-action-btn:hover {
    background: rgba(46, 125, 255, 0.15);
    border-color: rgba(46, 125, 255, 0.3);
}

.stp-product-modal {
    border: none;
    border-radius: 12px;
    padding: 0;
    max-width: 600px;
    width: 90%;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    background: #fff;
    color: #333;
}

.stp-product-modal::backdrop {
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.stp-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid #f0f0f0;
    background: #fafafa;
    border-radius: 12px 12px 0 0;
}

.stp-modal-header h4 {
    margin: 0;
    font-size: 1.25em;
    font-weight: 600;
    color: #222;
}

.stp-modal-close {
    background: none;
    border: none;
    font-size: 1.5em;
    cursor: pointer;
    color: #999;
    transition: color 0.2s;
    line-height: 1;
    padding: 0 5px;
}

.stp-modal-close:hover {
    color: #ff4757;
}

.stp-modal-content {
    padding: 25px;
    font-size: 1em;
    line-height: 1.6;
    max-height: 70vh;
    overflow-y: auto;
}

.stp-modal-content p:last-child {
    margin-bottom: 0;
}

.stp-modal-content table {
    width: 100%;
    border-collapse: collapse;
}

.stp-modal-content th, .stp-modal-content td {
    padding: 10px;
    border-bottom: 1px solid #eee;
    text-align: left;
}