/* ============ PURCHASE MODAL STYLES ============ */

/* Purchase Modal Container */
.purchase-modal {
    max-width: 480px;
    background: linear-gradient(180deg, var(--bg-card) 0%, var(--bg-primary) 100%);
}

.purchase-modal .modal-header {
    border-bottom: 1px solid var(--border);
    padding-bottom: 1rem;
}

.purchase-modal .modal-body {
    padding: 1.5rem;
}

/* Product Display */
.purchase-product {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 1.25rem;
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.03), rgba(139, 92, 246, 0.03));
    border-radius: var(--radius);
    margin-bottom: 1.25rem;
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
}

.purchase-product::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent), var(--purple));
}

.purchase-product img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    flex-shrink: 0;
    padding: 8px;
    border: 1px solid var(--border);
}

.purchase-product-info {
    flex: 1;
    min-width: 0;
}

.purchase-product-info h3 {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 0.3rem;
    color: var(--text-primary);
    line-height: 1.3;
    word-wrap: break-word;
}

.purchase-product-info p {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.purchase-product-info p::before {
    content: '🎮';
    font-size: 0.75rem;
}

.purchase-price {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--success);
    display: flex;
    align-items: baseline;
    gap: 0.3rem;
}

.purchase-price span {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
}

/* Stock Badge */
.purchase-stock {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(16, 185, 129, 0.05));
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 25px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--success);
    margin-bottom: 1.5rem;
}

.purchase-stock i {
    font-size: 0.9rem;
}

/* Quantity Selector */
.purchase-quantity {
    margin-bottom: 1.5rem;
}

.purchase-quantity label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.qty-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    background: var(--bg-tertiary);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    overflow: hidden;
    max-width: 180px;
    margin: 0 auto;
}

.qty-btn {
    width: 50px;
    height: 48px;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 1.4rem;
    font-weight: 300;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qty-btn:hover {
    background: var(--accent);
    color: #000;
}

.qty-btn:first-child {
    border-right: 1px solid var(--border);
}

.qty-btn:last-child {
    border-left: 1px solid var(--border);
}

.qty-controls input {
    width: 80px;
    height: 48px;
    text-align: center;
    font-size: 1.3rem;
    font-weight: 700;
    background: transparent;
    border: none;
    color: var(--text-primary);
}

.qty-controls input:focus {
    outline: none;
}

/* Order Summary */
.purchase-summary {
    background: linear-gradient(135deg, var(--bg-tertiary), var(--bg-secondary));
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border);
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.summary-row.total {
    border-top: 1px solid var(--border);
    margin-top: 0.75rem;
    padding-top: 1rem;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
}

.summary-row.total span:last-child {
    color: var(--success);
    font-size: 1.4rem;
    font-weight: 800;
}

/* Trust Badges */
.trust-badges {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.trust-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.85rem 0.5rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    text-align: center;
    transition: all 0.2s;
}

.trust-badge:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}

.trust-badge i {
    font-size: 1.25rem;
    color: var(--accent);
}

.trust-badge span {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-secondary);
    line-height: 1.2;
}

.trust-badge:nth-child(1) i { color: var(--accent); }
.trust-badge:nth-child(2) i { color: var(--success); }
.trust-badge:nth-child(3) i { color: var(--purple); }

/* Purchase Button */
.purchase-btn {
    width: 100%;
    padding: 1.1rem 1.5rem;
    font-size: 1.1rem;
    font-weight: 700;
    background: linear-gradient(135deg, #10b981, #059669);
    border: none;
    border-radius: var(--radius);
    color: white;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
}

.purchase-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.purchase-btn:hover::before {
    left: 100%;
}

.purchase-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(16, 185, 129, 0.4);
}

.purchase-btn:active {
    transform: translateY(-1px);
}

/* Security Footer */
.purchase-security {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    font-size: 0.75rem;
    color: var(--text-muted);
}

.purchase-security i {
    color: var(--success);
}

.purchase-security strong {
    color: var(--accent);
}

/* ============ ORDER SUCCESS MODAL ============ */

.order-success-modal {
    text-align: center;
    padding: 2rem !important;
    max-width: 420px;
}

.order-success-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.25rem;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(16, 185, 129, 0.05));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: successPop 0.5s ease-out;
}

@keyframes successPop {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.order-success-icon i {
    font-size: 2.5rem;
    color: var(--success);
}

.order-success-modal h2 {
    font-size: 1.5rem;
    margin-bottom: 1.25rem;
    color: var(--text-primary);
}

.order-details {
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
    margin-bottom: 1.25rem;
    border: 1px solid var(--border);
}

.order-item-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
}

.order-total {
    font-weight: 700;
    color: var(--success);
}

/* Order ID Box */
.order-id-box {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.1), rgba(139, 92, 246, 0.1));
    border: 2px solid var(--accent);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 1rem;
    position: relative;
}

.order-id-box label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.order-id-value {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: 3px;
    color: var(--accent);
    font-family: 'Space Grotesk', monospace;
    margin-bottom: 0.75rem;
}

.copy-btn {
    padding: 0.4rem 1rem;
    background: var(--accent);
    border: none;
    border-radius: 20px;
    color: #000;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.copy-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 20px rgba(0, 212, 255, 0.4);
}

/* Order Timer */
.order-timer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    color: var(--warning);
    margin-bottom: 1.25rem;
}

/* Next Steps */
.order-next-steps {
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    padding: 1rem;
    margin-bottom: 1.25rem;
    text-align: left;
    border: 1px solid var(--border);
}

.order-next-steps h4 {
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.order-next-steps h4 i {
    color: var(--accent);
}

.order-next-steps ol {
    margin: 0;
    padding-left: 1.25rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.order-next-steps li {
    padding: 0.2rem 0;
}

/* Discord Button */
.btn-discord {
    width: 100%;
    padding: 1rem;
    background: #5865F2;
    border: none;
    border-radius: var(--radius-sm);
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-decoration: none;
}

.btn-discord:hover {
    background: #4752C4;
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(88, 101, 242, 0.4);
}

/* Order Guarantee */
.order-guarantee {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
    padding: 0.75rem;
    background: rgba(16, 185, 129, 0.1);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    color: var(--success);
}

.order-guarantee i {
    font-size: 1rem;
}

.btn-close-order {
    margin-top: 1rem;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.85rem;
    cursor: pointer;
    padding: 0.5rem 1rem;
    transition: color 0.2s;
}

.btn-close-order:hover {
    color: var(--text-primary);
}

/* ============ RESPONSIVE ============ */

@media (max-width: 480px) {
    .purchase-modal,
    .order-success-modal {
        max-width: 100%;
        margin: 1rem;
    }
    
    .purchase-product {
        flex-direction: column;
        text-align: center;
    }
    
    .purchase-product-info {
        text-align: center;
    }
    
    .trust-badges {
        gap: 0.5rem;
    }
    
    .trust-badge {
        min-width: 80px;
        padding: 0.5rem;
        font-size: 0.65rem;
    }
    
    .order-id-value {
        font-size: 1.4rem;
        letter-spacing: 2px;
    }
    
    .order-next-steps {
        padding: 0.75rem;
    }
}

/* ============ DISCOUNT BADGES - Optimized ============ */

/* Game Card Sale Badge */
.game-sale-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: linear-gradient(135deg, #ff6b35, #f72585);
    color: white;
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 10;
    box-shadow: 0 2px 10px rgba(247, 37, 133, 0.4);
    display: flex;
    align-items: center;
    gap: 5px;
}

.game-sale-badge i {
    font-size: 0.75rem;
}

/* Item Row On Sale */
.item-on-sale {
    position: relative;
    border: 2px solid rgba(247, 37, 133, 0.3) !important;
    background: linear-gradient(135deg, rgba(247, 37, 133, 0.05), transparent) !important;
    overflow: visible;
}

.item-on-sale::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    height: 3px;
    background: linear-gradient(90deg, #ff6b35, #f72585);
    border-radius: var(--radius) var(--radius) 0 0;
}

/* Item Discount Badge */
.item-discount-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 15;
}

.discount-percent {
    background: linear-gradient(135deg, #ff6b35, #f72585);
    color: white;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
    box-shadow: 0 2px 10px rgba(247, 37, 133, 0.4);
}

.discount-text {
    background: var(--bg-tertiary);
    color: #ff6b9d;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    border: 2px solid rgba(247, 37, 133, 0.5);
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    animation: textGlow 2s ease-in-out infinite alternate;
}

@keyframes textGlow {
    0% { border-color: rgba(247, 37, 133, 0.4); text-shadow: none; }
    100% { border-color: rgba(247, 37, 133, 0.8); text-shadow: 0 0 10px rgba(247, 37, 133, 0.5); }
}

/* Price Styles - Enhanced */
.item-price-original {
    text-decoration: line-through;
    color: var(--text-muted);
    font-size: 0.9rem;
    opacity: 0.6;
    position: relative;
}

.item-price-discount {
    color: #10b981 !important;
    font-weight: 700;
    font-size: 1.15rem !important;
}

.item-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Admin Discount Fields */
.discount-fields {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 1rem;
    margin-top: 0.5rem;
}

.discount-fields .form-group {
    margin-bottom: 0;
}

.discount-preview {
    background: linear-gradient(135deg, rgba(247, 37, 133, 0.1), rgba(255, 107, 53, 0.05));
    border: 1px solid rgba(247, 37, 133, 0.2);
    border-radius: var(--radius);
    padding: 1rem;
    margin-top: 1rem;
    text-align: center;
}

.discount-preview-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.75rem;
}

.discount-preview-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.preview-old-price {
    color: var(--text-muted);
    text-decoration: line-through;
    font-size: 1.1rem;
    opacity: 0.7;
}

.preview-arrow {
    color: var(--accent);
    font-size: 0.9rem;
}

.preview-new-price {
    color: #10b981;
    font-weight: 700;
    font-size: 1.3rem;
    text-shadow: 0 0 10px rgba(16, 185, 129, 0.3);
}

.preview-promo {
    background: linear-gradient(135deg, #ff6b35, #f72585);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.discount-preview-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #ff6b35, #f72585);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 700;
    box-shadow: 0 4px 15px rgba(247, 37, 133, 0.4);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .item-discount-badge {
        position: relative;
        top: 0;
        left: 0;
        transform: none;
        margin-bottom: 12px;
        justify-content: center;
        animation: none;
    }
    
    .discount-percent {
        padding: 6px 12px;
        font-size: 0.85rem;
    }
    
    .discount-text {
        padding: 6px 10px;
        font-size: 0.7rem;
    }
    
    .game-sale-badge {
        padding: 6px 10px;
        font-size: 0.65rem;
    }
    
    .item-on-sale {
        padding-top: 2rem !important;
    }
}

/* Ensure item-row has space for badge */
.item-row.item-on-sale {
    margin-top: 1.5rem;
    overflow: visible;
}
